diff options
| author | pdeayton-nv <205388607+pdeayton-nv@users.noreply.github.com> | 2025-07-08 18:26:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-09 01:26:34 +0000 |
| commit | 4f54cccf0e0e06be38312e2ee97c2b50b82d7c10 (patch) | |
| tree | 54f9191daf268cd27022f5a7404ece48a031c8e9 /tests | |
| parent | a64a0ac3bff2d3e9d77f5beeaee035129ed8b406 (diff) | |
Generate OpExecutionMode PointMode for tessellation shaders (#7662)
* Generate "OpExecutionMode PointMode" for tessellation shaders instead of the incorrect geometry and mesh shader specific "OpExecutionMode OutputPoints".
* Add a test case verifying the OpExecutionMode is correct.
Fixes #7660
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/spirv/hull-shader-outputtopology.slang | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/spirv/hull-shader-outputtopology.slang b/tests/spirv/hull-shader-outputtopology.slang new file mode 100644 index 000000000..63c279528 --- /dev/null +++ b/tests/spirv/hull-shader-outputtopology.slang @@ -0,0 +1,60 @@ +//TEST:SIMPLE(filecheck=SPIRV_POINT):-target spirv -stage hull -entry hullMain_point +//TEST:SIMPLE(filecheck=SPIRV_TRICW):-target spirv -stage hull -entry hullMain_triangle_cw +//TEST:SIMPLE(filecheck=SPIRV_TRICCW):-target spirv -stage hull -entry hullMain_triangle_ccw + +// SPIRV_POINT: OpExecutionMode %hullMain_point PointMode +// SPIRV_TRICW: OpExecutionMode %hullMain_triangle_cw VertexOrderCw +// SPIRV_TRICCW: OpExecutionMode %hullMain_triangle_ccw VertexOrderCcw + +struct Out { + float x; +}; + +struct PatchConst { + float EdgeTessFactor[4] : SV_TessFactor; + float InsideTessFactor[2] : SV_InsideTessFactor; +}; + +PatchConst patchConst() { + PatchConst o; + o.EdgeTessFactor[0] = 1; + o.EdgeTessFactor[1] = 1; + o.EdgeTessFactor[2] = 1; + o.EdgeTessFactor[3] = 1; + o.InsideTessFactor[0] = 1; + o.InsideTessFactor[1] = 1; + return o; +} + +[domain("quad")] +[partitioning("integer")] +[outputtopology("point")] +[outputcontrolpoints(4)] +[patchconstantfunc("patchConst")] +Out hullMain_point() { + Out o; + o.x = 0; + return o; +} + +[domain("quad")] +[partitioning("integer")] +[outputtopology("triangle_cw")] +[outputcontrolpoints(4)] +[patchconstantfunc("patchConst")] +Out hullMain_triangle_cw() { + Out o; + o.x = 0; + return o; +} + +[domain("quad")] +[partitioning("integer")] +[outputtopology("triangle_ccw")] +[outputcontrolpoints(4)] +[patchconstantfunc("patchConst")] +Out hullMain_triangle_ccw() { + Out o; + o.x = 0; + return o; +} |
