From 91c48d8f43725a7887d2074270c57ca6bcd06466 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 10 Apr 2024 10:51:39 +0200 Subject: [PATCH] radv/rmv: fix image binds logging for disjoint images Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_image.c | 6 +++--- src/amd/vulkan/radv_rmv.c | 5 +++-- src/amd/vulkan/radv_rmv.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index 36616576bb2..a68266ac216 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -1372,7 +1372,7 @@ radv_image_create(VkDevice _device, const struct radv_image_create_info *create_ radv_rmv_log_image_create(device, pCreateInfo, is_internal, *pImage); if (image->bindings[0].bo) - radv_rmv_log_image_bind(device, *pImage); + radv_rmv_log_image_bind(device, 0, *pImage); return VK_SUCCESS; } @@ -1682,7 +1682,7 @@ radv_BindImageMemory2(VkDevice _device, uint32_t bindInfoCount, const VkBindImag image->bindings[0].bo = swapchain_img->bindings[0].bo; image->bindings[0].offset = swapchain_img->bindings[0].offset; - radv_rmv_log_image_bind(device, pBindInfos[i].image); + radv_rmv_log_image_bind(device, 0, pBindInfos[i].image); vk_address_binding_report(&instance->vk, &image->vk.base, radv_buffer_get_va(image->bindings[0].bo) + image->bindings[0].offset, @@ -1722,7 +1722,7 @@ radv_BindImageMemory2(VkDevice _device, uint32_t bindInfoCount, const VkBindImag image->bindings[bind_idx].bo = mem->bo; image->bindings[bind_idx].offset = pBindInfos[i].memoryOffset; - radv_rmv_log_image_bind(device, pBindInfos[i].image); + radv_rmv_log_image_bind(device, bind_idx, pBindInfos[i].image); vk_address_binding_report(&instance->vk, &image->vk.base, radv_buffer_get_va(image->bindings[bind_idx].bo) + image->bindings[bind_idx].offset, diff --git a/src/amd/vulkan/radv_rmv.c b/src/amd/vulkan/radv_rmv.c index f496e1ed321..d5beeea9f34 100644 --- a/src/amd/vulkan/radv_rmv.c +++ b/src/amd/vulkan/radv_rmv.c @@ -596,14 +596,15 @@ radv_rmv_log_image_create(struct radv_device *device, const VkImageCreateInfo *c } void -radv_rmv_log_image_bind(struct radv_device *device, VkImage _image) +radv_rmv_log_image_bind(struct radv_device *device, uint32_t bind_idx, VkImage _image) { if (!device->vk.memory_trace_data.is_enabled) return; VK_FROM_HANDLE(radv_image, image, _image); simple_mtx_lock(&device->vk.memory_trace_data.token_mtx); - log_resource_bind_locked(device, (uint64_t)_image, image->bindings[0].bo, image->bindings[0].offset, image->size); + log_resource_bind_locked(device, (uint64_t)_image, image->bindings[bind_idx].bo, image->bindings[bind_idx].offset, + image->size); simple_mtx_unlock(&device->vk.memory_trace_data.token_mtx); } diff --git a/src/amd/vulkan/radv_rmv.h b/src/amd/vulkan/radv_rmv.h index 34cb98e9bde..47f48dcd9d5 100644 --- a/src/amd/vulkan/radv_rmv.h +++ b/src/amd/vulkan/radv_rmv.h @@ -41,7 +41,7 @@ void radv_rmv_log_buffer_bind(struct radv_device *device, VkBuffer _buffer); void radv_rmv_log_image_create(struct radv_device *device, const VkImageCreateInfo *create_info, bool is_internal, VkImage _image); -void radv_rmv_log_image_bind(struct radv_device *device, VkImage _image); +void radv_rmv_log_image_bind(struct radv_device *device, uint32_t bind_idx, VkImage _image); void radv_rmv_log_query_pool_create(struct radv_device *device, VkQueryPool pool);