summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDarren Wihandi <65404740+fairywreath@users.noreply.github.com>2025-03-21 10:31:07 -0400
committerGitHub <noreply@github.com>2025-03-21 22:31:07 +0800
commit16ac0efa3e1e834e3b12af8ac34cf47a6418bb34 (patch)
tree1761fd5fa7186a3e9881be79b5ef9df6527f3a45 /tests
parent32a5bd2f43d55453bb5ea15c888c7a90730bbcff (diff)
Apply pixel interlock execution mode to entry-point functions only (#6661)
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/pipeline/rasterization/fragment-shader-interlock-child-function.slang31
1 files changed, 31 insertions, 0 deletions
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<float4> 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);
+}