From 0c3fae4e6e65b83cd6c61375f7be50566ee27e7c Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Sun, 17 Apr 2022 11:51:58 +0200 Subject: [PATCH] virgl: Don't let ntt optimize the register allocation Signed-off-by: Gert Wollny Reviewed-by: Emma Anholt Part-of: --- 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; }