Mesa (master): panfrost; Disable AFBC for depth buffers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 14 22:51:06 UTC 2019


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

Author: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Date:   Wed Mar 13 01:31:30 2019 +0000

panfrost; Disable AFBC for depth buffers

For inexplicable reasons, the depth buffer is faster if kept as linear,
whereas the colour buffers are faster if AFBC. Given both code paths are
available, we'll choose the faster one of each (which also helps with
testing coverage).

Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>

---

 src/gallium/drivers/panfrost/pan_context.c  | 5 +----
 src/gallium/drivers/panfrost/pan_resource.c | 6 ++++++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index a038ea122f7..f607a9a8169 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -2058,10 +2058,7 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx,
                                 panfrost_attach_vt_framebuffer(ctx);
                                 panfrost_set_scissor(ctx);
 
-                                struct panfrost_resource *tex = ((struct panfrost_resource *) ctx->pipe_framebuffer.zsbuf->texture);
-
-                                if (tex->bo->layout != PAN_AFBC && !panfrost_is_scanout(ctx))
-                                        panfrost_enable_afbc(ctx, tex, true);
+                                /* Keep the depth FBO linear */
                         }
                 }
         }
diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index 89be07871a5..ffb65fc52a9 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -220,6 +220,12 @@ panfrost_create_bo(struct panfrost_screen *screen, const struct pipe_resource *t
         /* Tiling textures is almost always faster, unless we only use it once */
         bool should_tile = (template->usage != PIPE_USAGE_STREAM) && (template->bind & PIPE_BIND_SAMPLER_VIEW);
 
+        /* For unclear reasons, depth/stencil is faster linear than AFBC, so
+         * make sure it's linear */
+
+        if (template->bind & PIPE_BIND_DEPTH_STENCIL)
+                should_tile = false;
+
         /* Set the layout appropriately */
         bo->layout = should_tile ? PAN_TILED : PAN_LINEAR;
 




More information about the mesa-commit mailing list