yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
2e24222c
main
1#version 330 compatibility 2 3in vec4 inVar ; 4layout (location = 0 ,index = 0 )out vec4 outVar ; 5 6varying vec4 varyingVar ; 7 8void main () 9{ 10gl_FragColor = varyingVar ;// link ERROR: user output was used 11gl_FragData [1 ]= inVar ;// link ERROR: user output was used 12int buffer = 4 ; 13} 14 15#extension GL_ARB_separate_shader_objects : enable 16 17in gl_PerFragment { 18vec4 gl_Color ; 19}; 20 21void foo () 22{ 23vec4 c = gl_Color ; 24outVar = inVar ; 25} 26 27in gl_block {// ERROR 28int gl_i ; 29}gl_name ; 30 31in myBlock { 32int gl_i ;// ERROR 33}gl_name ;// ERROR 34 35in gl_PerVertex {// ERROR 36vec4 gl_FragCoord ; 37}gl_in []; 38 39in gl_PerVertex {// ERROR 40vec4 gl_FragCoord ; 41};// ERROR 42 43const int start = 6 ; 44layout (location = -2 )in vec4 v1 ;// ERROR 45layout (location = start + 2 )in vec4 v2 ;// ERROR 46layout (location = 4.7e10 )in vec4 v20 ;// ERROR 47layout (location = +60 )in float v21 ;// ERROR 48layout (location = (2 ))in float v22 ;// ERROR 49 50struct S { 51float f1 ; 52layout (location = 3 )float f2 ;// ERROR 53}; 54 55layout (location = 1 )in inblock {// ERROR 56float f1 ; 57layout (location = 3 )float f2 ;// ERROR 58}; 59 60layout (location = 1 )uniform ublock {// ERROR 61float f1 ; 62layout (location = 3 )float f2 ;// ERROR 63}uinst ; 64 65#extension GL_ARB_enhanced_layouts : enable 66 67layout (location = start )in vec4 v3 ; 68layout (location = -2 )in vec4 v4 ;// ERROR 69layout (location = - start )in vec4 v5 ;// ERROR 70layout (location = start * start - 2 - 4 )in vec4 v6 ; 71layout (location = +61 )in float v23 ; 72layout (location = (62 ))in float v24 ; 73 74struct S2 { 75float f1 ; 76layout (location = 3 )float f2 ;// ERROR 77}; 78 79layout (location = 28 )in inblock2 { 80bool b1 ;// ERROR 81float f1 ; 82layout (location = 25 )float f2 ; 83vec4 f3 ; 84layout (location = 21 )S2 s2 ; 85vec4 f4 ; 86vec4 f5 ; 87}ininst2 ; 88 89layout (location = 13 )uniform ublock2 {// ERROR 90float f1 ; 91layout (location = 3 )float f2 ;// ERROR 92}uinst2 ; 93 94in inblock3 {// ERROR, mix of location internal with no location external 95float f1 ; 96layout (location = 40 )float f2 ; 97}in3 ; 98 99in ublock4 { 100layout (location = 50 )float f1 ; 101layout (location = 51 )float f2 ; 102}in4 ; 103 104layout (location = 33 )in struct SS { 105vec3 a ;// gets location 33 106mat2 b ;// gets locations 34 and 35 107vec4 c [2 ];// gets locations 36 and 37 108layout (location = 38 )vec2 A ;// ERROR, can't use on struct member 109}s ; 110 111layout (location = 44 )in block { 112vec4 d ;// gets location 44 113vec4 e ;// gets location 45 114layout (location = 47 )vec4 f ;// gets location 47 115vec4 g ;// gets location 48 116layout (location = 41 )vec4 h ;// gets location 41 117vec4 i ;// gets location 42 118vec4 j ;// gets location 43 119vec4 k ;// ERROR, location 44 already used 120}; 121 122layout (index = 0 )out vec4 outVar2 ;// ERROR: missing explicit location 123layout (location = 0 ,index = 1 )out vec4 outVar3 ;// no error even though location is overlapping 124layout (location = 0 ,index = 1 )out vec4 outVar4 ;// ERROR overlapping 125layout (location = 27 ,index = 0 )in vec4 indexIn ;// ERROR, not on in 126layout (location = 0 ,index = 0 )in ;// ERROR, not just on in 127layout (location = 0 ,index = 0 )out ;// ERROR, need a variable 128layout (location = 26 ,index = 0 )out indexBlock {int a ; }indexBlockI ;// ERROR, not on a block 129 130int precise ;// okay, not a keyword yet 131struct SKeyMem {int precise ; }KeyMem ;// okay, not a keyword yet 132 133void fooKeyMem () 134{ 135KeyMem .precise ; 136} 137 138layout (location = 28 ,index = 2 )out vec4 outIndex2 ;// ERROR index out of range 139 140layout (location = 4 )uniform vec4 ucolor0 ;// ERROR: extension is not enabled 141 142#extension GL_ARB_explicit_uniform_location : enable 143 144layout (location = 5 )uniform vec4 ucolor1 ; 145 146layout (location = 6 )uniform ColorsBuffer // ERROR: location cannot be applied in uniform buffer block 147{ 148vec4 colors [128 ]; 149}colorsBuffer ; 150 151 152void testOverload () { 153float overloadTest = 42 ; 154overloadTest = smoothstep (0 ,1 ,overloadTest ); 155}