diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/pipeline/rasterization/fragment-shader-interlock-child-function.slang | 31 |
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); +} |
