<div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 22, 2017 at 10:42 PM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This reverts commit 0bac2551e40410e2251daf4fd9faf6<wbr>9310ab34ce.<br>
<br>
Now that we position the guardband correctly (applying translations<br>
in addition to scaling) and made it as large (or larger) than the<br>
render target, this shouldn't be necessary.<br>
<br>
Now we leave guardband clipping enabled 100% of the time, like the<br>
Windows driver does.<br>
<br>
Fixes GL45-CTS.gtf21.GL2FixedTests.<wbr>clip.clip.  It tries to draw a<br>
16384x64 rectangle, and it appears that some kind of numerical<br>
imprecisions in the clipper result in some edge pixels going missing.<br>
The Windows driver passes this test because of guardband clipping.<br>
---<br>
 src/mesa/drivers/dri/i965/<wbr>gen6_clip_state.c | 31 -----------------------------<br>
 1 file changed, 31 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>gen6_clip_state.c b/src/mesa/drivers/dri/i965/<wbr>gen6_clip_state.c<br>
index 8e893f5668f..1c8c23730be 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>gen6_clip_state.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>gen6_clip_state.c<br>
@@ -172,37 +172,6 @@ upload_clip_state(struct brw_context *brw)<br>
    /* BRW_NEW_VIEWPORT_COUNT */<br>
    const unsigned viewport_count = brw->clip.viewport_count;<br>
<br>
-   /* We need to disable guardband clipping if the guardband (which we always<br>
-    * program to the maximum screen-space bounding box of 8K x 8K) will be<br>
-    * smaller than the viewport.<br>
-    *<br>
-    * Closely examining the clip determination formulas in the documentation<br>
-    * reveals that objects will be discarded entirely if they're outside the<br>
-    * (small) guardband, even if they're within the (large) viewport:<br>
-    *<br>
-    *     TR = TR_GB || TR_VPXY || TR_VPZ || TR_UC || TR_NEGW<br>
-    *     TA   = !TR && TA_GB && TA_VPZ && TA_NEGW<br>
-    *     MC = !(TA || TR)<br>
-    *<br>
-    * (TA is "Trivial Accept", TR is "Trivial Reject", MC is "Must Clip".)<br>
-    *<br>
-    * Disabling guardband clipping removes the TR_GB condition, which means<br>
-    * they'll be considered MC ("Must Clip") unless they're rejected for<br>
-    * some other reason.<br>
-    *<br>
-    * Note that there is no TA_VPXY condition.  If there were, objects entirely<br>
-    * inside a 16384x16384 viewport would be trivially accepted, breaking the<br>
-    * "objects must have a screenspace bounding box not exceeding 8K in the X<br>
-    * or Y direction" restriction.  Instead, they're clipped.<br>
-    */<br>
-   for (unsigned i = 0; i < viewport_count; i++) {<br>
-      if (ctx->ViewportArray[i].Width > 8192 ||<br>
-          ctx->ViewportArray[i].Height > 8192) {<br>
-         dw2 &= ~GEN6_CLIP_GB_TEST;<br>
-         break;<br>
-      }<br>
-   }<br>
-<br>
    /* BRW_NEW_RASTERIZER_DISCARD */<br>
    if (ctx->RasterDiscard) {<br>
       dw2 |= GEN6_CLIP_MODE_REJECT_ALL;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>