i965: Disable guardband clipping in the smaller-than-viewport case.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 26 Aug 2014 23:39:55 +0000 (16:39 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 10 Sep 2014 18:40:30 +0000 (11:40 -0700)
commit0bac2551e40410e2251daf4fd9faf69310ab34ce
treeb2fd33b14e7a3d9e1a37032b2c226f7b3663fb50
parent927f5db46135b3eb63f401833b1e40a3be9ca4e0
i965: Disable guardband clipping in the smaller-than-viewport case.

Apparently guardband clipping doesn't work like we thought: objects
entirely outside fthe guardband are trivially rejected, regardless of
their relation to the viewport.  Normally, the guardband is larger than
the viewport, so this is not a problem.  However, when the viewport is
larger than the guardband, this means that we would discard primitives
which were wholly outside of the guardband, but still visible.

We always program the guardband to 8K x 8K to enforce the restriction
that the screenspace bounding box of a single triangle must be no more
than 8K x 8K.  So, if the viewport is larger than that, we need to
disable guardband clipping.

Fixes ES3 conformance tests:
- framebuffer_blit_functionality_negative_height_blit
- framebuffer_blit_functionality_negative_width_blit
- framebuffer_blit_functionality_negative_dimensions_blit
- framebuffer_blit_functionality_magnifying_blit
- framebuffer_blit_functionality_multisampled_to_singlesampled_blit

v2: Mention the acronym expansion for TA/TR/MC in the comments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/gen6_clip_state.c