[Mesa-dev] [PATCH v2 08/19] i965/fs: Move offset(fs_reg, unsigned) to brw_fs.h

Iago Toral itoral at igalia.com
Thu Jun 25 23:23:42 PDT 2015


Reviewed-by: Iago Toral Quiroga <itoral at igali.com>

On Thu, 2015-06-25 at 13:24 -0700, Jason Ekstrand wrote:
> Shortly, offset() will depend on the builder so we need it moved to some
> place where it has access to that.
> ---
>  src/mesa/drivers/dri/i965/brw_fs.h    | 21 +++++++++++++++++++++
>  src/mesa/drivers/dri/i965/brw_ir_fs.h | 21 ---------------------
>  2 files changed, 21 insertions(+), 21 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
> index 243baf6..c1819cc 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.h
> +++ b/src/mesa/drivers/dri/i965/brw_fs.h
> @@ -62,6 +62,27 @@ namespace brw {
>     class fs_live_variables;
>  }
>  
> +static inline fs_reg
> +offset(fs_reg reg, unsigned delta)
> +{
> +   switch (reg.file) {
> +   case BAD_FILE:
> +      break;
> +   case GRF:
> +   case MRF:
> +   case ATTR:
> +      return byte_offset(reg,
> +                         delta * MAX2(reg.width * reg.stride, 1) *
> +                         type_sz(reg.type));
> +   case UNIFORM:
> +      reg.reg_offset += delta;
> +      break;
> +   default:
> +      assert(delta == 0);
> +   }
> +   return reg;
> +}
> +
>  /**
>   * The fragment shader front-end.
>   *
> diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h
> index 96dc20d..16b20be 100644
> --- a/src/mesa/drivers/dri/i965/brw_ir_fs.h
> +++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h
> @@ -129,27 +129,6 @@ horiz_offset(fs_reg reg, unsigned delta)
>  }
>  
>  static inline fs_reg
> -offset(fs_reg reg, unsigned delta)
> -{
> -   switch (reg.file) {
> -   case BAD_FILE:
> -      break;
> -   case GRF:
> -   case MRF:
> -   case ATTR:
> -      return byte_offset(reg,
> -                         delta * MAX2(reg.width * reg.stride, 1) *
> -                         type_sz(reg.type));
> -   case UNIFORM:
> -      reg.reg_offset += delta;
> -      break;
> -   default:
> -      assert(delta == 0);
> -   }
> -   return reg;
> -}
> -
> -static inline fs_reg
>  component(fs_reg reg, unsigned idx)
>  {
>     assert(reg.subreg_offset == 0);




More information about the mesa-dev mailing list