320.geom 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. #version 320 es
  2. precision mediump float;
  3. in fromVertex {
  4. in vec3 color;
  5. } fromV[];
  6. in vec4 nonBlockUnsized[];
  7. out toFragment {
  8. out vec3 color;
  9. } toF;
  10. out fromVertex { // okay to reuse a block name for another block name
  11. vec3 color;
  12. };
  13. out fooB { // ERROR, cannot reuse block name as block instance
  14. vec2 color;
  15. } fromVertex;
  16. int fromVertex; // ERROR, cannot reuse a block name for something else
  17. out fooC { // ERROR, cannot have same name for block and instance name
  18. vec2 color;
  19. } fooC;
  20. void main()
  21. {
  22. EmitVertex();
  23. EndPrimitive();
  24. EmitStreamVertex(1); // ERROR
  25. EndStreamPrimitive(0); // ERROR
  26. color = fromV[0].color;
  27. gl_ClipDistance[3] = // ERROR, no ClipDistance
  28. gl_in[1].gl_ClipDistance[2]; // ERROR, no ClipDistance
  29. gl_Position = gl_in[0].gl_Position;
  30. gl_PrimitiveID = gl_PrimitiveIDIn;
  31. gl_Layer = 2;
  32. }
  33. layout(stream = 4) out vec4 ov4; // ERROR, no streams
  34. layout(line_strip, points, triangle_strip, points, triangle_strip) out; // just means triangle_strip"
  35. out ooutb { vec4 a; } ouuaa6;
  36. layout(max_vertices = 200) out;
  37. layout(max_vertices = 300) out; // ERROR, too big
  38. void foo(layout(max_vertices = 4) int a) // ERROR
  39. {
  40. ouuaa6.a = vec4(1.0);
  41. }
  42. layout(line_strip, points, triangle_strip, points) out; // ERROR, changing output primitive
  43. layout(line_strip, points) out; // ERROR, changing output primitive
  44. layout(triangle_strip) in; // ERROR, not an input primitive
  45. layout(triangle_strip) uniform; // ERROR
  46. layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable
  47. layout(triangle_strip) in vec4 bad2v4[]; // ERROR, not on a variable or input
  48. layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0
  49. out outbn2 {
  50. layout(invocations = 3) int a; // 2 ERRORs, not on a block member, not until 4.0
  51. layout(max_vertices = 3) int b; // ERROR, not on a block member
  52. layout(triangle_strip) int c; // ERROR, not on a block member
  53. } outbi;
  54. layout(lines) out; // ERROR, not on output
  55. layout(lines_adjacency) in;
  56. layout(triangles) in; // ERROR, can't change it
  57. layout(triangles_adjacency) in; // ERROR, can't change it
  58. layout(invocations = 4) in;
  59. in sameName {
  60. int a15;
  61. } insn[];
  62. out sameName {
  63. float f15;
  64. };
  65. uniform sameName {
  66. bool b15;
  67. };
  68. const int summ = gl_MaxVertexAttribs +
  69. gl_MaxGeometryInputComponents +
  70. gl_MaxGeometryOutputComponents +
  71. gl_MaxGeometryImageUniforms +
  72. gl_MaxGeometryTextureImageUnits +
  73. gl_MaxGeometryOutputVertices +
  74. gl_MaxGeometryTotalOutputComponents +
  75. gl_MaxGeometryUniformComponents +
  76. gl_MaxGeometryAtomicCounters +
  77. gl_MaxGeometryAtomicCounterBuffers +
  78. gl_MaxVertexTextureImageUnits +
  79. gl_MaxCombinedTextureImageUnits +
  80. gl_MaxTextureImageUnits +
  81. gl_MaxDrawBuffers;
  82. void fooe1()
  83. {
  84. gl_ViewportIndex; // ERROR, not in ES
  85. gl_MaxViewports; // ERROR, not in ES
  86. insn.length(); // 4: lines_adjacency
  87. int inv = gl_InvocationID;
  88. }
  89. in vec4 explArray[4];
  90. in vec4 explArrayBad[5]; // ERROR, wrong size
  91. in vec4 nonArrayed; // ERROR, not an array
  92. flat out vec3 myColor1;
  93. centroid out vec3 myColor2;
  94. centroid in vec3 centr[];
  95. sample out vec4 perSampleColor; // ERROR without sample extensions
  96. layout(max_vertices = 200) out; // matching redecl
  97. layout(location = 7, component = 2) in float comp[]; // ERROR, es has no component
  98. void notHere()
  99. {
  100. gl_MaxGeometryVaryingComponents; // ERROR, not in ES
  101. gl_VerticesIn; // ERROR, not in ES
  102. }
  103. void pointSize2()
  104. {
  105. highp float ps = gl_in[3].gl_PointSize; // ERROR, need extension
  106. gl_PointSize = ps; // ERROR, need extension
  107. }