diff options
author | Jason Ekstrand <[email protected]> | 2017-11-16 09:56:37 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-12-04 10:04:19 -0800 |
commit | 393aa3f6c929fdbcaa599597e28a3206aa09dcc2 (patch) | |
tree | e5a4f32c38620b7edb1856d06e2115e914792ca0 /src/vulkan/wsi/wsi_common.c | |
parent | 1117f843fe6223a50aeedfd943696ac4a7b4691f (diff) |
vulkan/wsi: Move get_images into common code
This moves bits out of all four corners (anv, radv, x11, wayland) and
into the wsi common code. We also switch to using an outarray to ensure
we get our return code right.
Reviewed-by: Dave Airlie <[email protected]>
Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/vulkan/wsi/wsi_common.c')
-rw-r--r-- | src/vulkan/wsi/wsi_common.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c index e5a9a28d347..ea4920c6fe3 100644 --- a/src/vulkan/wsi/wsi_common.c +++ b/src/vulkan/wsi/wsi_common.c @@ -508,6 +508,23 @@ wsi_prime_image_blit_to_linear(const struct wsi_swapchain *chain, } VkResult +wsi_common_get_images(VkSwapchainKHR _swapchain, + uint32_t *pSwapchainImageCount, + VkImage *pSwapchainImages) +{ + WSI_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain); + VK_OUTARRAY_MAKE(images, pSwapchainImages, pSwapchainImageCount); + + for (uint32_t i = 0; i < swapchain->image_count; i++) { + vk_outarray_append(&images, image) { + *image = swapchain->get_wsi_image(swapchain, i)->image; + } + } + + return vk_outarray_status(&images); +} + +VkResult wsi_common_queue_present(const struct wsi_device *wsi, VkDevice device, VkQueue queue, |