yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
08d61df0
vulkan-sdk-1.4.350.0
1#version 310 es 2 3layout ( local_size_x = 2 ) in ; 4layout ( local_size_x = 16 ) in ; // ERROR, changing 5layout ( local_size_z = 4096 ) in ; // ERROR, too large 6layout ( local_size_x = 2 ) in ; 7layout ( local_size_y = 0 ) in ; // ERROR, 0 not allowed 8const int total = gl_MaxComputeWorkGroupCount . y 9+ gl_MaxComputeUniformComponents 10+ gl_MaxComputeTextureImageUnits 11+ gl_MaxComputeImageUniforms 12+ gl_MaxComputeAtomicCounters 13+ gl_MaxComputeAtomicCounterBuffers ; 14 15buffer ShaderStorageBlock 16{ 17int value ; 18float values [] ; 19} ; 20 21buffer InvalidShaderStorageBlock 22{ 23float values [] ; // ERROR 24int value ; 25} invalid ; 26 27void main () 28{ 29barrier () ; 30memoryBarrier () ; 31memoryBarrierAtomicCounter () ; 32memoryBarrierBuffer () ; 33memoryBarrierShared () ; 34memoryBarrierImage () ; 35groupMemoryBarrier () ; 36value = int ( values [ gl_LocalInvocationIndex ]) ; 37} 38 39layout ( location = 2 ) in vec3 v3 ; // ERROR 40in float f ; // ERROR 41out float fo ; // ERROR 42 43shared vec4 s ; 44layout ( location = 2 ) shared vec4 sl ; // ERROR 45shared float fs = 4.2 ; // ERROR 46 47layout ( local_size_x = 2 , local_size_y = 3 , local_size_z = 4 ) out ; // ERROR 48 49int arrX [ gl_WorkGroupSize . x ] ; 50int arrY [ gl_WorkGroupSize . y ] ; 51int arrZ [ gl_WorkGroupSize . z ] ; 52 53readonly buffer roblock 54{ 55int value ; 56float values [] ; 57} ro ; 58 59void foo () 60{ 61ro . values [ 2 ] = 4.7 ; // ERROR, readonly 62ro . values . length () ; 63++ s ; 64} 65 66buffer vec4 v ; // ERROR 67 68uniform usampler2D us2dbad ; // ERROR, default precision 69 70precision highp usampler2D ; 71precision highp iimage2DArray ; 72precision highp iimage2D ; 73 74uniform usampler2D us2d ; 75 76uniform iimage2DArray ii2dabad ; // ERROR, not writeonly 77uniform writeonly iimage2DArray ii2da ; 78 79layout ( r32i ) uniform iimage2D iimg2D ; 80layout ( rgba32i ) uniform readonly iimage2D iimg2Drgba ; 81layout ( rgba32f ) uniform readonly image2D img2Drgba ; // ERROR, no default 82layout ( r32ui ) uniform uimage2D uimg2D ; // ERROR, no default 83 84void qux () 85{ 86int i = 4 ; 87imageAtomicCompSwap ( iimg2D , ivec2 ( i , i ) , i , i ) ; // ERROR no longer in 310 88imageAtomicAdd ( uimg2D , ivec2 ( i , i ) , uint ( i )) ; // ERROR no longer in 310 89imageAtomicMin ( iimg2Drgba , ivec2 ( i , i ) , i ) ; // ERROR no longer in 310 // ERROR iimg2Drgba does not have r32i layout 90imageAtomicMax ( img2Drgba , ivec2 ( i , i ) , i ) ; // ERROR no longer in 310 // ERROR img2Drgba is not integer image 91ivec4 pos = imageLoad ( iimg2D , ivec2 ( i , i )) ; 92imageStore ( ii2da , ivec3 ( i , i , i ) , ivec4 ( 0 )) ; 93imageLoad ( img2Drgba , ivec2 ( i , i )) ; 94imageLoad ( ii2da , ivec3 ( i , i , i )) ; // ERROR, drops writeonly 95} 96 97volatile float vol ; // ERROR, not an image 98readonly int vol2 ; // ERROR, not an image 99 100void passr ( coherent readonly iimage2D image ) 101{ 102} 103 104layout ( r32i ) coherent readonly uniform iimage2D qualim1 ; 105layout ( r32i ) coherent restrict readonly uniform iimage2D qualim2 ; 106 107void passrc () 108{ 109passr ( qualim1 ) ; // ERROR, changing formats 110passr ( qualim2 ) ; // ERROR, drops restrict, ERROR, changing formats 111passr ( iimg2D ) ; // ERROR, changing formats 112} 113 114highp layout ( rg8i ) uniform readonly uimage2D i1bad ; // ERROR, type mismatch 115highp layout ( rgba32i ) uniform readonly image2D i2bad ; // ERROR, type mismatch 116highp layout ( rgba32f ) uniform readonly uimage2D i3bad ; // ERROR, type mismatch 117layout ( r8_snorm ) uniform readonly iimage2D i4bad ; // ERROR, type mismatch 118layout ( rgba32ui ) uniform readonly iimage2D i5bad ; // ERROR, type mismatch 119layout ( r8ui ) uniform readonly iimage2D i6bad ; // ERROR, type mismatch 120 121layout ( binding = 0 ) uniform atomic_uint counter ; 122 123uint func ( atomic_uint c ) 124{ 125return atomicCounterIncrement ( c ) ; 126} 127 128uint func2 ( out atomic_uint c ) // ERROR, output 129{ 130return counter ; // ERROR, type mismatch 131return atomicCounter ( counter ) ; 132} 133 134void mainAC () 135{ 136atomic_uint non_uniform_counter ; // ERROR 137uint val = atomicCounter ( counter ) ; 138atomicCounterDecrement ( counter ) ; 139} 140 141layout ( binding = 1 ) uniform mediump atomic_uint counterBad ; // ERROR, not highp 142 143layout ( binding = 2 , offset = 4 ) uniform atomic_uint countArr [ 4 ] ; 144uniform int i ; 145 146void opac () 147{ 148int a [ 3 ] ; 149a [ counter ] ; // ERROR, non-integer 150countArr [ 2 ] ; 151countArr [ i ] ; 152} 153 154shared int atomi ; 155shared uint atomu ; 156 157void atoms () 158{ 159int origi = atomicAdd ( atomi , 3 ) ; 160uint origu = atomicAnd ( atomu , 7u ) ; 161origi = atomicExchange ( atomi , 4 ) ; 162origu = atomicCompSwap ( atomu , 10u , 8u ) ; 163} 164 165precision highp atomic_uint ; 166precision lowp atomic_uint ; // ERROR 167 168precise int pfoo ; // ERROR, reserved 169 170dmat2x4 dm ; // ERROR 171uniform samplerCubeArray sca ; // ERROR 172uniform iimage2DRect i2dr ; // ERROR 173highp uniform image2DMS i2dms ; // ERROR 174uniform uimage2DMSArray u2dmsa ; // ERROR 175 176highp layout ( r32f ) coherent volatile restrict readonly writeonly uniform image2D okay1 ; 177layout ( r32i ) coherent volatile restrict readonly uniform iimage2D okay2 ; 178highp layout ( r32ui ) coherent volatile restrict writeonly uniform uimage2D okay3 ; 179highp layout ( r32f ) coherent volatile restrict uniform image2D okay4 ; 180 181highp layout ( rgba32f ) coherent volatile restrict uniform image2D badQ1 ; // ERROR, bad qualifiers 182layout ( rgba8i ) coherent volatile restrict uniform iimage2D badQ2 ; // ERROR, bad qualifiers 183highp layout ( rgba16ui ) coherent volatile restrict uniform uimage2D badQ3 ; // ERROR, bad qualifiers 184 185writeonly buffer woblock 186{ 187int value ; 188float values [] ; 189} wo ; 190 191void foowo () 192{ 193float g ; 194g = wo . values [ 2 ] ; // ERROR, writeonly 195float f = wo . values [ 2 ] ; // ERROR, writeonly 196++ wo . values [ 2 ] ; // ERROR, writeonly 197wo . values [ 2 ] -- ; // ERROR, writeonly 198f + wo . values [ 2 ] ; // ERROR, writeonly 199wo . values [ 2 ] - f ; // ERROR, writeonly 200bool b ; 201b ? f : wo . values [ 2 ] ; // ERROR, writeonly 202b ? wo . values [ 2 ] : f ; // ERROR, writeonly 203if ( f == wo . values [ 2 ]) // ERROR, writeonly 204++ f ; 205if ( f >= wo . values [ 2 ]) // ERROR, writeonly 206++ f ; 207f = vec3 ( wo . values [ 2 ]) . x ; // ERROR, writeonly 208~ wo . value ; // ERROR, writeonly 209wo . values [ 2 ] = 3.4 ; 210} 211 212buffer multioblock 213{ 214readonly int value ; 215writeonly float values [] ; 216} multio ; 217 218void foomultio () 219{ 220float g ; 221g = wo . values [ 2 ] ; // ERROR, writeonly 222~ wo . value ; 223wo . values [ 2 ] = 3.4 ; 224wo . value = 2 ; // ERROR, readonly 225} 226 227in inb { // ERROR 228int a ; 229} inbi ; 230 231out outb { // ERROR 232int a ; 233} outbi ; 234 235float t__ ; // ERROR, no __ until revision 310 236 237// ERROR, no __ until revision 310 238#define __D 239 240shared vec4 arr [ 2 ][ 3 ][ 4 ] ; 241 242void devi () 243{ 244gl_DeviceIndex ; // ERROR, no extension 245gl_ViewIndex ; // ERROR, never this stage 246} 247 248#ifdef GL_EXT_device_group 249#extension GL_EXT_device_group : enable 250#endif 251 252void devie () 253{ 254gl_DeviceIndex ; 255gl_ViewIndex ; // ERROR, never this stage 256}