Skip to content

Commit 15f3ee1

Browse files
[val] Allow TileImageEXT variables to be arrays (KhronosGroup#6733)
Handle the case where 'tile image variables' in the following spec refer to an `OpTypeArray` to tile images, as pointed out in KhronosGroup#6593 (comment). > The TileImageEXT Storage Class must only be used for declaring tile image variables
1 parent 199cb20 commit 15f3ee1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

source/val/validate_memory.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,12 @@ spv_result_t ValidateVariableTileImageEXT(ValidationState_t& _,
11491149

11501150
auto result_type = _.FindDef(inst->type_id());
11511151
if (result_type->opcode() == spv::Op::OpTypePointer) {
1152-
const auto pointee_type = _.FindDef(result_type->GetOperandAs<uint32_t>(2));
1152+
auto pointee_type = _.FindDef(result_type->GetOperandAs<uint32_t>(2));
1153+
1154+
while (pointee_type && pointee_type->opcode() == spv::Op::OpTypeArray) {
1155+
pointee_type = _.FindDef(pointee_type->GetOperandAs<uint32_t>(1));
1156+
}
1157+
11531158
if (pointee_type && pointee_type->opcode() == spv::Op::OpTypeImage) {
11541159
spv::Dim dim = static_cast<spv::Dim>(pointee_type->word(3));
11551160
if (dim != spv::Dim::TileImageDataEXT) {

0 commit comments

Comments
 (0)