From: Gert Wollny Date: Sat, 28 Dec 2019 16:17:02 +0000 (+0100) Subject: r600: Delete vertex buffer only if there is actually a shader state X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b119f8b4a050b2f37b0abbda669b7e27b0cd538b;p=mesa.git r600: Delete vertex buffer only if there is actually a shader state Fixes: gl-2.0-vertexattribpointer Signed-off-by: Gert Wollny Reviewed-by: Konstantin Kharlamov Part-of: --- diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index fe17d10c201..4718286bd2b 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -546,7 +546,8 @@ static void r600_bind_vertex_elements(struct pipe_context *ctx, void *state) static void r600_delete_vertex_elements(struct pipe_context *ctx, void *state) { struct r600_fetch_shader *shader = (struct r600_fetch_shader*)state; - r600_resource_reference(&shader->buffer, NULL); + if (shader) + r600_resource_reference(&shader->buffer, NULL); FREE(shader); }