protonscr

[d3d9] Codename: Panzers, Phase One Visuals Freeze on Cinematic Intro

dxvkclosed appid 411310needs apitraced3d9
doitsujin/dxvk#3196 · opened 2023-01-18 by zzhiyi · updated 2023-03-07 · 36 comments · github · game page · search this game
Zzzhiyi 2023-01-18 github

Software information

Steps to reproduce:

  1. Install Codename: Panzers, Phase One (SteamID 411310) and run it.
  2. You should see an intro video that shows a countdown from 5 to 4, 3, ... click the mouse left button to skip the video

Expected result: the video is skipped and the game's main menu is shown.
Actual result: The frame when the video is skipped remains on the screen. Wined3d doesn't have this issue. The game is still running because you can move the mouse to the lower right area to exit the game.

The video being played is "intro.bik"
$ file intro.bik
intro.bik: Bink Video rev.i, 640x480, 3801 frames at rate 1/25, 1 audio track 44100Hz stereo

System information

  • GPU: AMD 5500XT
  • Driver: MESA RADV 22.2.1
  • Wine version: Wine-8.0-rc4
  • DXVK version: 1.5.1~2.0

Log files

BBlisto91 2023-01-18 github

Hello.

Would you be able to make a apitrace with wined3d?
https://github.com/doitsujin/dxvk/wiki/Using-Apitrace

Zzzhiyi 2023-01-18 github

Hello.

Would you be able to make a apitrace with wined3d? https://github.com/doitsujin/dxvk/wiki/Using-Apitrace

Hi, I should be able to get one. But I am not near a computer right now. I will get you the file in a few days.

Lllde 2023-01-19 github

I have a retail version of the game, I will try to reproduce myself tomorrow

Lllde 2023-01-20 github

Hi. It seems that it seems that either DXVK or Winevulkan regressed in last version for this game (I compiled DXVK from master today and wine is the last staging ).
After the video playback (either normal completition or skipping) is causing an Assertion error:
Assertion failed: !status, file ../wine-git/dlls/winevulkan/loader_thunks.c, line 2703

line 2703 being inside vkCreateGraphicsPipelines loader thunk

Other applications doesn't seem to be affected (tested Control)

Wined3d opengl backend can play this game fully, while the vulkan backend complain about missing 1 bit texture format.

Mmbriar 2023-01-20 github

Unlikely to be a winevulkan regression, winevulkan will just assert there if vkCreateGraphicsPipelines() failed, so it's either a driver or DXVK problem. Can you try with older DXVK and/or run this with vulkan validation layers? FWIW, wined3d vulkan doesn't support d3d9 and older at the moment because vkd3d-shader doesn't support older shader models yet.

Lllde 2023-01-20 github

@mbriar Vulkan validation layer just prevent this game to load at all with DXVK for me. Not a problem with the layers itselves, as they do work with Control

Ddoitsujin maintainer 2023-01-20 github

Assertion failed: !status, file ../wine-git/dlls/winevulkan/loader_thunks.c, line 2703

This just means the call crashed inside the driver.

Kinda need an apitrace to debug this if you're unable to get validation to work. Would highly appreciate one since we're planning to do a release very soon and I don't want to introduce random regressions, but I also don't want this to block that release forever.

Lllde 2023-01-20 github

