From bed305fb7a1ad8d887fc6fa64e79e30cbd03bba1 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 27 Jun 2019 16:54:47 -0700 Subject: [PATCH] iris: Fix major resource leak in iris_set_shader_images We were failing to unreference the old image resource. Instead of open coding this and doing it badly, just use the copier function which does the right thing. --- src/gallium/drivers/iris/iris_state.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 01cd9dbcec7..e09a3ddbcc9 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -2098,9 +2098,7 @@ iris_set_shader_images(struct pipe_context *ctx, if (!unlikely(map)) return; - iv->base = *img; - iv->base.resource = NULL; - pipe_resource_reference(&iv->base.resource, &res->base); + util_copy_image_view(&iv->base, img); shs->bound_image_views |= 1 << (start_slot + i); -- 2.30.2