radv: fix memleak with link time optimizations and GPL
Do not clone the NIR when the driver retains NIR shaders because it exits early, otherwise stage->nir will never be freed. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7768 Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19973>
This commit is contained in:

committed by
Marge Bot

parent
16fd8b8324
commit
edc830be34
@@ -3761,7 +3761,7 @@ radv_pipeline_stage_retain_shader(struct radv_pipeline *pipeline, struct radv_pi
|
||||
{
|
||||
gl_shader_stage s = stage->stage;
|
||||
|
||||
pipeline->retained_shaders[s].nir = nir_shader_clone(NULL, stage->nir);
|
||||
pipeline->retained_shaders[s].nir = stage->nir;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user