mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-10-18 19:20:05 +00:00
spirv-val: Label ShaderRecordBufferKHR VUID (#4926)
This commit is contained in:
parent
c3f844aec4
commit
8422d8a44b
@ -744,9 +744,10 @@ void ValidationState_t::RegisterStorageClassConsumer(
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
} else if (storage_class == SpvStorageClassShaderRecordBufferKHR) {
|
} else if (storage_class == SpvStorageClassShaderRecordBufferKHR) {
|
||||||
|
std::string errorVUID = VkErrorID(7119);
|
||||||
function(consumer->function()->id())
|
function(consumer->function()->id())
|
||||||
->RegisterExecutionModelLimitation(
|
->RegisterExecutionModelLimitation(
|
||||||
[](SpvExecutionModel model, std::string* message) {
|
[errorVUID](SpvExecutionModel model, std::string* message) {
|
||||||
if (model != SpvExecutionModelRayGenerationKHR &&
|
if (model != SpvExecutionModelRayGenerationKHR &&
|
||||||
model != SpvExecutionModelIntersectionKHR &&
|
model != SpvExecutionModelIntersectionKHR &&
|
||||||
model != SpvExecutionModelAnyHitKHR &&
|
model != SpvExecutionModelAnyHitKHR &&
|
||||||
@ -755,6 +756,7 @@ void ValidationState_t::RegisterStorageClassConsumer(
|
|||||||
model != SpvExecutionModelMissKHR) {
|
model != SpvExecutionModelMissKHR) {
|
||||||
if (message) {
|
if (message) {
|
||||||
*message =
|
*message =
|
||||||
|
errorVUID +
|
||||||
"ShaderRecordBufferKHR Storage Class is limited to "
|
"ShaderRecordBufferKHR Storage Class is limited to "
|
||||||
"RayGenerationKHR, IntersectionKHR, AnyHitKHR, "
|
"RayGenerationKHR, IntersectionKHR, AnyHitKHR, "
|
||||||
"ClosestHitKHR, CallableKHR, and MissKHR execution model";
|
"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);
|
return VUID_WRAP(VUID-StandaloneSpirv-CallableDataKHR-04704);
|
||||||
case 4705:
|
case 4705:
|
||||||
return VUID_WRAP(VUID-StandaloneSpirv-IncomingCallableDataKHR-04705);
|
return VUID_WRAP(VUID-StandaloneSpirv-IncomingCallableDataKHR-04705);
|
||||||
|
case 7119:
|
||||||
|
return VUID_WRAP(VUID-StandaloneSpirv-ShaderRecordBufferKHR-07119);
|
||||||
case 4708:
|
case 4708:
|
||||||
return VUID_WRAP(VUID-StandaloneSpirv-PhysicalStorageBuffer64-04708);
|
return VUID_WRAP(VUID-StandaloneSpirv-PhysicalStorageBuffer64-04708);
|
||||||
case 4710:
|
case 4710:
|
||||||
|
@ -544,6 +544,8 @@ TEST_P(ValidateStorageExecutionModel, ShaderRecordBufferLoad) {
|
|||||||
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
|
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
|
||||||
} else {
|
} else {
|
||||||
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_2));
|
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_2));
|
||||||
|
EXPECT_THAT(getDiagnosticString(),
|
||||||
|
AnyVUID("VUID-StandaloneSpirv-ShaderRecordBufferKHR-07119"));
|
||||||
EXPECT_THAT(
|
EXPECT_THAT(
|
||||||
getDiagnosticString(),
|
getDiagnosticString(),
|
||||||
HasSubstr("ShaderRecordBufferKHR Storage Class is limited to "
|
HasSubstr("ShaderRecordBufferKHR Storage Class is limited to "
|
||||||
|
Loading…
Reference in New Issue
Block a user