Commit 999eb5f
authored
Allow no derivative layout for SPV_NV_compute_shader_derivatives (KhronosGroup#6678)
While adding glslang support for GL_KHR_compute_shader_derivatives I ran
into some compatibility issues with the prior NV version of this
extension.
The KHR SPIR-V spec differs from the NV version in that is requires one
of the DerivativeGroup*KHR modes to be set, while the NV spec says they
don't need to be specified:
> DerivativeGroup*NV execution mode that was specified for the entry
point. If neither derivative group mode was specified, the derivatives
return zero.
(From
https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/NV/SPV_NV_compute_shader_derivatives.asciidoc)
The issue raised in KhronosGroup/glslang#4239
shows that there are GLSL shaders using the NV extension that assume
that the modes don't have to be set.
I modified glslang to allow this behavior for the NV extension in
KhronosGroup/glslang#4247, but the generated
SPIR-V fails validation.
--
For this PR, I've made the execution mode check dependent on the KHR
extension. (The execution and capability tokens are aliased between the
KHR and NV extensions.)
That change caused a unit test regression. AFAICT, that test has never
been valid since it uses explicit derivatives in a compute shader
without enabling any extensions. I turned that into a test for the KHR
extension.1 parent 6337eb6 commit 999eb5f
2 files changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
| |||
0 commit comments