yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
01aee059
main
1#version 130 2 3lowp vec3 a ; 4mediump float b ; 5highp int c ; 6 7precision highp float ; 8 9in vec4 i; 10out vec4 o; 11 12flat in float fflat; 13smooth in float fsmooth; 14noperspective in float fnop; 15 16void main() 17{ 18float clip = gl_ClipDistance[ 3 ]; 19} 20 21uniform samplerCube sampC; 22 23void foo() 24{ 25vec4 s = textureGather(sampC, vec3( 0.2 )); 26} 27 28#extension GL_ARB_texture_gather : enable 29 30void bar() 31{ 32vec4 s = textureGather(sampC, vec3( 0.2 )); 33} 34 35flat in vec3 gl_Color; // ERROR, type 36in vec4 gl_Color; 37flat in vec4 gl_Color; 38flat in vec4 gl_Color[ 2 ]; // ERROR, array 39vec4 gl_Color; // ERROR, storage 40 41#extension GL_ARB_texture_gather : warn 42 43void bar2() 44{ 45vec4 s = textureGather(sampC, vec3( 0.2 )); 46 47uvec3 uv3; 48bvec3 b3; 49b3 = lessThan(uv3, uv3); 50b3 = equal(uv3, uv3); 51const bvec2 bl1 = greaterThanEqual(uvec2( 2 , 3 ), uvec2( 3 , 3 )); 52const bvec2 bl2 = equal(uvec2( 2 , 3 ), uvec2( 3 , 3 )); 53const bvec2 bl3 = equal(bl1, bl2); // yes, equal 54int a1[int(bl3. x )]; 55int a2[int(bl3. y )]; 56a1[ 0 ]; // size 1 57a2[ 0 ]; // size 1 58const bvec4 bl4 = notEqual(greaterThan(uvec4( 1 , 2 , 3 , 4 ), uvec4( 0 , 2 , 0 , 6 )), lessThanEqual(uvec4( 7 , 8 , 9 , 10 ), uvec4( 6 , 8 , 0 , 11 ))); // compare (t,f,t,f) with (f,t,f,t) 59int a3[int(bl4. x ) + int(bl4. y ) + int(bl4. z ) + int(bl4. w )]; 60a3[ 3 ]; // size 4 61b3 != b3; 62b3 < b3; // ERROR 63uv3 > uv3; // ERROR 64uvec2( 2 , 3 ) >= uvec2( 3 , 3 ); // ERROR 65int samples = gl_NumSamples; // ERROR 66int (bl4) <= int (bl4); // true 67int (bl4.x) > int (bl4.y); // false 68} 69 70#extension GL_ARB_texture_gather : enable 71#extension GL_ARB_texture_rectangle : enable 72#extension GL_ARB_sample_shading : enable 73 74uniform sampler2D samp2D; 75uniform sampler2DShadow samp2DS; 76uniform sampler2DRect samp2DR; 77uniform sampler2DArray samp2DA; 78 79void bar23() 80{ 81vec4 s; 82s = textureGatherOffset(sampC, vec3( 0.3 ), ivec2( 1 )); // ERROR 83s = textureGatherOffset(samp2DR, vec2( 0.3 ), ivec2( 1 )); // ERROR 84s = textureGatherOffset(samp2D, vec2( 0.3 ), ivec2( 1 )); 85s = textureGatherOffset(samp2DA, vec3( 0.3 ), ivec2( 1 )); 86s = textureGatherOffset(samp2DS, vec2( 0.3 ), 1.3 , ivec2( 1 )); // ERROR 87s = textureGatherOffset(samp2D, vec2( 0.3 ), ivec2( 1 ), 2 ); // ERROR 88int samples = gl_NumSamples; 89} 90 91#extension GL_ARB_gpu_shader5 : enable 92 93void bar234() 94{ 95vec4 s; 96s = textureGatherOffset(samp2D, vec2( 0.3 ), ivec2( 1 )); 97s = textureGatherOffset(samp2DA, vec3( 0.3 ), ivec2( 1 )); 98s = textureGatherOffset(samp2DR, vec2( 0.3 ), ivec2( 1 )); 99s = textureGatherOffset(samp2DS, vec2( 0.3 ), 1.3 , ivec2( 1 )); 100s = textureGatherOffset(samp2D, vec2( 0.3 ), ivec2( 1 ), 2 ); 101} 102 103#extension GL_ARB_texture_cube_map_array : enable 104 105uniform samplerCubeArray Sca; 106uniform isamplerCubeArray Isca; 107uniform usamplerCubeArray Usca; 108uniform samplerCubeArrayShadow Scas; 109 110void bar235() 111{ 112ivec3 a = textureSize(Sca, 3 ); 113vec4 b = texture(Sca, i); 114ivec4 c = texture(Isca, i, 0.7 ); 115uvec4 d = texture(Usca, i); 116117 b = textureLod(Sca, i, 1.7 ); 118a = textureSize(Scas, a. x ); 119float f = texture(Scas, i, b. y ); 120c = textureGrad(Isca, i, vec3( 0.1 ), vec3( 0.2 )); 121} 122 123int \ 124x; // ERROR until 420pack is turned on 125 126#extension GL_ARB_shading_language_420pack : enable 127 128const int ai[ 3 ] = { 10 , 23 , 32 }; 129layout (binding = 0 ) uniform blockname { int a ; } instanceName; // ERROR 130uniform layout (binding = 0 ) sampler2D bounds; 131 132void bar23444() 133{ 134mat4x3 m43; \ 135float a1 = m43[ 3 ]. y ; 136vec3 v3; 137int a2 = m43. length (); 138a2 += m43[ 1 ]. length (); 139a2 += v3. length (); 140const float b = 2 * a1; 141a. x = gl_MinProgramTexelOffset + gl_MaxProgramTexelOffset; 142bool boolb; 143boolb. length (); // ERROR 144m43[ 3 ][ 1 ]. length (); // ERROR 145v3. length ; // ERROR 146v3. length (b); // ERROR 147} 148 149in float gl_FogFragCoord; 150 151#extension GL_ARB_separate_shader_objects : enable 152 153in float gl_FogFragCoord; 154in int gl_FogFragCoord; // ERROR 155 156layout (early_fragment_tests) in ; // ERROR 157layout (r32i) uniform iimage2D iimg2Dbad; // ERROR 158 159#extension GL_ARB_shader_image_load_store : enable 160 161layout (early_fragment_tests) in ; 162 163layout (r32i) uniform iimage2D iimg2D; 164 165void qux2() 166{ 167int i; 168imageAtomicCompSwap(iimg2D, ivec2(i,i), i, i); 169ivec4 pos = imageLoad(iimg2D, ivec2(i,i)); 170} 171 172layout (early_fragment_tests) out ; // ERROR 173 174#extension GL_ARB_explicit_uniform_location : enable 175 176layout (location = 3 ) uniform vec4 ucolor0; // ERROR: explicit attrib location is also required for version < 330 177 178#extension GL_ARB_explicit_attrib_location : enable 179 180layout (location = 4 ) uniform vec4 ucolor1 ; 181