iris: Fix bug in bound vertex buffer tracking
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 7 Jan 2019 04:22:15 +0000 (20:22 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:11 +0000 (10:26 -0800)
res might be NULL, at which point this is an unbind.

src/gallium/drivers/iris/iris_state.c

index b12a77885bf38d9b3bdda766760cf16abe55d5c5..e7801a698dc74713f990feedebfb30f8c9b0a7f5 100644 (file)
@@ -2462,13 +2462,13 @@ iris_set_vertex_buffers(struct pipe_context *ctx,
 
       assert(!buffer->is_user_buffer);
 
-      ice->state.bound_vertex_buffers |= 1ull << (start_slot + i);
-
       pipe_resource_reference(&state->resource, buffer->buffer.resource);
       struct iris_resource *res = (void *) state->resource;
 
-      if (res)
+      if (res) {
+         ice->state.bound_vertex_buffers |= 1ull << (start_slot + i);
          res->bind_history |= PIPE_BIND_VERTEX_BUFFER;
+      }
 
       iris_pack_state(GENX(VERTEX_BUFFER_STATE), state->state, vb) {
          vb.VertexBufferIndex = start_slot + i;