yum-mirror/slang

Making it easier to work with shaders

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

ArielG-NVFix Varying Variable Location Assignments With Hull Shaders (#4915)f0ba756c2

master
1.1 KiB56 linesraw
1//TEST:SIMPLE(filecheck=GLSL):-target glsl -entry hullMain -stage hull -allow-glsl
2
3// Currently SPIR-V fails to compile this hull shader (#4914)
4//DISABLE_TEST:SIMPLE(filecheck=SPIRV):-target spirv -entry hullMain -stage hull -allow-glsl
5
6//GLSL-DAG: location = 0
7//GLSL-DAG: location = 1
8//GLSL-DAG: location = 2
9//GLSL-DAG: location = 3
10
11//SPIRV-DAG: location 0
12//SPIRV-DAG: location 1
13//SPIRV-DAG: location 2
14//SPIRV-DAG: location 3
15
16
17struct HsOut
18{
19    float2 pos;
20    float2 hm;
21};
22
23struct HscOut
24{
25    uint roundingFactor;
26    float EdgeTessFactor[4] : SV_TessFactor;
27    float InsideTessFactor[2] : SV_InsideTessFactor;
28    uint instanceId;
29};
30
31[domain("quad")]
32[partitioning("integer")]
33[outputtopology("triangle_ccw")]
34[outputcontrolpoints(4)]
35[patchconstantfunc("constants")]
36HsOut hullMain()
37{
38    HsOut o;
39    o.pos = 1;
40    o.hm = 2;
41    return o;
42}
43
44HscOut constants()
45{
46    HscOut o;
47    o.instanceId = 123;
48    o.roundingFactor = 6;
49    o.EdgeTessFactor[0] = 1;
50    o.EdgeTessFactor[1] = 2;
51    o.EdgeTessFactor[2] = 3;
52    o.EdgeTessFactor[3] = 4;
53    o.InsideTessFactor[0] = 0.5;
54    o.InsideTessFactor[1] = 0.5;
55    return o;
56}