From e8cbfa95a3a1d7ca1db235ae03fd76a698d5a556 Mon Sep 17 00:00:00 2001 From: Mykhailo Skorokhodov Date: Tue, 31 Aug 2021 10:43:46 +0300 Subject: [PATCH] iris: Fix compute shader leak Variant after creation with the function iris_create_shader_variant requires to be added to variants. Otherwise there is a memory leak after execution. Fixes: 2024d470483("iris: Add the variant to the list as early as possible") Signed-off-by: Mykhailo Skorokhodov Reviewed-by: Ian Romanick Part-of: --- src/gallium/drivers/iris/iris_program.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index 85b65675e5b..6ced0b942cc 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -2531,6 +2531,9 @@ iris_create_compute_state(struct pipe_context *ctx, iris_create_shader_variant(screen, NULL, IRIS_CACHE_CS, sizeof(key), &key); + /* Append our new variant to the shader's variant list. */ + list_addtail(&shader->link, &ish->variants); + if (!iris_disk_cache_retrieve(screen, uploader, ish, shader, &key, sizeof(key))) { iris_compile_cs(screen, uploader, &ice->dbg, ish, shader); -- 2.34.1