yum-mirror/slang

Making it easier to work with shaders

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

ArielG-NVSupport the GLSL/SPIR-V Built-in variable `DeviceIndex` (#7552)67af8c718

master
380 B16 linesraw
1//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry main -stage fragment -allow-glsl
2//TEST:SIMPLE(filecheck=GLSL): -target glsl -entry main -stage fragment -allow-glsl
3
4// SPIRV: OpDecorate %{{.*}} BuiltIn DeviceIndex
5// GLSL: gl_DeviceIndex
6
7struct PSIn
8{
9    float3 color;
10}
11
12[shader("fragment")]
13float4 main(PSIn pin)
14{
15    return float4(pin.color, (float)gl_DeviceIndex);
16}