diff options
author | Francisco Jerez <currojerez@riseup.net> | 2015-02-10 15:51:34 +0200 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2015-02-10 16:05:47 +0200 |
commit | 447879eb88b8df41ad32cf4406cc636b112b72d9 (patch) | |
tree | aae099dc2bcae6ab1dbde824e6b4d0a401b4ea17 /src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp | |
parent | e6146e6f14d5e2f9080ce033814fb1d14a175e70 (diff) | |
download | external_mesa3d-447879eb88b8df41ad32cf4406cc636b112b72d9.zip external_mesa3d-447879eb88b8df41ad32cf4406cc636b112b72d9.tar.gz external_mesa3d-447879eb88b8df41ad32cf4406cc636b112b72d9.tar.bz2 |
i965: Factor out virtual GRF allocation to a separate object.
Right now virtual GRF book-keeping and allocation is performed in each
visitor class separately (among other hundred different things),
leading to duplicated logic in each visitor and preventing layering as
it forces any code that manipulates i965 IR and needs to allocate
virtual registers to depend on the specific visitor that happens to be
used to translate from GLSL IR.
v2: Use realloc()/free() to allocate VGRF book-keeping arrays (Connor).
Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp index 62788cd..09f0fad 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp @@ -66,7 +66,7 @@ is_nop_mov(const fs_inst *inst) static bool is_copy_payload(const fs_visitor *v, const fs_inst *inst) { - if (v->virtual_grf_sizes[inst->src[0].reg] != inst->regs_written) + if (v->alloc.sizes[inst->src[0].reg] != inst->regs_written) return false; fs_reg reg = inst->src[0]; @@ -94,8 +94,8 @@ is_coalesce_candidate(const fs_visitor *v, const fs_inst *inst) return false; } - if (v->virtual_grf_sizes[inst->src[0].reg] > - v->virtual_grf_sizes[inst->dst.reg]) + if (v->alloc.sizes[inst->src[0].reg] > + v->alloc.sizes[inst->dst.reg]) return false; if (inst->opcode == SHADER_OPCODE_LOAD_PAYLOAD) { @@ -179,7 +179,7 @@ fs_visitor::register_coalesce() if (reg_from != inst->src[0].reg) { reg_from = inst->src[0].reg; - src_size = virtual_grf_sizes[inst->src[0].reg]; + src_size = alloc.sizes[inst->src[0].reg]; assert(src_size <= MAX_VGRF_SIZE); assert(inst->src[0].width % 8 == 0); |