diff options
| author | Darren Wihandi <65404740+fairywreath@users.noreply.github.com> | 2025-03-13 06:28:03 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-13 18:28:03 +0800 |
| commit | 395302d2404e3429f3cdfa406e89fa76bc0d444b (patch) | |
| tree | 0114009e9573cd94007dc3c4c1dfcad844cc33f8 /source/slang/slang-emit-spirv.cpp | |
| parent | ee1995ba397c4f670c991aeeb05d3fcaaebb6771 (diff) | |
Add mesh shader output topology checks (#6592)
* initial wip
* more wip
* add test
* add unexpected for invalid target
* fixups and improve error message
* fixups and improve error message
* remove incorrect comment
---------
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'source/slang/slang-emit-spirv.cpp')
| -rw-r--r-- | source/slang/slang-emit-spirv.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp index 3b8e5e1d1..d43af8ac2 100644 --- a/source/slang/slang-emit-spirv.cpp +++ b/source/slang/slang-emit-spirv.cpp @@ -4,6 +4,7 @@ #include "slang-compiler.h" #include "slang-emit-base.h" #include "slang-ir-call-graph.h" +#include "slang-ir-entry-point-decorations.h" #include "slang-ir-insts.h" #include "slang-ir-layout.h" #include "slang-ir-redundancy-removal.h" @@ -4684,7 +4685,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex entryPoint ? entryPoint->findDecoration<IREntryPointDecoration>() : nullptr; const auto o = cast<IROutputTopologyDecoration>(decoration); - const auto t = o->getTopology()->getStringSlice(); + const auto topologyType = OutputTopologyType(o->getTopologyType()); SpvExecutionMode m = SpvExecutionModeMax; if (entryPointDecor) @@ -4693,20 +4694,20 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex { case Stage::Domain: case Stage::Hull: - if (t == "triangle_cw") + if (topologyType == OutputTopologyType::TriangleCW) m = SpvExecutionModeVertexOrderCw; - else if (t == "triangle_ccw") + else if (topologyType == OutputTopologyType::TriangleCCW) m = SpvExecutionModeVertexOrderCcw; break; } } if (m == SpvExecutionModeMax) { - if (t == "triangle") + if (topologyType == OutputTopologyType::Triangle) m = SpvExecutionModeOutputTrianglesEXT; - else if (t == "line") + else if (topologyType == OutputTopologyType::Line) m = SpvExecutionModeOutputLinesEXT; - else if (t == "point") + else if (topologyType == OutputTopologyType::Point) m = SpvExecutionModeOutputPoints; } |
