yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
53863a3a
main
1#version 320 es 2 3out outbname { 4int a ; 5out vec4 v ; 6highp sampler2D s ;// ERROR, opaque type 7}outbinst ; 8 9out outbname2 { 10layout (location = 12 )int aAnon ; 11layout (location = 13 )vec4 vAnon ; 12}; 13 14layout (location = 12 )out highp int aliased ;// ERROR, aliasing location 15 16in inbname {int a ; }inbinst ;// ERROR, no in block in vertex shader 17 18out gl_PerVertex {// ERROR, has extra member 19highp vec4 gl_Position ; 20highp vec4 t ; 21}; 22 23void main () 24{ 25int sum = gl_VertexID + 26gl_InstanceID ; 27gl_Position = vec4 (1.0 ); 28gl_PointSize = 2.0 ;// ERROR, removed by redeclaration 29} 30 31out gl_PerVertex {// ERROR, already used and already redeclared 32highp vec4 gl_Position ; 33highp vec4 t ; 34}; 35 36smooth out smo {// ERROR, no smooth on a block 37int i ; 38}smon ; 39 40flat out fmo {// ERROR, no flat on a block 41int i ; 42}fmon ; 43 44centroid out cmo {// ERROR, no centroid on a block 45int i ; 46}cmon ; 47 48invariant out imo {// ERROR, no invariant on a block 49int i ; 50}imon ; 51 52in vec2 inf ,ing ; 53uniform ivec2 offsets [4 ]; 54uniform sampler2D sArray [4 ]; 55uniform int sIndex ; 56layout (binding = 0 )uniform atomic_uint auArray [2 ]; 57uniform ubName {int i ; }ubInst [4 ]; 58buffer bbName {int i ; }bbInst [4 ]; 59highp uniform writeonly image2D iArray [5 ]; 60const ivec2 constOffsets [4 ]= ivec2 [4 ](ivec2 (0.1 ),ivec2 (0.2 ),ivec2 (0.3 ),ivec2 (0.4 )); 61 62void pfoo () 63{ 64precise vec2 h ; 65h = fma (inf ,ing ,h ); 66sArray [sIndex + 1 ]; 67ubInst [sIndex + 1 ]; 68bbInst [sIndex - 2 ];// ERROR, still not supported 69iArray [2 ]; 70iArray [sIndex - 2 ]; 71textureGatherOffset (sArray [0 ],vec2 (0.1 ),ivec2 (inf )); 72textureGatherOffsets (sArray [0 ],vec2 (0.1 ),constOffsets ); 73textureGatherOffsets (sArray [0 ],vec2 (0.1 ),offsets );// ERROR, offset not constant 74} 75 76uniform samplerBuffer noPreSamp1 ;// ERROR, no default precision 77uniform isamplerBuffer noPreSamp2 ;// ERROR, no default precision 78uniform usamplerBuffer noPreSamp3 ;// ERROR, no default precision 79uniform writeonly imageBuffer noPreSamp4 ;// ERROR, no default precision 80uniform writeonly iimageBuffer noPreSamp5 ;// ERROR, no default precision 81uniform writeonly uimageBuffer noPreSamp6 ;// ERROR, no default precision 82 83precision highp samplerBuffer ; 84precision highp isamplerBuffer ; 85precision highp usamplerBuffer ; 86precision highp imageBuffer ; 87precision highp iimageBuffer ; 88precision highp uimageBuffer ; 89 90#ifdef GL_OES_texture_buffer 91uniform samplerBuffer bufSamp1; 92uniform isamplerBuffer bufSamp2; 93uniform usamplerBuffer bufSamp3; 94#endif 95#ifdef GL_EXT_texture_buffer 96uniform writeonly imageBuffer bufSamp4; 97uniform writeonly iimageBuffer bufSamp5; 98uniform writeonly uimageBuffer bufSamp6; 99#endif 100 101void bufferT() 102{ 103highp int s1 = textureSize(bufSamp1); 104highp int s2 = textureSize(bufSamp2); 105highp int s3 = textureSize(bufSamp3); 106 107highp int s4 = imageSize(bufSamp4); 108highp int s5 = imageSize(bufSamp5); 109highp int s6 = imageSize(bufSamp6); 110111 highp vec4 f1 = texelFetch(bufSamp1, s1); 112highp ivec4 f2 = texelFetch(bufSamp2, s2); 113highp uvec4 f3 = texelFetch(bufSamp3, s3); 114} 115 116uniform writeonly imageCubeArray noPreCA1; // ERROR, no default precision 117uniform writeonly iimageCubeArray noPreCA2; // ERROR, no default precision 118uniform writeonly uimageCubeArray noPreCA3; // ERROR, no default precision 119 120uniform samplerCubeArray noPreCA4; // ERROR, no default precision 121uniform samplerCubeArrayShadow noPreCA5; // ERROR, no default precision 122uniform isamplerCubeArray noPreCA6; // ERROR, no default precision 123uniform usamplerCubeArray noPreCA7; // ERROR, no default precision 124 125precision highp imageCubeArray ; 126precision highp iimageCubeArray ; 127precision highp uimageCubeArray ; 128 129precision highp samplerCubeArray ; 130precision highp samplerCubeArrayShadow ; 131precision highp isamplerCubeArray ; 132precision highp usamplerCubeArray ; 133 134uniform writeonly imageCubeArray CA1; 135uniform writeonly iimageCubeArray CA2; 136uniform writeonly uimageCubeArray CA3; 137 138layout (rgba16f) uniform readonly imageCubeArray rCA1; 139layout (rgba32i) uniform readonly iimageCubeArray rCA2; 140layout (r32ui) uniform readonly uimageCubeArray rCA3; 141 142#ifdef GL_OES_texture_cube_map_array 143uniform samplerCubeArray CA4; 144uniform samplerCubeArrayShadow CA5; 145uniform isamplerCubeArray CA6; 146uniform usamplerCubeArray CA7; 147#endif 148 149void CAT() 150{ 151highp ivec3 s4 = textureSize(CA4, 1 ); 152highp ivec3 s5 = textureSize(CA5, 1 ); 153highp ivec3 s6 = textureSize(CA6, 1 ); 154highp ivec3 s7 = textureSize(CA7, 1 ); 155156 highp vec4 t4 = texture(CA4, vec4( 0.5 )); 157highp float t5 = texture(CA5, vec4( 0.5 ), 3.0 ); 158highp ivec4 t6 = texture(CA6, vec4( 0.5 )); 159highp uvec4 t7 = texture(CA7, vec4( 0.5 )); 160 161highp vec4 L4 = textureLod(CA4, vec4( 0.5 ), 0.24 ); 162highp ivec4 L6 = textureLod(CA6, vec4( 0.5 ), 0.26 ); 163highp uvec4 L7 = textureLod(CA7, vec4( 0.5 ), 0.27 ); 164 165highp vec4 g4 = textureGrad(CA4, vec4( 0.5 ), vec3( 0.1 ), vec3( 0.2 )); 166highp ivec4 g6 = textureGrad(CA6, vec4( 0.5 ), vec3( 0.1 ), vec3( 0.2 )); 167highp uvec4 g7 = textureGrad(CA7, vec4( 0.5 ), vec3( 0.1 ), vec3( 0.2 )); 168 169highp vec4 gath4 = textureGather(CA4, vec4( 0.5 )); 170highp vec4 gathC4 = textureGather(CA4, vec4( 0.5 ), 2 ); 171highp ivec4 gath6 = textureGather(CA6, vec4( 0.5 )); 172highp ivec4 gathC6 = textureGather(CA6, vec4( 0.5 ), 1 ); 173highp uvec4 gath7 = textureGather(CA7, vec4( 0.5 )); 174highp uvec4 gathC7 = textureGather(CA7, vec4( 0.5 ), 0 ); 175 176highp vec4 gath5 = textureGather(CA5, vec4( 0.5 ), 2.5 ); 177 178highp ivec3 s1 = imageSize(CA1); 179highp ivec3 s2 = imageSize(CA2); 180highp ivec3 s3 = imageSize(CA3); 181 182imageStore(CA1, s3, vec4( 1 )); 183imageStore(CA2, s3, ivec4( 1 )); 184imageStore(CA3, s3, uvec4( 1 )); 185 186highp vec4 cl1 = imageLoad(rCA1, s3); 187highp ivec4 cl2 = imageLoad(rCA2, s3); 188highp uvec4 cl3 = imageLoad(rCA3, s3); 189} 190 191uniform sampler2DMSArray noPrec2DMS; // ERROR, no default 192uniform isampler2DMSArray noPrec2DMSi; // ERROR, no default 193uniform usampler2DMSArray noPrec2DMSu; // ERROR, no default 194 195precision highp sampler2DMSArray ; 196precision highp isampler2DMSArray ; 197precision highp usampler2DMSArray ; 198 199uniform sampler2DMSArray samp2DMSA; 200uniform isampler2DMSArray samp2DMSAi; 201uniform usampler2DMSArray samp2DMSAu; 202 203void MSA() 204{ 205vec4 tf = texelFetch(samp2DMSA, ivec3( 5 ), 2 ); 206ivec4 tfi = texelFetch(samp2DMSAi, ivec3( 5 ), 2 ); 207uvec4 tfu = texelFetch(samp2DMSAu, ivec3( 5 ), 2 ); 208209 ivec3 tfs = textureSize(samp2DMSA); 210ivec3 tfsi = textureSize(samp2DMSAi); 211ivec3 tfsb = textureSize(samp2DMSAi, 4 ); // ERROR, no lod 212ivec3 tfsu = textureSize(samp2DMSAu); 213} 214 215uniform layout (r32f) highp image2D im2Df; 216uniform layout (r32ui) highp uimage2D im2Du; 217uniform layout (r32i) highp iimage2D im2Di; 218uniform ivec2 P; 219 220void goodImageAtom() 221{ 222float datf; 223int dati; 224uint datu; 225 226imageAtomicAdd( im2Di, P, dati); 227imageAtomicAdd( im2Du, P, datu); 228imageAtomicMin( im2Di, P, dati); 229imageAtomicMin( im2Du, P, datu); 230imageAtomicMax( im2Di, P, dati); 231imageAtomicMax( im2Du, P, datu); 232imageAtomicAnd( im2Di, P, dati); 233imageAtomicAnd( im2Du, P, datu); 234imageAtomicOr( im2Di, P, dati); 235imageAtomicOr( im2Du, P, datu); 236imageAtomicXor( im2Di, P, dati); 237imageAtomicXor( im2Du, P, datu); 238imageAtomicExchange(im2Di, P, dati); 239imageAtomicExchange(im2Du, P, datu); 240imageAtomicExchange(im2Df, P, datf); 241imageAtomicCompSwap(im2Di, P, 3 , dati); 242imageAtomicCompSwap(im2Du, P, 5u , datu); 243} 244 245sample out vec4 colorSample; 246flat sample out vec4 colorfsi; 247sample out vec3 sampInArray[ 4 ]; 248in vec4 inv4; 249 250void badInterp() 251{ 252interpolateAtCentroid(inv4); // ERROR, wrong stage 253interpolateAtSample(inv4, 1 ); // ERROR, need extension 254interpolateAtOffset(inv4, vec2( 0.2 )); // ERROR, need extension 255}