Merge pull request #2976 from jeremy-lunarg/hayes-fix-2975
[platform/upstream/glslang.git] / Test / hlsl.structbuffer.frag
1 struct sb_t
2 {
3     float3 color;
4     bool   test;
5     bool   test2;
6 }; // stride = 20
7
8 StructuredBuffer<sb_t>  sbuf : register(t10);
9 StructuredBuffer<float> sbuf2;
10
11 float4 main(uint pos : FOO) : SV_Target0
12 {
13     sb_t mydata = sbuf.Load(pos);
14
15     uint size;
16     uint stride;
17     sbuf.GetDimensions(size, stride);
18
19     if (sbuf[pos].test)
20         return float4(sbuf[pos].color + sbuf2[pos], 0);
21     else
22         return mydata.color.x + size + stride;
23 }