FidelityFX-FSR2 icon indicating copy to clipboard operation
FidelityFX-FSR2 copied to clipboard

GLSL: Don't bind PreparedImage as SRV in depth clip shader

Open K0bin opened this issue 2 years ago • 1 comments

The GLSL version of the depth clip pass binds the image "PreparedInputColor" as both an SRV and a UAV.

https://github.com/GPUOpen-Effects/FidelityFX-FSR2/blob/master/src/ffx-fsr2-api/shaders/ffx_fsr2_depth_clip_pass.glsl#L32 https://github.com/GPUOpen-Effects/FidelityFX-FSR2/blob/master/src/ffx-fsr2-api/shaders/ffx_fsr2_depth_clip_pass.glsl#LL41C9-L41C61

The Vulkan backend transitions all SRVs to IMAGE_LAYOUT_SHADER_READ_ONLY and all UAVs to IMAGE_LAYOUT_GENERAL. SRV layout transitions are added after the UAV ones and SRV descriptors are set to use IMAGE_LAYOUT_SHADER_READ_ONLY, so even if we assume that layout transitions are serialized and the shader never actually writes to the UAV, this is still a bug.

The HLSL equivalent does not try to bind the SRV of PreparedInputColor and the underlying shader only ever needs the UAV one (write only even).

K0bin avatar Feb 22 '23 01:02 K0bin

Still an issue on 2.2.1 as far as I can tell...

K0bin avatar Jun 09 '23 15:06 K0bin