Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSpencer Fricke <spencerfricke@gmail.com>2022-09-07 22:12:07 +0300
committerGitHub <noreply@github.com>2022-09-07 22:12:07 +0300
commit59cf5b1346d8b029add67a919f801c29ea13cc49 (patch)
tree03807ae8681cea25f56a84f98763962bb24a4bd8 /source
parent934a0597874e93b2440e196cf5b45a830513c2db (diff)
spirv-val: consider OpEmitMeshTasksEXT a terminator instruction (#4923)
Diffstat (limited to 'source')
-rw-r--r--source/opcode.cpp12
-rw-r--r--source/val/validate_cfg.cpp6
2 files changed, 16 insertions, 2 deletions
diff --git a/source/opcode.cpp b/source/opcode.cpp
index 2584d51eb..e3797b707 100644
--- a/source/opcode.cpp
+++ b/source/opcode.cpp
@@ -468,8 +468,16 @@ bool spvOpcodeIsBlockTerminator(SpvOp opcode) {
}
bool spvOpcodeTerminatesExecution(SpvOp opcode) {
- return opcode == SpvOpKill || opcode == SpvOpTerminateInvocation ||
- opcode == SpvOpTerminateRayKHR || opcode == SpvOpIgnoreIntersectionKHR;
+ switch (opcode) {
+ case SpvOpKill:
+ case SpvOpTerminateInvocation:
+ case SpvOpTerminateRayKHR:
+ case SpvOpIgnoreIntersectionKHR:
+ case SpvOpEmitMeshTasksEXT:
+ return true;
+ default:
+ return false;
+ }
}
bool spvOpcodeIsBaseOpaqueType(SpvOp opcode) {
diff --git a/source/val/validate_cfg.cpp b/source/val/validate_cfg.cpp
index 87975e1ef..c684a9918 100644
--- a/source/val/validate_cfg.cpp
+++ b/source/val/validate_cfg.cpp
@@ -1066,6 +1066,7 @@ spv_result_t CfgPass(ValidationState_t& _, const Instruction* inst) {
case SpvOpTerminateInvocation:
case SpvOpIgnoreIntersectionKHR:
case SpvOpTerminateRayKHR:
+ case SpvOpEmitMeshTasksEXT:
_.current_function().RegisterBlockEnd(std::vector<uint32_t>());
if (opcode == SpvOpKill) {
_.current_function().RegisterExecutionModelLimitation(
@@ -1087,6 +1088,11 @@ spv_result_t CfgPass(ValidationState_t& _, const Instruction* inst) {
SpvExecutionModelAnyHitKHR,
"OpTerminateRayKHR requires AnyHitKHR execution model");
}
+ if (opcode == SpvOpEmitMeshTasksEXT) {
+ _.current_function().RegisterExecutionModelLimitation(
+ SpvExecutionModelTaskEXT,
+ "OpEmitMeshTasksEXT requires TaskEXT execution model");
+ }
break;
default: