Mesa (main): zink: remove unused variable from image map

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 17 21:13:58 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Jul 30 10:23:48 2021 -0400

zink: remove unused variable from image map

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12422>

---

 src/gallium/drivers/zink/zink_resource.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index 23749a9aaa0..66c7a3f1125 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -1221,7 +1221,7 @@ zink_image_map(struct pipe_context *pctx,
 
    trans->base.b.level = level;
 
-   void *ptr, *base;
+   void *ptr;
    if (usage & PIPE_MAP_WRITE && !(usage & PIPE_MAP_READ))
       /* this is like a blit, so we can potentially dump some clears or maybe we have to  */
       zink_fb_clears_apply_or_discard(ctx, pres, zink_rect_from_box(box), false);
@@ -1265,13 +1265,13 @@ zink_image_map(struct pipe_context *pctx,
          zink_fence_wait(pctx);
       }
 
-      ptr = base = map_resource(screen, staging_res);
-      if (!base)
+      ptr = map_resource(screen, staging_res);
+      if (!ptr)
          return NULL;
    } else {
       assert(!res->optimal_tiling);
-      base = map_resource(screen, res);
-      if (!base)
+      ptr = map_resource(screen, res);
+      if (!ptr)
          return NULL;
       if (zink_resource_has_usage(res)) {
          if (usage & PIPE_MAP_WRITE)
@@ -1303,7 +1303,7 @@ zink_image_map(struct pipe_context *pctx,
          VkMappedMemoryRange range = zink_resource_init_mem_range(screen, res->obj, res->obj->offset + offset, size);
          vkFlushMappedMemoryRanges(screen->dev, 1, &range);
       }
-      ptr = ((uint8_t *)base) + offset;
+      ptr = ((uint8_t *)ptr) + offset;
    }
    if (sizeof(void*) == 4)
       trans->base.b.usage |= ZINK_MAP_TEMPORARY;



More information about the mesa-commit mailing list