From 6f0db3778f3e2e874d844b98b256f121680be331 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Tue, 10 May 2022 12:13:17 -0700 Subject: [PATCH] mesa/st: Only scalarize for doubles lowering if we're lowering doubles. lower_int64 doesn't need it, and the scalarizing ended up tickling some bug in virgl once I started using lower_int64. Acked-by: Alyssa Rosenzweig Part-of: --- src/mesa/state_tracker/st_glsl_to_nir.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 113b2cbfa14..aca156de2f0 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -503,15 +503,14 @@ st_glsl_to_nir_post_opts(struct st_context *st, struct gl_program *prog, bool lowered_64bit_ops = false; bool revectorize = false; - /* nir_lower_doubles is not prepared for vector ops, so if the backend doesn't - * request lower_alu_to_scalar until now, lower all 64 bit ops, and try to - * vectorize them afterwards again */ - if (!nir->options->lower_to_scalar) { - NIR_PASS(revectorize, nir, nir_lower_alu_to_scalar, filter_64_bit_instr, nullptr); - NIR_PASS(revectorize, nir, nir_lower_phis_to_scalar, false); - } - if (nir->options->lower_doubles_options) { + /* nir_lower_doubles is not prepared for vector ops, so if the backend doesn't + * request lower_alu_to_scalar until now, lower all 64 bit ops, and try to + * vectorize them afterwards again */ + if (!nir->options->lower_to_scalar) { + NIR_PASS(revectorize, nir, nir_lower_alu_to_scalar, filter_64_bit_instr, nullptr); + NIR_PASS(revectorize, nir, nir_lower_phis_to_scalar, false); + } NIR_PASS(lowered_64bit_ops, nir, nir_lower_doubles, st->ctx->SoftFP64, nir->options->lower_doubles_options); }