swr: limit pipe_draw_info->restart_index usage

Only copy this value when in restart drawing mode.

Eliminates valgrind errors when running trivial programs.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
This commit is contained in:
Tim Rowley 2017-08-22 10:39:57 -05:00
parent 7fb4b6f270
commit f0602dc920
1 changed files with 4 additions and 1 deletions

View File

@ -107,7 +107,10 @@ swr_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
}
struct swr_vertex_element_state *velems = ctx->velems;
velems->fsState.cutIndex = info->restart_index;
if (info->primitive_restart)
velems->fsState.cutIndex = info->restart_index;
else
velems->fsState.cutIndex = 0;
velems->fsState.bEnableCutIndex = info->primitive_restart;
velems->fsState.bPartialVertexBuffer = (info->min_index > 0);