diff options
Diffstat (limited to 'src/gallium/drivers/vc4')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_program.c | 16 | ||||
-rw-r--r-- | src/gallium/drivers/vc4/vc4_qir.c | 5 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 01d4badd40d..12584e10526 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -28,6 +28,7 @@ #include "util/u_hash_table.h" #include "util/u_hash.h" #include "util/u_memory.h" +#include "util/ralloc.h" #include "tgsi/tgsi_dump.h" #include "tgsi/tgsi_info.h" @@ -1312,14 +1313,14 @@ vc4_shader_tgsi_to_qir(struct vc4_compiled_shader *shader, enum qstage stage, c->stage = stage; /* XXX sizing */ - c->temps = calloc(sizeof(struct qreg), 1024); - c->inputs = calloc(sizeof(struct qreg), 8 * 4); - c->outputs = calloc(sizeof(struct qreg), 1024); - c->uniforms = calloc(sizeof(struct qreg), 1024); - c->consts = calloc(sizeof(struct qreg), 1024); + c->temps = ralloc_array(c, struct qreg, 1024); + c->inputs = ralloc_array(c, struct qreg, 8 * 4); + c->outputs = ralloc_array(c, struct qreg, 1024); + c->uniforms = ralloc_array(c, struct qreg, 1024); + c->consts = ralloc_array(c, struct qreg, 1024); - c->uniform_data = calloc(sizeof(uint32_t), 1024); - c->uniform_contents = calloc(sizeof(enum quniform_contents), 1024); + c->uniform_data = ralloc_array(c, uint32_t, 1024); + c->uniform_contents = ralloc_array(c, enum quniform_contents, 1024); c->shader_state = key->shader_state; ret = tgsi_parse_init(&c->parser, c->shader_state->tokens); @@ -1383,7 +1384,6 @@ vc4_shader_tgsi_to_qir(struct vc4_compiled_shader *shader, enum qstage stage, } tgsi_parse_free(&c->parser); - free(c->temps); qir_optimize(c); diff --git a/src/gallium/drivers/vc4/vc4_qir.c b/src/gallium/drivers/vc4/vc4_qir.c index ef8a4e54d24..60455d50f86 100644 --- a/src/gallium/drivers/vc4/vc4_qir.c +++ b/src/gallium/drivers/vc4/vc4_qir.c @@ -23,6 +23,7 @@ #include "util/u_memory.h" #include "util/u_simple_list.h" +#include "util/ralloc.h" #include "vc4_qir.h" #include "vc4_qpu.h" @@ -274,7 +275,7 @@ qir_reg_equals(struct qreg a, struct qreg b) struct vc4_compile * qir_compile_init(void) { - struct vc4_compile *c = CALLOC_STRUCT(vc4_compile); + struct vc4_compile *c = rzalloc(NULL, struct vc4_compile); make_empty_list(&c->instructions); @@ -284,7 +285,7 @@ qir_compile_init(void) void qir_compile_destroy(struct vc4_compile *c) { - free(c); + ralloc_free(c); } const char * |