yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
7a0b9b21
main
1#version 150 core 2 3in vec4 gl_FragCoord ; 4layout ( origin_upper_left , pixel_center_integer ) in vec4 gl_FragCoord ; // ERROR 5layout ( pixel_center_integer ) in vec4 gl_FragCoord ; // ERROR 6layout ( origin_upper_left ) in vec4 foo ; // ERROR 7layout ( origin_upper_left , pixel_center_integer ) in vec4 gl_FragCoord ; 8 9void main () 10{ 11vec4 c = gl_FragCoord ; 12} 13 14layout ( origin_upper_left , pixel_center_integer ) in vec4 gl_FragCoord ; // ERROR, declared after use 15 16in struct S { float f ; } s ; 17 18float patch = 3.1 ; 19 20uniform sampler2DMS sms ; 21uniform isampler2DMS isms ; 22uniform usampler2DMS usms ; 23uniform sampler2DMSArray smsa ; 24uniform isampler2DMSArray ismsa ; 25uniform usampler2DMSArray usmsa ; 26 27flat in ivec2 p2 ; 28flat in ivec3 p3 ; 29flat in int samp ; 30 31void barWxyz () 32{ 33ivec2 t11 = textureSize ( sms ) ; 34ivec2 t12 = textureSize ( isms ) ; 35ivec2 t13 = textureSize ( usms ) ; 36ivec3 t21 = textureSize ( smsa ) ; 37ivec3 t22 = textureSize ( ismsa ) ; 38ivec3 t23 = textureSize ( usmsa ) ; 39vec4 t31 = texelFetch ( sms , p2 , samp ) ; 40ivec4 t32 = texelFetch ( isms , p2 , samp ) ; 41uvec4 t33 = texelFetch ( usms , p2 , 3 ) ; 42vec4 t41 = texelFetch ( smsa , p3 , samp ) ; 43ivec4 t42 = texelFetch ( ismsa , ivec3 ( 2 ) , samp ) ; 44uvec4 t43 = texelFetch ( usmsa , p3 , samp ) ; 45} 46 47int primitiveID () 48{ 49return gl_PrimitiveID ; 50gl_PerFragment ; // ERROR, block name can't get reused 51} 52 53in double type1 ; // ERROR 54#extension GL_ARB_gpu_shader_fp64 : enable 55double type2 ; 56double type3 = 2.0 ; 57int absTest = sqrt ( type3 ) ; 58double absTest2 = sqrt ( type3 ) ; 59double absTest3 = sqrt ( 2 ) ; 60float dk = sqrt ( 11 ) ; 61 62#extension GL_ARB_shader_bit_encoding : enable 63 64float f ; 65vec4 v4 ; 66ivec4 iv4a ; 67uvec2 uv2c ; 68void bitEncodingPass () 69{ 70int i = floatBitsToInt ( f ) ; 71uvec4 uv11 = floatBitsToUint ( v4 ) ; 72vec4 v14 = intBitsToFloat ( iv4a ) ; 73vec2 v15 = uintBitsToFloat ( uv2c ) ; 74} 75 76#extension GL_ARB_shader_bit_encoding : disable 77 78void bitEncodingFail () 79{ 80int i = floatBitsToInt ( f ) ; // Error, extention GL_ARB_bit_encoding is diabled 81} 82 83#extension GL_ARB_shading_language_packing : enable 84vec2 v2a ; 85uint uy ; 86 87void packingPass () 88{ 89uint u19 = packSnorm2x16 ( v2a ) ; 90vec2 v20 = unpackSnorm2x16 ( uy ) ; 91uint u15 = packUnorm2x16 ( v2a ) ; 92vec2 v16 = unpackUnorm2x16 ( uy ) ; 93uint u17 = packHalf2x16 ( v2a ) ; 94vec2 v18 = unpackHalf2x16 ( uy ) ; 95} 96 97#extension GL_ARB_shading_language_packing : disable 98void packingFail () 99{ 100uint u19 = packSnorm2x16 ( v2a ) ; // Error, extension GL_ARB_shading_language_packing is disabled 101} 102 103// Testing extension GL_ARB_texture_query_lod 104uniform sampler1D samp1D ; 105uniform sampler2DShadow samp2Ds ; 106 107void qlodFail () 108{ 109vec2 lod ; 110float pf ; 111vec2 pf2 ; 112vec3 pf3 ; 113 114lod = textureQueryLOD ( samp1D , pf ) ; // ERROR, extension GL_ARB_texture_query_lod needed 115lod = textureQueryLOD ( samp2Ds , pf2 ) ; // ERROR, extension GL_ARB_texture_query_lod needed 116} 117 118#extension GL_ARB_texture_query_lod : enable 119 120uniform isampler2D isamp2D ; 121uniform usampler3D usamp3D ; 122uniform samplerCube sampCube ; 123uniform isampler1DArray isamp1DA ; 124uniform usampler2DArray usamp2DA ; 125 126uniform sampler1DShadow samp1Ds ; 127uniform samplerCubeShadow sampCubes ; 128uniform sampler1DArrayShadow samp1DAs ; 129uniform sampler2DArrayShadow samp2DAs ; 130 131uniform samplerBuffer sampBuf ; 132uniform sampler2DRect sampRect ; 133 134void qlodPass () 135{ 136vec2 lod ; 137float pf ; 138vec2 pf2 ; 139vec3 pf3 ; 140 141lod = textureQueryLOD ( samp1D , pf ) ; 142lod = textureQueryLOD ( isamp2D , pf2 ) ; 143lod = textureQueryLOD ( usamp3D , pf3 ) ; 144lod = textureQueryLOD ( sampCube , pf3 ) ; 145lod = textureQueryLOD ( isamp1DA , pf ) ; 146lod = textureQueryLOD ( usamp2DA , pf2 ) ; 147 148lod = textureQueryLOD ( samp1Ds , pf ) ; 149lod = textureQueryLOD ( samp2Ds , pf2 ) ; 150lod = textureQueryLOD ( sampCubes , pf3 ) ; 151lod = textureQueryLOD ( samp1DAs , pf ) ; 152lod = textureQueryLOD ( samp2DAs , pf2 ) ; 153 154lod = textureQueryLOD ( sampBuf , pf ) ; // ERROR 155lod = textureQueryLOD ( sampRect , pf2 ) ; // ERROR 156} 157 158// Test extension GL_EXT_shader_integer_mix 159#extension GL_EXT_shader_integer_mix : enable 160bool b1 , b2 , b ; 161int x , y ; 162uint z , w ; 163 164void testmix () 165{ 166int ival = mix ( x , y , b ) ; 167ivec2 iv2 = mix ( ivec2 ( x ) , ivec2 ( y ) , bvec2 ( b )) ; 168ivec3 iv3 = mix ( ivec3 ( x ) , ivec3 ( y ) , bvec3 ( b )) ; 169ivec4 iv4 = mix ( ivec4 ( x ) , ivec4 ( x ) , bvec4 ( b )) ; 170uint uiv = mix ( z , w , b ) ; 171uvec2 uv2 = mix ( uvec2 ( z ) , uvec2 ( z ) , bvec2 ( b )) ; 172uvec3 uv3 = mix ( uvec3 ( z ) , uvec3 ( z ) , bvec3 ( b )) ; 173uvec4 uv4 = mix ( uvec4 ( z ) , uvec4 ( z ) , bvec4 ( b )) ; 174bool bv = mix ( b1 , b2 , b ) ; 175bvec2 bv2 = mix ( bvec2 ( b1 ) , bvec2 ( b2 ) , bvec2 ( b )) ; 176bvec3 bv3 = mix ( bvec3 ( b1 ) , bvec3 ( b2 ) , bvec3 ( b )) ; 177bvec4 bv4 = mix ( bvec4 ( b1 ) , bvec4 ( b2 ) , bvec4 ( b )) ; 178} 179 180#extension GL_EXT_shader_integer_mix : disable 181void testmixFail () 182{ 183int ival = mix ( x , y , b ) ; // Error since extenson GL_EXT_shader_integer_mix is disabled 184}