diff options
author | Brian Paul <[email protected]> | 2018-02-14 09:33:58 -0800 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-02-15 09:05:08 -0700 |
commit | 072df89a796f549cc0ad90ce3dcbc9ad5c58d892 (patch) | |
tree | 6ee6acfec00b2d00aae30167857efd5347ae17bd /src/gallium/drivers/svga | |
parent | 6f0aec5671a1efd374f517d3f9e4b0ff1c4c4709 (diff) |
svga: move svga_update_state() call in draw code
This fixes a few Piglit transform feedback regressions caused by
commit 7a1401938b351.
In that change I moved the moved svga_update_state() into the loops,
after the calls to svga_hwtnl_set_flatshade(). But
svga_hwtnl_set_flatshade() actually depends on some derived shader
state. This patch moves the svga_update_state() call into
svga_draw_vbo() so it's not duplicated in two places.
Fixes: 7a1401938b351 ("svga: clean up retry_draw_range_elements(),
retry_draw_arrays()")
Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r-- | src/gallium/drivers/svga/svga_pipe_draw.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_draw.c b/src/gallium/drivers/svga/svga_pipe_draw.c index ee4a1057adf..af538819ea6 100644 --- a/src/gallium/drivers/svga/svga_pipe_draw.c +++ b/src/gallium/drivers/svga/svga_pipe_draw.c @@ -75,17 +75,14 @@ retry_draw_range_elements(struct svga_context *svga, svga->curr.rast->templ.flatshade_first); for (unsigned try = 0; try < 2; try++) { - ret = svga_update_state(svga, SVGA_STATE_HW_DRAW); - if (ret == PIPE_OK) { - ret = svga_hwtnl_draw_range_elements(svga->hwtnl, - index_buffer, index_size, - index_bias, - min_index, max_index, - prim, start, count, - start_instance, instance_count); - if (ret == PIPE_OK) - break; - } + ret = svga_hwtnl_draw_range_elements(svga->hwtnl, + index_buffer, index_size, + index_bias, + min_index, max_index, + prim, start, count, + start_instance, instance_count); + if (ret == PIPE_OK) + break; svga_context_flush(svga, NULL); } @@ -114,13 +111,10 @@ retry_draw_arrays(struct svga_context *svga, svga->curr.rast->templ.flatshade_first); for (unsigned try = 0; try < 2; try++) { - ret = svga_update_state(svga, SVGA_STATE_HW_DRAW); - if (ret == PIPE_OK) { - ret = svga_hwtnl_draw_arrays(svga->hwtnl, prim, start, count, - start_instance, instance_count); - if (ret == PIPE_OK) - break; - } + ret = svga_hwtnl_draw_arrays(svga->hwtnl, prim, start, count, + start_instance, instance_count); + if (ret == PIPE_OK) + break; svga_context_flush(svga, NULL); } @@ -229,6 +223,13 @@ svga_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) ret = svga_swtnl_draw_vbo(svga, info, indexbuf, index_offset); } else { + ret = svga_update_state(svga, SVGA_STATE_HW_DRAW); + if (ret != PIPE_OK) { + svga_context_flush(svga, NULL); + ret = svga_update_state(svga, SVGA_STATE_HW_DRAW); + assert(ret == PIPE_OK); + } + if (info->index_size && indexbuf) { unsigned offset; |