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:
authorSpencer Fricke <spencerfricke@gmail.com>2022-09-16 21:05:23 +0300
committerGitHub <noreply@github.com>2022-09-16 21:05:23 +0300
commit8422d8a44b208ecdd124b28fefc84b9373cf4359 (patch)
treeac725c98e785e7f1d2e6a54347b6a1b4d830f4d2
parentc3f844aec4e1a8b578a557a45ed2df33bc113299 (diff)
spirv-val: Label ShaderRecordBufferKHR VUID (#4926)
-rw-r--r--source/val/validation_state.cpp6
-rw-r--r--test/val/val_storage_test.cpp2
2 files changed, 7 insertions, 1 deletions
diff --git a/source/val/validation_state.cpp b/source/val/validation_state.cpp
index 2e1fa31ae..218369506 100644
--- a/source/val/validation_state.cpp
+++ b/source/val/validation_state.cpp
@@ -744,9 +744,10 @@ void ValidationState_t::RegisterStorageClassConsumer(
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 @@ void ValidationState_t::RegisterStorageClassConsumer(
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 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
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 600e5b918..8693e8036 100644
--- a/test/val/val_storage_test.cpp
+++ b/test/val/val_storage_test.cpp
@@ -544,6 +544,8 @@ TEST_P(ValidateStorageExecutionModel, ShaderRecordBufferLoad) {
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 "