You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
If the SV_ShadingRate semantic is used in any shader stage that supports it, the compiler seems to skip optimizing out unused resources as though the -fspv-preserve-bindings flag were set. Additionally it does not remove unused variables in the input. Directly appending just the SPV_KHR_fragment_shading_rate extension via inline SPIR-V produces the same result.
Compile 3 times with the following command line arguments:
normal: -E vertex -T vs_6_5 -spirv -fspv-target-env=vulkan1.2
with SV_ShadingRate: -E vertex -T vs_6_5 -spirv -fspv-target-env=vulkan1.2 -D SHADING_RATE
with just the extension: -E vertex -T vs_6_5 -spirv -fspv-target-env=vulkan1.2 -D EXT_ONLY
Behavior
This vertex shader outputs a constant 0, so we should expect that all the textures, samplers, and cbuffer should be removed and the input vertex and texcoord semantics should be optimized away as well. This happens when the base shader is compiled. When adding SV_ShadingRate to the output or simply declaring the extension via inline SPIR-V, no resources are removed and the unused position and texcoord semantics are loaded.
Environment
DXC version 1.8.2407
Host Operating System: Windows 10 22H2
The text was updated successfully, but these errors were encountered:
Description
If the SV_ShadingRate semantic is used in any shader stage that supports it, the compiler seems to skip optimizing out unused resources as though the
-fspv-preserve-bindings
flag were set. Additionally it does not remove unused variables in the input. Directly appending just theSPV_KHR_fragment_shading_rate
extension via inline SPIR-V produces the same result.Steps to Reproduce
Godbolt Link
Using this shader: test.hlsl:
Compile 3 times with the following command line arguments:
normal:
-E vertex -T vs_6_5 -spirv -fspv-target-env=vulkan1.2
with SV_ShadingRate:
-E vertex -T vs_6_5 -spirv -fspv-target-env=vulkan1.2 -D SHADING_RATE
with just the extension:
-E vertex -T vs_6_5 -spirv -fspv-target-env=vulkan1.2 -D EXT_ONLY
Results:
Normal
Shading Rate
Extension Only
Behavior
This vertex shader outputs a constant 0, so we should expect that all the textures, samplers, and cbuffer should be removed and the input vertex and texcoord semantics should be optimized away as well. This happens when the base shader is compiled. When adding SV_ShadingRate to the output or simply declaring the extension via inline SPIR-V, no resources are removed and the unused position and texcoord semantics are loaded.
Environment
The text was updated successfully, but these errors were encountered: