radv/rt: Free traversal NIR after compilation
authorFriedrich Vock <friedrich.vock@gmx.de>
Thu, 4 Jan 2024 13:37:08 +0000 (14:37 +0100)
committerEric Engestrom <eric@engestrom.ch>
Thu, 4 Jan 2024 18:45:58 +0000 (18:45 +0000)
Could lead to OOM in games that compile RTPSOs often,
like Ghostwire Tokyo.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26892>
(cherry picked from commit 34cc76517286b88c8191a3e10dda0a3293c09127)

.pick_status.json
src/amd/vulkan/radv_pipeline_rt.c

index 307feeb..8468534 100644 (file)
@@ -14,7 +14,7 @@
         "description": "radv/rt: Free traversal NIR after compilation",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null,
         "notes": null
index 810f604..c61d2be 100644 (file)
@@ -609,6 +609,7 @@ radv_rt_compile_shaders(struct radv_device *device, struct vk_pipeline_cache *ca
    radv_shader_layout_init(pipeline_layout, MESA_SHADER_INTERSECTION, &traversal_stage.layout);
    result = radv_rt_nir_to_asm(device, cache, pCreateInfo, key, pipeline, false, &traversal_stage, NULL, NULL,
                                &pipeline->base.base.shaders[MESA_SHADER_INTERSECTION]);
+   ralloc_free(traversal_module.nir);
 
 cleanup:
    for (uint32_t i = 0; i < pCreateInfo->stageCount; i++)