From 5c50c84c7ab8e51ba1fb5598b2e39927c42c7ac7 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 6 Jun 2018 14:00:27 +1000 Subject: [PATCH] renderer: use is_buffer flag on resource destruction This just makes sure we use the correct destruction path. Reviewed-by: Elie Tournier Tested-by: Jakob Bornecrantz Signed-off-by: Jakob Bornecrantz --- src/vrend_renderer.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 53df8a4..66506bc 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -4779,11 +4779,7 @@ void vrend_renderer_resource_destroy(struct vrend_resource *res, bool remove) if (res->ptr) free(res->ptr); if (res->id) { - if (res->target == GL_ELEMENT_ARRAY_BUFFER_ARB || - res->target == GL_ARRAY_BUFFER_ARB || - res->target == GL_UNIFORM_BUFFER|| - res->target == GL_TEXTURE_BUFFER|| - res->target == GL_TRANSFORM_FEEDBACK_BUFFER) { + if (res->is_buffer) { glDeleteBuffers(1, &res->id); if (res->tbo_tex_id) glDeleteTextures(1, &res->tbo_tex_id);