vulkan/wsi/x11: add support for IMMEDIATE present mode
authorDave Airlie <airlied@redhat.com>
Wed, 26 Oct 2016 03:05:51 +0000 (13:05 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 27 Oct 2016 01:43:15 +0000 (11:43 +1000)
We shouldn't be using ASYNC here, that would be used
for immediate mode, so let's implement that.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/vulkan/wsi/wsi_common_x11.c

index 47eeb3e5e2111221cf8493331269f813cc3290f9..efd3fb5529962e05658f8d445ed06b7046182ddf 100644 (file)
@@ -141,6 +141,7 @@ static const VkSurfaceFormatKHR formats[] = {
 };
 
 static const VkPresentModeKHR present_modes[] = {
+   VK_PRESENT_MODE_IMMEDIATE_KHR,
    VK_PRESENT_MODE_MAILBOX_KHR,
 };
 
@@ -643,7 +644,8 @@ x11_queue_present(struct wsi_swapchain *anv_chain,
    int64_t divisor = 0;
    int64_t remainder = 0;
 
-   options |= XCB_PRESENT_OPTION_ASYNC;
+   if (chain->base.present_mode == VK_PRESENT_MODE_IMMEDIATE_KHR)
+      options |= XCB_PRESENT_OPTION_ASYNC;
 
    xshmfence_reset(image->shm_fence);