[Mesa-dev] [PATCH 27/59] i965/fs: add a stride helper
Iago Toral
itoral at igalia.com
Mon May 2 14:02:12 UTC 2016
On Mon, 2016-05-02 at 10:30 +0300, Pohjolainen, Topi wrote:
> 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:
If the register is a uniform the stride operation is a no-op and we
should just ignore it. I am not sure right now if we can end up here
with a uniform/immediate but I think that might be possible for example
when copy-propagating from a uniform register, and in that case, this
does exactly what we want it to do.
> /* 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
> _______________________________________________
> 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