Mesa (master): i965: Move multiply by 4 for VS ATTR setup into the scalar backend.

Jason Ekstrand jekstrand at kemper.freedesktop.org
Tue May 9 22:08:23 UTC 2017


Module: Mesa
Branch: master
Commit: 5e832302dcd10ab2d7f50b2f991129d8969273cb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5e832302dcd10ab2d7f50b2f991129d8969273cb

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Wed May  3 16:56:15 2017 -0700

i965: Move multiply by 4 for VS ATTR setup into the scalar backend.

The vec4 backend will want to count in units of vec4s, not scalar
components.  The simplest solution is to move the multiplication by 4
into the scalar backend.  This also improves consistency with how we
count varyings.

Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/intel/compiler/brw_fs_nir.cpp | 2 +-
 src/intel/compiler/brw_nir.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp
index 2ea94ab693..d90eaad32b 100644
--- a/src/intel/compiler/brw_fs_nir.cpp
+++ b/src/intel/compiler/brw_fs_nir.cpp
@@ -2251,7 +2251,7 @@ fs_visitor::nir_emit_vs_intrinsic(const fs_builder &bld,
    }
 
    case nir_intrinsic_load_input: {
-      fs_reg src = fs_reg(ATTR, instr->const_index[0], dest.type);
+      fs_reg src = fs_reg(ATTR, nir_intrinsic_base(instr) * 4, dest.type);
       unsigned first_component = nir_intrinsic_component(instr);
       unsigned num_components = instr->num_components;
       enum brw_reg_type type = dest.type;
diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c
index f5b6612117..2c44d8f182 100644
--- a/src/intel/compiler/brw_nir.c
+++ b/src/intel/compiler/brw_nir.c
@@ -279,7 +279,7 @@ brw_nir_lower_vs_inputs(nir_shader *nir,
                int attr = nir_intrinsic_base(intrin);
                int slot = _mesa_bitcount_64(nir->info.inputs_read &
                                             BITFIELD64_MASK(attr));
-               nir_intrinsic_set_base(intrin, 4 * slot);
+               nir_intrinsic_set_base(intrin, slot);
             }
          }
       }




More information about the mesa-commit mailing list