yum-mirror/slang

Making it easier to work with shaders

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

Jay KwakRemove the semantic decoration from the original entry struct (#8146)d7e2bac2d

master
897 B40 linesraw
1// tests/wgsl/entry-point-legalization.slang
2//TEST:SIMPLE(filecheck=CHK):-target wgsl-spirv-asm -stage vertex -entry vertexMain
3//TEST:SIMPLE(filecheck=CHK):-target wgsl-spirv-asm -stage vertex -entry vertexMain -DREPRODUCE
4
5//CHK: %vertexMain = OpFunction
6
7struct AssembledVertex
8{
9        float3  position;
10};
11
12struct VertexStageInput
13{
14    AssembledVertex assembledVertex : A;
15};
16
17struct VertexStageOutput
18{
19        float4                  sv_position             : SV_Position;
20};
21
22float3 GetPosition(VertexStageInput i)
23{
24    return i.assembledVertex.position;
25}
26
27[shader("vertex")]
28VertexStageOutput vertexMain(VertexStageInput input)
29{
30        VertexStageOutput output;
31
32#if defined(REPRODUCE)
33        float3 position = GetPosition(input);
34#else
35        float3 position = input.assembledVertex.position;
36#endif
37
38        output.sv_position = float4(position, 1.0);
39        return output;
40}