summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2017-06-15 11:31:53 -0600
committerAndres Gomez <[email protected]>2017-07-12 19:32:09 +0300
commitc6e841667f27f7c97f80f9b447d22b1610372353 (patch)
treedb143f133d8a52cd0e170b596bfc7dbe65d4ed70 /src/gallium/drivers
parent49b5da785f52a092bebef32dde6536c9d898a7d5 (diff)
svga: clamp device line width to at least 1 to fix HWv8 line stippling
The line stipple fallback code for virtual HW version 8 didn't work. With HW version 8, we were getting zero when querying the max line widths (AA and non-AA). This means we were setting the draw module's wide line threshold to zero. This caused the wide line stage to always get enabled. That caused the line stipple module to fall because the wide line stage was clobbering the rasterization state with a state object setting the line stipple pattern to 0xffff. Now the wide_lines variable in draw's validate_pipeline() will not be incorrectly set. Also improve debug output. BTW, also this fixes several other piglit tests: polygon-mode, primitive- restart-draw-mode, and line-flat-clip-color since they all use the draw module fallback. See VMware bug 1895811. Reviewed-by: Charmaine Lee <[email protected]> (cherry picked from commit c2b92dada076afc303e31e3d029256d234254c27) Squashed with: svga: adjust line subpixel position for HWv8 This fixes two regressions on HWv8: Piglit gl-1.0-ortho-pos Piglit/glean fbo This was caused by commit c2b92dada076a "svga: clamp device line width to at least 1 to fix HWv8 line stippling" This also fixes two conform tests: Vertex Order and Polygon Face No Piglit/conform changes with HWv9 or later. VMware bug 1905053 Reviewed-by: Charmaine Lee <[email protected]> (cherry picked from commit 5b8d33acefa9adbf1f0c9ff10f1933a0b3a5c66b)
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/svga/svga_screen.c8
-rw-r--r--src/gallium/drivers/svga/svga_state_framebuffer.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index 5e303c82587..9be806d826f 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -1090,18 +1090,18 @@ svga_screen_create(struct svga_winsys_screen *sws)
get_bool_cap(sws, SVGA3D_DEVCAP_LINE_STIPPLE, FALSE);
svgascreen->maxLineWidth =
- get_float_cap(sws, SVGA3D_DEVCAP_MAX_LINE_WIDTH, 1.0f);
+ MAX2(1.0, get_float_cap(sws, SVGA3D_DEVCAP_MAX_LINE_WIDTH, 1.0f));
svgascreen->maxLineWidthAA =
- get_float_cap(sws, SVGA3D_DEVCAP_MAX_AA_LINE_WIDTH, 1.0f);
+ MAX2(1.0, get_float_cap(sws, SVGA3D_DEVCAP_MAX_AA_LINE_WIDTH, 1.0f));
if (0) {
debug_printf("svga: haveProvokingVertex %u\n",
svgascreen->haveProvokingVertex);
debug_printf("svga: haveLineStip %u "
- "haveLineSmooth %u maxLineWidth %f\n",
+ "haveLineSmooth %u maxLineWidth %.2f maxLineWidthAA %.2f\n",
svgascreen->haveLineStipple, svgascreen->haveLineSmooth,
- svgascreen->maxLineWidth);
+ svgascreen->maxLineWidth, svgascreen->maxLineWidthAA);
debug_printf("svga: maxPointSize %g\n", svgascreen->maxPointSize);
debug_printf("svga: msaa samples mask: 0x%x\n", svgascreen->ms_samples);
}
diff --git a/src/gallium/drivers/svga/svga_state_framebuffer.c b/src/gallium/drivers/svga/svga_state_framebuffer.c
index 146d9dcf5d3..ee767bdb767 100644
--- a/src/gallium/drivers/svga/svga_state_framebuffer.c
+++ b/src/gallium/drivers/svga/svga_state_framebuffer.c
@@ -535,7 +535,7 @@ emit_viewport( struct svga_context *svga,
break;
case PIPE_PRIM_LINES:
adjust_x = -0.5;
- adjust_y = 0;
+ adjust_y = -0.125;
break;
case PIPE_PRIM_TRIANGLES:
adjust_x = -0.5;