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
diff options
context:
space:
mode:
Diffstat (limited to 'source/val/validate.cpp')
-rw-r--r--source/val/validate.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/val/validate.cpp b/source/val/validate.cpp
index 9a685f229..efb9225e6 100644
--- a/source/val/validate.cpp
+++ b/source/val/validate.cpp
@@ -209,6 +209,8 @@ spv_result_t ValidateBinaryUsingContextAndValidationState(
return error;
}
+ bool has_mask_task_nv = false;
+ bool has_mask_task_ext = false;
std::vector<Instruction*> visited_entry_points;
for (auto& instruction : vstate->ordered_instructions()) {
{
@@ -247,6 +249,11 @@ spv_result_t ValidateBinaryUsingContextAndValidationState(
}
}
visited_entry_points.push_back(inst);
+
+ has_mask_task_nv |= (execution_model == SpvExecutionModelTaskNV ||
+ execution_model == SpvExecutionModelMeshNV);
+ has_mask_task_ext |= (execution_model == SpvExecutionModelTaskEXT ||
+ execution_model == SpvExecutionModelMeshEXT);
}
if (inst->opcode() == SpvOpFunctionCall) {
if (!vstate->in_function_body()) {
@@ -298,6 +305,12 @@ spv_result_t ValidateBinaryUsingContextAndValidationState(
return vstate->diag(SPV_ERROR_INVALID_LAYOUT, nullptr)
<< "Missing required OpSamplerImageAddressingModeNV instruction.";
+ if (has_mask_task_ext && has_mask_task_nv)
+ return vstate->diag(SPV_ERROR_INVALID_LAYOUT, nullptr)
+ << vstate->VkErrorID(7102)
+ << "Module can't mix MeshEXT/TaskEXT with MeshNV/TaskNV Execution "
+ "Model.";
+
// Catch undefined forward references before performing further checks.
if (auto error = ValidateForwardDecls(*vstate)) return error;
@@ -352,6 +365,7 @@ spv_result_t ValidateBinaryUsingContextAndValidationState(
if (auto error = LiteralsPass(*vstate, &instruction)) return error;
if (auto error = RayQueryPass(*vstate, &instruction)) return error;
if (auto error = RayTracingPass(*vstate, &instruction)) return error;
+ if (auto error = MeshShadingPass(*vstate, &instruction)) return error;
}
// Validate the preconditions involving adjacent instructions. e.g. SpvOpPhi