summaryrefslogtreecommitdiffstats
path: root/tests/cross-compile/dual-source-blending.slang
blob: 602f8e20ff9574664f12915cb3ddf1f49f4ad758 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//dual-source-blending.slang

// Test handling of `vk::location` and
// `vk::index` attributes to compile
// for dual-source color blending.

//TEST:SIMPLE(filecheck=CHECK):-target spirv-assembly -entry main -stage fragment
//TEST_DISABLED:SIMPLE:-target glsl

// CHECK: OpDecorate %{{.*}}main_a Location 0
// CHECK: OpDecorate %{{.*}}main_b Location 0
// CHECK: OpDecorate %{{.*}}main_b Index 1

struct FragmentOutput
{
	[[vk::location(0)]]
	float4 a : SV_Target0;

	[[vk::location(0), vk::index(1)]]
	float4 b : SV_Target1;
}

[shader("fragment")]
FragmentOutput main(float4 v : V)
{
	FragmentOutput f = {};
	f.a = v;
	f.b = v;
	return f;	
}