spirv-val: Label ShaderRecordBufferKHR VUID (#4926)
diff --git a/source/val/validation_state.cpp b/source/val/validation_state.cpp index 2e1fa31..2183695 100644 --- a/source/val/validation_state.cpp +++ b/source/val/validation_state.cpp
@@ -744,9 +744,10 @@ return true; }); } else if (storage_class == SpvStorageClassShaderRecordBufferKHR) { + std::string errorVUID = VkErrorID(7119); function(consumer->function()->id()) ->RegisterExecutionModelLimitation( - [](SpvExecutionModel model, std::string* message) { + [errorVUID](SpvExecutionModel model, std::string* message) { if (model != SpvExecutionModelRayGenerationKHR && model != SpvExecutionModelIntersectionKHR && model != SpvExecutionModelAnyHitKHR && @@ -755,6 +756,7 @@ model != SpvExecutionModelMissKHR) { if (message) { *message = + errorVUID + "ShaderRecordBufferKHR Storage Class is limited to " "RayGenerationKHR, IntersectionKHR, AnyHitKHR, " "ClosestHitKHR, CallableKHR, and MissKHR execution model"; @@ -2038,6 +2040,8 @@ return VUID_WRAP(VUID-StandaloneSpirv-CallableDataKHR-04704); case 4705: return VUID_WRAP(VUID-StandaloneSpirv-IncomingCallableDataKHR-04705); + case 7119: + return VUID_WRAP(VUID-StandaloneSpirv-ShaderRecordBufferKHR-07119); case 4708: return VUID_WRAP(VUID-StandaloneSpirv-PhysicalStorageBuffer64-04708); case 4710:
diff --git a/test/val/val_storage_test.cpp b/test/val/val_storage_test.cpp index 600e5b9..8693e80 100644 --- a/test/val/val_storage_test.cpp +++ b/test/val/val_storage_test.cpp
@@ -544,6 +544,8 @@ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2)); } else { ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_2)); + EXPECT_THAT(getDiagnosticString(), + AnyVUID("VUID-StandaloneSpirv-ShaderRecordBufferKHR-07119")); EXPECT_THAT( getDiagnosticString(), HasSubstr("ShaderRecordBufferKHR Storage Class is limited to "