Mesa (master): svga: tweak pre-VGPU10 rasterization offsets

Brian Paul brianp at kemper.freedesktop.org
Tue Oct 3 18:10:05 UTC 2017


Module: Mesa
Branch: master
Commit: 362fb05b65ce7db69af6ae896caa2f0f6afd5fb2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=362fb05b65ce7db69af6ae896caa2f0f6afd5fb2

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Aug 18 14:38:03 2017 -0600

svga: tweak pre-VGPU10 rasterization offsets

It seems there's no perfect x/y biases for line drawing to satisfy all
applications.  Depending on the biases, either real apps produce results
similar to VGPU10 while Piglit's gl-1.0-ortho-pos fails, or vice versa.

Let's lean toward real applications (Solidworks, SolidEdge, Google Earth)
over Piglit.

Using (-0.5, -0.5) for points, lines and triangles, seems to generally
work well.

We don't seem to have these issues with VGPU10.

Tested with Piglit and CAD-oriented apitraces.  See VMware bugs 1775498
and 1905053.

Reviewed-by: José Fonseca <jfonseca at vmware.com>
Reviewed-by: Charmaine Lee <charmainel at vmware.com>

---

 src/gallium/drivers/svga/svga_state_framebuffer.c | 24 +++++++----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_state_framebuffer.c b/src/gallium/drivers/svga/svga_state_framebuffer.c
index c52b7eeebf..0aabde71e0 100644
--- a/src/gallium/drivers/svga/svga_state_framebuffer.c
+++ b/src/gallium/drivers/svga/svga_state_framebuffer.c
@@ -554,23 +554,13 @@ emit_viewport( struct svga_context *svga,
          }
       }
       else {
-         switch (svga->curr.reduced_prim) {
-         case PIPE_PRIM_POINTS:
-            adjust_x = -0.375;
-            adjust_y = -0.75;
-            break;
-         case PIPE_PRIM_LINES:
-            adjust_x = -0.5;
-            adjust_y = -0.125;
-            break;
-         case PIPE_PRIM_TRIANGLES:
-            adjust_x = -0.5;
-            adjust_y = -0.5;
-            break;
-         default:
-            /* nothing */
-            break;
-         }
+         /* Use (-0.5, -0.5) bias for all prim types.
+          * Regarding line rasterization, this does not seem to satisfy
+          * the Piglit gl-1.0-ortho-pos test but it generally produces
+          * results identical or very similar to VGPU10.
+          */
+         adjust_x = -0.5;
+         adjust_y = -0.5;
       }
 
       if (invertY)




More information about the mesa-commit mailing list