Mesa (main): zink: use align64 for allocation sizes

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 28 02:14:55 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Oct 27 16:37:03 2021 -0400

zink: use align64 for allocation sizes

avoid 32bit sint overflows

fixes #5568

cc: mesa-stable

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

---

 src/gallium/drivers/zink/zink_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_bo.c b/src/gallium/drivers/zink/zink_bo.c
index e673efefb3e..6a554ec91f2 100644
--- a/src/gallium/drivers/zink/zink_bo.c
+++ b/src/gallium/drivers/zink/zink_bo.c
@@ -263,7 +263,7 @@ bo_create_internal(struct zink_screen *screen,
    mai.memoryTypeIndex = screen->heap_map[heap];
    if (screen->info.mem_props.memoryTypes[mai.memoryTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
       alignment = MAX2(alignment, screen->info.props.limits.minMemoryMapAlignment);
-      mai.allocationSize = align(mai.allocationSize, screen->info.props.limits.minMemoryMapAlignment);
+      mai.allocationSize = align64(mai.allocationSize, screen->info.props.limits.minMemoryMapAlignment);
    }
    VkResult ret = VKSCR(AllocateMemory)(screen->dev, &mai, NULL, &bo->mem);
    if (!zink_screen_handle_vkresult(screen, ret))



More information about the mesa-commit mailing list