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
644 B30 linesraw
1//dual-source-blending.slang
2
3// Test handling of `vk::location` and
4// `vk::index` attributes to compile
5// for dual-source color blending.
6
7//TEST:SIMPLE(filecheck=CHECK):-target spirv-assembly -entry main -stage fragment
8//TEST_DISABLED:SIMPLE:-target glsl
9
10// CHECK: OpDecorate %{{.*}}main_a Location 0
11// CHECK: OpDecorate %{{.*}}main_b Location 0
12// CHECK: OpDecorate %{{.*}}main_b Index 1
13
14struct FragmentOutput
15{
16	[[vk::location(0)]]
17	float4 a : SV_Target0;
18
19	[[vk::location(0), vk::index(1)]]
20	float4 b : SV_Target1;
21}
22
23[shader("fragment")]
24FragmentOutput main(float4 v : V)
25{
26	FragmentOutput f = {};
27	f.a = v;
28	f.b = v;
29	return f;	
30}