Mesa (main): nir: Extend store_combined_output_pan

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Jan 2 01:41:20 UTC 2022


Module: Mesa
Branch: main
Commit: 24ea7cbb061eb9b6675c8e34025a6619541e0bdc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=24ea7cbb061eb9b6675c8e34025a6619541e0bdc

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Fri Oct 29 08:48:46 2021 -0400

nir: Extend store_combined_output_pan

Extend store_combined_output_pan to take a dual source blend input in
addition to colour, depth, and stencil inputs. Use the last source for
this, and represent the type with the DEST_TYPE index. This is a hack
but there is no SRC2_TYPE and NIR doesn't seem to mind as long as we
know what we mean. This allows the backend to emit a combined "blend
render target #0" instruction taking two sources.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13714>

---

 src/compiler/nir/nir_intrinsics.py     | 2 +-
 src/panfrost/util/pan_lower_writeout.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py
index bae6e1aeed1..90b4e07c4ef 100644
--- a/src/compiler/nir/nir_intrinsics.py
+++ b/src/compiler/nir/nir_intrinsics.py
@@ -1149,7 +1149,7 @@ intrinsic("shared_atomic_comp_swap_dxil", src_comp=[1, 1, 1], dest_comp=1)
 
 # src[] = { value }
 store("raw_output_pan", [], [])
-store("combined_output_pan", [1, 1, 1], [COMPONENT, SRC_TYPE])
+store("combined_output_pan", [1, 1, 1, 4], [COMPONENT, SRC_TYPE, DEST_TYPE])
 load("raw_output_pan", [1], [BASE], [CAN_ELIMINATE, CAN_REORDER])
 
 # Loads the sampler paramaters <min_lod, max_lod, lod_bias>
diff --git a/src/panfrost/util/pan_lower_writeout.c b/src/panfrost/util/pan_lower_writeout.c
index 5b65be915a9..2c3a3f9bb5e 100644
--- a/src/panfrost/util/pan_lower_writeout.c
+++ b/src/panfrost/util/pan_lower_writeout.c
@@ -66,6 +66,7 @@ pan_nir_emit_combined_store(nir_builder *b,
                 rt0_store ? rt0_store->src[1].ssa : zero,
                 stores[0] ? stores[0]->src[0].ssa : zero,
                 stores[1] ? stores[1]->src[0].ssa : zero,
+                zero4,
         };
 
         for (int i = 0; i < ARRAY_SIZE(src); ++i)



More information about the mesa-commit mailing list