yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
0b3e8560
main
1#version 460 2 3layout (location = 0 )in vec4 a0 ;// accessed 4layout (location = 1 )in vec4 a1 ;// accessed 5layout (location = 2 )in vec4 a2 ;// accessed 6layout (location = 3 )in vec4 a3 ;// accessed 7layout (location = 4 )in vec4 a4 ;// accessed 8layout (location = 5 )in vec4 a5 ;// accessed 9layout (location = 6 )in vec4 a6 ;// accessed 10layout (location = 7 )in vec4 a7 ;// accessed 11layout (location = 8 )in vec4 a8 ;// accessed 12layout (location = 9 )in vec4 a9 ;// accessed 13layout (location = 10 )in vec4 a10 ;// accessed 14layout (location = 11 )in vec4 n0 ;// not accessed 15layout (location = 12 )in vec4 n1 ;// not accessed 16layout (location = 13 )in vec4 n2 ;// not accessed 17layout (location = 14 )in vec4 n3 ;// not accessed 18layout (location = 15 )in vec4 n4 ;// not accessed 19layout (location = 16 )in vec4 n5 ;// not accessed 20layout (location = 17 )in vec4 n6 ;// not accessed 21layout (location = 18 )in vec4 n7 ;// not accessed 22layout (location = 19 )in vec4 n8 ;// not accessed 23layout (location = 20 )in vec4 n9 ;// not accessed 24 25void main () { 26// empty case is live 27switch (2 ) { 28case 2 :break ; 29case 1 : 30gl_Position = n0 ; 31 } 32 33// empty default case is live 34switch (3 ) { 35default :break ; 36case 1 : 37gl_Position = n1 ; 38 } 39 40// no live case 41switch (3 ) { 42case 2 :// fallthrough 43case 1 : 44gl_Position = n2 ; 45 } 46 47// ensure break is handled correctly 48switch (1 ) { 49case -1 : 50gl_Position = n3 ; 51break ; 52case 1 : 53gl_Position = a0 ; 54break ; 55gl_Position = n4 ; 56case 0 : 57gl_Position = n5 ; 58 } 59 60const int cx = 1 ; 61 62// signed/unsigned mismatch 63switch (cx ) { 64case uint (1 ): 65gl_Position = a1 ; 66 } 67 68// signed/unsigned conversion 69switch (-1 ) { 70case ~uint (0 ): 71gl_Position = a2 ; 72 } 73 74// const variable case 75switch (1 ) { 76case cx : 77gl_Position = a3 ; 78break ; 79case -1 : 80gl_Position = n6 ; 81 } 82 83// fallthrough with const variable 84switch (cx ) { 85default :// fallthrough 86case 2 : 87gl_Position = a4 ; 88 } 89 90// non-trivial constant expression 91switch (((cx + 1 )* 2 )- 3 ) { 92case 1 : 93gl_Position = a5 ; 94break ; 95case 2 : 96gl_Position = n7 ; 97 } 98 99// expression as case 100switch (5 + 3 ) { 101case 6 + 2 : 102gl_Position = a6 ; 103break ; 104case 5 + 2 : 105gl_Position = n8 ; 106break ; 107 } 108 109int x = 2 ; 110 111// liveness of non-const variables cannot be deduced 112switch (x ) { 113case 1 : 114gl_Position = a7 ; 115break ; 116case 2 : 117gl_Position = a8 ; 118break ; 119 } 120 121// const and non-const expression 122switch (cx + x ) { 123case 1 : 124gl_Position = a9 ; 125break ; 126case 3 : 127gl_Position = a10 ; 128break ; 129 } 130}