From daa48cbaef9584a9880f8107e5f03e27e246a8f5 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Mon, 10 Feb 2025 09:10:12 +0100 Subject: [PATCH] v3dv: fix crash on 32-bit builds Command buffer private object destroy callbacks receive a 64-integer so their signature should respect that to avoid alignment issues when passing pointers. This is the same we were already doing for color pipelines, but now for D/S pipelines too. Fixes crash on 32-bit build with: dEQP-VK.synchronization2.op.single_queue.fence.write_clear_attachments_read_copy_image_to_buffer.image_128x128_d16_unorm Reviewed-by: Juan A. Suarez cc: mesa-stable Part-of: --- src/broadcom/vulkan/v3dv_meta_clear.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_meta_clear.c b/src/broadcom/vulkan/v3dv_meta_clear.c index 2338e60e464..926f5eb8544 100644 --- a/src/broadcom/vulkan/v3dv_meta_clear.c +++ b/src/broadcom/vulkan/v3dv_meta_clear.c @@ -220,9 +220,11 @@ destroy_color_clear_pipeline(VkDevice _device, static void destroy_depth_clear_pipeline(VkDevice _device, - struct v3dv_meta_depth_clear_pipeline *p, + uint64_t pipeline, VkAllocationCallbacks *alloc) { + struct v3dv_meta_depth_clear_pipeline *p = + (struct v3dv_meta_depth_clear_pipeline *)(uintptr_t)pipeline; v3dv_DestroyPipeline(_device, p->pipeline, alloc); vk_free(alloc, p); } @@ -306,7 +308,7 @@ v3dv_meta_clear_finish(struct v3dv_device *device) hash_table_foreach(device->meta.depth_clear.cache, entry) { struct v3dv_meta_depth_clear_pipeline *item = entry->data; - destroy_depth_clear_pipeline(_device, item, &device->vk.alloc); + destroy_depth_clear_pipeline(_device, (uintptr_t)item, &device->vk.alloc); } _mesa_hash_table_destroy(device->meta.depth_clear.cache, NULL); }