nir: Add alignment information to cast derefs

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6472>
This commit is contained in:
Jason Ekstrand
2020-08-24 09:51:04 -05:00
committed by Marge Bot
parent a0b82c24b6
commit 878a8daca6
5 changed files with 19 additions and 1 deletions
+4
View File
@@ -1037,6 +1037,8 @@ write_deref(write_ctx *ctx, const nir_deref_instr *deref)
case nir_deref_type_cast:
write_src(ctx, &deref->parent);
blob_write_uint32(ctx->blob, deref->cast.ptr_stride);
blob_write_uint32(ctx->blob, deref->cast.align_mul);
blob_write_uint32(ctx->blob, deref->cast.align_offset);
if (!header.deref.cast_type_same_as_last) {
encode_type_to_blob(ctx->blob, deref->type);
ctx->last_type = deref->type;
@@ -1101,6 +1103,8 @@ read_deref(read_ctx *ctx, union packed_instr header)
case nir_deref_type_cast:
read_src(ctx, &deref->parent, &deref->instr);
deref->cast.ptr_stride = blob_read_uint32(ctx->blob);
deref->cast.align_mul = blob_read_uint32(ctx->blob);
deref->cast.align_offset = blob_read_uint32(ctx->blob);
if (header.deref.cast_type_same_as_last) {
deref->type = ctx->last_type;
} else {