300layout.vert 1.5 KB

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