yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
53863a3a
main
1#version 320 es 2 3out outbname {int a ; }outbinst ;// ERROR, not out block in fragment shader 4 5in inbname { 6int a ; 7vec4 v ; 8struct {int b ; }s ;// ERROR, nested struct definition 9}inbinst ; 10 11in inbname2 { 12layout (location = 12 )int aAnon ; 13layout (location = 13 )centroid in vec4 vAnon ; 14}; 15 16in layout (location = 13 )vec4 aliased ;// ERROR, aliased 17 18in inbname2 {// ERROR, reuse of block name 19int aAnon ; 20centroid in vec4 vAnon ; 21}; 22 23in badmember {// ERROR, aAnon already in global scope 24int aAnon ; 25}; 26 27int inbname ;// ERROR, redefinition of block name 28 29vec4 vAnon ;// ERROR, anon in global scope; redefinition 30 31in arrayed { 32float f ; 33}arrayedInst [4 ]; 34uniform int i ; 35void fooIO () 36{ 37vec4 v = inbinst .v + vAnon ; 38v *=arrayedInst [2 ].f ; 39v *=arrayedInst [i ].f ; 40} 41 42in vec4 gl_FragCoord ; 43layout (origin_upper_left ,pixel_center_integer )in vec4 gl_FragCoord ;// ERROR, non-ES 44 45layout (early_fragment_tests )in ; 46out float gl_FragDepth ; 47layout (depth_any )out float gl_FragDepth ;// ERROR, non-ES 48 49void main () 50{ 51gl_FragDepth = 0.2 ;// ERROR, early_fragment_tests declared 52bool f = gl_FrontFacing ; 53} 54 55out float gl_FragDepth ; 56 57void foo_GS () 58{ 59highp int l = gl_Layer ; 60highp int p = gl_PrimitiveID ; 61} 62 63in vec2 inf ,ing ; 64uniform ivec2 offsets [4 ]; 65uniform sampler2D sArray [4 ]; 66uniform int sIndex ; 67layout (binding = 0 )uniform atomic_uint auArray [2 ]; 68uniform ubName {int i ; }ubInst [4 ]; 69buffer bbName {int i ; }bbInst [4 ]; 70highp uniform writeonly image2D iArray [5 ]; 71const ivec2 constOffsets [4 ]= ivec2 [4 ](ivec2 (0.1 ),ivec2 (0.2 ),ivec2 (0.3 ),ivec2 (0.4 )); 72 73void pfoo () 74{ 75precise vec2 h ; 76h = fma (inf ,ing ,h ); 77textureGatherOffset (sArray [0 ],vec2 (0.1 ),ivec2 (inf )); 78textureGatherOffsets (sArray [0 ],vec2 (0.1 ),constOffsets ); 79textureGatherOffsets (sArray [0 ],vec2 (0.1 ),offsets );// ERROR, offset not constant 80} 81 82precision highp imageCubeArray ; 83precision highp iimageCubeArray ; 84precision highp uimageCubeArray ; 85 86precision highp samplerCubeArray ; 87precision highp samplerCubeArrayShadow ; 88precision highp isamplerCubeArray ; 89precision highp usamplerCubeArray ; 90 91uniform writeonly imageCubeArray CA1; 92uniform writeonly iimageCubeArray CA2; 93uniform writeonly uimageCubeArray CA3; 94 95#ifdef GL_EXT_texture_cube_map_array 96uniform samplerCubeArray CA4; 97uniform samplerCubeArrayShadow CA5; 98uniform isamplerCubeArray CA6; 99uniform usamplerCubeArray CA7; 100#endif 101 102void CAT() 103{ 104highp vec4 b4 = texture(CA4, vec4( 0.5 ), 0.24 ); 105highp ivec4 b6 = texture(CA6, vec4( 0.5 ), 0.26 ); 106highp uvec4 b7 = texture(CA7, vec4( 0.5 ), 0.27 ); 107} 108 109void goodSample() 110{ 111lowp int a1 = gl_SampleID; 112mediump vec2 a2 = gl_SamplePosition; 113highp int a3 = gl_SampleMaskIn[ 0 ]; 114gl_SampleMask[ 0 ] = a3; 115mediump int n1 = gl_MaxSamples; 116mediump int n2 = gl_NumSamples; 117} 118 119uniform layout (r32f) highp image2D im2Df; 120uniform layout (r32ui) highp uimage2D im2Du; 121uniform layout (r32i) highp iimage2D im2Di; 122uniform ivec2 P; 123 124uniform layout (rgba32f) highp image2D badIm2Df; // ERROR, needs readonly or writeonly 125uniform layout (rgba8ui) highp uimage2D badIm2Du; // ERROR, needs readonly or writeonly 126uniform layout (rgba16i) highp iimage2D badIm2Di; // ERROR, needs readonly or writeonly 127 128void goodImageAtom() 129{ 130float datf; 131int dati; 132uint datu; 133 134imageAtomicAdd( im2Di, P, dati); 135imageAtomicAdd( im2Du, P, datu); 136imageAtomicMin( im2Di, P, dati); 137imageAtomicMin( im2Du, P, datu); 138imageAtomicMax( im2Di, P, dati); 139imageAtomicMax( im2Du, P, datu); 140imageAtomicAnd( im2Di, P, dati); 141imageAtomicAnd( im2Du, P, datu); 142imageAtomicOr( im2Di, P, dati); 143imageAtomicOr( im2Du, P, datu); 144imageAtomicXor( im2Di, P, dati); 145imageAtomicXor( im2Du, P, datu); 146imageAtomicExchange(im2Di, P, dati); 147imageAtomicExchange(im2Du, P, datu); 148imageAtomicExchange(im2Df, P, datf); 149imageAtomicCompSwap(im2Di, P, 3 , dati); 150imageAtomicCompSwap(im2Du, P, 5u , datu); 151 152imageAtomicMax(badIm2Di, P, dati); // ERROR, not an allowed layout() on the image 153imageAtomicMax(badIm2Du, P, datu); // ERROR, not an allowed layout() on the image 154imageAtomicExchange(badIm2Df, P, datf); // ERROR, not an allowed layout() on the image 155} 156 157centroid out vec4 colorCentroidBad; // ERROR 158flat out vec4 colorBadFlat; // ERROR 159smooth out vec4 colorBadSmooth; // ERROR 160noperspective out vec4 colorBadNo; // ERROR 161flat centroid in vec2 colorfc; 162in float scalarIn; 163 164sample in vec4 colorSampIn; 165sample out vec4 colorSampleBad; // ERROR 166flat sample in vec4 colorfsi; 167sample in vec3 sampInArray[ 4 ]; 168 169void interp() 170{ 171float res; 172vec2 res2; 173vec3 res3; 174vec4 res4; 175 176res2 = interpolateAtCentroid(colorfc); 177res4 = interpolateAtCentroid(colorSampIn); 178res4 = interpolateAtCentroid(colorfsi); 179res = interpolateAtCentroid(scalarIn); 180res3 = interpolateAtCentroid(sampInArray); // ERROR 181res3 = interpolateAtCentroid(sampInArray[ 2 ]); 182res2 = interpolateAtCentroid(sampInArray[ 2 ]. xy ); // ERROR 183 184res3 = interpolateAtSample(sampInArray, 1 ); // ERROR 185res3 = interpolateAtSample(sampInArray[i], 0 ); 186res2 = interpolateAtSample(sampInArray[ 2 ]. xy , 2 ); // ERROR 187res = interpolateAtSample(scalarIn, 1 ); 188 189res3 = interpolateAtOffset(sampInArray, vec2( 0.2 )); // ERROR 190res3 = interpolateAtOffset(sampInArray[ 2 ], vec2( 0.2 )); 191res2 = interpolateAtOffset(sampInArray[ 2 ]. xy , vec2( 0.2 )); // ERROR, no swizzle 192res = interpolateAtOffset(scalarIn + scalarIn, vec2( 0.2 )); // ERROR, no binary ops other than dereference 193res = interpolateAtOffset(scalarIn, vec2( 0.2 )); 194 195float f; 196res = interpolateAtCentroid(f); // ERROR, not interpolant 197res4 = interpolateAtSample(outp, 0 ); // ERROR, not interpolant 198} 199 200layout (blend_support_multiply) out ; 201layout (blend_support_screen) out ; 202layout (blend_support_overlay) out ; 203layout (blend_support_darken, blend_support_lighten) out ; 204layout (blend_support_colordodge) layout (blend_support_colorburn) out ; 205layout (blend_support_hardlight) out ; 206layout (blend_support_softlight) out ; 207layout (blend_support_difference) out ; 208layout (blend_support_exclusion) out ; 209layout (blend_support_hsl_hue) out ; 210layout (blend_support_hsl_saturation) out ; 211layout (blend_support_hsl_color) out ; 212layout (blend_support_hsl_luminosity) out ; 213layout (blend_support_all_equations) out ; 214 215layout (blend_support_hsl_luminosity) out ; // okay to repeat 216 217layout (blend_support_hsl_luminosity) in ; // ERROR, only on "out" 218layout (blend_support_hsl_luminosity) out vec4 ; // ERROR, only on standalone 219layout (blend_support_hsl_luminosity) out vec4 badout; // ERROR, only on standalone 220layout (blend_support_hsl_luminosity) struct badS { int i ;}; // ERROR, only on standalone 221layout (blend_support_hsl_luminosity) void blendFoo() { } // ERROR, only on standalone 222void blendFoo( layout (blend_support_hsl_luminosity) vec3 v) { } // ERROR, only on standalone 223layout (blend_support_flizbit) out ; // ERROR, no flizbit 224 225out vec4 outAA[ 2 ][ 2 ]; // ERROR