yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

James Helferty (NVIDIA)Enable metal tests (#8446)8086adc90

master
790 B35 linesraw
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 debug1;
9    float4 debug2;
10};
11
12struct Output
13{
14    float4 Diffuse : SV_Target0;
15    NestedReturn val : SV_Target1;
16    float4 Material : SV_Target2;
17}
18
19// METALLIB: define {{.*}} @fragmentMain
20// METAL: color(0)
21// METAL: color(1)
22// METAL-DAG: color(3)
23// METAL-DAG: color(2)
24
25// WGSLSPIRV: %fragmentMain = OpFunction
26// WGSL: @location(0) Diffuse
27// WGSL: @location(1) debug1
28// WGSL-DAG: @location(3) debug2
29// WGSL-DAG: @location(2) Material
30
31[shader("fragment")]
32Output fragmentMain()
33{
34    return { float4(1), {float4(2), float4(2)}, float4(3) };
35}