Mesa (main): virgl: Don't let ntt optimize the register allocation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 21 11:33:34 UTC 2022


Module: Mesa
Branch: main
Commit: 0c3fae4e6e65b83cd6c61375f7be50566ee27e7c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0c3fae4e6e65b83cd6c61375f7be50566ee27e7c

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Sun Apr 17 11:51:58 2022 +0200

virgl: Don't let ntt optimize the register allocation

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15995>

---

 src/gallium/drivers/virgl/virgl_context.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c
index 6d9683b6e47..b78ca18f15b 100644
--- a/src/gallium/drivers/virgl/virgl_context.c
+++ b/src/gallium/drivers/virgl/virgl_context.c
@@ -684,8 +684,11 @@ static void *virgl_shader_encoder(struct pipe_context *ctx,
    int ret;
 
    if (shader->type == PIPE_SHADER_IR_NIR) {
+      struct nir_to_tgsi_options options = {
+         .unoptimized_ra = true
+      };
       nir_shader *s = nir_shader_clone(NULL, shader->ir.nir);
-      ntt_tokens = tokens = nir_to_tgsi(s, vctx->base.screen); /* takes ownership */
+      ntt_tokens = tokens = nir_to_tgsi_options(s, vctx->base.screen, &options); /* takes ownership */
    } else {
       tokens = shader->tokens;
    }
@@ -1366,8 +1369,11 @@ static void *virgl_create_compute_state(struct pipe_context *ctx,
    int ret;
 
    if (state->ir_type == PIPE_SHADER_IR_NIR) {
+      struct nir_to_tgsi_options options = {
+         .unoptimized_ra = true
+      };
       nir_shader *s = nir_shader_clone(NULL, state->prog);
-      ntt_tokens = tokens = nir_to_tgsi(s, vctx->base.screen); /* takes ownership */
+      ntt_tokens = tokens = nir_to_tgsi_options(s, vctx->base.screen, &options); /* takes ownership */
    } else {
       tokens = state->prog;
    }



More information about the mesa-commit mailing list