u_vbuf: avoid unnecessary update of the vertex elements
authorVadim Girlin <vadimgirlin@gmail.com>
Tue, 28 Aug 2012 14:01:13 +0000 (18:01 +0400)
committerVadim Girlin <vadimgirlin@gmail.com>
Tue, 28 Aug 2012 14:01:13 +0000 (18:01 +0400)
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
src/gallium/auxiliary/util/u_vbuf.c

index 4141ba536fd64a0778eccc32449eb145831297e3..52db294cbd4b1690db652250fc27c7410033c046 100644 (file)
@@ -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;
 }