Module: Mesa
Branch: staging/18.1
Commit: 6fee88ea082cde28ecc74af5787d4d3f25646612
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6fee88ea082cde28ecc74af5787d4d3f25646612

Author: Samuel Pitoiset <[email protected]>
Date:   Fri Jul 20 18:48:07 2018 +0200

radv: fix a memleak for merged shaders on GFX9

modules[i] can be NULL for merged shaders but we have to
free the NIR code. radv_can_dump_shader_stats() already handles
if modules[i] is NULL, no need to check it twice.

Cc: [email protected]
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
(cherry picked from commit 6e32d9e7b0945268b844ab2397ab3c9924136d3a)

---

 src/amd/vulkan/radv_pipeline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 79778f3b5e..879499cd29 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -2154,7 +2154,7 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
 
        for (int i = 0; i < MESA_SHADER_STAGES; ++i) {
                free(codes[i]);
-               if (modules[i]) {
+               if (nir[i]) {
                        if (!pipeline->device->keep_shader_info)
                                ralloc_free(nir[i]);
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to