[Mesa-dev] [PATCH 2/4] i965: Drop has_pln checks in unlit centroid workaround.

Kenneth Graunke kenneth at whitecape.org
Mon Jul 18 01:27:15 UTC 2016


On Sunday, July 17, 2016 9:17:12 AM PDT Timothy Arceri wrote:
> On Sun, 2016-07-17 at 09:14 +1000, Timothy Arceri wrote:
> > On Fri, 2016-07-15 at 23:43 -0700, Kenneth Graunke wrote:
> > > The unlit centroid workaround starts being necessary on Gen6, which
> > > is the first platform with multisampling.  PLN exists on G45+, so
> > > all
> > > platforms which need this workaround have PLN.
> > > 
> > > Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> > > ---
> > >  src/mesa/drivers/dri/i965/brw_fs.cpp | 7 ++-----
> > >  1 file changed, 2 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp
> > > b/src/mesa/drivers/dri/i965/brw_fs.cpp
> > > index 446cf3a..940f425 100644
> > > --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> > > +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> > > @@ -1185,16 +1185,13 @@
> > > fs_visitor::emit_general_interpolation(fs_reg
> > > *attr, const char *name,
> > >                                 delta_xy[centroid_to_pixel(bary)],
> > > interp);
> > >                 inst->predicate = BRW_PREDICATE_NORMAL;
> > >                 inst->predicate_inverse = true;
> > > -               if (devinfo->has_pln)
> > > -                  inst->no_dd_clear = true;
> > > +               inst->no_dd_clear = true;
> > >  
> > >                 inst = bld.emit(FS_OPCODE_LINTERP, *attr,
> > >                                 delta_xy[bary], interp);
> > >                 inst->predicate = BRW_PREDICATE_NORMAL;
> > >                 inst->predicate_inverse = false;
> > > -               if (devinfo->has_pln)
> > > -                  inst->no_dd_check = true;
> > > -
> > > +               inst->no_dd_check = true;
> > >              } else {
> > >                 bld.emit(FS_OPCODE_LINTERP, *attr, delta_xy[bary],
> > > interp);
> > >              }
> > 
> > There is code just below this:
> > 
> >    if (devinfo->gen < 6 && interpolation_mode ==
> > INTERP_QUALIFIER_SMOOTH) {
> >        bld.MUL(*attr, *attr, this->pixel_w);
> >    }
> > 
> > Which I think you could change to:
> > 
> >     else {
> >        bld.emit(FS_OPCODE_LINTERP, *attr, delta_xy[bary], interp);
> >           if (interpolation_mode == INTERP_QUALIFIER_SMOOTH) {
> >          
> >    bld.MUL(*attr, *attr, this->pixel_w);
> >           }
> >     }
> > 
> > With or without that change:
> 
> Ignore that we only apply the fix to some gen6+ and it could have been
> a source of bugs if it had changed later. Sorry still waking up :P 

Right, the unlit centroid workaround stops being applied at some point
(looks like Haswell).  I'll leave it as is, then.  (I've got several
more patches coming that shuffle this around more anyway...)

Thanks for reviewing!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160717/9f81847d/attachment.sig>


More information about the mesa-dev mailing list