mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
hk: adopt wsi_common_get_memory
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35875>
This commit is contained in:
parent
7bb3f29b2a
commit
3f273eb01b
1 changed files with 8 additions and 19 deletions
|
|
@ -1360,28 +1360,17 @@ hk_BindImageMemory2(VkDevice device, uint32_t bindInfoCount,
|
|||
/* Ignore this struct on Android, we cannot access swapchain structures
|
||||
* there. */
|
||||
#ifdef HK_USE_WSI_PLATFORM
|
||||
const VkBindImageMemorySwapchainInfoKHR *swapchain_info =
|
||||
vk_find_struct_const(pBindInfos[i].pNext,
|
||||
BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR);
|
||||
|
||||
if (swapchain_info && swapchain_info->swapchain != VK_NULL_HANDLE) {
|
||||
VkImage _wsi_image = wsi_common_get_image(swapchain_info->swapchain,
|
||||
swapchain_info->imageIndex);
|
||||
VK_FROM_HANDLE(hk_image, wsi_img, _wsi_image);
|
||||
|
||||
assert(image->plane_count == 1);
|
||||
assert(wsi_img->plane_count == 1);
|
||||
|
||||
struct hk_image_plane *plane = &image->planes[0];
|
||||
struct hk_image_plane *swapchain_plane = &wsi_img->planes[0];
|
||||
|
||||
/* Copy memory binding information from swapchain image to the current
|
||||
* image's plane. */
|
||||
plane->addr = swapchain_plane->addr;
|
||||
continue;
|
||||
if (!mem) {
|
||||
const VkBindImageMemorySwapchainInfoKHR *swapchain_info =
|
||||
vk_find_struct_const(pBindInfos[i].pNext,
|
||||
BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR);
|
||||
assert(swapchain_info && swapchain_info->swapchain != VK_NULL_HANDLE);
|
||||
mem = hk_device_memory_from_handle(wsi_common_get_memory(
|
||||
swapchain_info->swapchain, swapchain_info->imageIndex));
|
||||
}
|
||||
#endif
|
||||
|
||||
assert(mem);
|
||||
uint64_t offset_B = pBindInfos[i].memoryOffset;
|
||||
if (image->disjoint) {
|
||||
const VkBindImagePlaneMemoryInfo *plane_info = vk_find_struct_const(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue