diff options
Diffstat (limited to 'src/compiler/nir/nir_serialize.c')
-rw-r--r-- | src/compiler/nir/nir_serialize.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_serialize.c b/src/compiler/nir/nir_serialize.c index fe74603115a..e9e84bf8aaa 100644 --- a/src/compiler/nir/nir_serialize.c +++ b/src/compiler/nir/nir_serialize.c @@ -553,7 +553,7 @@ write_load_const(write_ctx *ctx, const nir_load_const_instr *lc) uint32_t val = lc->def.num_components; val |= lc->def.bit_size << 3; blob_write_uint32(ctx->blob, val); - blob_write_bytes(ctx->blob, (uint8_t *) &lc->value, sizeof(lc->value)); + blob_write_bytes(ctx->blob, lc->value, sizeof(*lc->value) * lc->def.num_components); write_add_object(ctx, &lc->def); } @@ -565,7 +565,7 @@ read_load_const(read_ctx *ctx) nir_load_const_instr *lc = nir_load_const_instr_create(ctx->nir, val & 0x7, val >> 3); - blob_copy_bytes(ctx->blob, (uint8_t *) &lc->value, sizeof(lc->value)); + blob_copy_bytes(ctx->blob, lc->value, sizeof(*lc->value) * lc->def.num_components); read_add_object(ctx, &lc->def); return lc; } |