i965: Disable the GB clip test when a limited viewport is set.
authorEric Anholt <eric@anholt.net>
Thu, 15 Nov 2012 20:00:33 +0000 (12:00 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 20 Nov 2012 06:33:44 +0000 (22:33 -0800)
commitd411bbd5bd895617e265e023213895100e4509ef
tree4e6424919f7625fbcd99b0fbd35c9cd858094ca4
parent23e7b81f2d742d292d77b53ac9cf72c3d89fc798
i965: Disable the GB clip test when a limited viewport is set.

The theory of the guardband is that you extend the clip volume to avoid
expensive clipping computation, and just let fragments outside the viewport
get clipped by the drawable's bounds.  But if a smaller-than-window-size
viewport is set, and we don't also happen to have a scissor set, then
rendering could incorrectly extend outside of the viewport when it should have
been clipped to the viewport.

Fixes the new piglit triangle-guardband-viewport test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 9.0 branch.
src/mesa/drivers/dri/i965/gen6_clip_state.c
src/mesa/drivers/dri/i965/gen7_clip_state.c