panfrost: Don't leak NIR blend shaders
authorBoris Brezillon <boris.brezillon@collabora.com>
Thu, 8 Oct 2020 08:20:45 +0000 (10:20 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 9 Oct 2020 14:16:41 +0000 (14:16 +0000)
commitdbc33e8854e1c700a2c352322d8ee1d62c95fbec
treeabaf82e045e001da8fcc4a075b567bba2e103f31
parent8a5b885c94a6f61e2cf97afb5f4aa6cd24fe33bb
panfrost: Don't leak NIR blend shaders

Right now we create shaders that are not attached to any memory
context, leading to memory leaks. Ideally, we should free the NIR
shader as soon as we've turned it into a binary, but there's no
function explicitly destroy a shader. Let's attach those to the blend
state so they get destroyed when this state is freed.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7066>
src/gallium/drivers/panfrost/pan_blend_cso.c
src/gallium/drivers/panfrost/pan_blend_shaders.c
src/gallium/drivers/panfrost/pan_blend_shaders.h