From 5cc27d59a11ed11081b3f5c9acc3280ec412ebed Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 1 Apr 2020 17:24:10 -0500 Subject: [PATCH] anv/image: Use align_u64 for image offsets The ALIGN functions in util/u_math.h work on uintptr_t whose size changes depending on your platform. Use ones which take an explicit 64-bit type instead to avoid 32-bit platform issues. Cc: mesa-stable@lists.freedesktop.org Reported-by: Mark Janes Reviewed-by: Jordan Justen Reviewed-by: Lionel Landwerlin Tested-by: Marge Bot Part-of: --- src/intel/vulkan/anv_image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index e0b5ea8db18..5d7845d721a 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -328,8 +328,8 @@ add_aux_state_tracking_buffer(struct anv_image *image, * a 4K alignment. We believe that 256B might be enough, but due to lack of * testing we will leave this as 4K for now. */ - image->planes[plane].size = ALIGN(image->planes[plane].size, 4096); - image->size = ALIGN(image->size, 4096); + image->planes[plane].size = align_u64(image->planes[plane].size, 4096); + image->size = align_u64(image->size, 4096); assert(image->planes[plane].offset % 4096 == 0); -- 2.30.2