yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
69d0c1ac
16.3.0
1#version 450 2 3struct S1 { 4float a ; 5int b ; 6} ; 7 8layout ( location = 0 ) flat in S1 in1 ; 9layout ( location = 2 ) flat in S1 in2 ; 10layout ( location = 4 ) flat in int cond ; 11 12layout ( location = 0 ) out float outv ; 13 14void fun1 (){} 15void fun2 (){} 16 17void main () 18{ 19// glslang will only make OpSelect for very trivial looking expressions 20 21float f1 = 1.0 ; 22float f2 = 2.0 ; 23outv = cond < 8 ? f1 : f2 ; // in all versions 24 25ivec4 iv1 = ivec4 ( f1 ) ; 26ivec4 iv2 = ivec4 ( f2 ) ; 27outv *= ( cond > 0 ? iv1 : iv2 ) . z ; // in all versions, but in 1.4 as scalar condition, not smeared ala mix() 28 29mat3 m1 = mat3 ( 1.0 ) ; 30mat3 m2 = mat3 ( 2.0 ) ; 31outv *= ( cond < 20 ? m1 : m2 )[ 2 ][ 1 ] ; // in 1.4, but not before 32 33S1 fv = cond > 5 ? in1 : in2 ; // in 1.4, but not before 34outv *= fv . a ; 35 36cond > 0 ? fun1 () : fun2 () ; // not allowed by any version 37}