radv: remove NIR_PASS in radv_nir_lower_rt_abi

When NIR_DEBUG=serialize or NIR_DEBUG=clone is used, NIR_PASS recreates
nir_function_impl and nir_variable objects, causing use-after-free since
radv_nir_lower_rt_abi() keeps pointers to those in local variables.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37573>
This commit is contained in:
Rhys Perry
2025-09-25 13:28:59 +01:00
committed by Marge Bot
parent 42bb81137e
commit 762a803aa7
+2 -1
View File
@@ -1992,7 +1992,8 @@ radv_nir_lower_rt_abi(nir_shader *shader, const VkRayTracingPipelineCreateInfoKH
}
shader->scratch_size = 0;
NIR_PASS(_, shader, nir_lower_returns);
/* This can't use NIR_PASS because NIR_DEBUG=serialize,clone invalidates pointers. */
nir_lower_returns(shader);
nir_cf_list list;
nir_cf_extract(&list, nir_before_impl(impl), nir_after_impl(impl));