spv.300layout.vert 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #version 310 es
  2. layout(location = 7) in vec3 c;
  3. layout(LocatioN = 3) in vec4 p;
  4. layout(location = 9) in ivec2 aiv2;
  5. out vec4 pos;
  6. out vec3 color;
  7. flat out int iout;
  8. layout(row_major) uniform; // default is now row_major
  9. layout(std140) uniform Transform { // layout of this block is std140
  10. mat4 M1; // row_major
  11. layout(column_major) mat4 M2; // column major
  12. mat3 N1; // row_major
  13. int iuin;
  14. } tblock;
  15. uniform T2 { // layout of this block is shared
  16. bool b;
  17. mat4 t2m;
  18. };
  19. layout(column_major) uniform T3 { // shared and column_major
  20. mat4 M3; // column_major
  21. layout(row_major) mat4 M4; // row major
  22. mat2x3 N2; // column_major
  23. layout(align=16, offset=2048) uvec3 uv3a[4];
  24. };
  25. in uint uiuin;
  26. struct S {
  27. vec3 c;
  28. float f;
  29. };
  30. out S s;
  31. void main()
  32. {
  33. pos = p * (tblock.M1 + tblock.M2 + M4 + M3 + t2m);
  34. color = c * tblock.N1;
  35. iout = tblock.iuin + int(uiuin) + aiv2.y;
  36. s.c = c;
  37. s.f = p.x;
  38. if (N2[1] != vec3(1.0) || uv3a[2] != uvec3(5))
  39. ++s.c;
  40. }