diff options
author | Rob Clark <[email protected]> | 2015-03-11 12:36:26 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2015-03-15 13:26:44 -0400 |
commit | 7208e96bb810a7a6c92fd11bb7f4df8c9b7f1a2d (patch) | |
tree | d6cce4fe6e01f732c044fd932f1d0b198dfff7a8 /src/gallium/drivers/freedreno/ir3/ir3.c | |
parent | db095eb43bd02414e71f93e72ff61b463bef0ece (diff) |
freedreno/ir3: bit of cleanup
Add an array_insert() macro to simplify inserting into dynamically sized
arrays, add a comment, and remove unused prototype inherited from the
original freedreno.git/fdre-a3xx test code, etc.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3/ir3.c')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3.c b/src/gallium/drivers/freedreno/ir3/ir3.c index 01cdd8ad57a..25d7c7af065 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3.c +++ b/src/gallium/drivers/freedreno/ir3/ir3.c @@ -588,21 +588,10 @@ static void insert_instr(struct ir3 *shader, static uint32_t serialno = 0; instr->serialno = ++serialno; #endif - if (shader->instrs_count == shader->instrs_sz) { - shader->instrs_sz = MAX2(2 * shader->instrs_sz, 16); - shader->instrs = realloc(shader->instrs, - shader->instrs_sz * sizeof(shader->instrs[0])); - } - shader->instrs[shader->instrs_count++] = instr; + array_insert(shader->instrs, instr); - if (is_input(instr)) { - if (shader->baryfs_count == shader->baryfs_sz) { - shader->baryfs_sz = MAX2(2 * shader->baryfs_sz, 16); - shader->baryfs = realloc(shader->baryfs, - shader->baryfs_sz * sizeof(shader->baryfs[0])); - } - shader->baryfs[shader->baryfs_count++] = instr; - } + if (is_input(instr)) + array_insert(shader->baryfs, instr); } struct ir3_block * ir3_block_create(struct ir3 *shader, |