pan/bi: Call pan_nir_lower_zs_store late
authorAlyssa Rosenzweig <alyssa@collabora.com>
Mon, 20 Feb 2023 04:44:17 +0000 (23:44 -0500)
committerMarge Bot <emma+marge@anholt.net>
Thu, 23 Mar 2023 23:53:46 +0000 (23:53 +0000)
This will give the driver [notably, PanVK] a chance to lower dual source
blending without having the dual stores turned into store_combined_output_pan.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>

src/panfrost/compiler/bifrost_compile.c

index 1d131d5..830751a 100644 (file)
@@ -4751,7 +4751,6 @@ bifrost_preprocess_nir(nir_shader *nir, unsigned gpu_id)
    }
 
    NIR_PASS_V(nir, nir_lower_ssbo);
-   NIR_PASS_V(nir, pan_nir_lower_zs_store);
    NIR_PASS_V(nir, pan_lower_sample_pos);
    NIR_PASS_V(nir, nir_lower_bit_size, bi_lower_bit_size, NULL);
    NIR_PASS_V(nir, nir_lower_64bit_phis);
@@ -5167,6 +5166,11 @@ bifrost_compile_shader_nir(nir_shader *nir,
 {
    bifrost_debug = debug_get_option_bifrost_debug();
 
+   /* Combine stores late, to give the driver a chance to lower dual-source
+    * blending as regular store_output intrinsics.
+    */
+   NIR_PASS_V(nir, pan_nir_lower_zs_store);
+
    bi_optimize_nir(nir, inputs->gpu_id, inputs->is_blend);
 
    info->tls_size = nir->scratch_size;