yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Darren WihandiApply pixel interlock execution mode to entry-point functions only (#6661)16ac0efa3

master
720 B31 linesraw
1//TEST:SIMPLE(filecheck=CHECK):-target spirv -entry main -stage fragment
2
3RasterizerOrderedTexture2D<float4> texture;
4
5//
6// Tests that an interlock region place at a non-entry point function will properly apply the SPIRV execution mode
7// to the entry point function and not the child function.
8//
9
10// CHECK: OpEntryPoint
11// CHECK: OpExecutionMode %main PixelInterlockOrderedEXT
12
13float4 foo(float4 coords)
14{
15    float4 result;
16
17    beginInvocationInterlock();
18    {
19        result = texture[uint2(coords.xy)];
20        texture[uint2(coords.xy)] = result + coords;
21    }
22    endInvocationInterlock();
23
24    return result;
25}
26
27[shader("fragment")]
28float4 main(float4 coords : COORDS) : SV_Target
29{
30    return foo(coords);
31}