yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
2e24222c
main
1#version 430 core 2 3layout (location = 3 )vec4 v4 ;// ERROR 4 5layout (location = 4 )uniform vec4 uv4 ; 6 7layout (location = 2 )in inb1 {vec4 v ; }b1 ;// ERROR 8layout (location = 2 )out outb1 {vec4 v ; }b2 ;// ERROR 9 10out gl_PerVertex { 11float gl_ClipDistance []; 12}; 13 14void foo () 15{ 16gl_ClipDistance [2 ]= 3.7 ; 17} 18 19struct sp { 20highp float f ; 21in float g ;// ERROR 22uniform float h ;// ERROR 23invariant float i ;// ERROR 24volatile float j ;// ERROR 25layout (row_major )mat3 m3 ;// ERROR 26}; 27 28void foo3 (invariant vec4 v4 ,// ERROR 29volatile vec3 v3 , 30layout (location = 3 )vec2 v2 ,// ERROR 31centroid vec3 cv3 )// ERROR 32{ 33} 34 35struct S { 36mat3x2 m [7 ];// needs 7*3 locations 37float f ;// needs 1 location 38};// needs 22 locations 39 40layout (location = 10 )out S cs [2 ];// 10 through 10 + 2 * 22 - 1 = 53 41layout (location = 54 )out float cf ; 42layout (location = 53 )out float cg ;// ERROR, collision at 31 43 44layout (location = 10 )in vec4 alias1 ; 45layout (location = 10 )in vec4 alias2 ;// okay for vertex input on desktop 46 47out float gl_ClipDistance [17 ];// ERROR, size too big 48 49// enhanced_layouts (most tests are in 440.*) 50 51layout (location = start * start - 2 - 4 )in vec4 v6e ;// ERROR 52 53layout (location = 28 )in inblock2e { 54layout (location = 25 )float f2 ;// ERROR 55}ininst2e ; 56 57in ublock4e { 58layout (location = 50 )float f1 ;// ERROR 59layout (location = 51 )float f2 ;// ERROR 60}in4e ; 61 62layout (align = 16 ,std140 )uniform ubl4e {int a ; }inst4e ;// ERROR 63 64layout (align = 32 )uniform ubl9e {// ERROR 65layout (offset = 12 ,align = 4 )float f ;// ERROR 66layout (offset = 20 )float g ;// ERROR 67}inst9e ; 68 69layout (std140 )uniform blocke { 70vec4 a ; 71layout (offset = 32 )vec3 b ;// ERROR 72}spinste ; 73 74int aconste [gl_MaxTransformFeedbackBuffers ];// ERROR 75int bconste [gl_MaxTransformFeedbackInterleavedComponents ];// ERROR 76 77out bblck2 { 78layout (xfb_offset = 64 )vec4 bbv ;// ERROR 79}bbinst2 ; 80 81layout (xfb_buffer = 3 ,xfb_stride = 64 )out ;// ERROR 82 83layout (xfb_buffer = 2 ,xfb_offset = 48 ,xfb_stride = 80 )out vec4 bge ;// ERROR 84layout (xfb_offset = 32 ,xfb_stride = 64 )out vec4 bhe ;// ERROR 85 86layout (xfb_stride = 80 ,xfb_buffer = 2 ,xfb_offset = 16 )out bblck4e {// ERROR 87vec4 bbv1 ; 88vec4 bbv2 ; 89}bbinst4e ; 90 91out bblck5e { 92layout (xfb_offset = 0 )vec4 bbv1 ;// ERROR 93layout (xfb_stride = 64 ,xfb_buffer = 3 ,xfb_offset = 48 )vec4 bbv2 ;// ERROR 94}bbinst5e ; 95 96#extension GL_ARB_enhanced_layouts : enable 97 98layout (align = 16 ,std140 )uniform ubl4 {int a ; }inst4 ; 99layout (std430 )uniform ; 100 101layout (align = 32 )uniform ubl9 { 102layout (offset = 12 ,align = 4 )float f ; 103layout (offset = 20 )float g ; 104}inst9 ; 105 106layout (std140 )uniform block { 107vec4 a ;// a takes offsets 0-15 108layout (offset = 32 )vec3 b ;// b takes offsets 32-43 109}spinst ; 110 111int aconst [gl_MaxTransformFeedbackBuffers ]; 112int bconst [gl_MaxTransformFeedbackInterleavedComponents ]; 113 114const int start2 = 5 ; 115layout (location = start2 * start2 - 2 - 4 )in vec4 v6 ; 116 117layout (location = 28 )in inblock2 {// ERROR, input block in vertex shader, other errors are valid checks still... 118bool b1 ;// ERROR 119float f1 ; 120layout (location = 25 )float f2 ; 121}ininst2 ; 122 123in ublock4 {// ERROR, input block in vertex shader, other errors are valid checks still... 124layout (location = 50 )float f1 ; 125layout (location = 51 )float f2 ; 126}in4 ; 127 128out bblck2g { 129layout (xfb_offset = 64 )vec4 bbv ; 130}bbinst2g ; 131 132layout (xfb_buffer = 1 ,xfb_stride = 80 )out ;// default buffer is 3 133 134layout (xfb_buffer = 1 ,xfb_offset = 48 ,xfb_stride = 80 )out vec4 bg ; 135layout (xfb_offset = 32 ,xfb_stride = 80 )out vec4 bh ; 136 137layout (xfb_stride = 80 ,xfb_buffer = 1 ,xfb_offset = 16 )out bblck4 { 138vec4 bbv1 ; 139}bbinst4 ; 140 141out bblck5 { 142layout (xfb_offset = 0 )vec4 bbv1 ; 143layout (xfb_stride = 80 ,xfb_buffer = 1 ,xfb_offset = 64 )vec4 bbv2 ; 144}bbinst5 ; 145 146shared vec4 sharedv ;// ERROR 147 148void fooBarrier () 149{ 150barrier ();// ERROR 151memoryBarrier (); 152memoryBarrierAtomicCounter (); 153memoryBarrierBuffer (); 154memoryBarrierShared ();// ERROR 155memoryBarrierImage (); 156groupMemoryBarrier ();// ERROR 157} 158 159buffer vec4 v ;// ERROR 160 161uniform sampler2DMS s2dms ; 162uniform usampler2DMSArray us2dmsa ; 163layout (rgba32i )uniform iimage2DMS ii2dms ; 164layout (rgba32f )uniform image2DMSArray i2dmsa ; 165 166void fooq () 167{ 168int s = textureSamples (s2dms );// ERROR 169s += textureSamples (us2dmsa );// ERROR 170s += imageSamples (ii2dms );// ERROR 171s += imageSamples (i2dmsa );// ERROR 172} 173 174#extension GL_ARB_shader_texture_image_samples : enable 175 176void fooq2 () 177{ 178int s = textureSamples (s2dms ); 179s += textureSamples (us2dmsa ); 180s += imageSamples (ii2dms ); 181s += imageSamples (i2dmsa ); 182} 183 184uniform sampler1D samp1D ; 185uniform usampler2D usamp2D ; 186uniform isampler3D isamp3D ; 187uniform isamplerCube isampCube ; 188uniform isampler1DArray isamp1DA ; 189uniform sampler2DArray samp2DA ; 190uniform usamplerCubeArray usampCubeA ; 191 192uniform sampler1DShadow samp1Ds ; 193uniform sampler2DShadow samp2Ds ; 194uniform samplerCubeShadow sampCubes ; 195uniform sampler1DArrayShadow samp1DAs ; 196uniform sampler2DArrayShadow samp2DAs ; 197uniform samplerCubeArrayShadow sampCubeAs ; 198 199uniform samplerBuffer sampBuf ; 200uniform sampler2DRect sampRect ; 201 202void qlod () 203{ 204int levels ; 205 206levels = textureQueryLevels (samp1D ); 207levels = textureQueryLevels (usamp2D ); 208levels = textureQueryLevels (isamp3D ); 209levels = textureQueryLevels (isampCube ); 210levels = textureQueryLevels (isamp1DA ); 211levels = textureQueryLevels (samp2DA ); 212levels = textureQueryLevels (usampCubeA ); 213 214levels = textureQueryLevels (samp1Ds ); 215levels = textureQueryLevels (samp2Ds ); 216levels = textureQueryLevels (sampCubes ); 217levels = textureQueryLevels (samp1DAs ); 218levels = textureQueryLevels (samp2DAs ); 219levels = textureQueryLevels (sampCubeAs ); 220 221levels = textureQueryLevels (sampBuf );// ERROR 222levels = textureQueryLevels (sampRect );// ERROR 223}