300.vert 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. #version 300 es
  2. uniform mat4x3 m43;
  3. uniform mat3x3 m33;
  4. uniform mat4x4 m44;
  5. in vec3 v3;
  6. varying vec2 v2; // ERROR, varying reserved
  7. in vec4 bad[10]; // ERROR, no arrayed inputs
  8. highp in vec4 badorder; // ERROR, incorrect qualifier order
  9. out invariant vec4 badorder2; // ERROR, incorrect qualifier order
  10. in centroid vec4 badorder4; // ERROR, incorrect qualifier order
  11. out flat vec4 badorder3; // ERROR, incorrect qualifier order
  12. void bar(in const float a); // ERROR, incorrect qualifier order
  13. void bar2(highp in float b); // ERROR, incorrect qualifier order
  14. smooth flat out vec4 rep; // ERROR, replicating interpolation qualification
  15. centroid sample out vec4 rep2; // ERROR, replicating auxiliary qualification
  16. in uniform vec4 rep3; // ERROR, replicating storage qualification
  17. struct S {
  18. vec3 c;
  19. float f;
  20. };
  21. out S s;
  22. void main()
  23. {
  24. int id = gl_VertexID + gl_InstanceID;
  25. int c0 = gl_MaxVertexAttribs;
  26. int c1 = gl_MaxVertexUniformVectors;
  27. int c2 = gl_MaxVertexOutputVectors;
  28. int c3 = gl_MaxFragmentInputVectors;
  29. int c4 = gl_MaxVertexTextureImageUnits;
  30. int c5 = gl_MaxCombinedTextureImageUnits;
  31. int c6 = gl_MaxTextureImageUnits;
  32. int c7 = gl_MaxFragmentUniformVectors;
  33. int c8 = gl_MaxDrawBuffers;
  34. int c9 = gl_MinProgramTexelOffset;
  35. int c10 = gl_MaxProgramTexelOffset;
  36. mat3x4 tm = transpose(m43);
  37. highp float dm = determinant(m44);
  38. mat3x3 im = inverse(m33);
  39. mat3x2 op = outerProduct(v2, v3);
  40. gl_Position = m44[2];
  41. gl_PointSize = v2.y;
  42. s.c = v3;
  43. s.f = dm;
  44. #ifdef GL_ES
  45. #error GL_ES is set
  46. #else
  47. #error GL_ES is not set
  48. #endif
  49. }
  50. float badsize[]; // ERROR
  51. float[] badsize2; // ERROR
  52. uniform ub {
  53. int a[]; // ERROR
  54. } ubInst[]; // ERROR
  55. void foo(int a[]); // ERROR
  56. float okayA[] = float[](3.0f, 4.0F); // Okay
  57. out vec3 newV;
  58. void newVFun()
  59. {
  60. newV = v3;
  61. }
  62. invariant newV; // ERROR, variable already used
  63. in vec4 invIn;
  64. invariant invIn; // ERROR, in v300
  65. out S s2;
  66. invariant s2;
  67. invariant out S s3;
  68. flat out int;
  69. uniform ub2 {
  70. float f;
  71. } a;
  72. uniform ub2 { // ERROR redeclaration of block name (same instance name)
  73. float g;
  74. } a;
  75. uniform ub2 { // ERROR redeclaration of block name (different instance name)
  76. float f;
  77. } c;
  78. uniform ub2 { // ERROR redeclaration of block name (no instance name)
  79. float f123;
  80. };
  81. uniform ub3 {
  82. bool b23;
  83. };
  84. uniform ub3 { // ERROR redeclaration of block name (no instance name in first or declared)
  85. bool b234;
  86. };
  87. precision lowp sampler3D;
  88. precision lowp sampler2DShadow;
  89. precision lowp sampler2DArrayShadow;
  90. uniform sampler2D s2D;
  91. uniform sampler3D s3D;
  92. uniform sampler2DShadow s2DS;
  93. uniform sampler2DArrayShadow s2DAS;
  94. in vec2 c2D;
  95. void foo23()
  96. {
  97. ivec2 x1 = textureSize(s2D, 2);
  98. textureSize(s2D); // ERROR, no lod
  99. ivec3 x3 = textureSize(s2DAS, -1);
  100. textureSize(s2DAS); // ERROR, no lod
  101. vec4 x4 = texture(s2D, c2D);
  102. texture(s2D, c2D, 0.2); // ERROR, bias
  103. vec4 x5 = textureProjOffset(s3D, vec4(0.2), ivec3(1));
  104. textureProjOffset(s3D, vec4(0.2), ivec3(1), .03); // ERROR, bias
  105. float x6 = textureProjGradOffset(s2DS, invIn, vec2(4.2), vec2(5.3), ivec2(1));
  106. }
  107. int fgfg(float f, mediump int i);
  108. int fgfg(float f, highp int i); // ERROR, precision qualifier difference
  109. int fgfgh(float f, const in mediump int i);
  110. int fgfgh(float f, in mediump int i); // ERROR, precision qualifier difference
  111. void foo2349()
  112. {
  113. float[] x = float[] (1.0, 2.0, 3.0);
  114. float[] y = x;
  115. float[3] z = x;
  116. float[3] w;
  117. w = y;
  118. }
  119. int[] foo213234(); // ERROR
  120. int foo234234(float[]); // ERROR
  121. int foo234235(vec2[] v); // ERROR
  122. precision highp float[2]; // ERROR
  123. int fffg(float f);
  124. int fffg(float f);
  125. int gggf(float f);
  126. int gggf(float f) { return 2; }
  127. int gggf(float f);
  128. int agggf(float f) { return 2; }
  129. int agggf(float f);
  130. out struct Ssss { float f; } ssss;
  131. uniform Bblock {
  132. int a;
  133. } Binst;
  134. int Bfoo;
  135. layout(std140) Binst; // ERROR
  136. layout(std140) Bblock; // ERROR
  137. layout(std140) Bfoo; // ERROR
  138. layout(std430) uniform B430 { int a; } B430i; // ERROR
  139. struct SNA {
  140. int a[]; // ERROR
  141. };
  142. void fooDeeparray()
  143. {
  144. float[] x = float[] (1.0, 2.0, 3.0),
  145. y = float[] (1.0, 2.0, 3.0, 4.0);
  146. float xp[3], yp[4];
  147. xp = x;
  148. yp = y;
  149. xp = y; // ERROR, wrong size
  150. yp = x; // ERROR, wrong size
  151. }
  152. layout(num_views = 2) in; // ERROR, no extension
  153. void mwErr()
  154. {
  155. gl_ViewID_OVR; // ERROR, no extension
  156. }
  157. #extension GL_OVR_multiview : enable
  158. layout(num_views = 2) uniform float mwUniform; // ERROR, must be global
  159. layout(num_views = 2) in; // OK
  160. void mwOk()
  161. {
  162. gl_ViewID_OVR;
  163. }