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 <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16437>
This commit is contained in:
Emma Anholt 2022-05-10 12:13:17 -07:00 committed by Marge Bot
parent 7e098db1ae
commit 6f0db3778f
1 changed files with 7 additions and 8 deletions

View File

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