r600: Delete possible old NIR variant when translating from TGSI

With shader variants it may happen that we already translated a TGSI
shader for the current selector, so delete the old nir shader if we
already had one.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17729>
This commit is contained in:
Gert Wollny 2022-07-24 13:49:37 +02:00 committed by Marge Bot
parent 92feb77bbb
commit 97d4e98501
1 changed files with 2 additions and 0 deletions

View File

@ -195,6 +195,8 @@ int r600_pipe_shader_create(struct pipe_context *ctx,
}
} else {
if (sel->ir_type == PIPE_SHADER_IR_TGSI) {
if (sel->nir)
ralloc_free(sel->nir);
sel->nir = tgsi_to_nir(sel->tokens, ctx->screen, true);
const nir_shader_compiler_options *nir_options =
(const nir_shader_compiler_options *)