[Mesa-dev] [PATCH 2/4] i965: Use a better guardband calculation.

Kenneth Graunke kenneth at whitecape.org
Thu Jan 26 09:25:37 UTC 2017


On Monday, January 23, 2017 9:13:38 AM PST Jason Ekstrand wrote:
> On Mon, Jan 23, 2017 at 4:59 AM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> 
> > On Mon, Jan 23, 2017 at 1:42 AM, Kenneth Graunke <kenneth at whitecape.org>
> > wrote:
> > > +      *ymin = MIN2(ndc_gb_ymin, ndc_gb_ymax);
> >
> > Should this be limited on the negative end of the range?
> >
> > > +      *ymax = MIN2(MAX2(ndc_gb_ymin, ndc_gb_ymax), 16383);
> >
> > And should this be a different value for gen6? Perhaps based on gb_size?
> >
> 
> I don't think so.  It's a limit on some hardware for unknown reasons.  That
> said, Ken, it would be really nice to get an actual PRM citation because I
> can't find it anywhere.

I'm going to drop this bonus clamp.  It's attempting to implement a
workaround (WaGuardbandSize) which is only documented in the BSpec
(I believe it was added after the PRMs were published).   I believe
it was trying to fix some Windows test, but it wasn't terribly clear
what the issue was.  The documentation doesn't indicate whether it
should be done in screen space or NDC space.

I believe the Windows driver attempts to do it in screen space, but
actually ends up clamping things to [-16385, 16385] because of what
looks like an off-by-one bug...so it doesn't match the documentation
either.  Plus, their viewport transform code is a bit different than
Jason's - it just applies the transform, but doesn't consider the
framebuffer.  It might be that Jason's transform is enough to fix
the issue.  Unclear.

More importantly, implementing the clamping in screenspace like I
intended to do (but botched) causes GL45-CTS.gtf21.GL2FixedTests.clip.clip
to remain broken, and fixing that was kind of the point of all this.

I'll send a v2 of this patch.

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170126/3a79ab62/attachment.sig>


More information about the mesa-dev mailing list