From: Brian Paul Date: Tue, 17 May 2016 16:44:01 +0000 (-0600) Subject: svga: fix use of provoking vertex control X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ca531aeeb120cdda966120a17cdf50aa14c3129b;p=mesa.git svga: fix use of provoking vertex control If the SVGA3D_DEVCAP_DX_PROVOKING_VERTEX query returns false, never define rasterizer state objects with provokingVertexLast set. Despite what the device reports, it may interpret the provokingVertexLast flag anyway. This fixes an issue when using capability clamping. Tested with piglit provoking-vertex and glsl-fs-flat-color tests. VMware bug 1550143. Reviewed-by: --- diff --git a/src/gallium/drivers/svga/svga_pipe_rasterizer.c b/src/gallium/drivers/svga/svga_pipe_rasterizer.c index b01b04c2cfc..569fbe16f67 100644 --- a/src/gallium/drivers/svga/svga_pipe_rasterizer.c +++ b/src/gallium/drivers/svga/svga_pipe_rasterizer.c @@ -105,6 +105,7 @@ static void define_rasterizer_object(struct svga_context *svga, struct svga_rasterizer_state *rast) { + struct svga_screen *svgascreen = svga_screen(svga->pipe.screen); unsigned fill_mode = translate_fill_mode(rast->templ.fill_front); unsigned cull_mode = translate_cull_mode(rast->templ.cull_face); int depth_bias = rast->templ.offset_units; @@ -129,6 +130,8 @@ define_rasterizer_object(struct svga_context *svga, } for (try = 0; try < 2; try++) { + const uint8 pv_last = !rast->templ.flatshade_first && + svgascreen->haveProvokingVertex; enum pipe_error ret = SVGA3D_vgpu10_DefineRasterizerState(svga->swc, rast->id, @@ -146,7 +149,7 @@ define_rasterizer_object(struct svga_context *svga, rast->templ.line_stipple_enable, line_factor, line_pattern, - !rast->templ.flatshade_first); + pv_last); if (ret == PIPE_OK) return; svga_context_flush(svga, NULL);