diff options
author | Karol Herbst <[email protected]> | 2019-03-27 00:59:03 +0100 |
---|---|---|
committer | Karol Herbst <[email protected]> | 2019-04-14 22:25:56 +0200 |
commit | 14531d676b11999123c04fb7569ab80c9f150180 (patch) | |
tree | d0f40439b5b92fa362195868300098c063f71ea7 /src/compiler/nir/nir_serialize.c | |
parent | 73d883037d170ab8dcade3e0cfcf9f33c8ed6557 (diff) |
nir: make nir_const_value scalar
v2: remove & operator in a couple of memsets
add some memsets
v3: fixup lima
Signed-off-by: Karol Herbst <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]> (v2)
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; } |