yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
4ae01c5f
main
1 2void Test1 () 3{ 4struct mystruct {float2 a ; }; 5mystruct test1 = { 6 {1 ,2 , },// test trailing commas in list 7 }; 8 9mystruct test2 = { 10float2 (3 ,4 ), 11 }; 12 13// mystruct test3 = { 14// { { 5, 6, } }, // TODO: test unneeded levels 15// }; 16 17float test4 = {7 , } ;// test scalar initialization 18 19struct mystruct2 {float a ;float b ;float c ; }; 20mystruct2 test5 = { {8 ,}, {9 ,}, {10 }, }; 21const mystruct2 constTest5 = { {8 ,}, {9 ,}, {10 }, }; 22constTest5 .c ; 23 24float const origStep = 1.0f ; 25const float step = origStep ; 26float n = 0 ; 27const float3 a [8 ]= { 28normalize (float3 (1 ,1 ,1 ))* (n += step ), 29normalize (float3 (-1 ,-1 ,-1 ))* (n += step ), 30normalize (float3 (-1 ,-1 ,1 ))* (n += step ), 31normalize (float3 (-1 ,1 ,-1 ))* (n += step ), 32normalize (float3 (-1 ,1 ,1 ))* (n += step ), 33normalize (float3 (1 ,-1 ,-1 ))* (n += step ), 34normalize (float3 (1 ,-1 ,1 ))* (n += step ), 35normalize (float3 (1 ,1 ,-1 ))* (n += step ) }; 36 37const struct one {float3 a ; }oneNonConst = {normalize (float3 (-1 ,1 ,1 ))* (n += step ) }; 38const struct two {float3 a ; 39float3 b ; }twoNonConst = {normalize (float3 (-1 ,1 ,1 ))* (n += step ), 40normalize (float3 (-1 ,1 ,1 ))* (n += step ) }; 41} 42 43struct PS_OUTPUT {float4 color :SV_Target0 ; }; 44 45PS_OUTPUT main () 46{ 47Test1 (); 48 49PS_OUTPUT ps_output ; 50ps_output .color = 1.0 ; 51return ps_output ; 52}