virgl: Don't let ntt optimize the register allocation

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15995>
This commit is contained in:
Gert Wollny 2022-04-17 11:51:58 +02:00 committed by Marge Bot
parent 677a42378b
commit 0c3fae4e6e
1 changed files with 8 additions and 2 deletions

View File

@ -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;
}