From 16ac0efa3e1e834e3b12af8ac34cf47a6418bb34 Mon Sep 17 00:00:00 2001 From: Darren Wihandi <65404740+fairywreath@users.noreply.github.com> Date: Fri, 21 Mar 2025 10:31:07 -0400 Subject: Apply pixel interlock execution mode to entry-point functions only (#6661) Co-authored-by: Ellie Hermaszewska --- .../fragment-shader-interlock-child-function.slang | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/pipeline/rasterization/fragment-shader-interlock-child-function.slang (limited to 'tests') diff --git a/tests/pipeline/rasterization/fragment-shader-interlock-child-function.slang b/tests/pipeline/rasterization/fragment-shader-interlock-child-function.slang new file mode 100644 index 000000000..65dc39bdc --- /dev/null +++ b/tests/pipeline/rasterization/fragment-shader-interlock-child-function.slang @@ -0,0 +1,31 @@ +//TEST:SIMPLE(filecheck=CHECK):-target spirv -entry main -stage fragment + +RasterizerOrderedTexture2D texture; + +// +// Tests that an interlock region place at a non-entry point function will properly apply the SPIRV execution mode +// to the entry point function and not the child function. +// + +// CHECK: OpEntryPoint +// CHECK: OpExecutionMode %main PixelInterlockOrderedEXT + +float4 foo(float4 coords) +{ + float4 result; + + beginInvocationInterlock(); + { + result = texture[uint2(coords.xy)]; + texture[uint2(coords.xy)] = result + coords; + } + endInvocationInterlock(); + + return result; +} + +[shader("fragment")] +float4 main(float4 coords : COORDS) : SV_Target +{ + return foo(coords); +} -- cgit v1.2.3