}
VkResult radv_AcquireNextImageKHR(
- VkDevice _device,
+ VkDevice device,
VkSwapchainKHR swapchain,
uint64_t timeout,
VkSemaphore semaphore,
- VkFence _fence,
+ VkFence fence,
+ uint32_t* pImageIndex)
+{
+ VkAcquireNextImageInfoKHR acquire_info = {
+ .sType = VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR,
+ .swapchain = swapchain,
+ .timeout = timeout,
+ .semaphore = semaphore,
+ .fence = fence,
+ .deviceMask = 0,
+ };
+
+ return radv_AcquireNextImage2KHR(device, &acquire_info, pImageIndex);
+}
+
+VkResult radv_AcquireNextImage2KHR(
+ VkDevice _device,
+ const VkAcquireNextImageInfoKHR* pAcquireInfo,
uint32_t* pImageIndex)
{
RADV_FROM_HANDLE(radv_device, device, _device);
struct radv_physical_device *pdevice = device->physical_device;
- RADV_FROM_HANDLE(radv_fence, fence, _fence);
-
- VkResult result = wsi_common_acquire_next_image(&pdevice->wsi_device,
- _device,
- swapchain,
- timeout,
- semaphore,
- pImageIndex);
+ RADV_FROM_HANDLE(radv_fence, fence, pAcquireInfo->fence);
+
+ VkResult result = wsi_common_acquire_next_image2(&pdevice->wsi_device,
+ _device,
+ pAcquireInfo,
+ pImageIndex);
if (fence && (result == VK_SUCCESS || result == VK_SUBOPTIMAL_KHR)) {
fence->submitted = true;
}
VkResult anv_AcquireNextImageKHR(
- VkDevice _device,
+ VkDevice device,
VkSwapchainKHR swapchain,
uint64_t timeout,
VkSemaphore semaphore,
VkFence fence,
uint32_t* pImageIndex)
+{
+ VkAcquireNextImageInfoKHR acquire_info = {
+ .sType = VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR,
+ .swapchain = swapchain,
+ .timeout = timeout,
+ .semaphore = semaphore,
+ .fence = fence,
+ .deviceMask = 0,
+ };
+
+ return anv_AcquireNextImage2KHR(device, &acquire_info, pImageIndex);
+}
+
+VkResult anv_AcquireNextImage2KHR(
+ VkDevice _device,
+ const VkAcquireNextImageInfoKHR* pAcquireInfo,
+ uint32_t* pImageIndex)
{
ANV_FROM_HANDLE(anv_device, device, _device);
struct anv_physical_device *pdevice = &device->instance->physicalDevice;
- VkResult result = wsi_common_acquire_next_image(&pdevice->wsi_device,
- _device,
- swapchain,
- timeout,
- semaphore,
- pImageIndex);
+ VkResult result = wsi_common_acquire_next_image2(&pdevice->wsi_device,
+ _device,
+ pAcquireInfo,
+ pImageIndex);
/* Thanks to implicit sync, the image is ready immediately. However, we
* should wait for the current GPU state to finish.
*/
- if (fence != VK_NULL_HANDLE)
- anv_QueueSubmit(anv_queue_to_handle(&device->queue), 0, NULL, fence);
+ if (pAcquireInfo->fence != VK_NULL_HANDLE) {
+ anv_QueueSubmit(anv_queue_to_handle(&device->queue), 0, NULL,
+ pAcquireInfo->fence);
+ }
return result;
}
}
VkResult
-wsi_common_acquire_next_image(const struct wsi_device *wsi,
- VkDevice device,
- VkSwapchainKHR _swapchain,
- uint64_t timeout,
- VkSemaphore semaphore,
- uint32_t *pImageIndex)
+wsi_common_acquire_next_image2(const struct wsi_device *wsi,
+ VkDevice device,
+ const VkAcquireNextImageInfoKHR *pAcquireInfo,
+ uint32_t *pImageIndex)
{
- WSI_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain);
+ WSI_FROM_HANDLE(wsi_swapchain, swapchain, pAcquireInfo->swapchain);
- return swapchain->acquire_next_image(swapchain, timeout,
- semaphore, pImageIndex);
+ return swapchain->acquire_next_image(swapchain, pAcquireInfo, pImageIndex);
}
VkResult
VkImage *pSwapchainImages);
VkResult
-wsi_common_acquire_next_image(const struct wsi_device *wsi,
- VkDevice device,
- VkSwapchainKHR swapchain,
- uint64_t timeout,
- VkSemaphore semaphore,
- uint32_t *pImageIndex);
+wsi_common_acquire_next_image2(const struct wsi_device *wsi,
+ VkDevice device,
+ const VkAcquireNextImageInfoKHR *pAcquireInfo,
+ uint32_t *pImageIndex);
VkResult
wsi_common_create_swapchain(struct wsi_device *wsi,
static VkResult
wsi_display_acquire_next_image(struct wsi_swapchain *drv_chain,
- uint64_t timeout,
- VkSemaphore semaphore,
+ const VkAcquireNextImageInfoKHR *info,
uint32_t *image_index)
{
struct wsi_display_swapchain *chain =
if (chain->status != VK_SUCCESS)
return chain->status;
+ uint64_t timeout = info->timeout;
if (timeout != 0 && timeout != UINT64_MAX)
timeout = wsi_rel_to_abs_time(timeout);
struct wsi_image *(*get_wsi_image)(struct wsi_swapchain *swapchain,
uint32_t image_index);
VkResult (*acquire_next_image)(struct wsi_swapchain *swap_chain,
- uint64_t timeout, VkSemaphore semaphore,
+ const VkAcquireNextImageInfoKHR *info,
uint32_t *image_index);
VkResult (*queue_present)(struct wsi_swapchain *swap_chain,
uint32_t image_index,
static VkResult
wsi_wl_swapchain_acquire_next_image(struct wsi_swapchain *wsi_chain,
- uint64_t timeout,
- VkSemaphore semaphore,
+ const VkAcquireNextImageInfoKHR *info,
uint32_t *image_index)
{
struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain;
static VkResult
x11_acquire_next_image(struct wsi_swapchain *anv_chain,
- uint64_t timeout,
- VkSemaphore semaphore,
+ const VkAcquireNextImageInfoKHR *info,
uint32_t *image_index)
{
struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain;
+ uint64_t timeout = info->timeout;
if (chain->threaded) {
return x11_acquire_next_image_from_queue(chain, image_index, timeout);