protonscr

Ravenswatch shader issue on Steam Deck

vkd3dclosed
HansKristian-Work/vkd3d-proton#1706 · opened 2023-09-19 by Vincent-P · updated 2023-09-20 · 9 comments · github
VVincent-P 2023-09-19 github

A specific decal shader is invisible most of the time. This issue happens only on Steam Deck, when there is no vulkan layer. (So the issue is not reproducible when capturing with Renderdoc or gfxreconstruct).

Software information

Ravenswatch, steam id: 2071280

System information

Steam Deck

Log files

I can provide logs privately in mail.
There is not much vkd3d logs, a lot of:

10615.193:013c:0140:warn:vkd3d-proton:vkd3d_get_image_allocation_info: Padding allocation requirements. Requested alignment 4096 < 65536 (dim 3, 128 x 128 x 1, 1 levels, 1 samples, fmt #1c, flags #0).
10615.332:013c:0140:warn:vkd3d-proton:d3d12_pipeline_state_init_graphics_create_info: Ignoring stencilTestEnable due to lack of stencil aspect.

Which I assume is not important.

BBlisto91 2023-09-19 github

Could you post a screenshot or video? And ideally also a save game if it isn't right at the beginning.

Which SteamOS version are you using? I assume Stable channel.

VVincent-P 2023-09-19 github

Here is a screenshot with the decal (on Windows) and without (on Steam Deck)
rw_decal_bad
rw_decal_ok

To reproduce you don't need a save game, as some hero abilities have this issue. You can select Beowulf and hold down the shield ability.
The steam deck is using "SteamOS Holo" 3.4.10

VVincent-P 2023-09-19 github

I forgot to mention that I'm a dev on the game, and I wrote the entire D3D12 backend for the game.
I'm more than happy to make changes to work around this, but I've had no luck with debugging so far.

BBananaWorks07 2023-09-19 github

could you try steam deck preview channel (steam os 3.5)?

KK0bin 2023-09-19 github

@Vincent-P You don't happen to use a depth bias for drawing the decal, do you?

HHansKristian-Work maintainer 2023-09-19 github

@runar-work or @Blisto91 Can you get a renderdoc capture of the game so we can study what the app is trying to do for that effect?

BBlisto91 2023-09-19 github

rdna2 and rdna3 captures on Proton Exeperimental with radv 23.0.3 (driver i know it reproduces with) https://drive.proton.me/urls/8SGJ1TV4K0#8YVus33P41uV
I can confirm that the issue doesn't reproduce when either renderdoc or gfxreconstruct is used.

It also seems like this might only be an issue with older radv drivers including the one on SteamOS stable. On desktop using 23.0.4 and above i have not been able to reproduce it an ditto when using beta SteamOS channel.
But the exact cause is still being investigated.

HHansKristian-Work maintainer 2023-09-20 github

@Vincent-P I think I've root caused the issue:

In the fragment shader that renders the effect, you seem to have:

SamplerState bindless[] : register(space2, s1);

This ends up causing a subtle overflow in address computation in Mesa that was fixed in https://gitlab.freedesktop.org/mesa/mesa/-/commit/20b252c4c8ba23b3bb2d6cd0a4db7930b74ddb85.

I think you should be able to work around the bug by using:
SamplerState bindless[] : register(space2, s0); instead.

I'll look into a workaround on vkd3d-proton's end though, since the code we emit for this scenario looks funny anyways.

It's possible this affects resources as well if you have arrays with register not equal to 0.

VVincent-P 2023-09-20 github

Thank you! The workaround is working.

Proton versions