diff options
author | Tim Rowley <[email protected]> | 2017-08-22 10:39:57 -0500 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2017-08-23 11:37:50 -0500 |
commit | f0602dc92044ea6d738d0e539e52f938a41f6093 (patch) | |
tree | 3e25e9f973d5dbb715828753023b3b2f4f7a340d /src/gallium/drivers/swr/swr_draw.cpp | |
parent | 7fb4b6f27056679e0271ba90dabf7e8a7bfbd181 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/swr_draw.cpp')
-rw-r--r-- | src/gallium/drivers/swr/swr_draw.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/swr/swr_draw.cpp b/src/gallium/drivers/swr/swr_draw.cpp index df1c11abeb7..2363800f805 100644 --- a/src/gallium/drivers/swr/swr_draw.cpp +++ b/src/gallium/drivers/swr/swr_draw.cpp @@ -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); |