u_vbuf: Only create driver CSO if no incompatible elements
authorPaul Cercueil <paul@crapouillou.net>
Tue, 19 Nov 2019 20:59:07 +0000 (21:59 +0100)
committerMarge Bot <eric+marge@anholt.net>
Sat, 21 Dec 2019 18:29:30 +0000 (18:29 +0000)
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2807>

src/gallium/auxiliary/util/u_vbuf.c

index 67c82a56ecd865fcea81e50706cd05c295d31df5..8e67cd965f87544a0e15ec0d32c28a5e4ed90b63 100644 (file)
@@ -811,8 +811,12 @@ u_vbuf_create_vertex_elements(struct u_vbuf *mgr, unsigned count,
       }
    }
 
-   ve->driver_cso =
-      pipe->create_vertex_elements_state(pipe, count, driver_attribs);
+   /* Only create driver CSO if no incompatible elements */
+   if (!ve->incompatible_elem_mask) {
+      ve->driver_cso =
+         pipe->create_vertex_elements_state(pipe, count, driver_attribs);
+   }
+
    return ve;
 }