From 8ba1982b1e37aa69680e243fe391254211ae273a Mon Sep 17 00:00:00 2001 From: Alejandro PiƱeiro Date: Fri, 17 Jul 2015 11:54:34 +0200 Subject: i965/nir/fs: removed unneeded support for global variables As functions are inlined, and nir_lower_global_vars_to_local gets run, all global variables are lowered to local variables. Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_fs.h | 1 - src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 16 ++++------------ src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 1 - 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index c00566667e0..283ee361d17 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -371,7 +371,6 @@ public: fs_reg *nir_locals; fs_reg *nir_ssa_values; - fs_reg *nir_globals; fs_reg nir_inputs; fs_reg nir_outputs; fs_reg *nir_system_values; diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 3099dc447ec..12cd4530c37 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -55,14 +55,6 @@ fs_visitor::emit_nir_code() nir_emit_system_values(nir); - nir_globals = ralloc_array(mem_ctx, fs_reg, nir->reg_alloc); - foreach_list_typed(nir_register, reg, node, &nir->registers) { - unsigned array_elems = - reg->num_array_elems == 0 ? 1 : reg->num_array_elems; - unsigned size = array_elems * reg->num_components; - nir_globals[reg->index] = bld.vgrf(BRW_REGISTER_TYPE_F, size); - } - /* get the main function and emit it */ nir_foreach_overload(nir, overload) { assert(strcmp(overload->function->name, "main") == 0); @@ -1159,10 +1151,10 @@ fs_reg_for_nir_reg(fs_visitor *v, nir_register *nir_reg, unsigned base_offset, nir_src *indirect) { fs_reg reg; - if (nir_reg->is_global) - reg = v->nir_globals[nir_reg->index]; - else - reg = v->nir_locals[nir_reg->index]; + + assert(!nir_reg->is_global); + + reg = v->nir_locals[nir_reg->index]; reg = offset(reg, v->bld, base_offset * nir_reg->num_components); if (indirect) { diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index d6a60a7cff7..47dc9254664 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -2029,7 +2029,6 @@ fs_visitor::fs_visitor(const struct brw_compiler *compiler, void *log_data, this->nir_locals = NULL; this->nir_ssa_values = NULL; - this->nir_globals = NULL; memset(&this->payload, 0, sizeof(this->payload)); memset(this->outputs, 0, sizeof(this->outputs)); -- cgit v1.2.3