vtn: Propagate access data that's present on all struct members to the struct itself

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10356>
This commit is contained in:
Jesse Natalie 2021-04-19 16:04:14 -07:00 committed by Marge Bot
parent 939bf7a419
commit 9936463ef6
1 changed files with 8 additions and 0 deletions

View File

@ -1484,6 +1484,14 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
};
vtn_foreach_decoration(b, val, struct_member_decoration_cb, &ctx);
/* Propagate access specifiers that are present on all members to the overall type */
enum gl_access_qualifier overall_access = ACCESS_COHERENT | ACCESS_VOLATILE |
ACCESS_NON_READABLE | ACCESS_NON_WRITEABLE;
for (unsigned i = 0; i < num_fields; ++i)
overall_access &= val->type->members[i]->access;
val->type->access = overall_access;
vtn_foreach_decoration(b, val, struct_member_matrix_stride_cb, &ctx);
vtn_foreach_decoration(b, val, struct_block_decoration_cb, NULL);