[Mesa-dev] [PATCH 27/59] i965/fs: add a stride helper

Pohjolainen, Topi topi.pohjolainen at intel.com
Mon May 2 07:30:01 UTC 2016


On Fri, Apr 29, 2016 at 01:29:24PM +0200, Samuel Iglesias Gons?lvez wrote:
> From: Connor Abbott <connor.w.abbott at intel.com>
> 
> Similar to retype() and offset().
> ---
>  src/mesa/drivers/dri/i965/brw_ir_fs.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h
> index e4f20f4..abda2c3 100644
> --- a/src/mesa/drivers/dri/i965/brw_ir_fs.h
> +++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h
> @@ -78,6 +78,14 @@ retype(fs_reg reg, enum brw_reg_type type)
>  }
>  
>  static inline fs_reg
> +stride(fs_reg reg, unsigned stride)
> +{
> +   if (reg.stride != 0)
> +      reg.stride = stride;

Do we have cases where we should silently ignore the given stride? Stride
zero is reserved for uniforms and immediates, right? Or should we have:

      /* Cannot change stride for uniforms or immediates (stride zero). */
      assert(reg.stride);
      reg.stride = stride;

> +   return reg;
> +}
> +
> +static inline fs_reg
>  byte_offset(fs_reg reg, unsigned delta)
>  {
>     switch (reg.file) {
> -- 
> 2.5.0
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list