From 83675103a1a4fefde11b314aed26f4d37860efe7 Mon Sep 17 00:00:00 2001 From: davli-nv Date: Tue, 5 Aug 2025 10:55:52 -0700 Subject: 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 --- source/slang/glsl.meta.slang | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/slang/glsl.meta.slang') diff --git a/source/slang/glsl.meta.slang b/source/slang/glsl.meta.slang index dfa858eca..782c09bb9 100644 --- a/source/slang/glsl.meta.slang +++ b/source/slang/glsl.meta.slang @@ -216,6 +216,9 @@ public in int gl_ViewportIndex : SV_ViewportArrayIndex; public in int gl_BaseVertex : SV_StartVertexLocation; public in int gl_BaseInstance : SV_StartInstanceLocation; +public in int gl_FragInvocationCountEXT : SV_FragInvocationCount; +public in int2 gl_FragSizeEXT : SV_FragSize; + // Override operator* behavior to compute algebric product of matrices and vectors. -- cgit v1.2.3