X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fsvga%2Fsvga_pipe_rasterizer.c;h=356898a86e7ef2bb484539def9f611897c20e34c;hb=413bc0a618d39873336cbfaf8fb5e43217f66ccf;hp=61e13fae9d9e9d5f5542a0c8f6ffb0dd48e352f2;hpb=1737189f0a0b2bd22feb47818e86ba4b8133c404;p=mesa.git diff --git a/src/gallium/drivers/svga/svga_pipe_rasterizer.c b/src/gallium/drivers/svga/svga_pipe_rasterizer.c index 61e13fae9d9..356898a86e7 100644 --- a/src/gallium/drivers/svga/svga_pipe_rasterizer.c +++ b/src/gallium/drivers/svga/svga_pipe_rasterizer.c @@ -30,6 +30,7 @@ #include "util/u_memory.h" #include "svga_context.h" +#include "svga_screen.h" #include "svga_hw_reg.h" @@ -66,6 +67,7 @@ svga_create_rasterizer_state(struct pipe_context *pipe, { struct svga_context *svga = svga_context(pipe); struct svga_rasterizer_state *rast = CALLOC_STRUCT( svga_rasterizer_state ); + struct svga_screen *screen = svga_screen(pipe->screen); /* need this for draw module. */ rast->templ = *templ; @@ -100,23 +102,28 @@ svga_create_rasterizer_state(struct pipe_context *pipe, rast->need_pipeline_tris_str = "poly stipple"; } - if (templ->line_width >= 1.5f && - !svga->debug.no_line_width) { + if (screen->maxLineWidth > 1.0F) { + /* pass line width to device */ + rast->linewidth = MAX2(1.0F, templ->line_width); + } + else if (svga->debug.no_line_width) { + /* nothing */ + } + else { + /* use 'draw' pipeline for wide line */ rast->need_pipeline |= SVGA_PIPELINE_FLAG_LINES; rast->need_pipeline_lines_str = "line width"; } if (templ->line_stipple_enable) { - /* XXX: LinePattern not implemented on all backends, and there is no - * mechanism to query it. - */ - if (!svga->debug.force_hw_line_stipple) { + if (screen->haveLineStipple || svga->debug.force_hw_line_stipple) { SVGA3dLinePattern lp; lp.repeat = templ->line_stipple_factor + 1; lp.pattern = templ->line_stipple_pattern; rast->linepattern = lp.uintValue; } else { + /* use 'draw' module to decompose into short line segments */ rast->need_pipeline |= SVGA_PIPELINE_FLAG_LINES; rast->need_pipeline_lines_str = "line stipple"; } @@ -127,9 +134,16 @@ svga_create_rasterizer_state(struct pipe_context *pipe, rast->need_pipeline_points_str = "smooth points"; } - if (templ->line_smooth) { + if (templ->line_smooth && !screen->haveLineSmooth) { + /* + * XXX: Enabling the pipeline slows down performance immensely, so ignore + * line smooth state, where there is very little visual improvement. + * Smooth lines will still be drawn for wide lines. + */ +#if 0 rast->need_pipeline |= SVGA_PIPELINE_FLAG_LINES; rast->need_pipeline_lines_str = "smooth lines"; +#endif } { @@ -228,6 +242,13 @@ svga_create_rasterizer_state(struct pipe_context *pipe, rast->depthbias = 0; } + if (0 && rast->need_pipeline) { + debug_printf("svga: rast need_pipeline = 0x%x\n", rast->need_pipeline); + debug_printf(" pnts: %s \n", rast->need_pipeline_points_str); + debug_printf(" lins: %s \n", rast->need_pipeline_lines_str); + debug_printf(" tris: %s \n", rast->need_pipeline_tris_str); + } + return rast; }