r600: don't clone the nir shader, just use it
authorGert Wollny <gert.wollny@collabora.com>
Sun, 24 Jul 2022 11:58:42 +0000 (13:58 +0200)
committerMarge Bot <emma+marge@anholt.net>
Sun, 24 Jul 2022 18:39:13 +0000 (18:39 +0000)
The nir shader passed in with the shader state has to be released by
the backe-end, so don't clone it, just use it.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17729>

src/gallium/drivers/r600/r600_state_common.c

index 56b3760..8e1c061 100644 (file)
@@ -996,7 +996,7 @@ struct r600_pipe_shader_selector *r600_create_shader_state_tokens(struct pipe_co
                        ir = PIPE_SHADER_IR_TGSI;
                        tgsi_scan_shader(sel->tokens, &sel->info);
                } else {
-                       sel->nir = nir_shader_clone(NULL, s);
+                       sel->nir = s;
                        nir_tgsi_scan_shader(sel->nir, &sel->info, true);
                }
        }