Mesa (staging/22.0): pan/bi: Read base for combined stores

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 26 16:40:23 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: 1020ddf8cd0df73d857307b8ae043a1ff7b751fc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1020ddf8cd0df73d857307b8ae043a1ff7b751fc

Author: Icecream95 <ixn at disroot.org>
Date:   Tue May 24 16:29:46 2022 +1200

pan/bi: Read base for combined stores

Fixes depth/stencil writes with MRT.

Fixes: 996645e4794 ("pan/bi: Don't read base for combined stores")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16685>
(cherry picked from commit f1a226dd2418e1765750c2c06dcb4a50fbcc853c)

---

 .pick_status.json                      |  2 +-
 src/panfrost/bifrost/bifrost_compile.c | 15 +++++----------
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index e889e4e9270..0337cf602c7 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -580,7 +580,7 @@
         "description": "pan/bi: Read base for combined stores",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "because_sha": "996645e4794acc84537b6b69680acfc46620bbcb"
     },
     {
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 1887f9ef651..0e7075fe87c 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -582,16 +582,11 @@ bi_emit_fragment_out(bi_builder *b, nir_intrinsic_instr *instr)
         bool emit_blend = writeout & (PAN_WRITEOUT_C);
         bool emit_zs = writeout & (PAN_WRITEOUT_Z | PAN_WRITEOUT_S);
 
-        unsigned loc = ~0;
+        const nir_variable *var =
+                nir_find_variable_with_driver_location(b->shader->nir,
+                                                       nir_var_shader_out, nir_intrinsic_base(instr));
 
-        if (!combined) {
-                const nir_variable *var =
-                        nir_find_variable_with_driver_location(b->shader->nir,
-                                        nir_var_shader_out, nir_intrinsic_base(instr));
-                assert(var);
-
-                loc = var->data.location;
-        }
+        unsigned loc = var ? var->data.location : 0;
 
         bi_index src0 = bi_src_index(&instr->src[0]);
 
@@ -641,7 +636,7 @@ bi_emit_fragment_out(bi_builder *b, nir_intrinsic_instr *instr)
         }
 
         if (emit_blend) {
-                unsigned rt = combined ? 0 : (loc - FRAG_RESULT_DATA0);
+                unsigned rt = loc ? (loc - FRAG_RESULT_DATA0) : 0;
                 bool dual = (writeout & PAN_WRITEOUT_2);
                 bi_index color = bi_src_index(&instr->src[0]);
                 bi_index color2 = dual ? bi_src_index(&instr->src[4]) : bi_null();



More information about the mesa-commit mailing list