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_live_variables.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_live_variables.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp index 189a119..968219b 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp @@ -278,17 +278,17 @@ fs_live_variables::fs_live_variables(fs_visitor *v, const cfg_t *cfg) { mem_ctx = ralloc_context(NULL); - num_vgrfs = v->virtual_grf_count; + num_vgrfs = v->alloc.count; num_vars = 0; var_from_vgrf = rzalloc_array(mem_ctx, int, num_vgrfs); for (int i = 0; i < num_vgrfs; i++) { var_from_vgrf[i] = num_vars; - num_vars += v->virtual_grf_sizes[i]; + num_vars += v->alloc.sizes[i]; } vgrf_from_var = rzalloc_array(mem_ctx, int, num_vars); for (int i = 0; i < num_vgrfs; i++) { - for (int j = 0; j < v->virtual_grf_sizes[i]; j++) { + for (unsigned j = 0; j < v->alloc.sizes[i]; j++) { vgrf_from_var[var_from_vgrf[i] + j] = i; } } @@ -344,7 +344,7 @@ fs_visitor::calculate_live_intervals() if (this->live_intervals) return; - int num_vgrfs = this->virtual_grf_count; + int num_vgrfs = this->alloc.count; ralloc_free(this->virtual_grf_start); ralloc_free(this->virtual_grf_end); virtual_grf_start = ralloc_array(mem_ctx, int, num_vgrfs); |