Skip to content

Commit

Permalink
Add MeshNV for Execution Model alias
Browse files Browse the repository at this point in the history
  • Loading branch information
sjfricke committed Sep 23, 2022
1 parent dd4740d commit e51d1d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
6 changes: 4 additions & 2 deletions source/val/validate_mode_setting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,12 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _,
case SpvExecutionModeOutputPrimitivesEXT:
if (!std::all_of(models->begin(), models->end(),
[](const SpvExecutionModel& model) {
return model == SpvExecutionModelMeshEXT;
return (model == SpvExecutionModelMeshEXT ||
model == SpvExecutionModelMeshNV);
})) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Execution mode can only be used with the MeshEXT execution "
<< "Execution mode can only be used with the MeshEXT or MeshNV "
"execution "
"model.";
}
break;
Expand Down
21 changes: 9 additions & 12 deletions test/val/val_mesh_shading_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,9 @@ TEST_F(ValidateMeshShading, BadExecutionModelOutputLinesEXT) {
CompileSuccessfully(body, SPV_ENV_UNIVERSAL_1_5);
EXPECT_EQ(SPV_ERROR_INVALID_DATA,
ValidateInstructions(SPV_ENV_UNIVERSAL_1_5));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr(
"Execution mode can only be used with the MeshEXT execution model."));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Execution mode can only be used with the MeshEXT or "
"MeshNV execution model."));
}

TEST_F(ValidateMeshShading, BadExecutionModelOutputTrianglesEXT) {
Expand All @@ -333,10 +332,9 @@ TEST_F(ValidateMeshShading, BadExecutionModelOutputTrianglesEXT) {
CompileSuccessfully(body, SPV_ENV_UNIVERSAL_1_5);
EXPECT_EQ(SPV_ERROR_INVALID_DATA,
ValidateInstructions(SPV_ENV_UNIVERSAL_1_5));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr(
"Execution mode can only be used with the MeshEXT execution model."));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Execution mode can only be used with the MeshEXT or "
"MeshNV execution model."));
}

TEST_F(ValidateMeshShading, BadExecutionModelOutputPrimitivesEXT) {
Expand All @@ -357,10 +355,9 @@ TEST_F(ValidateMeshShading, BadExecutionModelOutputPrimitivesEXT) {
CompileSuccessfully(body, SPV_ENV_UNIVERSAL_1_5);
EXPECT_EQ(SPV_ERROR_INVALID_DATA,
ValidateInstructions(SPV_ENV_UNIVERSAL_1_5));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr(
"Execution mode can only be used with the MeshEXT execution model."));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Execution mode can only be used with the MeshEXT or "
"MeshNV execution model."));
}

TEST_F(ValidateMeshShading, OpEmitMeshTasksBadGroupCountSignedInt) {
Expand Down

0 comments on commit e51d1d4

Please sign in to comment.