Debian Codegraph @

third_party/spirv-cross/reference/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 uint ident = gl_GlobalInvocationID.x;
19 float idata = asfloat(_22.Load(ident * 4 + 0));
20 sShared[gl_LocalInvocationIndex] = idata;
21 GroupMemoryBarrierWithGroupSync();
22 _44.Store(ident * 4 + 0, asuint(sShared[(4u - gl_LocalInvocationIndex) - 1u]));
23 }
24
25 [numthreads(4, 1, 1)]
26 void main(SPIRV_Cross_Input stage_input)
27 {
28 gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
29 gl_LocalInvocationIndex = stage_input.gl_LocalInvocationIndex;
30 comp_main();
31 }