From 657591728aeee87f470260c1a55d77b8187e57eb Mon Sep 17 00:00:00 2001 From: "Eric R. Smith" Date: Sat, 3 Aug 2024 13:41:14 +0000 Subject: [PATCH] panfrost: move lower_image_ms to after lower_atomics The nir_lower_image_atomics_to_global pass can create some image load/stores, so we need to do the multisample image load/store lowering after this. Also, the pass only actually works on bifrost and below, so skip it for valhall. Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/compiler/bifrost_compile.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index 5c5ddb55925..5c8172ba3e6 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -4982,9 +4982,6 @@ bifrost_preprocess_nir(nir_shader *nir, unsigned gpu_id) psiz->data.precision = GLSL_PRECISION_MEDIUM; } - /* lower MSAA load/stores to 3D load/stores */ - NIR_PASS_V(nir, pan_nir_lower_image_ms); - /* Get rid of any global vars before we lower to scratch. */ NIR_PASS_V(nir, nir_lower_global_vars_to_local); @@ -5068,6 +5065,10 @@ bifrost_preprocess_nir(nir_shader *nir, unsigned gpu_id) NIR_PASS_V(nir, nir_lower_image_atomics_to_global); + /* on bifrost, lower MSAA load/stores to 3D load/stores */ + if (pan_arch(gpu_id) < 9) + NIR_PASS_V(nir, pan_nir_lower_image_ms); + NIR_PASS_V(nir, nir_lower_alu_to_scalar, bi_scalarize_filter, NULL); NIR_PASS_V(nir, nir_lower_load_const_to_scalar); NIR_PASS_V(nir, nir_lower_phis_to_scalar, true);