yum-mirror/slang

Making it easier to work with shaders

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

Yong HeSPIRV `Block` decoration fixes. (#4303)9a23a9aab

master
664 B25 linesraw
1// Test that explicit binding of varying output works.
2
3//TEST:SIMPLE(filecheck=CHECK): -stage fragment -entry MainPS -target spirv -emit-spirv-directly
4
5struct PS_OUTPUT 
6{
7    [[vk::location(0) vk::index(0)]]    
8    float4 vColor : SV_Target0 ; 
9    
10    [[vk::location(0) vk::index(1)]] 
11    float4 vColor2 : SV_Target1 ; 
12    
13};
14
15// CHECK: OpDecorate %{{.*}}MainPS_vColor Location 0
16// CHECK: OpDecorate %{{.*}}MainPS_vColor2 Location 0
17// CHECK: OpDecorate %{{.*}}MainPS_vColor2 Index 1
18
19PS_OUTPUT MainPS()
20{
21    PS_OUTPUT output;
22    output.vColor = float4(1.0f, 0.0f, 0.0f, 1.0f);
23    output.vColor2 = float4(0.0f, 1.0f, 0.0f, 1.0f);
24    return output;
25}