[Mesa-dev] [PATCH] i965/nir/fs: removed unneeded support for global variables
Alejandro Piñeiro
apinheiro at igalia.com
Thu Jul 16 02:44:11 PDT 2015
Ping. Any possibility of a patch review? FWIW, the patch itself is
pretty small.
On 26/06/15 13:47, Alejandro Piñeiro wrote:
> As functions are inlined, and nir_lower_global_vars_to_local gets
> run, all global variables are lowered to local variables.
> ---
>
> Jason Enkstrand already confirmed that global support is not needed
> on the bug open for the nir/vec4 support:
> https://bugs.freedesktop.org/show_bug.cgi?id=89580#c9
>
> So this patch just apply that answer to the fs path.
>
> Full piglit run. No regressions.
>
> src/mesa/drivers/dri/i965/brw_fs.h | 1 -
> src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 14 ++------------
> src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 1 -
> 3 files changed, 2 insertions(+), 14 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
> index 243baf6..c49d0f8 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.h
> +++ b/src/mesa/drivers/dri/i965/brw_fs.h
> @@ -345,7 +345,6 @@ public:
> unsigned max_grf;
>
> fs_reg *nir_locals;
> - 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 59081ea..a648a5a 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);
> @@ -1151,10 +1143,8 @@ 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];
> +
> + reg = v->nir_locals[nir_reg->index];
>
> reg = offset(reg, 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 9a4bad6..90d5706 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> @@ -2012,7 +2012,6 @@ fs_visitor::fs_visitor(const struct brw_compiler *compiler, void *log_data,
> this->no16_msg = NULL;
>
> this->nir_locals = NULL;
> - this->nir_globals = NULL;
>
> memset(&this->payload, 0, sizeof(this->payload));
> memset(this->outputs, 0, sizeof(this->outputs));
--
Alejandro Piñeiro (apinheiro at igalia.com)
More information about the mesa-dev
mailing list