Mesa (master): mesa/st: Free the ARB_vp/fp nir-to-tgsi temporary tokens.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 12 20:03:35 UTC 2021


Module: Mesa
Branch: master
Commit: a4a5045d59adc8f7bac56b3828551c94b23f3617
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a4a5045d59adc8f7bac56b3828551c94b23f3617

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Jan 11 11:09:12 2021 -0800

mesa/st: Free the ARB_vp/fp nir-to-tgsi temporary tokens.

The driver interface doesn't take ownership of the TGSI tokens, so free
our temporary.

Fixes: cf3fc79cd0ab ("st/mesa: Replace mesa_to_tgsi() with prog_to_nir() and nir_to_tgsi().")
Reviewed-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8422>

---

 src/mesa/state_tracker/st_program.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 7e360d3e676..7b8d27cf101 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -745,6 +745,9 @@ st_create_vp_variant(struct st_context *st,
       else
          vpv->base.driver_shader = pipe->create_vs_state(pipe, &state);
 
+      if (state.type == PIPE_SHADER_IR_TGSI)
+         tgsi_free_tokens(state.tokens);
+
       return vpv;
    }
 
@@ -1351,6 +1354,9 @@ st_create_fp_variant(struct st_context *st,
       variant->base.driver_shader = pipe->create_fs_state(pipe, &state);
       variant->key = *key;
 
+      if (state.type == PIPE_SHADER_IR_TGSI)
+         tgsi_free_tokens(state.tokens);
+
       return variant;
    }
 



More information about the mesa-commit mailing list