[Mesa-dev] [PATCH] swr: limit pipe_draw_info->restart_index usage
Cherniak, Bruce
bruce.cherniak at intel.com
Wed Aug 23 16:32:22 UTC 2017
Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
> On Aug 23, 2017, at 11:19 AM, Tim Rowley <timothy.o.rowley at intel.com> wrote:
>
> Only copy this value when in restart drawing mode.
>
> Eliminates valgrind errors when running trivial programs.
> ---
> src/gallium/drivers/swr/swr_draw.cpp | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/swr/swr_draw.cpp b/src/gallium/drivers/swr/swr_draw.cpp
> index df1c11a..2363800 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);
>
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list