From: Kenneth Graunke Date: Mon, 7 Jan 2019 04:22:15 +0000 (-0800) Subject: iris: Fix bug in bound vertex buffer tracking X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=732c3a90a409aa5972c70f5ea333cbecec508c41;p=mesa.git iris: Fix bug in bound vertex buffer tracking res might be NULL, at which point this is an unbind. --- diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index b12a77885bf..e7801a698dc 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -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;