Mesa (main): pan/bi: Use ST_TILE for multisampled blend output

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 20 20:29:21 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Wed Aug 18 22:12:02 2021 +0000

pan/bi: Use ST_TILE for multisampled blend output

ST_TILE lets us specify an explicit sample, whereas BLEND replicates to
all samples. This fully fixes the interaction between blend shaders and
multisampling on Bifrost, manifesting as
dEQP-GLES3.functional.fragment_ops.random.* failures with the
configuration rgba8888d24s8ms4.

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

---

 src/panfrost/bifrost/bifrost_compile.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 47f62f84d3b..73976566619 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -507,11 +507,17 @@ static void
 bi_emit_blend_op(bi_builder *b, bi_index rgba, nir_alu_type T, unsigned rt)
 {
         /* Reads 2 or 4 staging registers to cover the input */
-        unsigned sr_count = (nir_alu_type_get_type_size(T) <= 16) ? 2 : 4;
-
-        if (b->shader->inputs->is_blend) {
-                uint64_t blend_desc = b->shader->inputs->blend.bifrost_blend_desc;
-
+        unsigned size = nir_alu_type_get_type_size(T);
+        unsigned sr_count = (size <= 16) ? 2 : 4;
+        const struct panfrost_compile_inputs *inputs = b->shader->inputs;
+        uint64_t blend_desc = inputs->blend.bifrost_blend_desc;
+
+        if (inputs->is_blend && inputs->blend.nr_samples > 1) {
+                /* Conversion descriptor comes from the compile inputs, pixel
+                 * indices derived at run time based on sample ID */
+                bi_st_tile(b, rgba, bi_pixel_indices(b, rt), bi_register(60),
+                                bi_imm_u32(blend_desc >> 32), BI_VECSIZE_V4);
+        } else if (b->shader->inputs->is_blend) {
                 /* Blend descriptor comes from the compile inputs */
                 /* Put the result in r0 */
                 bi_blend_to(b, bi_register(0), rgba,



More information about the mesa-commit mailing list