Debian Codegraph @

third_party/spirv-cross/reference/opt/shaders-hlsl/comp/shared.comp

raw
1 static const uint3 gl_WorkGroupSize = uint3(4u, 1u, 1u);
2
3 ByteAddressBuffer _22 : register(t0);
4 RWByteAddressBuffer _44 : register(u1);
5
6 static uint3 gl_GlobalInvocationID;
7 static uint gl_LocalInvocationIndex;
8 struct SPIRV_Cross_Input
9 {
10 uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
11 uint gl_LocalInvocationIndex : SV_GroupIndex;
12 };
13
14 groupshared float sShared[4];
15
16 void comp_main()
17 {
18 sShared[gl_LocalInvocationIndex] = asfloat(_22.Load(gl_GlobalInvocationID.x * 4 + 0));
19 GroupMemoryBarrierWithGroupSync();
20 _44.Store(gl_GlobalInvocationID.x * 4 + 0, asuint(sShared[3u - gl_LocalInvocationIndex]));
21 }
22
23 [numthreads(4, 1, 1)]
24 void main(SPIRV_Cross_Input stage_input)
25 {
26 gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
27 gl_LocalInvocationIndex = stage_input.gl_LocalInvocationIndex;
28 comp_main();
29 }