panfrost: Mark PIPE_BUFFER BOs as not renderable
authorIcecream95 <ixn@keemail.me>
Sat, 4 Apr 2020 23:49:07 +0000 (11:49 +1200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 9 Jun 2020 13:52:52 +0000 (13:52 +0000)
Without this, memory usage explodes by 16x due to height alignment.

Closes: #2715
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4451>

src/gallium/drivers/panfrost/pan_resource.c

index 8b57abada3edd3b41165fc2a1f13325995c38562..0506163f2913fe84a507f16b77e4efd7e17b363b 100644 (file)
@@ -280,7 +280,8 @@ panfrost_setup_slices(struct panfrost_resource *pres, size_t *bo_size)
          * makes code a lot simpler */
 
         bool renderable = res->bind &
-                          (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL);
+                          (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL) &&
+                          res->target != PIPE_BUFFER;
         bool afbc = pres->layout == MALI_TEXTURE_AFBC;
         bool tiled = pres->layout == MALI_TEXTURE_TILED;
         bool should_align = renderable || tiled;