From: Marek Olšák <marek.ol...@amd.com>

The code didn't expect that.

Fixes: 86d63b53a20a747e "gallium: remove aux_vertex_buffer_slot code"
---
 src/gallium/auxiliary/cso_cache/cso_context.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c 
b/src/gallium/auxiliary/cso_cache/cso_context.c
index e3d46f3c8de..2543c5ff61f 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -1140,20 +1140,23 @@ cso_restore_vertex_elements(struct cso_context *ctx)
 }
 
 /* vertex buffers */
 
 void cso_set_vertex_buffers(struct cso_context *ctx,
                             unsigned start_slot, unsigned count,
                             const struct pipe_vertex_buffer *buffers)
 {
    struct u_vbuf *vbuf = ctx->vbuf;
 
+   if (!count)
+      return;
+
    if (vbuf) {
       u_vbuf_set_vertex_buffers(vbuf, start_slot, count, buffers);
       return;
    }
 
    /* Save what's in the auxiliary slot, so that we can save and restore it
     * for meta ops. */
    if (start_slot == 0) {
       if (buffers) {
          pipe_vertex_buffer_reference(&ctx->vertex_buffer0_current,
-- 
2.17.0

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to