blob: b2df43c138b1c00177049c6dbceceea17af22798 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
//TEST:SIMPLE(filecheck=SPV): -target spirv
struct Bottom
{
float bigArray[1024];
float bottomGetValue(int index) { return bigArray[index]; }
}
struct Middle
{
Bottom bottom;
float middleGetValue(int index) { return bottom.bottomGetValue(index); }
}
struct Top
{
Middle middle;
float topGetValue(int index) { return middle.middleGetValue(index); }
}
struct Root
{
Top top;
}
ConstantBuffer<Root> cb;
RWStructuredBuffer<float> outputBuffer;
// SPV: OpEntryPoint
// SPV-NOT: OpCompositeConstruct
[shader("compute")]
[numthreads(1, 1, 1)]
void compute_main(uint3 tid: SV_DispatchThreadID)
{
outputBuffer[0] = cb.top.topGetValue(0);
}
|