Mesa (master): virgl: use pipe_box for blit dst-rect

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 17 07:41:24 UTC 2019


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

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Thu Apr  4 16:58:46 2019 +0200

virgl: use pipe_box for blit dst-rect

Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh at chromium.org>

---

 src/gallium/drivers/virgl/virgl_texture.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c
index 9db876d171a..5a7ce71cb18 100644
--- a/src/gallium/drivers/virgl/virgl_texture.c
+++ b/src/gallium/drivers/virgl/virgl_texture.c
@@ -31,13 +31,17 @@
 static void virgl_copy_region_with_blit(struct pipe_context *pipe,
                                         struct pipe_resource *dst,
                                         unsigned dst_level,
-                                        unsigned dstx, unsigned dsty, unsigned dstz,
+                                        const struct pipe_box *dst_box,
                                         struct pipe_resource *src,
                                         unsigned src_level,
                                         const struct pipe_box *src_box)
 {
    struct pipe_blit_info blit;
 
+   assert(src_box->width == dst_box->width);
+   assert(src_box->height == dst_box->height);
+   assert(src_box->depth == dst_box->depth);
+
    memset(&blit, 0, sizeof(blit));
    blit.src.resource = src;
    blit.src.format = src->format;
@@ -46,9 +50,9 @@ static void virgl_copy_region_with_blit(struct pipe_context *pipe,
    blit.dst.resource = dst;
    blit.dst.format = dst->format;
    blit.dst.level = dst_level;
-   blit.dst.box.x = dstx;
-   blit.dst.box.y = dsty;
-   blit.dst.box.z = dstz;
+   blit.dst.box.x = dst_box->x;
+   blit.dst.box.y = dst_box->y;
+   blit.dst.box.z = dst_box->z;
    blit.dst.box.width = src_box->width;
    blit.dst.box.height = src_box->height;
    blit.dst.box.depth = src_box->depth;
@@ -159,7 +163,10 @@ static void *texture_transfer_map_resolve(struct pipe_context *ctx,
    if (!resolve_tmp)
       return NULL;
 
-   virgl_copy_region_with_blit(ctx, resolve_tmp, 0, 0, 0, 0, resource, level, box);
+   struct pipe_box dst_box = *box;
+   dst_box.x = dst_box.y = dst_box.z = 0;
+
+   virgl_copy_region_with_blit(ctx, resolve_tmp, 0, &dst_box, resource, level, box);
    ctx->flush(ctx, NULL, 0);
 
    void *ptr = texture_transfer_map_plain(ctx, resolve_tmp, 0, usage, box,




More information about the mesa-commit mailing list