r600: Delete vertex buffer only if there is actually a shader state

Fixes: gl-2.0-vertexattribpointer
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Konstantin Kharlamov <hi-angel@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3286>
This commit is contained in:
Gert Wollny
2019-12-28 17:17:02 +01:00
committed by Gert Wollny
parent 32bb5f2941
commit b119f8b4a0
+2 -1
View File
@@ -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);
}