From 24ea7cbb061eb9b6675c8e34025a6619541e0bdc Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 29 Oct 2021 08:48:46 -0400 Subject: [PATCH] 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 Part-of: --- 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 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)