diff options
| author | davli-nv <davli@nvidia.com> | 2025-08-05 10:55:52 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-05 17:55:52 +0000 |
| commit | 83675103a1a4fefde11b314aed26f4d37860efe7 (patch) | |
| tree | 136f597da62532f4b9361ff0d9e785d413fef2f1 /source/slang/slang-emit-glsl.cpp | |
| parent | 2d775b54d2ab7772785c2196075d4c7c174407ab (diff) | |
Implement SPV_EXT_fragment_invocation_density (SPV_NV_shading_rate) (#8037)
* Implement SPV_EXT_fragment_invocation_density
-Adds semantics SV_FragSize and SV_FragInvocationCount and implements them for SPIRV and GLSL using the appropriate target builtins from extensions.
-Adds test case checking for expected target builtins from these semantics.
-For future work, could implement SV_FragSize using pixel shader input SV_ShadingRate for HLSL, and SV_FragInvocationCount needs research.
Fixes #7974
Generated with Claude Code
* address review feedback
https://github.com/shader-slang/slang/pull/8037#pullrequestreview-3084645845
* fixup format
* review feedback
https://github.com/shader-slang/slang/pull/8037#pullrequestreview-3086442819
Diffstat (limited to 'source/slang/slang-emit-glsl.cpp')
| -rw-r--r-- | source/slang/slang-emit-glsl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp index eb71286a2..eb6d4c694 100644 --- a/source/slang/slang-emit-glsl.cpp +++ b/source/slang/slang-emit-glsl.cpp @@ -1246,6 +1246,14 @@ void GLSLSourceEmitter::_maybeEmitGLSLBuiltin(IRGlobalParam* var, UnownedStringS { _requireGLSLExtension(toSlice("GL_EXT_fragment_shading_rate_primitive")); } + else if (name == "gl_FragSizeEXT") + { + _requireGLSLExtension(toSlice("GL_EXT_fragment_invocation_density")); + } + else if (name == "gl_FragInvocationCountEXT") + { + _requireGLSLExtension(toSlice("GL_EXT_fragment_invocation_density")); + } else if (name == "gl_DrawID") { _requireGLSLVersion(460); |
