summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3.c10
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3.h4
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c8
3 files changed, 8 insertions, 14 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3.c b/src/gallium/drivers/freedreno/ir3/ir3.c
index 7c925ee7cb0..c5a030282d8 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3.c
@@ -63,12 +63,6 @@ struct ir3 * ir3_create(struct ir3_compiler *compiler,
void ir3_destroy(struct ir3 *shader)
{
- /* TODO convert the dynamic array to ralloc too: */
- free(shader->indirects);
- free(shader->predicates);
- free(shader->baryfs);
- free(shader->keeps);
- free(shader->astc_srgb);
ralloc_free(shader);
}
@@ -626,7 +620,7 @@ static void insert_instr(struct ir3_block *block,
list_addtail(&instr->node, &block->instr_list);
if (is_input(instr))
- array_insert(shader->baryfs, instr);
+ array_insert(shader, shader->baryfs, instr);
}
struct ir3_block * ir3_block_create(struct ir3 *shader)
@@ -729,7 +723,7 @@ ir3_instr_set_address(struct ir3_instruction *instr,
if (instr->address != addr) {
struct ir3 *ir = instr->block->shader;
instr->address = addr;
- array_insert(ir->indirects, instr);
+ array_insert(ir, ir->indirects, instr);
}
}
diff --git a/src/gallium/drivers/freedreno/ir3/ir3.h b/src/gallium/drivers/freedreno/ir3/ir3.h
index e0d0eeebc81..c205c8fac48 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3.h
+++ b/src/gallium/drivers/freedreno/ir3/ir3.h
@@ -854,10 +854,10 @@ static inline unsigned ir3_cat3_absneg(opc_t opc)
}
}
-#define array_insert(arr, val) do { \
+#define array_insert(ctx, arr, val) do { \
if (arr ## _count == arr ## _sz) { \
arr ## _sz = MAX2(2 * arr ## _sz, 16); \
- arr = realloc(arr, arr ## _sz * sizeof(arr[0])); \
+ arr = reralloc_size(ctx, arr, arr ## _sz * sizeof(arr[0])); \
} \
arr[arr ##_count++] = val; \
} while (0)
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
index fd4a1d6ecce..7932a6f18a3 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
@@ -1306,9 +1306,9 @@ emit_intrinsic(struct ir3_compile *ctx, nir_intrinsic_instr *intr)
cond->regs[0]->num = regid(REG_P0, 0);
kill = ir3_KILL(b, cond, 0);
- array_insert(ctx->ir->predicates, kill);
+ array_insert(ctx->ir, ctx->ir->predicates, kill);
- array_insert(ctx->ir->keeps, kill);
+ array_insert(ctx->ir, ctx->ir->keeps, kill);
ctx->so->has_kill = true;
break;
@@ -1583,7 +1583,7 @@ emit_tex(struct ir3_compile *ctx, nir_tex_instr *tex)
sam = ir3_SAM(b, opc, type, TGSI_WRITEMASK_W, flags,
tex_idx, tex_idx, col0, col1);
- array_insert(ctx->ir->astc_srgb, sam);
+ array_insert(ctx->ir, ctx->ir->astc_srgb, sam);
/* fixup .w component: */
split_dest(b, &dst[3], sam, 3, 1);
@@ -1972,7 +1972,7 @@ emit_stream_out(struct ir3_compile *ctx)
stg->cat6.type = TYPE_U32;
stg->cat6.dst_offset = (strmout->output[i].dst_offset + j) * 4;
- array_insert(ctx->ir->keeps, stg);
+ array_insert(ctx->ir, ctx->ir->keeps, stg);
}
}