From 93d004ab6457c980ee689ff3fc4df11f23bdbf88 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: (cherry picked from commit daa48cbaef9584a9880f8107e5f03e27e246a8f5) --- .pick_status.json | 2 +- src/broadcom/vulkan/v3dv_meta_clear.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f2809c44083..e1481fcf526 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -714,7 +714,7 @@ "description": "v3dv: fix crash on 32-bit builds", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null 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); }