Merge pull request #2976 from jeremy-lunarg/hayes-fix-2975
[platform/upstream/glslang.git] / Test / spv.16bitstorage-int.frag
1 #version 450 core\r
2 \r
3 #extension GL_EXT_shader_16bit_storage : enable\r
4 \r
5 struct S\r
6 {\r
7     int16_t  x;\r
8     i16vec2    y;\r
9     i16vec3    z;\r
10 };\r
11 \r
12 layout(column_major, std140) uniform B1\r
13 {\r
14     int16_t  a;\r
15     i16vec2    b;\r
16     i16vec3    c;\r
17     int16_t  d[2];\r
18     S          g;\r
19     S          h[2];\r
20     int        j;\r
21 } b1;\r
22 \r
23 layout(row_major, std430) buffer B2\r
24 {\r
25     int16_t  o;\r
26     i16vec2    p;\r
27     i16vec3    q;\r
28     int16_t  r[2];\r
29     S          u;\r
30     S          v[2];\r
31     i16vec2    x[100];\r
32     int16_t  w[];\r
33 } b2;\r
34 \r
35 layout(row_major, std140) uniform B5\r
36 {\r
37     int16_t  o;\r
38     i16vec2    p;\r
39     i16vec3    q;\r
40     int16_t  r[2];\r
41     S          u;\r
42     S          v[2];\r
43     i16vec2    x[100];\r
44     int16_t  w[100];\r
45 } b5;\r
46 \r
47 struct S2 {\r
48     mat4x4 x;\r
49     int16_t y;\r
50     int z;\r
51 };\r
52 \r
53 struct S3 {\r
54     S2 x;\r
55 };\r
56 \r
57 layout(row_major, std430) buffer B3\r
58 {\r
59     S2 x;\r
60 } b3;\r
61 \r
62 layout(column_major, std430) buffer B4\r
63 {\r
64     S2 x;\r
65     S3 y;\r
66 } b4;\r
67 \r
68 void main()\r
69 {\r
70     b2.o = b1.a;\r
71     b2.p = i16vec2(ivec3(b2.q).xy);\r
72     b2.p = i16vec2(ivec3(b5.q).xy);\r
73     b2.r[0] = b2.r[0];\r
74     b2.r[1] = b5.r[1];\r
75     b2.p = b2.p;\r
76     int x0 = int(b1.a);\r
77     ivec4 x1 = ivec4(b1.a, b2.p, 1);\r
78     b4.x.x = b3.x.x;\r
79     b2.o = int16_t(ivec2(b2.p).x);\r
80     b2.p = b2.v[1].y;\r
81     ivec3 v3 = ivec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]);\r
82     ivec3 u3 = ivec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]);\r
83     b2.x[0] = b2.x[0];\r
84     b2.x[1] = b5.x[1];\r
85     b2.p.x = b1.a;\r
86     b2.o = b2.p.x;\r
87     b2.p = i16vec2(ivec2(1, 2));\r
88     b2.o = int16_t(3);\r
89 }\r
90 \r