[Mesa-dev] [PATCH 25/95] i965/vec4: fix base offset for nir_registers with doubles

Francisco Jerez currojerez at riseup.net
Wed Aug 3 01:40:51 UTC 2016


Iago Toral Quiroga <itoral at igalia.com> writes:

> ---
>  src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
> index cf35f2e..fde7b60 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
> @@ -280,7 +280,8 @@ vec4_visitor::get_nir_dest(const nir_dest &dest)
>        nir_ssa_values[dest.ssa.index] = dst;
>        return dst;
>     } else {
> -      return dst_reg_for_nir_reg(this, dest.reg.reg, dest.reg.base_offset,
> +      unsigned base_offset = dest.reg.base_offset * dest.reg.reg->bit_size / 32;
> +      return dst_reg_for_nir_reg(this, dest.reg.reg, base_offset,
>                                   dest.reg.indirect);
>     }
>  }
> @@ -308,8 +309,9 @@ vec4_visitor::get_nir_src(const nir_src &src, enum brw_reg_type type,
>        reg = nir_ssa_values[src.ssa->index];
>     }
>     else {
> -     reg = dst_reg_for_nir_reg(this, src.reg.reg, src.reg.base_offset,
> -                               src.reg.indirect);
> +      unsigned base_offset = src.reg.base_offset * src.reg.reg->bit_size / 32;
> +      reg = dst_reg_for_nir_reg(this, src.reg.reg, base_offset,
> +                                src.reg.indirect);

I think this wouldn't have been necessary if you had fixed the offset()
helper to take into account the register type (as it does in the FS
back-end)?

>     }
>  
>     reg = retype(reg, type);
> -- 
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160802/fe70dad5/attachment-0001.sig>


More information about the mesa-dev mailing list