diff options
author | Brian Paul <[email protected]> | 2013-12-09 10:46:56 -0800 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-12-11 17:19:44 -0800 |
commit | ccd6bf8272cba7c57e4ae09ab8a03db63472648e (patch) | |
tree | 3d3dd8783c41ba50b418a4758e1322badc64363f /src/gallium/drivers/svga/svga_screen.c | |
parent | 84b1716b5efa98c21db32ff7f55bb7608d6a11df (diff) |
svga: expose HW smooth/stipple/wide lines
Newer virtual HW versions support smooth/stipple/wide lines.
Use that instead of 'draw' fallbacks when possible.
Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_screen.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_screen.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index 6c2533800d6..330ffdf0e2d 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -103,9 +103,9 @@ svga_get_paramf(struct pipe_screen *screen, enum pipe_capf param) switch (param) { case PIPE_CAPF_MAX_LINE_WIDTH: - /* fall-through */ + return svgascreen->maxLineWidth; case PIPE_CAPF_MAX_LINE_WIDTH_AA: - return 7.0; + return svgascreen->maxLineWidthAA; case PIPE_CAPF_MAX_POINT_WIDTH: /* fall-through */ @@ -660,6 +660,34 @@ svga_screen_create(struct svga_winsys_screen *sws) } } + /* Query device caps + */ + if (!sws->get_cap(sws, SVGA3D_DEVCAP_LINE_STIPPLE, &result)) + svgascreen->haveLineStipple = FALSE; + else + svgascreen->haveLineStipple = result.u; + + if (!sws->get_cap(sws, SVGA3D_DEVCAP_LINE_AA, &result)) + svgascreen->haveLineSmooth = FALSE; + else + svgascreen->haveLineSmooth = result.u; + + if (!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_LINE_WIDTH, &result)) + svgascreen->maxLineWidth = 1.0F; + else + svgascreen->maxLineWidth = result.f; + + if (!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_AA_LINE_WIDTH, &result)) + svgascreen->maxLineWidthAA = 1.0F; + else + svgascreen->maxLineWidthAA = result.f; + + if (0) + debug_printf("svga: haveLineStip %u " + "haveLineSmooth %u maxLineWidth %f\n", + svgascreen->haveLineStipple, svgascreen->haveLineSmooth, + svgascreen->maxLineWidth); + if (!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_POINT_SIZE, &result)) { svgascreen->maxPointSize = 1.0F; } else { |