Skip to content

Commit 87a678a

Browse files
1 parent a14486e commit 87a678a

3 files changed

Lines changed: 9 additions & 19 deletions

File tree

source/val/validate_decorations.cpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2467,20 +2467,13 @@ spv_result_t CheckInvalidVulkanExplicitLayout(ValidationState_t& vstate) {
24672467
case spv::Op::OpBufferPointerEXT: {
24682468
const auto ptr_id = inst.GetOperandAs<uint32_t>(1);
24692469
const auto ptr_type = vstate.FindDef(vstate.FindDef(ptr_id)->type_id());
2470-
// Check the type of the data operand for an invalid layout.
24712470
sc = ptr_type->GetOperandAs<spv::StorageClass>(1);
2472-
if (!AllowsLayout(vstate, sc) &&
2473-
UsesExplicitLayout(vstate, type_id, cache) !=
2474-
spv::Decoration::Max) {
2471+
// OpBufferPointerEXT needs to be in explicit layout, which it is,
2472+
// because it must be Uniform/StorageBuffer
2473+
if (sc != spv::StorageClass::StorageBuffer &&
2474+
sc != spv::StorageClass::Uniform) {
24752475
return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
2476-
<< vstate.VkErrorID(11346)
2477-
<< "The result type operand of OpBufferPointerEXT must have "
2478-
<< "a Type operand that is explicitly laid out : "
2479-
<< vstate.getIdName(type_id);
2480-
} else if (sc != spv::StorageClass::StorageBuffer &&
2481-
sc != spv::StorageClass::Uniform) {
2482-
return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
2483-
<< "OpBufferPointerEXT's Result Type must be a pointer type "
2476+
<< "OpBufferPointerEXT Result Type must be a pointer type "
24842477
<< "with a Storage Class of Uniform or StorageBuffer.";
24852478
}
24862479
break;

source/val/validation_state.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3493,8 +3493,6 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
34933493
return VUID_WRAP(VUID-StandaloneSpirv-Result-11337);
34943494
case 11339:
34953495
return VUID_WRAP(VUID-StandaloneSpirv-Result-11339);
3496-
case 11346:
3497-
return VUID_WRAP(VUID-StandaloneSpirv-Result-11346);
34983496
case 11347:
34993497
return VUID_WRAP(VUID-StandaloneSpirv-OpUntypedVariableKHR-11347);
35003498
case 11416:

test/val/val_extension_spv_ext_descriptor_heap.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ TEST_F(ValidateSpvEXTDescriptorHeap, BufferPointerEXTStorageClass) {
11401140
const std::string diag = getDiagnosticString();
11411141
EXPECT_THAT(
11421142
diag,
1143-
HasSubstr("OpBufferPointerEXT's Result Type must be a pointer "
1143+
HasSubstr("OpBufferPointerEXT Result Type must be a pointer "
11441144
"type with a Storage Class of Uniform or StorageBuffer."));
11451145
}
11461146

@@ -1195,10 +1195,9 @@ TEST_F(ValidateSpvEXTDescriptorHeap, BufferPointerEXTLayout) {
11951195
CompileSuccessfully(str.c_str(), SPV_ENV_VULKAN_1_3);
11961196
EXPECT_NE(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
11971197
const std::string diag = getDiagnosticString();
1198-
EXPECT_THAT(diag, AnyVUID("VUID-StandaloneSpirv-Result-11346"));
1199-
EXPECT_THAT(
1200-
diag, HasSubstr("The result type operand of OpBufferPointerEXT "
1201-
"must have a Type operand that is explicitly laid out"));
1198+
EXPECT_THAT(diag,
1199+
HasSubstr("OpBufferPointerEXT Result Type must be a pointer type "
1200+
"with a Storage Class of Uniform or StorageBuffer."));
12021201
}
12031202

12041203
TEST_F(ValidateSpvEXTDescriptorHeap, BufferPointerEXTDecorate) {

0 commit comments

Comments
 (0)