[Mesa-dev] [PATCH 14/17] i965/fs_builder: Use dispatch_width instead of reg.width for offset and half

Pohjolainen, Topi topi.pohjolainen at intel.com
Tue Jun 23 02:03:48 PDT 2015


On Thu, Jun 18, 2015 at 05:51:43PM -0700, Jason Ekstrand wrote:
> ---
>  src/mesa/drivers/dri/i965/brw_fs_builder.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_builder.h b/src/mesa/drivers/dri/i965/brw_fs_builder.h
> index 7d3c8ab..58519d7 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_builder.h
> +++ b/src/mesa/drivers/dri/i965/brw_fs_builder.h
> @@ -161,7 +161,7 @@ namespace brw {
>           case MRF:
>           case ATTR:

How would you feel about an assertion here:

            assert(reg.stride);

>              return byte_offset(reg,
> -                               delta * MAX2(reg.width * reg.stride, 1) *
> +                               delta * dispatch_width() * reg.stride *
>                                 type_sz(reg.type));
>           case UNIFORM:
>              reg.reg_offset += delta;
> @@ -185,9 +185,9 @@ namespace brw {
>  
>           case GRF:
>           case MRF:
> -            assert(reg.width == 16);
> -            reg.width = 8;
> -            return horiz_offset(reg, 8 * idx);
> +            assert(dispatch_width() == 16);
> +            reg.width = dispatch_width() / 2;
> +            return horiz_offset(reg, (dispatch_width() / 2) * idx);
>  
>           case ATTR:
>           case HW_REG:
> -- 
> 2.4.3
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list