summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderimage.h
diff options
context:
space:
mode:
authorGert Wollny <[email protected]>2019-02-02 13:17:16 +0100
committerGert Wollny <[email protected]>2019-02-05 10:53:41 +0000
commitb0b3de2be750966343fca96b7123340f8656f056 (patch)
tree36507c22af4d85973ff32f612cf0037900248402 /src/mesa/main/shaderimage.h
parentf1f3640f6fe841942a7de6a74f7a5c9996077e6b (diff)
mesa: release references to image textures when a context is destroyed
When a texture is still bound as an image and the context it was bound in is destroyed but not the texture, then the texture will still hold the resource and will not be freed when it is finally destroyed. Hence, release these references when the context is destroyed. This leak was triggered by virglrenderer: https://gitlab.freedesktop.org/virgl/virglrenderer/issues/86 Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderimage.h')
-rw-r--r--src/mesa/main/shaderimage.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/main/shaderimage.h b/src/mesa/main/shaderimage.h
index 6a9e3d67e92..daed27508a7 100644
--- a/src/mesa/main/shaderimage.h
+++ b/src/mesa/main/shaderimage.h
@@ -68,6 +68,9 @@ _mesa_default_image_unit(struct gl_context *ctx);
void
_mesa_init_image_units(struct gl_context *ctx);
+void
+_mesa_free_image_textures(struct gl_context *ctx);
+
/**
* Return GL_TRUE if the state of the image unit passed as argument is valid
* and access from the shader is allowed. Otherwise loads from this unit