nir: Fix serializing pointer initializers.

Found by manual inspection.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>

Fixes: 7acc81056f ("compiler/nir: Add support for variable initialization from a pointer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22355>
(cherry picked from commit 1546a9de99)
This commit is contained in:
Tatsuyuki Ishi 2023-04-07 18:34:17 +09:00 committed by Eric Engestrom
parent ae7dacac62
commit cb9d82bc2a
2 changed files with 3 additions and 2 deletions

View file

@ -193,7 +193,7 @@
"description": "nir: Fix serializing pointer initializers.",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "7acc81056f7ac6a869ef6403573b2572c77dbecf"
},

View file

@ -330,7 +330,8 @@ write_variable(write_ctx *ctx, const nir_variable *var)
if (var->constant_initializer)
write_constant(ctx, var->constant_initializer);
if (var->pointer_initializer)
write_lookup_object(ctx, var->pointer_initializer);
blob_write_uint32(ctx->blob,
write_lookup_object(ctx, var->pointer_initializer));
if (var->num_members > 0) {
blob_write_bytes(ctx->blob, (uint8_t *) var->members,
var->num_members * sizeof(*var->members));