Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[d3d9] Codename: Panzers, Phase One (411310) Visuals Freeze on Cinematic Intro #3196

Closed
zzhiyi opened this issue Jan 18, 2023 · 36 comments · Fixed by #3209
Closed

[d3d9] Codename: Panzers, Phase One (411310) Visuals Freeze on Cinematic Intro #3196

zzhiyi opened this issue Jan 18, 2023 · 36 comments · Fixed by #3209

Comments

@zzhiyi
Copy link
Contributor

zzhiyi commented Jan 18, 2023

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

@Blisto91
Copy link
Contributor

Hello.

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

@zzhiyi
Copy link
Contributor Author

zzhiyi commented Jan 18, 2023

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.

@llde
Copy link

llde commented Jan 19, 2023

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

@llde
Copy link

llde commented Jan 20, 2023

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.

@mbriar
Copy link
Contributor

mbriar commented Jan 20, 2023

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.

@llde
Copy link

llde commented Jan 20, 2023

@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

@doitsujin
Copy link
Owner

doitsujin commented Jan 20, 2023

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.

@llde
Copy link

llde commented Jan 20, 2023

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.

@mbriar
Copy link
Contributor

mbriar commented Jan 20, 2023

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.

@mbriar
Copy link
Contributor

mbriar commented Jan 20, 2023

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

@mbriar
Copy link
Contributor

mbriar commented Jan 20, 2023

@llde
Copy link

llde commented Jan 20, 2023

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

@mbriar
Copy link
Contributor

mbriar commented Jan 20, 2023

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

@llde
Copy link

llde commented Jan 20, 2023

@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

@mbriar
Copy link
Contributor

mbriar commented Jan 20, 2023

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

@llde
Copy link

llde commented Jan 20, 2023

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.

@mbriar
Copy link
Contributor

mbriar commented Jan 20, 2023

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.

@llde
Copy link

llde commented Jan 20, 2023

Bisect result
e5157a5 is the first bad commit
commit e5157a5
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 ++-

@Blisto91
Copy link
Contributor

Blisto91 commented Jan 20, 2023

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

@doitsujin
Copy link
Owner

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

@mbriar
Copy link
Contributor

mbriar commented Jan 20, 2023

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?

@llde
Copy link

llde commented Jan 20, 2023

@Blisto91 No it doesn't have effect

@Blisto91
Copy link
Contributor

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

@llde
Copy link

llde commented Jan 20, 2023

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 e5157a5 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)

@doitsujin
Copy link
Owner

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

@doitsujin
Copy link
Owner

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

@doitsujin
Copy link
Owner

doitsujin commented Jan 21, 2023

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.

@llde
Copy link

llde commented Jan 21, 2023

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

@doitsujin
Copy link
Owner

doitsujin commented Jan 21, 2023

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.

@doitsujin doitsujin reopened this Jan 21, 2023
@doitsujin
Copy link
Owner

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

@llde
Copy link

llde commented Jan 21, 2023

@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.

@K0bin
Copy link
Collaborator

K0bin commented Jan 24, 2023

Can someone make an apitrace of the intro cinematic?

The one @mbriar made works fine with DXVK.

@mbriar
Copy link
Contributor

mbriar commented Jan 24, 2023

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.

@Blisto91
Copy link
Contributor

Blisto91 commented Jan 24, 2023

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.

@mbriar
Copy link
Contributor

mbriar commented Jan 24, 2023

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

@Blisto91
Copy link
Contributor

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

Etaash-mathamsetty pushed a commit to Etaash-mathamsetty/dxvk that referenced this issue Jul 16, 2023
Fixes doitsujin#3196, not to mention that this was god-awful code anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants