yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
8086adc90
master
1//TEST:SIMPLE(filecheck=METAL): -target metal 2//TEST:SIMPLE(filecheck=METALLIB): -target metallib 3//TEST:SIMPLE(filecheck=WGSL): -target wgsl 4//TEST:SIMPLE(filecheck=WGSLSPIRV): -target wgsl-spirv-asm 5 6struct NestedReturn 7{ 8 float4 debug; 9}; 10struct NestedReturn2 11{ 12 float4 debugAux1; 13 float4 debugAux2; 14}; 15 16// Semantics are supposed to ignore uppercase/lowercase differences 17struct Output 18{ 19 float4 Diffuse : SV_TarGet0; 20 NestedReturn debug1 : SV_Target1; 21 float4 Material : SV_TArgeT2; 22 NestedReturn2 debug2 : SV_TaRget3; 23} 24 25// METALLIB: define {{.*}} @fragmentMain 26// METAL: color(0) 27// METAL-DAG: color(1) 28// METAL-DAG: color(2) 29// METAL-DAG: color(3) 30// METAL-DAG: color(4) 31 32// WGSLSPIRV: %fragmentMain = OpFunction 33// WGSL: @location(0) Diffuse 34// WGSL: @location(1) debug 35// WGSL: @location(2) Material 36// WGSL: @location(3) debugAux1 37// WGSL: @location(4) debugAux2 38 39[shader("fragment")] 40Output fragmentMain() 41{ 42 return { float4(1), {float4(2)}, float4(3) }; 43}