diff options
author | Spencer Fricke <spencerfricke@gmail.com> | 2022-09-07 22:12:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-07 22:12:07 +0300 |
commit | 59cf5b1346d8b029add67a919f801c29ea13cc49 (patch) | |
tree | 03807ae8681cea25f56a84f98763962bb24a4bd8 /source | |
parent | 934a0597874e93b2440e196cf5b45a830513c2db (diff) |
spirv-val: consider OpEmitMeshTasksEXT a terminator instruction (#4923)
Diffstat (limited to 'source')
-rw-r--r-- | source/opcode.cpp | 12 | ||||
-rw-r--r-- | source/val/validate_cfg.cpp | 6 |
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: |