• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 300 es
2
3struct s { vec4 v; };
4
5layout(location = 7) in vec3 c;
6layout(LocatioN = 3) in vec4 p;
7layout(LocatioN = 9) in vec4 q[4]; // ERROR, no array
8layout(LocatioN = 10) in s r[4];   // ERROR, no struct, ERROR, location overlap
9out vec4 pos;
10out vec3 color;
11
12layout(shared, column_major) uniform mat4 badm4; // ERROR
13layout(shared, column_major, row_major) uniform; // default is now shared and row_major
14
15layout(std140) uniform Transform { // layout of this block is std140
16    mat4 M1; // row_major
17    layout(column_major) mat4 M2; // column major
18    mat3 N1; // row_major
19    centroid float badf;  // ERROR
20    in float badg;        // ERROR
21    layout(std140) float bad1;
22    layout(shared) float bad2;
23    layout(packed) float bad3;
24} tblock;
25
26uniform T2 { // layout of this block is shared
27    bool b;
28    mat4 t2m;
29};
30
31layout(column_major) uniform T3 { // shared and column_major
32    mat4 M3; // column_major
33    layout(row_major) mat4 M4; // row major
34    mat3 N2; // column_major
35    int b;  // ERROR, redefinition (needs to be last member of block for testing, following members are skipped)
36};
37
38out badout {  // ERROR
39    float f;
40};
41
42layout (location = 10) out vec4 badoutA;  // ERROR
43
44void main()
45{
46    pos = p * (tblock.M1 + tblock.M2 + M4 + M3 + t2m);
47    color = c * tblock.N1;
48}
49
50shared vec4 compute_only;  // ERROR
51
52layout(packed) uniform;
53
54layout(packed) uniform float aoeuntaoeu;  // ERROR, packed on variable
55
56layout(location = 40) in float cd;
57layout(location = 37) in mat4x3 ce; // ERROR, overlap
58