[Mesa-dev] [PATCH 1/2] i965: Implement guardband clipping on Sandybridge.

Eric Anholt eric at anholt.net
Tue May 8 16:07:05 PDT 2012


On Fri,  4 May 2012 17:06:38 -0700, Kenneth Graunke <kenneth at whitecape.org> wrote:
> -   vp->xmin = -1.0;
> -   vp->xmax = 1.0;
> -   vp->ymin = -1.0;
> -   vp->ymax = 1.0;
> +   /* According to the Sandybridge PRM, Volume 2, Part 1, Section 6.3.8
> +    * "Vertex X,Y Clamping and Quantization", the screen-aligned 2D
> +    * bounding-box of an object must not exceed 16K pixels in either X or Y.
> +    */
> +   const float maximum_post_clamp_delta = 16384;
> +   float gbx = maximum_post_clamp_delta / (float) ctx->Viewport.Width;
> +   float gby = maximum_post_clamp_delta / (float) ctx->Viewport.Height;
> +
> +   vp->xmin = -gbx;
> +   vp->xmax = gbx;
> +   vp->ymin = -gby;
> +   vp->ymax = gby;

Aren't you letting primitives extend from -16384 to 16384 this way?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120508/d404041a/attachment.pgp>


More information about the mesa-dev mailing list