wsi/common: Add common implementation of vkReleaseSwapchainImagesEXT.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no> Reviewed-by: Joshua Ashton <joshua@froggi.es> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
This commit is contained in:
committed by
Marge Bot
parent
c1fa7fe785
commit
8ece1ade5b
@@ -987,6 +987,29 @@ wsi_DestroySwapchainKHR(VkDevice _device,
|
||||
swapchain->destroy(swapchain, alloc);
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
wsi_ReleaseSwapchainImagesEXT(VkDevice _device,
|
||||
const VkReleaseSwapchainImagesInfoEXT *pReleaseInfo)
|
||||
{
|
||||
VK_FROM_HANDLE(wsi_swapchain, swapchain, pReleaseInfo->swapchain);
|
||||
VkResult result = swapchain->release_images(swapchain,
|
||||
pReleaseInfo->imageIndexCount,
|
||||
pReleaseInfo->pImageIndices);
|
||||
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
if (swapchain->wsi->set_memory_ownership) {
|
||||
for (uint32_t i = 0; i < pReleaseInfo->imageIndexCount; i++) {
|
||||
uint32_t image_index = pReleaseInfo->pImageIndices[i];
|
||||
VkDeviceMemory mem = swapchain->get_wsi_image(swapchain, image_index)->memory;
|
||||
swapchain->wsi->set_memory_ownership(swapchain->device, mem, false);
|
||||
}
|
||||
}
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult
|
||||
wsi_common_get_images(VkSwapchainKHR _swapchain,
|
||||
uint32_t *pSwapchainImageCount,
|
||||
|
||||
@@ -188,6 +188,9 @@ struct wsi_swapchain {
|
||||
VkResult (*wait_for_present)(struct wsi_swapchain *swap_chain,
|
||||
uint64_t present_id,
|
||||
uint64_t timeout);
|
||||
VkResult (*release_images)(struct wsi_swapchain *swap_chain,
|
||||
uint32_t count,
|
||||
const uint32_t *indices);
|
||||
};
|
||||
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user