radv: map images with host-transfer at bind time
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35974>
This commit is contained in:
committed by
Marge Bot
parent
d85b7b6c62
commit
afa7509207
@@ -1776,7 +1776,7 @@ radv_DestroyImage(VkDevice _device, VkImage _image, const VkAllocationCallbacks
|
||||
|
||||
static void
|
||||
radv_bind_image_memory(struct radv_device *device, struct radv_image *image, uint32_t bind_idx,
|
||||
struct radeon_winsys_bo *bo, uint64_t addr, uint64_t range)
|
||||
struct radeon_winsys_bo *bo, uint64_t addr, uint64_t offset, uint64_t range)
|
||||
{
|
||||
struct radv_physical_device *pdev = radv_device_physical(device);
|
||||
struct radv_instance *instance = radv_physical_device_instance(pdev);
|
||||
@@ -1784,9 +1784,12 @@ radv_bind_image_memory(struct radv_device *device, struct radv_image *image, uin
|
||||
assert(bind_idx < 3);
|
||||
|
||||
image->bindings[bind_idx].bo = bo;
|
||||
image->bindings[bind_idx].addr = addr;
|
||||
image->bindings[bind_idx].addr = addr + offset;
|
||||
image->bindings[bind_idx].range = range;
|
||||
|
||||
if (image->vk.usage & VK_IMAGE_USAGE_HOST_TRANSFER_BIT)
|
||||
image->bindings[bind_idx].host_ptr = (uint8_t *)radv_buffer_map(device->ws, bo) + offset;
|
||||
|
||||
radv_rmv_log_image_bind(device, bind_idx, radv_image_to_handle(image));
|
||||
|
||||
vk_address_binding_report(&instance->vk, &image->vk.base, image->bindings[bind_idx].addr,
|
||||
@@ -1848,9 +1851,10 @@ radv_BindImageMemory2(VkDevice _device, uint32_t bindInfoCount, const VkBindImag
|
||||
}
|
||||
}
|
||||
|
||||
const uint64_t addr = radv_buffer_get_va(mem->bo) + pBindInfos[i].memoryOffset;
|
||||
const uint64_t addr = radv_buffer_get_va(mem->bo);
|
||||
|
||||
radv_bind_image_memory(device, image, bind_idx, mem->bo, addr, reqs.memoryRequirements.size);
|
||||
radv_bind_image_memory(device, image, bind_idx, mem->bo, addr, pBindInfos[i].memoryOffset,
|
||||
reqs.memoryRequirements.size);
|
||||
}
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ struct radv_image_plane {
|
||||
struct radv_image_binding {
|
||||
/* Set when bound */
|
||||
struct radeon_winsys_bo *bo;
|
||||
void *host_ptr;
|
||||
uint64_t addr;
|
||||
uint64_t range;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user