yum-mirror/slang

Making it easier to work with shaders

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

Yong HeLower varying parameters as pointers instead of SSA values. (#5919)c43f6fa55

master
423 B22 linesraw
1// Test passing a varying parameter direclty to an inout parameter.
2
3//TEST:SIMPLE(filecheck=CHECK):-target spirv -entry main -stage fragment
4
5// CHECK: OpEntryPoint Fragment %main "main"
6struct PS_IN
7{
8    float3 pos : SV_Position;
9    float4 color : COLOR;
10}
11
12void test(inout PS_IN v)
13{
14    v.color = v.color + v.pos.x;
15}
16
17[shader("fragment")]
18float4 main(PS_IN psIn):SV_Target
19{
20    test(psIn);
21    return psIn.color;
22}