[Mesa-dev] [PATCH] swr: set dynamic vertex size

Cherniak, Bruce bruce.cherniak at intel.com
Thu Jun 29 17:07:46 UTC 2017


Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>

> On Jun 29, 2017, at 10:07 AM, Tim Rowley <timothy.o.rowley at intel.com> wrote:
> 
> Reduces the memory footprint of the frontend processing by packing
> vertices.
> ---
> src/gallium/drivers/swr/swr_draw.cpp | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/swr/swr_draw.cpp b/src/gallium/drivers/swr/swr_draw.cpp
> index f85076b..f26b8e8 100644
> --- a/src/gallium/drivers/swr/swr_draw.cpp
> +++ b/src/gallium/drivers/swr/swr_draw.cpp
> @@ -129,8 +129,10 @@ swr_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
>     * XXX setup provokingVertex & topologyProvokingVertex */
>    SWR_FRONTEND_STATE feState = {0};
> 
> -   /* XXX this value should be minimized based on the shader set */
> -   feState.vsVertexSize = SWR_VTX_NUM_SLOTS;
> +   feState.vsVertexSize =
> +      VERTEX_ATTRIB_START_SLOT +
> +      + ctx->vs->info.base.num_outputs
> +      - (ctx->vs->info.base.writes_position ? 1 : 0);
> 
>    if (ctx->rasterizer->flatshade_first) {
>       feState.provokingVertex = {1, 0, 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