Something really bizarre is going on here...
I don't get the issue when playing back the trace with native or with DXVK 1.3.1.

I do, however, get the issue when playing back the trace with RenderDoc attached, and when trying to capture it crashes for me.

I spoke with @adih2001 and the trace plays back fine for him with DXVK 1.3.1 both with or without RenderDoc.
The validation layer output was not particularly interesting (to me anyway,) just the standard one we ignore for unbound resources.
10105268: debug: UNASSIGNED-CoreValidation-DrawState-DescriptorSetNotUpdated(ERROR / SPEC): msgNum: 0 - Descriptor set 0x4cb88 bound as set #0 encountered the following validation error at vkCmdDraw() time: Descriptor in binding #1 index 0 requires FLOAT component type, but bound descriptor format is VK_FORMAT_R32_UINT.
Objects: 1
[0] 0x4cb88, type: 23, name: NULL
UNASSIGNED-CoreValidation-DrawState-DescriptorSetNotUpdated(ERROR / SPEC): msgNum: 0 - Descriptor set 0x4cb88 bound as set #0 encountered the following validation error at vkCmdDraw() time: Descriptor in binding #1 index 0 requires FLOAT component type, but bound descriptor format is VK_FORMAT_R32_UINT.
Objects: 1
[0] 0x4cb88, type: 23, name: NULL
To me it looks like a lack of textures as sometimes I see dust and stuff which is correctly shown and depth tested...
Which makes me think that perhaps there is something more to
err: D3D11: CopySubresourceRegion: Incompatible texel size
Dst texel size: 8
Src texel size: 4
in the logs.
It's worth noting that the trace was made with native D3D11 on Windows.
I'm going to sleep now however, it's 4am! 🐸
Can anyone bisect this?
FWIW I cannot reproduce the problem, and the apitrace replays fine even with RenderDoc attached on my end. But note that the engine is known to be broken, so issues with DXVK are kind of expected at this point.
@Joshua-Ashton the CopySubresourceRegion thing is a game bug and has been there since forever.
https://github.com/doitsujin/dxvk/commit/03c6df56
is what caused this issue
Note that I can only reproduce this with DXVK compiled using GCC. With MSVC build the issue does not occur.
@tannisroot I suspect that there is a bug in DXVK involving undefined behavior given your report on discord that an -O0 GCC build worked fine (although with performance loss). Bugs in code involving undefined behavior are triggered by GCC's strong compiler optimizations far more than code exposes bugs in GCC, so I am leaning toward this being an undefined behavior bug. MSVC's optimizer tends to trigger undefined behavior bugs less than GCC's optimizer, so the MSVC builds not having any issue here doesn't contradict that theory.
Here is a patch that should work around it:
https://github.com/ryao/dxvk/commit/ae458360a2cbb372a01990d76e234d1b366d213d
Unless D3D11Initializer::InitDeviceLocalTexture() is in a performance critical code path, it should workaround this issue with zero performance loss. Let me know if it makes things work.
As an additional note, if that patch works, it might be possible to bisect the function itself using those pragma commands to find the line with undefined behavior.
Also, 03c6df56 doing anything at all suggests to me that there is undefined behavior in this function that is affected by the compiler's register scheduling.
@adih2001 I suggest trying out the new Nvidia vulkan beta driver version 435.19.03:
https://developer.nvidia.com/vulkan-driver
It claims to have a corruption fix for this game.
The black screen seems to be fixed after upgrading to DXVK 1.4 on my setup (AMD RX470 (Polaris)).
Some users noted that this might have been some weird issue with the DXVK builds rather than a code issue, but I'm not sure if that's true.
Anyway, closing.
Nothing extracted yet.
Software information
Name: Saints Row IV
Settings used:
https://caustic-rays-cdn.s3.eu-west-2.amazonaws.com/pics/dxvk/1.png
https://caustic-rays-cdn.s3.eu-west-2.amazonaws.com/pics/dxvk/2.png
System information
Apitrace file(s)
Log files
Notes:
I first tested this game with DXVK 1.2.3. The game had some flickering but the game worked overall as you can see here: https://youtu.be/eB6HICBrcFM (Note: The effects on the walls are normal and they are from the game. They can be best seen at 1:08).
When I switched to DXVK 1.3 everything was completely black other then the UI elements as you can see here: https://youtu.be/hj0xvrpiHIE. DXVK 1.3.1 does the exact same thing.
In the google drive link I've included all the necessary files.
I know Windows is not a supported platform, so it would be great if someone could try and replicate the issue on Linux using the provided trace.
Thanks 🐸