summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Wihandi <65404740+fairywreath@users.noreply.github.com>2025-03-19 17:53:57 -0400
committerGitHub <noreply@github.com>2025-03-19 21:53:57 +0000
commit404e95cdd02830ba0fb215081e826025609c4d14 (patch)
tree4f68e2476a29372c385329e709719f2f51e3055d
parent155e0804edbc9e7175cb0a6ed60d3daff0ba5e01 (diff)
Output SPV_KHR_compute_shader_derivatives extension string instead of the NV extension (#6641)
* Output SPV_KHR_compute_shader_derivatives instead of the NV extension * add alias for nv extension
-rw-r--r--docs/user-guide/a3-02-reference-capability-atoms.md3
-rw-r--r--source/slang/slang-capabilities.capdef8
-rw-r--r--source/slang/slang-emit-spirv.cpp10
-rw-r--r--tests/glsl-intrinsic/compute-derivative/intrinsic-derivative-function-in-compute.slang12
4 files changed, 20 insertions, 13 deletions
diff --git a/docs/user-guide/a3-02-reference-capability-atoms.md b/docs/user-guide/a3-02-reference-capability-atoms.md
index 696e0fa94..9a6eead6d 100644
--- a/docs/user-guide/a3-02-reference-capability-atoms.md
+++ b/docs/user-guide/a3-02-reference-capability-atoms.md
@@ -409,6 +409,9 @@ Extensions
`SPV_NV_shader_image_footprint`
> Represents the SPIR-V extension for shader image footprint.
+`SPV_KHR_compute_shader_derivatives`
+> Represents the SPIR-V extension for compute shader derivatives.
+
`SPV_NV_compute_shader_derivatives`
> Represents the SPIR-V extension for compute shader derivatives.
diff --git a/source/slang/slang-capabilities.capdef b/source/slang/slang-capabilities.capdef
index 2285bd2e5..749a72e3b 100644
--- a/source/slang/slang-capabilities.capdef
+++ b/source/slang/slang-capabilities.capdef
@@ -527,7 +527,11 @@ def SPV_NV_shader_image_footprint : _spirv_1_0;
/// Represents the SPIR-V extension for compute shader derivatives.
/// [EXT]
-def SPV_NV_compute_shader_derivatives : _spirv_1_0;
+def SPV_KHR_compute_shader_derivatives : _spirv_1_0;
+
+/// Represents the SPIR-V extension for compute shader derivatives.
+/// [EXT]
+alias SPV_NV_compute_shader_derivatives = SPV_KHR_compute_shader_derivatives;
/// Represents the SPIR-V extension for SPV_GOOGLE_user_type.
/// [EXT]
@@ -971,7 +975,7 @@ alias GL_KHR_shader_subgroup_vote = _GL_KHR_shader_subgroup_vote | spvGroupNonUn
/// Represents the GL_NV_compute_shader_derivatives extension.
/// [EXT]
-alias GL_NV_compute_shader_derivatives = _GL_NV_compute_shader_derivatives | SPV_NV_compute_shader_derivatives | _sm_6_6;
+alias GL_NV_compute_shader_derivatives = _GL_NV_compute_shader_derivatives | SPV_KHR_compute_shader_derivatives | _sm_6_6;
/// Represents the GL_NV_fragment_shader_barycentric extension.
/// [EXT]
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp
index 758e1ca7e..266f3b7e9 100644
--- a/source/slang/slang-emit-spirv.cpp
+++ b/source/slang/slang-emit-spirv.cpp
@@ -3603,7 +3603,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex
continue;
ensureExtensionDeclaration(
- UnownedStringSlice("SPV_NV_compute_shader_derivatives"));
+ UnownedStringSlice("SPV_KHR_compute_shader_derivatives"));
auto numThreadsDecor =
entryPointDecor->findDecoration<IRNumThreadsDecoration>();
if (isQuad)
@@ -3617,8 +3617,8 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex
requireSPIRVExecutionMode(
nullptr,
getIRInstSpvID(entryPoint),
- SpvExecutionModeDerivativeGroupQuadsNV);
- requireSPIRVCapability(SpvCapabilityComputeDerivativeGroupQuadsNV);
+ SpvExecutionModeDerivativeGroupQuadsKHR);
+ requireSPIRVCapability(SpvCapabilityComputeDerivativeGroupQuadsKHR);
}
else
{
@@ -3631,8 +3631,8 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex
requireSPIRVExecutionMode(
nullptr,
getIRInstSpvID(entryPoint),
- SpvExecutionModeDerivativeGroupLinearNV);
- requireSPIRVCapability(SpvCapabilityComputeDerivativeGroupLinearNV);
+ SpvExecutionModeDerivativeGroupLinearKHR);
+ requireSPIRVCapability(SpvCapabilityComputeDerivativeGroupLinearKHR);
}
}
diff --git a/tests/glsl-intrinsic/compute-derivative/intrinsic-derivative-function-in-compute.slang b/tests/glsl-intrinsic/compute-derivative/intrinsic-derivative-function-in-compute.slang
index 1c9152969..6d05213e5 100644
--- a/tests/glsl-intrinsic/compute-derivative/intrinsic-derivative-function-in-compute.slang
+++ b/tests/glsl-intrinsic/compute-derivative/intrinsic-derivative-function-in-compute.slang
@@ -12,14 +12,14 @@
//TEST:SIMPLE(filecheck=CHECK_SPV_QUAD_C): -allow-glsl -stage compute -entry computeMain -target spirv -DQUAD -DCOMPUTE
// CHECK_SPV_QUAD_C: DerivativeGroupQuads{{NV|KHR}}
// CHECK_SPV_QUAD_C-NOT: DerivativeGroupQuads{{NV|KHR}}
-// CHECK_SPV_QUAD_C: "SPV_NV_compute_shader_derivatives"
-// CHECK_SPV_QUAD_C-NOT: "SPV_NV_compute_shader_derivatives"
+// CHECK_SPV_QUAD_C: "SPV_KHR_compute_shader_derivatives"
+// CHECK_SPV_QUAD_C-NOT: "SPV_KHR_compute_shader_derivatives"
//TEST:SIMPLE(filecheck=CHECK_SPV_LINEAR_C): -allow-glsl -stage compute -entry computeMain -target spirv -DLINEAR -DCOMPUTE
// CHECK_SPV_LINEAR_C: DerivativeGroupLinear{{NV|KHR}}
// CHECK_SPV_LINEAR_C-NOT: DerivativeGroupLinear{{NV|KHR}}
-// CHECK_SPV_LINEAR_C: "SPV_NV_compute_shader_derivatives"
-// CHECK_SPV_LINEAR_C-NOT: "SPV_NV_compute_shader_derivatives"
+// CHECK_SPV_LINEAR_C: "SPV_KHR_compute_shader_derivatives"
+// CHECK_SPV_LINEAR_C-NOT: "SPV_KHR_compute_shader_derivatives"
//TEST:SIMPLE(filecheck=CHECK_HLSL_C): -allow-glsl -stage compute -entry computeMain -target hlsl -DCOMPUTE
// CHECK_HLSL_C: computeMain(
@@ -29,11 +29,11 @@
//TEST:SIMPLE(filecheck=CHECK_SPV_QUAD_F): -allow-glsl -stage fragment -entry computeMain -target spirv -DQUAD
// CHECK_SPV_QUAD_F-NOT: DerivativeGroupQuads{{NV|KHR}}
-// CHECK_SPV_QUAD_F-NOT: "SPV_NV_compute_shader_derivatives"
+// CHECK_SPV_QUAD_F-NOT: "SPV_KHR_compute_shader_derivatives"
//TEST:SIMPLE(filecheck=CHECK_SPV_LINEAR_F): -allow-glsl -stage fragment -entry computeMain -target spirv -DLINEAR
// CHECK_SPV_LINEAR_F-NOT: DerivativeGroupLinear{{NV|KHR}}
-// CHECK_SPV_LINEAR_F-NOT: "SPV_NV_compute_shader_derivatives"
+// CHECK_SPV_LINEAR_F-NOT: "SPV_KHR_compute_shader_derivatives"
//TEST:SIMPLE(filecheck=CHECK_GLSL_QUAD_F): -allow-glsl -stage fragment -entry computeMain -target glsl
// CHECK_GLSL_QUAD_F-NOT: GL_NV_compute_shader_derivatives