Mesa (staging/21.2): panfrost: Fix gl_FragColor lowering

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 27 21:53:15 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: d44a78c078f89e1bb11f75e2d12c5648da93f312
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d44a78c078f89e1bb11f75e2d12c5648da93f312

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Sat Oct 16 16:14:00 2021 -0400

panfrost: Fix gl_FragColor lowering

The gl_FragColor lowering in the fragment shader depends on the number
of render targets, which can change every set_framebuffer_state.
set_framebuffer_state thus needs to force a rebind of the fragment
shader.

Fixes a regression in Piglit fbo-drawbuffers-none gl_FragColor -auto
-fbo from enabling AFBC on Mali G52.

Fixes: 28ac4d1e005 ("panfrost: Call nir_lower_fragcolor based on key")
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13498>
(cherry picked from commit e0335ad8881d3feeb89b571b1047bb8799ae23b7)

---

 .pick_status.json                          | 2 +-
 src/gallium/drivers/panfrost/pan_context.c | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index f0c200b78fd..9e5a4577fe7 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -94,7 +94,7 @@
         "description": "panfrost: Fix gl_FragColor lowering",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "28ac4d1e00553b38691966b4b9b95fee826c97d4"
     },
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index b617c41241b..ee55b61d5fa 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -688,11 +688,10 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx,
         }
 
         /* We may need to generate a new variant if the fragment shader is
-         * keyed to the framebuffer format (due to EXT_framebuffer_fetch) */
+         * keyed to the framebuffer format or render target count */
         struct panfrost_shader_variants *fs = ctx->shader[PIPE_SHADER_FRAGMENT];
 
-        if (fs && fs->variant_count &&
-            fs->variants[fs->active_variant].info.fs.outputs_read)
+        if (fs && fs->variant_count)
                 ctx->base.bind_fs_state(&ctx->base, fs);
 }
 



More information about the mesa-commit mailing list