Description
I have a shader which uses QuadReadAcross* intrinsics. On the C++ side, I have enabled the VK_KHR_compute_shader_derivatives extension in order to have derivatives available. Under this logic, I would be able to access neighbouring thread's data using QuadReadAcross*.
The issue however is that since my shader does not use Sample(), ddx(), or any other derivative requiring operation, the generated SPIRV for my shader does not contain the SPV_KHR_compute_shader_derivatives OpExtension, thus the result of QuadReadAcross* is not the same as when I target DX12.
Steps to Reproduce
Godbolt examples:
In the first example, the result of QuadReadAcrossX does not match what DXIL would give me.
In the second example, once I add ddx() the resulting spirv contains SPV_KHR_compute_shader_derivatives, which causes the shader to now be consistent between spirv and DXIL.
Actual Behavior
I would expect that the use of QuadReadAcross* would mean the compiler emits SPV_KHR_compute_shader_derivatives as a required extension, since using QuadReadAcross* with non-2x2 grouped threads doesn't make much sense.
Environment
- DXC version
1.8.2505 in godbolt, locally I have the same issue with dxcompiler.dll: 1.9 - 1.8.0.4973 (8f5595872)
- Host Operating System Windows 11 (24H2)