[Mesa-dev] [PATCH 2/2] i965/vec4_nir: Load constants as integers

Jason Ekstrand jason at jlekstrand.net
Fri Aug 14 07:50:47 PDT 2015


I don't think this applies on top of the patch Matt sent yesterday to use
fewer moves for loading constants.
On Aug 14, 2015 4:56 AM, "Antia Puentes" <apuentes at igalia.com> wrote:
>
> Loads constants using integer as their register type, this is done
> for consistency with the FS backend.
> ---
>  src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
> index 923e2d3..e4ae899 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
> @@ -456,7 +456,7 @@ void
>  vec4_visitor::nir_emit_load_const(nir_load_const_instr *instr)
>  {
>     dst_reg reg = dst_reg(GRF, alloc.allocate(1));
> -   reg.type =  BRW_REGISTER_TYPE_F;
> +   reg.type =  BRW_REGISTER_TYPE_D;
>
>     /* @FIXME: consider emitting vector operations to save some MOVs in
>      * cases where the components are representable in 8 bits.
> @@ -464,7 +464,7 @@
vec4_visitor::nir_emit_load_const(nir_load_const_instr *instr)
>      */
>     for (unsigned i = 0; i < instr->def.num_components; ++i) {
>        reg.writemask = 1 << i;
> -      emit(MOV(reg, src_reg(instr->value.f[i])));
> +      emit(MOV(reg, src_reg(instr->value.i[i])));
>     }
>
>     /* Set final writemask */
> --
> 2.1.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150814/ea3ae01f/attachment-0001.html>


More information about the mesa-dev mailing list