aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMike Blumenkrantz <[email protected]>2020-06-03 11:42:10 -0400
committerMarge Bot <[email protected]>2020-07-18 07:51:37 +0000
commitadc4f3896ae3cfd9ef8394d11204dfd9d321cf82 (patch)
treeffd24da63feadf1ff3e162ea893bbaea2da87d6e /src/gallium/drivers
parent1ff2d195b04f6d258d7d804590ad83946af1de8a (diff)
zink: free pipeline cache during program destroy
more leaks Reviewed-by: Antonio Caggiano <[email protected]> Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5887>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/zink/zink_program.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c
index 0de286d4691..341c3293ac2 100644
--- a/src/gallium/drivers/zink/zink_program.c
+++ b/src/gallium/drivers/zink/zink_program.c
@@ -34,6 +34,11 @@
#include "util/u_memory.h"
#include "tgsi/tgsi_from_mesa.h"
+struct pipeline_cache_entry {
+ struct zink_gfx_pipeline_state state;
+ VkPipeline pipeline;
+};
+
static VkDescriptorSetLayout
create_desc_set_layout(VkDevice dev,
struct zink_shader *stages[PIPE_SHADER_TYPES - 1],
@@ -187,14 +192,19 @@ zink_destroy_gfx_program(struct zink_screen *screen,
_mesa_set_destroy(prog->render_passes, NULL);
}
+ for (int i = 0; i < ARRAY_SIZE(prog->pipelines); ++i) {
+ hash_table_foreach(prog->pipelines[i], entry) {
+ struct pipeline_cache_entry *pc_entry = entry->data;
+
+ vkDestroyPipeline(screen->dev, pc_entry->pipeline, NULL);
+ free(pc_entry);
+ }
+ _mesa_hash_table_destroy(prog->pipelines[i], NULL);
+ }
+
FREE(prog);
}
-struct pipeline_cache_entry {
- struct zink_gfx_pipeline_state state;
- VkPipeline pipeline;
-};
-
static VkPrimitiveTopology
primitive_topology(enum pipe_prim_type mode)
{