[Mesa-dev] [PATCH] u_vbuf: avoid unnecessary update of the vertex elements

Marek Olšák maraeo at gmail.com
Tue Aug 28 01:58:03 PDT 2012


Reviewed-by: Marek Olšák <maraeo at gmail.com>

Marek

On Tue, Aug 28, 2012 at 2:36 AM, Vadim Girlin <vadimgirlin at gmail.com> wrote:
> Signed-off-by: Vadim Girlin <vadimgirlin at gmail.com>
> ---
>
> Improves performance for Lightsmark (and probably other apps).
>
>  src/gallium/auxiliary/util/u_vbuf.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
> index 4141ba5..52db294 100644
> --- a/src/gallium/auxiliary/util/u_vbuf.c
> +++ b/src/gallium/auxiliary/util/u_vbuf.c
> @@ -225,7 +225,9 @@ u_vbuf_set_vertex_elements_internal(struct u_vbuf *mgr, unsigned count,
>     }
>
>     assert(ve);
> -   pipe->bind_vertex_elements_state(pipe, ve->driver_cso);
> +
> +   if (ve != mgr->ve)
> +          pipe->bind_vertex_elements_state(pipe, ve->driver_cso);
>     return ve;
>  }
>
> --
> 1.7.11.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list