summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-01-21 03:54:46 -0800
committerEmil Velikov <[email protected]>2017-02-10 11:13:48 +0000
commit05abd64caef4b90ae2f70a2e8d35c2dd80cd035d (patch)
tree880a9a12bf47bded91cb779c474530e267841fae /src/mesa/drivers
parent09468226b4e689ee6ba03534cda4875958f9d8d3 (diff)
Revert "i965: Disable guardband clipping in the smaller-than-viewport case."
This reverts commit 0bac2551e40410e2251daf4fd9faf69310ab34ce. Now that we position the guardband correctly (applying translations in addition to scaling) and made it as large (or larger) than the render target, this shouldn't be necessary. Now we leave guardband clipping enabled 100% of the time, like the Windows driver does. Fixes GL45-CTS.gtf21.GL2FixedTests.clip.clip. It tries to draw a 16384x64 rectangle, and it appears that some kind of numerical imprecisions in the clipper result in some edge pixels going missing. The Windows driver passes this test because of guardband clipping. Cc: "17.0" <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> (cherry picked from commit ce8a63de6dffd4a7bc704b63bdd48a63798a438e)
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_clip_state.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_clip_state.c b/src/mesa/drivers/dri/i965/gen6_clip_state.c
index 8e893f5668f..1c8c23730be 100644
--- a/src/mesa/drivers/dri/i965/gen6_clip_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_clip_state.c
@@ -172,37 +172,6 @@ upload_clip_state(struct brw_context *brw)
/* BRW_NEW_VIEWPORT_COUNT */
const unsigned viewport_count = brw->clip.viewport_count;
- /* We need to disable guardband clipping if the guardband (which we always
- * program to the maximum screen-space bounding box of 8K x 8K) will be
- * smaller than the viewport.
- *
- * Closely examining the clip determination formulas in the documentation
- * reveals that objects will be discarded entirely if they're outside the
- * (small) guardband, even if they're within the (large) viewport:
- *
- * TR = TR_GB || TR_VPXY || TR_VPZ || TR_UC || TR_NEGW
- * TA = !TR && TA_GB && TA_VPZ && TA_NEGW
- * MC = !(TA || TR)
- *
- * (TA is "Trivial Accept", TR is "Trivial Reject", MC is "Must Clip".)
- *
- * Disabling guardband clipping removes the TR_GB condition, which means
- * they'll be considered MC ("Must Clip") unless they're rejected for
- * some other reason.
- *
- * Note that there is no TA_VPXY condition. If there were, objects entirely
- * inside a 16384x16384 viewport would be trivially accepted, breaking the
- * "objects must have a screenspace bounding box not exceeding 8K in the X
- * or Y direction" restriction. Instead, they're clipped.
- */
- for (unsigned i = 0; i < viewport_count; i++) {
- if (ctx->ViewportArray[i].Width > 8192 ||
- ctx->ViewportArray[i].Height > 8192) {
- dw2 &= ~GEN6_CLIP_GB_TEST;
- break;
- }
- }
-
/* BRW_NEW_RASTERIZER_DISCARD */
if (ctx->RasterDiscard) {
dw2 |= GEN6_CLIP_MODE_REJECT_ALL;