summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-12-03 22:36:46 -0800
committerGitHub <noreply@github.com>2024-12-03 22:36:46 -0800
commit59ba2594dedac02ad2ef7bc049bd78f5412e1a92 (patch)
treec0d5405f6cfd2922af2d7a47142921edc5b38125
parent5450a4907c93f493fa7a5849d5e98e1b07db1ee4 (diff)
Fix `SpvExecutionModeOutputLinesEXT`. (#5740)
-rw-r--r--source/slang/slang-check-decl.cpp3
-rw-r--r--source/slang/slang-emit-spirv.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index e4206827f..4a4ade047 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -8789,7 +8789,8 @@ void SemanticsDeclHeaderVisitor::checkMeshOutputDecl(VarDeclBase* varDecl)
nullptr,
ConstantFoldingKind::LinkTime,
getSink());
-
+ if (!index)
+ return;
Type* d = m_astBuilder->getMeshOutputTypeFromModifier(modifier, base, index);
varDecl->type.type = d;
}
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp
index b0da7e4a6..58f5e4f66 100644
--- a/source/slang/slang-emit-spirv.cpp
+++ b/source/slang/slang-emit-spirv.cpp
@@ -4467,7 +4467,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex
if (t == "triangle")
m = SpvExecutionModeOutputTrianglesEXT;
else if (t == "line")
- m = SpvExecutionModeOutputTrianglesEXT;
+ m = SpvExecutionModeOutputLinesEXT;
else if (t == "point")
m = SpvExecutionModeOutputPoints;
}