It seems to definetly be a DXVK regression that happened after 2.0.
If I use DXVK 20.0 the behaviour is consistent, with the screen hang after video playback.
WIth latest master I get the first load with the previous behaviour, while all the successive ones are crashing. (First execution after it's executed with DXVK 2.0 release )
Now why the first execution have a difference here?
I will make an apitrace.

Mmbriar 2023-01-20 github

Seems to hit this assertion with a RADV debug build

mesa/src/vulkan/runtime/vk_graphics_state.c:656: vk_multisample_state_init: Assertion `ms_info->rasterizationSamples <= MESA_VK_MAX_SAMPLES' failed.
Mmbriar 2023-01-20 github

It segfaults with validation layers right after this

VUID-VkSubmitInfo2-semaphore-03881(ERROR / SPEC): msgNum: -1771252314 - Validation Error: [ VUID-VkSubmitInfo2-semaphore-03881 ] Object 0: handle = 0xf56c9b0000000004, type = VK_OBJECT_TYPE_UNKNOWN; Object 1: handle = 0x7d4b7dd0, type = VK_OBJECT_TYPE_QUEUE; | MessageID = 0x966cd5a6 | vkQueueSubmit2(): pSubmits[0].pSignalSemaphoreInfos[0] signal value (0x4) in VkQueue 0x7d4b7dd0[] must be greater than current timeline semaphore VkNonDispatchableHandle 0xf56c9b0000000004[] value (0x72654b68) The Vulkan spec states: If the same semaphore is used as the semaphore member of both an element of pSignalSemaphoreInfos and pWaitSemaphoreInfos, and that semaphore is a timeline semaphore, the value member of the pSignalSemaphoreInfos element must be greater than the value member of the pWaitSemaphoreInfos element (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkSubmitInfo2-semaphore-03881)
    Objects: 2
        [0] 0xf56c9b0000000004, type: 0, name: NULL
        [1] 0x7d4b7dd0, type: 4, name: NULL
Lllde 2023-01-20 github

Thanks, I'm unable to generate a trace. I get the apitrace: loaded into C:\Program Files (x86)\Panzers\PANZERS.EXE
but when I look for the trace there is nothing

Mmbriar 2023-01-20 github

You need to look for the trace in $WINEPREFIX/drive_c/users/$USER/Desktop.

Lllde 2023-01-20 github

@mbriar They aren't there.

BTW replaying the trace, crash apitrace either with the same assertion using master or an memory violation on 2.0.
So it seems consistent.

Trace do crash even when replayed by WineD3D however

Mmbriar 2023-01-20 github

The trace replays fine for me with wined3d, but crashes/asserts with dxvk.

Lllde 2023-01-20 github

Ok It finally generate a trace for me too. If I use a trace generated by a good run of the game it will replay with WineD3D and DXVK 2.0, but will crash on master.
If I use a trace generated from a bad take it will crash everywhere.
(Apitrace will not show the stuck video BTW )
@mbriar sorry you were right, forgot to disable the DLL override

At this point I will do a bisect.

Mmbriar 2023-01-20 github

I don't know how the game renders it's intro video, but doesn't look like it's using d3d9 or opengl for it. Neither the DXVK hud nor the gallium hud shows up for it. So it makes sense that apitrace doesn't capture it.

Lllde 2023-01-20 github

Bisect result
e5157a5360280fd195fe9489b2f4578e7ca6bb55 is the first bad commit
commit e5157a5360280fd195fe9489b2f4578e7ca6bb55
Author: Philip Rebohle [email protected]
Date: Mon Jan 9 21:26:15 2023 +0100

[dxvk] Add pre-rasterization pipeline libraries to the state cache

This allows compiling tessellation or geometry shader pipelines
early while still using the pipeline library path.

Also removes compute shaders. Since API-provided compute shaders
are always compiled early, supporting them is no longer needed.

src/dxvk/dxvk_compute.cpp | 15 +---
src/dxvk/dxvk_compute.h | 3 -
src/dxvk/dxvk_pipemanager.cpp | 36 +++++---
src/dxvk/dxvk_pipemanager.h | 13 ++-
src/dxvk/dxvk_state_cache.cpp | 185 ++++++++++++++++++++++++--------------
src/dxvk/dxvk_state_cache.h | 20 ++---
src/dxvk/dxvk_state_cache_types.h | 14 ++-

BBlisto91 2023-01-20 github

Try to set dxvk.enableGraphicsPipelineLibrary = False in a dxvk.conf

Ddoitsujin maintainer 2023-01-20 github

That's... interesting since we should never hit any of those code paths in D3D9.

Mmbriar 2023-01-20 github

Try to set dxvk.enableGraphicsPipelineLibrary = False in a dxvk.conf

I didn't enable GPL for RADV, so I don't think this would have an effect?

Lllde 2023-01-20 github

@Blisto91 No it doesn't have effect

BBlisto91 2023-01-20 github

Oh sorry i totally missed it was AMD cards involved. I probably need to to sleep soon :sweat_smile:

Lllde 2023-01-20 github

I was thinking, this is related to a crash that's happening only on non first execution. The only thing it's changing is the state cache, and the e5157a5360280fd195fe9489b2f4578e7ca6bb55 is state cache related.
MAybe something is written wrong to the cache (it may also explain why updating or downgrading DXVK solve the issue for the firs run after the change)

Ddoitsujin maintainer 2023-01-21 github

Yes, this is a corrupt state cache. I can reproduce this with the trace but don't know what's going on yet.

Ddoitsujin maintainer 2023-01-21 github

Should be fixed now, thanks @mbriar for providing the trace and info.

Ddoitsujin maintainer 2023-01-21 github

Note that you might need to delete your state cache before this works for now.

I'll add another commit that will basically invalidate all v16 state caches created since the bad commit, unfortunately it is not possible to recover corrupted cache files since we lose some information.

Lllde 2023-01-21 github

@doitsujin I confirm the crash is solved.
The Video Freeze is not, so it may be worth to repen this issue

Ddoitsujin maintainer 2023-01-21 github

That is a separate issue, but from what I understand, video playback is not done through D3D anyway?

In which case DXVK can't really do much.

Ddoitsujin maintainer 2023-01-21 github

well anyway, things do get rather confusing when different bugs are discussed in one report.

Lllde 2023-01-21 github

@doitsujin While that seems true (video not done with D3D), it's working with WineD3D. So there may still be something on D3D side at the end of the video DXVK is missing.

KK0bin maintainer 2023-01-24 github

Can someone make an apitrace of the intro cinematic?

The one @mbriar made works fine with DXVK.

Mmbriar 2023-01-24 github

I don't know what else to trace, like mentioned, neither the DXVK hud nor the gallium hud shows up for the video playback (they do later in game of course) and the apitrace doesn't contain the intro.

BBlisto91 2023-01-24 github

https://mega.nz/file/w4RXybDA#slgLDO3kMj25S2X7qPiGfr1YW0oE4Ypd_XShKwRgfNk

Edit: oh i see what mbriar means now so this trace doesn't help. Hadn't checked the traces before.

Mmbriar 2023-01-24 github

Yeah, this one doesn't have the intro video in it either.

BBlisto91 2023-01-24 github

Found that d3d9.enableDialogMode = True works around the issue.

Launch options