Debian Codegraph @

third_party/spirv-cross/reference/shaders-hlsl/comp/composite-array-initialization.comp

raw
1 struct Data
2 {
3 float a;
4 float b;
5 };
6
7 #ifndef SPIRV_CROSS_CONSTANT_ID_0
8 #define SPIRV_CROSS_CONSTANT_ID_0 4.0f
9 #endif
10 static const float X = SPIRV_CROSS_CONSTANT_ID_0;
11
12 static const uint3 gl_WorkGroupSize = uint3(2u, 1u, 1u);
13
14 static const Data _21 = { 1.0f, 2.0f };
15 static const Data _24 = { 3.0f, 4.0f };
16 static const Data _25[2] = { { 1.0f, 2.0f }, { 3.0f, 4.0f } };
17 static const Data _30 = { 3.0f, 5.0f };
18
19 RWByteAddressBuffer _61 : register(u0);
20
21 static uint3 gl_WorkGroupID;
22 static uint3 gl_LocalInvocationID;
23 static uint gl_LocalInvocationIndex;
24 struct SPIRV_Cross_Input
25 {
26 uint3 gl_WorkGroupID : SV_GroupID;
27 uint3 gl_LocalInvocationID : SV_GroupThreadID;
28 uint gl_LocalInvocationIndex : SV_GroupIndex;
29 };
30
31 static Data data[2];
32 static Data data2[2];
33
34 Data combine(Data a, Data b)
35 {
36 Data _46 = { a.a + b.a, a.b + b.b };
37 return _46;
38 }
39
40 void comp_main()
41 {
42 data = _25;
43 Data _28 = { X, 2.0f };
44 Data _31[2] = { _28, _30 };
45 data2 = _31;
46 if (gl_LocalInvocationIndex == 0u)
47 {
48 Data param = data[gl_LocalInvocationID.x];
49 Data param_1 = data2[gl_LocalInvocationID.x];
50 Data _79 = combine(param, param_1);
51 _61.Store(gl_WorkGroupID.x * 8 + 0, asuint(_79.a));
52 _61.Store(gl_WorkGroupID.x * 8 + 4, asuint(_79.b));
53 }
54 }
55
56 [numthreads(2, 1, 1)]
57 void main(SPIRV_Cross_Input stage_input)
58 {
59 gl_WorkGroupID = stage_input.gl_WorkGroupID;
60 gl_LocalInvocationID = stage_input.gl_LocalInvocationID;
61 gl_LocalInvocationIndex = stage_input.gl_LocalInvocationIndex;
62 comp_main();
63 }