yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
ac666e73
main
1#version 310 es 2 3shared vec4 s ;// ERROR 4layout (local_size_x = 2 )out ;// ERROR 5buffer vec4 v ;// ERROR 6in int ini ; 7layout (location = 2 )uniform mat4 x ; 8layout (location = 3 )uniform mat4 y ; 9layout (location = 2 )out mat4 xi ; 10layout (location = 3 )out mat4 yi ;// ERROR, locations conflict with xi 11 12void main () 13{ 14uvec2 u2 ; 15u2 = uaddCarry (u2 ,u2 ,u2 ); 16uint u1 ; 17u1 = usubBorrow (u1 ,u1 ,u1 ); 18uvec4 u4 ; 19umulExtended (u4 ,u4 ,u4 ,u4 ); 20ivec4 i4 ; 21imulExtended (i4 ,i4 ,i4 ,i4 ); 22int i1 ; 23i1 = bitfieldExtract (i1 ,4 ,5 ); 24uvec3 u3 ; 25u3 = bitfieldExtract (u3 ,4 ,5 ); 26ivec3 i3 ; 27i3 = bitfieldInsert (i3 ,i3 ,4 ,5 ); 28u1 = bitfieldInsert (u1 ,u1 ,4 ,5 ); 29ivec2 i2 ; 30i2 = bitfieldReverse (i2 ); 31u4 = bitfieldReverse (u4 ); 32i1 = bitCount (i1 ); 33i3 = bitCount (u3 ); 34i2 = findLSB (i2 ); 35i4 = findLSB (u4 ); 36i1 = findMSB (i1 ); 37i2 = findMSB (u2 ); 38 39vec3 v3 ; 40v3 = frexp (v3 ,i3 ); 41vec2 v2 ; 42v2 = ldexp (v2 ,i2 ); 43 44mediump vec4 v4 ; 45u1 = packUnorm4x8 (v4 ); 46u1 = packSnorm4x8 (v4 ); 47v4 = unpackUnorm4x8 (u1 ); 48v4 = unpackSnorm4x8 (u1 ); 49} 50 51precision highp sampler2DMS ; 52precision highp isampler2DMS ; 53precision highp usampler2DMS ; 54 55uniform sampler2DMS s2dms; 56uniform isampler2DMS is2dms; 57uniform usampler2DMS us2dms; 58uniform usampler2DMSArray us2dmsa; // ERROR 59 60void foo() 61{ 62ivec2 v2; 63v2 = textureSize(s2dms); 64v2 = textureSize(us2dms); 65vec4 v4 = texelFetch(s2dms, v2, 2 ); 66ivec4 iv4 = texelFetch(is2dms, v2, 2 ); 67textureSamples(s2dms); // ERROR 68float f; 69frexp(f, ini); // ERROR, i not writable 70} 71 72out bool outb; // ERROR 73out sampler2D outo; // ERROR 74out float outa[ 4 ]; 75out float outaa[ 4 ][ 2 ]; // ERROR 76struct S { float f ; }; 77out S outs; 78out S [ 4 ] outasa; // ERROR 79out S outsa[ 4 ]; // ERROR 80struct SA { float f [ 4 ]; }; 81out SA outSA; // ERROR 82struct SS { float f ; S s ; }; 83out SS outSS; // ERROR 84 85layout (std430) uniform U430 { int a ; } U430i; // ERROR 86layout (std430) buffer B430 { int a ; } B430i; 87 88#ifndef GL_OES_shader_io_blocks 89#error GL_OES_shader_io_blocks not defined 90#endif 91 92#extension GL_OES_shader_io_blocks : enable 93 94out outbname { 95int a ; 96out vec4 v ; 97highp sampler2D s ; // ERROR, opaque type 98} outbinst; 99 100out outbname2 { 101layout (location = 12 ) int aAnon ; 102layout (location = 13 ) vec4 vAnon ; 103}; 104 105layout (location = 12 ) out highp int aliased; // ERROR, aliasing location 106 107in inbname { int a ; } inbinst; // ERROR, no in block in vertex shader 108 109out gl_PerVertex { // ERROR, has extra member 110highp vec4 gl_Position ; 111highp vec4 t ; 112}; 113 114void foo_IO() 115{ 116int sum = gl_VertexID + 117gl_InstanceID; 118gl_Position = vec4( 1.0 ); 119gl_PointSize = 2.0 ; // ERROR, removed by redeclaration 120} 121 122out gl_PerVertex { // ERROR, already used and already redeclared 123highp vec4 gl_Position ; 124highp vec4 t ; 125}; 126 127smooth out smo { // ERROR, no smooth on a block 128int i ; 129} smon; 130 131flat out fmo { // ERROR, no flat on a block 132int i ; 133} fmon; 134 135centroid out cmo { // ERROR, no centroid on a block 136int i ; 137} cmon; 138 139invariant out imo { // ERROR, no invariant on a block 140int i ; 141} imon; 142 143in vec2 inf, ing; 144uniform ivec2 offsets[ 4 ]; 145uniform sampler2D sArray[ 4 ]; 146uniform int sIndex; 147layout (binding = 0 ) uniform atomic_uint auArray[ 2 ]; 148uniform ubName { int i ; } ubInst[ 4 ]; 149buffer bbName { int i ; } bbInst[ 4 ]; 150highp uniform writeonly image2D iArray[ 5 ]; 151const ivec2 constOffsets[ 4 ] = ivec2[ 4 ](ivec2( 0.1 ), ivec2( 0.2 ), ivec2( 0.3 ), ivec2( 0.4 )); 152 153void pfooBad() 154{ 155precise vec2 h; // ERROR reserved 156h = fma(inf, ing, h); // ERROR, not available 157sArray[sIndex + 1 ]; // ERRRO, not supported 158auArray[sIndex + 1 ]; 159ubInst[ 1 ]; 160bbInst[ 2 ]; 161ubInst[sIndex + 1 ]; // ERROR, not supported 162bbInst[sIndex]; // ERROR, not supported 163iArray[ 2 ]; 164iArray[sIndex * 2 ]; // ERROR, not supported 165textureGatherOffset(sArray[ 0 ], vec2( 0.1 ), ivec2(inf)); // ERROR, offset not constant 166textureGatherOffsets(sArray[ 0 ], vec2( 0.1 ), constOffsets); // ERROR, not available 167} 168 169#extension GL_OES_gpu_shader5 : enable 170 171void pfoo() 172{ 173precise vec2 h; 174h = fma(inf, ing, h); 175sArray[sIndex + 1 ]; 176ubInst[sIndex + 1 ]; 177bbInst[sIndex - 2 ]; // ERROR, still not supported 178iArray[ 2 ]; 179iArray[sIndex - 2 ]; 180textureGatherOffset(sArray[ 0 ], vec2( 0.1 ), ivec2(inf)); 181textureGatherOffsets(sArray[ 0 ], vec2( 0.1 ), constOffsets); 182textureGatherOffsets(sArray[ 0 ], vec2( 0.1 ), offsets); // ERROR, offset not constant 183} 184 185uniform samplerBuffer badSamp1; // ERROR, reserved 186uniform isamplerBuffer badSamp2; // ERROR, reserved 187uniform usamplerBuffer badSamp3; // ERROR, reserved 188uniform writeonly imageBuffer badSamp4; // ERROR, reserved 189uniform writeonly iimageBuffer badSamp5; // ERROR, reserved 190uniform writeonly uimageBuffer badSamp6; // ERROR, reserved 191 192#extension GL_OES_texture_buffer : enable 193#extension GL_EXT_texture_buffer : enable 194 195uniform samplerBuffer noPreSamp1; // ERROR, no default precision 196uniform isamplerBuffer noPreSamp2; // ERROR, no default precision 197uniform usamplerBuffer noPreSamp3; // ERROR, no default precision 198uniform writeonly imageBuffer noPreSamp4; // ERROR, no default precision 199uniform writeonly iimageBuffer noPreSamp5; // ERROR, no default precision 200uniform writeonly uimageBuffer noPreSamp6; // ERROR, no default precision 201 202precision highp samplerBuffer ; 203precision highp isamplerBuffer ; 204precision highp usamplerBuffer ; 205precision highp imageBuffer ; 206precision highp iimageBuffer ; 207precision highp uimageBuffer ; 208 209#ifdef GL_OES_texture_buffer 210uniform samplerBuffer bufSamp1; 211uniform isamplerBuffer bufSamp2; 212uniform usamplerBuffer bufSamp3; 213#endif 214#ifdef GL_EXT_texture_buffer 215uniform writeonly imageBuffer bufSamp4; 216uniform writeonly iimageBuffer bufSamp5; 217uniform writeonly uimageBuffer bufSamp6; 218#endif 219 220void bufferT() 221{ 222highp int s1 = textureSize(bufSamp1); 223highp int s2 = textureSize(bufSamp2); 224highp int s3 = textureSize(bufSamp3); 225 226highp int s4 = imageSize(bufSamp4); 227highp int s5 = imageSize(bufSamp5); 228highp int s6 = imageSize(bufSamp6); 229230 highp vec4 f1 = texelFetch(bufSamp1, s1); 231highp ivec4 f2 = texelFetch(bufSamp2, s2); 232highp uvec4 f3 = texelFetch(bufSamp3, s3); 233} 234 235uniform writeonly imageCubeArray badCA1; // ERROR, reserved 236uniform writeonly iimageCubeArray badCA2; // ERROR, reserved 237uniform writeonly uimageCubeArray badCA3; // ERROR, reserved 238 239uniform samplerCubeArray badCA4; // ERROR, reserved 240uniform samplerCubeArrayShadow badCA5; // ERROR, reserved 241uniform isamplerCubeArray badCA6; // ERROR, reserved 242uniform usamplerCubeArray badCA7; // ERROR, reserved 243 244#extension GL_OES_texture_cube_map_array : enable 245 246uniform writeonly imageCubeArray noPreCA1; // ERROR, no default precision 247uniform writeonly iimageCubeArray noPreCA2; // ERROR, no default precision 248uniform writeonly uimageCubeArray noPreCA3; // ERROR, no default precision 249 250uniform samplerCubeArray noPreCA4; // ERROR, no default precision 251uniform samplerCubeArrayShadow noPreCA5; // ERROR, no default precision 252uniform isamplerCubeArray noPreCA6; // ERROR, no default precision 253uniform usamplerCubeArray noPreCA7; // ERROR, no default precision 254 255precision highp imageCubeArray ; 256precision highp iimageCubeArray ; 257precision highp uimageCubeArray ; 258 259precision highp samplerCubeArray ; 260precision highp samplerCubeArrayShadow ; 261precision highp isamplerCubeArray ; 262precision highp usamplerCubeArray ; 263 264uniform writeonly imageCubeArray CA1; 265uniform writeonly iimageCubeArray CA2; 266uniform writeonly uimageCubeArray CA3; 267 268layout (rgba16f) uniform readonly imageCubeArray rCA1; 269layout (rgba32i) uniform readonly iimageCubeArray rCA2; 270layout (r32ui) uniform readonly uimageCubeArray rCA3; 271 272#ifdef GL_OES_texture_cube_map_array 273uniform samplerCubeArray CA4; 274uniform samplerCubeArrayShadow CA5; 275uniform isamplerCubeArray CA6; 276uniform usamplerCubeArray CA7; 277#endif 278 279void CAT() 280{ 281highp ivec3 s4 = textureSize(CA4, 1 ); 282highp ivec3 s5 = textureSize(CA5, 1 ); 283highp ivec3 s6 = textureSize(CA6, 1 ); 284highp ivec3 s7 = textureSize(CA7, 1 ); 285286 highp vec4 t4 = texture(CA4, vec4( 0.5 )); 287highp float t5 = texture(CA5, vec4( 0.5 ), 3.0 ); 288highp ivec4 t6 = texture(CA6, vec4( 0.5 )); 289highp uvec4 t7 = texture(CA7, vec4( 0.5 )); 290 291highp vec4 L4 = textureLod(CA4, vec4( 0.5 ), 0.24 ); 292highp ivec4 L6 = textureLod(CA6, vec4( 0.5 ), 0.26 ); 293highp uvec4 L7 = textureLod(CA7, vec4( 0.5 ), 0.27 ); 294 295highp vec4 g4 = textureGrad(CA4, vec4( 0.5 ), vec3( 0.1 ), vec3( 0.2 )); 296highp ivec4 g6 = textureGrad(CA6, vec4( 0.5 ), vec3( 0.1 ), vec3( 0.2 )); 297highp uvec4 g7 = textureGrad(CA7, vec4( 0.5 ), vec3( 0.1 ), vec3( 0.2 )); 298 299highp vec4 gath4 = textureGather(CA4, vec4( 0.5 )); 300highp vec4 gathC4 = textureGather(CA4, vec4( 0.5 ), 2 ); 301highp ivec4 gath6 = textureGather(CA6, vec4( 0.5 )); 302highp ivec4 gathC6 = textureGather(CA6, vec4( 0.5 ), 1 ); 303highp uvec4 gath7 = textureGather(CA7, vec4( 0.5 )); 304highp uvec4 gathC7 = textureGather(CA7, vec4( 0.5 ), 0 ); 305 306highp vec4 gath5 = textureGather(CA5, vec4( 0.5 ), 2.5 ); 307 308highp ivec3 s1 = imageSize(CA1); 309highp ivec3 s2 = imageSize(CA2); 310highp ivec3 s3 = imageSize(CA3); 311 312imageStore(CA1, s3, vec4( 1 )); 313imageStore(CA2, s3, ivec4( 1 )); 314imageStore(CA3, s3, uvec4( 1 )); 315 316highp vec4 cl1 = imageLoad(rCA1, s3); 317highp ivec4 cl2 = imageLoad(rCA2, s3); 318highp uvec4 cl3 = imageLoad(rCA3, s3); 319} 320 321uniform sampler2DMSArray bad2DMS; // ERROR, reserved 322uniform isampler2DMSArray bad2DMSi; // ERROR, reserved 323uniform usampler2DMSArray bad2DMSu; // ERROR, reserved 324 325#extension GL_OES_texture_storage_multisample_2d_array : enable 326 327#ifdef GL_OES_texture_storage_multisample_2d_array 328 329uniform sampler2DMSArray noPrec2DMS; // ERROR, no default 330uniform isampler2DMSArray noPrec2DMSi; // ERROR, no default 331uniform usampler2DMSArray noPrec2DMSu; // ERROR, no default 332 333#endif 334 335precision highp sampler2DMSArray ; 336precision highp isampler2DMSArray ; 337precision highp usampler2DMSArray ; 338 339uniform sampler2DMSArray samp2DMSA; 340uniform isampler2DMSArray samp2DMSAi; 341uniform usampler2DMSArray samp2DMSAu; 342 343void MSA() 344{ 345vec4 tf = texelFetch(samp2DMSA, ivec3( 5 ), 2 ); 346ivec4 tfi = texelFetch(samp2DMSAi, ivec3( 5 ), 2 ); 347uvec4 tfu = texelFetch(samp2DMSAu, ivec3( 5 ), 2 ); 348349 ivec3 tfs = textureSize(samp2DMSA); 350ivec3 tfsi = textureSize(samp2DMSAi); 351ivec3 tfsb = textureSize(samp2DMSAi, 4 ); // ERROR, no lod 352ivec3 tfsu = textureSize(samp2DMSAu); 353} 354 355#ifdef GL_OES_shader_image_atomic 356#extension GL_OES_shader_image_atomic : enable 357#endif 358 359uniform layout (r32f) highp image2D im2Df; 360uniform layout (r32ui) highp uimage2D im2Du; 361uniform layout (r32i) highp iimage2D im2Di; 362uniform ivec2 P; 363 364void goodImageAtom() 365{ 366float datf; 367int dati; 368uint datu; 369 370imageAtomicAdd( im2Di, P, dati); 371imageAtomicAdd( im2Du, P, datu); 372imageAtomicMin( im2Di, P, dati); 373imageAtomicMin( im2Du, P, datu); 374imageAtomicMax( im2Di, P, dati); 375imageAtomicMax( im2Du, P, datu); 376imageAtomicAnd( im2Di, P, dati); 377imageAtomicAnd( im2Du, P, datu); 378imageAtomicOr( im2Di, P, dati); 379imageAtomicOr( im2Du, P, datu); 380imageAtomicXor( im2Di, P, dati); 381imageAtomicXor( im2Du, P, datu); 382imageAtomicExchange(im2Di, P, dati); 383imageAtomicExchange(im2Du, P, datu); 384imageAtomicExchange(im2Df, P, datf); 385imageAtomicCompSwap(im2Di, P, 3 , dati); 386imageAtomicCompSwap(im2Du, P, 5u , datu); 387} 388 389sample out vec4 colorSampInBad; // ERROR, reserved 390 391#extension GL_OES_shader_multisample_interpolation : enable 392 393sample out vec4 colorSample; 394flat sample out vec4 colorfsi; 395sample out vec3 sampInArray[ 4 ]; 396in vec4 inv4; 397 398void badInterp() 399{ 400interpolateAtCentroid(inv4); // ERROR, wrong stage 401interpolateAtSample(inv4, 1 ); // ERROR, need extension 402interpolateAtOffset(inv4, vec2( 0.2 )); // ERROR, need extension 403}