mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-21 19:20:07 +00:00
Allow ArrayStride on untyped pointers (#5746)
This commit is contained in:
parent
ffb8d85eac
commit
8731673a5d
@ -123,7 +123,8 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, spv::Decoration dec,
|
||||
case spv::Decoration::ArrayStride:
|
||||
if (target->opcode() != spv::Op::OpTypeArray &&
|
||||
target->opcode() != spv::Op::OpTypeRuntimeArray &&
|
||||
target->opcode() != spv::Op::OpTypePointer) {
|
||||
target->opcode() != spv::Op::OpTypePointer &&
|
||||
target->opcode() != spv::Op::OpTypeUntypedPointerKHR) {
|
||||
return fail(0) << "must be an array or pointer type";
|
||||
}
|
||||
break;
|
||||
|
@ -257,6 +257,22 @@ OpFunctionEnd
|
||||
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
|
||||
}
|
||||
|
||||
TEST_F(DecorationTest, ArrayStrideUntypedPointerKHR) {
|
||||
const std::string text = R"(
|
||||
OpCapability Shader
|
||||
OpCapability Linkage
|
||||
OpCapability UntypedPointersKHR
|
||||
OpExtension "SPV_KHR_untyped_pointers"
|
||||
OpExtension "SPV_KHR_storage_buffer_storage_class"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpDecorate %ptr ArrayStride 4
|
||||
%ptr = OpTypeUntypedPointerKHR StorageBuffer
|
||||
)";
|
||||
|
||||
CompileSuccessfully(text);
|
||||
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
|
||||
}
|
||||
|
||||
using MemberOnlyDecorations = spvtest::ValidateBase<std::string>;
|
||||
|
||||
TEST_P(MemberOnlyDecorations, MemberDecoration) {
|
||||
|
Loading…
Reference in New Issue
Block a user