Merge pull request #2892 from greg-lunarg/mb
[platform/upstream/glslang.git] / Test / hlsl.rw.swizzle.frag
1 RWTexture2D<float3> rwtx;
2 RWBuffer<float3> buf;
3
4 float3 SomeValue() { return float3(1,2,3); }
5
6 float4 main() : SV_Target0
7 {
8     int2 tc2 = { 0, 0 };
9     int tc = 0;
10
11     // Test swizzles and partial updates of L-values when writing to buffers and writable textures.
12     rwtx[tc2].zyx = float3(1,2,3);     // full swizzle, simple RHS
13     rwtx[tc2].zyx = SomeValue();       // full swizzle, complex RHS
14     rwtx[tc2].zyx = 2;                 // full swizzle, modify op
15
16     // Partial updates not yet supported.
17     // Partial values, which will use swizzles.
18     // buf[tc].yz = 42;                 // partial swizzle, simple RHS
19     // buf[tc].yz = SomeValue().x;      // partial swizzle, complex RHS
20     // buf[tc].yz += 43;                // partial swizzle, modify op
21
22     // // Partial values, which will use index.
23     // buf[tc].y = 44;                  // single index, simple RHS
24     // buf[tc].y = SomeValue().x;       // single index, complex RHS
25     // buf[tc].y += 45;                 // single index, modify op
26
27     return 0.0;
28 }