yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f9bcad355
master
1//TEST:SIMPLE(filecheck=CHECK): -target cpp -entry computeMain -stage compute -allow-glsl 2 3// CHECK: computeMain( 4 5layout(binding = 0) buffer MyBlockName 6{ 7 int v[1]; 8} outputBuffer; 9 10// `default` only should try to define `glsl`, but glsl target is 11// present in a `case` statment. Therefore this code should error 12// since cpp is missing a target for a function called 13[require(cpp)] 14[require(glsl)] 15[require(spirv)] 16void someInternalFunc() 17{ 18 __target_switch 19 { 20 case glsl: 21 outputBuffer.v[0] = 0; 22 default: 23 outputBuffer.v[0] = 0; 24 } 25} 26void someMin() 27{ 28 someInternalFunc(); 29} 30[numthreads(1,1,1)] 31void computeMain() 32{ 33 someMin(); 34}