yum-mirror/slang

Making it easier to work with shaders

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

Jay KwakFix a false failure when using the latest SPIR-V (#4904)a3fbd8f06

master
663 B29 linesraw
1//TEST:SIMPLE(filecheck=HLSL): -entry main -target hlsl
2//TEST:SIMPLE(filecheck=GLSL): -entry main -target glsl
3//TEST:SIMPLE(filecheck=SPIRV): -entry main -target spirv
4
5// HLSL-DAG: main
6// HLSL-DAG: SV_InstanceID
7
8// GLSL-DAG: main
9// GLSL-DAG: gl_InstanceIndex
10
11// SPIRV: OpEntryPoint
12// SPIRV-NOT: BuiltIn InstanceIndex
13
14// We require 1 `Flat` for the fragment input `uint`
15// SPIRV: OpDecorate %{{[1-9][0-9]*}} Flat
16// SPIRV-NOT: OpDecorate %{{[1-9][0-9]*}} Flat
17
18
19struct PSInput
20{
21    uint vInstance : SV_InstanceID;
22	float4 color : COLOR;
23};
24
25[shader("pixel")]
26float4 main(PSInput input) : SV_TARGET
27{
28	return input.color + float(input.vInstance).xxxx;
29}