summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGert Wollny <[email protected]>2019-12-28 17:17:02 +0100
committerGert Wollny <[email protected]>2020-01-04 16:22:40 +0000
commitb119f8b4a050b2f37b0abbda669b7e27b0cd538b (patch)
tree5bb79c4b66080f5cb8b73764b34ea3e152cf1726
parent32bb5f294103f3e80a4d5b8f0e2f89960d06b083 (diff)
r600: Delete vertex buffer only if there is actually a shader state
Fixes: gl-2.0-vertexattribpointer Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Konstantin Kharlamov <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3286>
-rw-r--r--src/gallium/drivers/r600/r600_state_common.c3
1 files changed, 2 insertions, 1 deletions
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);
}