Mesa (main): v3d: allow TFU blitting for single layer textures

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 9 07:28:17 UTC 2022


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

Author: Juan A. Suarez Romero <jasuarez at igalia.com>
Date:   Fri May  6 13:56:17 2022 +0200

v3d: allow TFU blitting for single layer textures

TFU just handles 2D textures.

But for 2D array textures, cubemaps and 3D textures, if only one layer needs
to be blitted, then it is like a simple 2D texture, and thus we can also
use the TFU.

Signed-off-by: Juan A. Suarez Romero <jasuarez at igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16372>

---

 src/gallium/drivers/v3d/v3d_blit.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/v3d/v3d_blit.c b/src/gallium/drivers/v3d/v3d_blit.c
index 84bc5fc5263..9b8ae425ac4 100644
--- a/src/gallium/drivers/v3d/v3d_blit.c
+++ b/src/gallium/drivers/v3d/v3d_blit.c
@@ -220,9 +220,6 @@ v3d_tfu(struct pipe_context *pctx,
         if (psrc->nr_samples != pdst->nr_samples)
                 return false;
 
-        if (pdst->target != PIPE_TEXTURE_2D || psrc->target != PIPE_TEXTURE_2D)
-                return false;
-
         /* Can't write to raster. */
         if (dst_base_slice->tiling == V3D_TILING_RASTER)
                 return false;
@@ -369,10 +366,12 @@ v3d_tfu_blit(struct pipe_context *pctx, struct pipe_blit_info *info)
             info->dst.box.y != 0 ||
             info->dst.box.width != dst_width ||
             info->dst.box.height != dst_height ||
+            info->dst.box.depth != 1 ||
             info->src.box.x != 0 ||
             info->src.box.y != 0 ||
             info->src.box.width != info->dst.box.width ||
-            info->src.box.height != info->dst.box.height) {
+            info->src.box.height != info->dst.box.height ||
+            info->src.box.depth != 1) {
                 return;
         }
 



More information about the mesa-commit mailing list