nir/serialize: remove unused parameter from read_src()

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12910>
This commit is contained in:
Rhys Perry 2021-09-08 15:28:53 +01:00 committed by Marge Bot
parent 69a9b343e8
commit 1df320dae7

View file

@ -545,7 +545,7 @@ write_src(write_ctx *ctx, const nir_src *src)
}
static union packed_src
read_src(read_ctx *ctx, nir_src *src, void *mem_ctx)
read_src(read_ctx *ctx, nir_src *src)
{
STATIC_ASSERT(sizeof(union packed_src) == 4);
union packed_src header;
@ -559,7 +559,7 @@ read_src(read_ctx *ctx, nir_src *src, void *mem_ctx)
src->reg.base_offset = blob_read_uint32(ctx->blob);
if (header.any.is_indirect) {
src->reg.indirect = malloc(sizeof(nir_src));
read_src(ctx, src->reg.indirect, mem_ctx);
read_src(ctx, src->reg.indirect);
} else {
src->reg.indirect = NULL;
}
@ -780,7 +780,7 @@ read_dest(read_ctx *ctx, nir_dest *dst, nir_instr *instr,
dst->reg.base_offset = blob_read_uint32(ctx->blob);
if (dest.reg.is_indirect) {
dst->reg.indirect = malloc(sizeof(nir_src));
read_src(ctx, dst->reg.indirect, instr);
read_src(ctx, dst->reg.indirect);
}
}
}
@ -936,7 +936,7 @@ read_alu(read_ctx *ctx, union packed_instr header)
}
} else {
for (unsigned i = 0; i < num_srcs; i++) {
union packed_src src = read_src(ctx, &alu->src[i].src, &alu->instr);
union packed_src src = read_src(ctx, &alu->src[i].src);
unsigned src_channels = nir_ssa_alu_instr_src_components(alu, i);
unsigned src_components = nir_src_num_components(alu->src[i].src);
bool packed = src_components <= 4 && src_channels <= 4;
@ -1115,7 +1115,7 @@ read_deref(read_ctx *ctx, union packed_instr header)
break;
case nir_deref_type_struct:
read_src(ctx, &deref->parent, &deref->instr);
read_src(ctx, &deref->parent);
parent = nir_src_as_deref(deref->parent);
deref->strct.index = blob_read_uint32(ctx->blob);
deref->type = glsl_get_struct_field(parent->type, deref->strct.index);
@ -1129,8 +1129,8 @@ read_deref(read_ctx *ctx, union packed_instr header)
deref->arr.index.is_ssa = true;
deref->arr.index.ssa = read_lookup_object(ctx, blob_read_uint16(ctx->blob));
} else {
read_src(ctx, &deref->parent, &deref->instr);
read_src(ctx, &deref->arr.index, &deref->instr);
read_src(ctx, &deref->parent);
read_src(ctx, &deref->arr.index);
}
deref->arr.in_bounds = header.deref.in_bounds;
@ -1143,7 +1143,7 @@ read_deref(read_ctx *ctx, union packed_instr header)
break;
case nir_deref_type_cast:
read_src(ctx, &deref->parent, &deref->instr);
read_src(ctx, &deref->parent);
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);
@ -1156,7 +1156,7 @@ read_deref(read_ctx *ctx, union packed_instr header)
break;
case nir_deref_type_array_wildcard:
read_src(ctx, &deref->parent, &deref->instr);
read_src(ctx, &deref->parent);
parent = nir_src_as_deref(deref->parent);
deref->type = glsl_get_array_element(parent->type);
break;
@ -1256,7 +1256,7 @@ read_intrinsic(read_ctx *ctx, union packed_instr header)
read_dest(ctx, &intrin->dest, &intrin->instr, header);
for (unsigned i = 0; i < num_srcs; i++)
read_src(ctx, &intrin->src[i], &intrin->instr);
read_src(ctx, &intrin->src[i]);
/* Vectorized instrinsics have num_components same as dst or src that has
* 0 components in the info. Find it.
@ -1579,7 +1579,7 @@ read_tex(read_ctx *ctx, union packed_instr header)
tex->array_is_lowered_cube = packed.u.array_is_lowered_cube;
for (unsigned i = 0; i < tex->num_srcs; i++) {
union packed_src src = read_src(ctx, &tex->src[i].src, &tex->instr);
union packed_src src = read_src(ctx, &tex->src[i].src);
tex->src[i].src_type = src.tex.src_type;
}
@ -1725,7 +1725,7 @@ read_call(read_ctx *ctx)
nir_call_instr *call = nir_call_instr_create(ctx->nir, callee);
for (unsigned i = 0; i < call->num_params; i++)
read_src(ctx, &call->params[i], call);
read_src(ctx, &call->params[i]);
return call;
}
@ -1878,7 +1878,7 @@ read_if(read_ctx *ctx, struct exec_list *cf_list)
{
nir_if *nif = nir_if_create(ctx->nir);
read_src(ctx, &nif->condition, nif);
read_src(ctx, &nif->condition);
nif->control = blob_read_uint8(ctx->blob);
nir_cf_node_insert_end(cf_list, &nif->cf_node);