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