yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
42ddfbd3
main
1#version 420 core 2#version 420 core 3varying vec2 v2 ;// ERROR, varying reserved 4in vec4 bad [10 ]; 5highp in vec4 badorder ; 6out invariant vec4 badorder2 ; 7in centroid vec4 badorder4 ;// ERROR, no centroid input to vertex stage 8out flat vec4 badorder3 ; 9void bar (in const float a ); 10void bar2 (highp in float b ); 11smooth flat out vec4 rep ;// ERROR, replicating interpolation qualification 12centroid sample out vec4 rep2 ;// ERROR, replicating auxiliary qualification 13in uniform vec4 rep3 ;// ERROR, replicating storage qualification 14 15int anonconst ; 16const int aconst = 5 ; 17const int a = aconst ; 18const int b = anonconst ;// ERROR at global scope 19 20const int foo ()// ERROR, no const functions 21{ 22const int a = aconst ; 23const int b = anonconst ; 24const int c = a ;// still compile-time const 25const int d = b ;// not a compile-time const 26float x [c ];// okay 27float y [d ];// ERROR 28 29return b ; 30} 31 32void main () 33{ 34int i ; 35if (i == 3 ) 36int j = i ; 37else 38int k = j ;// ERROR, j is undeclared 39int m = k ;// ERROR, k is undeclared 40int n = j ;// ERROR, j is undeclared 41 42while (true) 43int jj ; 44int kk = jj ;// ERROR, jj is undeclared 45} 46 47const float cx = 4.20 ; 48const float dx = 4.20 ; 49 50void bar (in highp volatile vec4 v ) 51{ 52int s ; 53s .x ;// okay 54s .y ;// ERROR 55if (bad [0 ].x == cx .x ) 56 ; 57if (cx .x == dx .x ) 58badorder3 = bad [0 ]; 59 60float f ; 61vec3 smeared = f .xxx ; 62f .xxxxx ;// ERROR 63f .xxy ;// ERROR 64} 65 66layout (binding = 3 )uniform ;// ERROR 67layout (binding = 3 )uniform boundblock {int aoeu ; }boundInst ; 68layout (binding = 7 )uniform anonblock {int aoeu ; } ; 69layout (location = 1 )in ;// ERROR 70layout (binding = 1 )in inblock {int aoeua ; };// ERROR 71layout (binding = 100000 )uniform anonblock2 {int aooeu ; } ; 72layout (binding = 4 )uniform sampler2D sampb1 ; 73layout (binding = 5 )uniform sampler2D sampb2 [10 ]; 74layout (binding = 80 )uniform sampler2D sampb3 ;// ERROR, binding too big 75layout (binding = 31 )uniform sampler2D sampb4 ; 76layout (binding = 79 )uniform sampler2D sampb5 [2 ];// ERROR, binding too big 77 78int fgfg (float f ,mediump int i ); 79int fgfg (float f ,highp int i ); 80 81out gl_PerVertex { 82float gl_ClipDistance [4 ]; 83}; 84 85patch in vec4 patchIn ;// ERROR 86patch out vec4 patchOut ;// ERROR 87 88void bar23444 () 89{ 90mat4x3 m43 ; \ 91float a1 = m43 [3 ].y ; 92vec3 v3 ; 93int a2 = m43 .length (); 94a2 += m43 [1 ].length (); 95a2 += v3 .length (); 96const float b = 2 * a1 ; 97int a = gl_MinProgramTexelOffset + gl_MaxProgramTexelOffset ; 98} 99 100const int comma0 = (2 ,3 );// ERROR 101int comma1 [(2 ,3 )];// ERROR 102 103layout (r32i )uniform iimage2D iimg2D ; 104layout (rgba32i )uniform iimage2D iimg2Drgba ; 105layout (rgba32f )uniform image2D img2Drgba ; 106layout (r32ui )uniform uimage2D uimg2D ; 107uniform image2DMS img2DMS ;// ERROR image variables not declared writeonly must have format layout qualifier 108uniform writeonly image2DMS img2DMSWO ; 109void qux () 110{ 111int i = aoeu ; 112imageAtomicCompSwap (iimg2D ,ivec2 (i ,i ),i ,i ); 113imageAtomicAdd (uimg2D ,ivec2 (i ,i ),uint (i )); 114imageAtomicMin (iimg2Drgba ,ivec2 (i ,i ),i );// ERROR iimg2Drgba does not have r32i layout 115imageAtomicMax (img2Drgba ,ivec2 (i ,i ),i );// ERROR img2Drgba is not integer image 116ivec4 pos = imageLoad (iimg2D ,ivec2 (i ,i )); 117vec4 col = imageLoad (img2DMS ,ivec2 (i ,i ),i ); 118imageStore (img2DMSWO ,ivec2 (i ,i ),i ,vec4 (0 )); 119imageLoad (img2DMSWO ,ivec2 (i ,i ),i );// ERROR, drops writeonly 120} 121 122volatile float vol ;// ERROR, not an image 123readonly int vol2 ;// ERROR, not an image 124 125void passr (coherent readonly iimage2D image ) 126{ 127} 128 129layout (r32i )coherent readonly uniform iimage2D qualim1 ; 130layout (r32i )coherent volatile readonly uniform iimage2D qualim2 ; 131 132void passrc () 133{ 134passr (qualim1 );// ERROR, changing formats 135passr (qualim2 );// ERROR, drops volatile, ERROR, changing formats 136passr (iimg2D );// ERROR, changing formats 137} 138 139layout (rg8i )uniform uimage2D i1bad ;// ERROR, type mismatch 140layout (rgba32i )uniform image2D i2bad ;// ERROR, type mismatch 141layout (rgba32f )uniform uimage2D i3bad ;// ERROR, type mismatch 142layout (r8_snorm )uniform iimage2D i4bad ;// ERROR, type mismatch 143layout (rgba32ui )uniform iimage2D i5bad ;// ERROR, type mismatch 144layout (r8ui )uniform iimage2D i6bad ;// ERROR, type mismatch 145 146uniform offcheck { 147layout (offset = 16 )int foo ;// ERROR 148}offcheckI ; 149 150uniform sampler1D samp1D ; 151uniform sampler1DShadow samp1Ds ; 152 153void qlod () 154{ 155int levels ; 156 157levels = textureQueryLevels (samp1D );// ERROR, not until 430 158levels = textureQueryLevels (samp1Ds );// ERROR, not until 430 159} 160 161layout (binding = 0 )writeonly uniform image1D badArray []; 162layout (binding = 74 )uniform sampler2D u_sampler0 [6 ];