summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-10-26 12:58:34 +1000
committerEmil Velikov <emil.l.velikov@gmail.com>2016-11-28 12:17:46 +0000
commit2e3e5c0e73cf4e3156823367084fd6e2d8286be8 (patch)
tree7458b5a9122d3f44de85323abb7f926d95579361
parentae6e22e311d417ec0b50edb9b656c1c3de6df28a (diff)
downloadexternal_mesa3d-2e3e5c0e73cf4e3156823367084fd6e2d8286be8.zip
external_mesa3d-2e3e5c0e73cf4e3156823367084fd6e2d8286be8.tar.gz
external_mesa3d-2e3e5c0e73cf4e3156823367084fd6e2d8286be8.tar.bz2
vulkan/wsi: store present mode in swapchain base class
This just moves this up a level as x11 will need it to implement things properly. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 1cdca1eb16ab33da338dda076794efd4bf859f7b)
-rw-r--r--src/vulkan/wsi/wsi_common.h1
-rw-r--r--src/vulkan/wsi/wsi_common_wayland.c6
-rw-r--r--src/vulkan/wsi/wsi_common_x11.c1
3 files changed, 5 insertions, 3 deletions
diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h
index ee67511..a1f5a40 100644
--- a/src/vulkan/wsi/wsi_common.h
+++ b/src/vulkan/wsi/wsi_common.h
@@ -53,6 +53,7 @@ struct wsi_swapchain {
VkAllocationCallbacks alloc;
const struct wsi_image_fns *image_fns;
VkFence fences[3];
+ VkPresentModeKHR present_mode;
VkResult (*destroy)(struct wsi_swapchain *swapchain,
const VkAllocationCallbacks *pAllocator);
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index a8130ce..f6c218b 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -576,7 +576,7 @@ wsi_wl_swapchain_queue_present(struct wsi_swapchain *wsi_chain,
{
struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain;
- if (chain->present_mode == VK_PRESENT_MODE_FIFO_KHR) {
+ if (chain->base.present_mode == VK_PRESENT_MODE_FIFO_KHR) {
while (!chain->fifo_ready) {
int ret = wl_display_dispatch_queue(chain->display->display,
chain->queue);
@@ -589,7 +589,7 @@ wsi_wl_swapchain_queue_present(struct wsi_swapchain *wsi_chain,
wl_surface_attach(chain->surface, chain->images[image_index].buffer, 0, 0);
wl_surface_damage(chain->surface, 0, 0, INT32_MAX, INT32_MAX);
- if (chain->present_mode == VK_PRESENT_MODE_FIFO_KHR) {
+ if (chain->base.present_mode == VK_PRESENT_MODE_FIFO_KHR) {
struct wl_callback *frame = wl_surface_frame(chain->surface);
wl_proxy_set_queue((struct wl_proxy *)frame, chain->queue);
wl_callback_add_listener(frame, &frame_listener, chain);
@@ -717,12 +717,12 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
chain->base.acquire_next_image = wsi_wl_swapchain_acquire_next_image;
chain->base.queue_present = wsi_wl_swapchain_queue_present;
chain->base.image_fns = image_fns;
+ chain->base.present_mode = pCreateInfo->presentMode;
chain->surface = surface->surface;
chain->extent = pCreateInfo->imageExtent;
chain->vk_format = pCreateInfo->imageFormat;
chain->drm_format = wl_drm_format_for_vk_format(chain->vk_format, alpha);
- chain->present_mode = pCreateInfo->presentMode;
chain->fifo_ready = true;
chain->image_count = num_images;
diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index ae2d111..9ce3842 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -825,6 +825,7 @@ x11_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
chain->base.acquire_next_image = x11_acquire_next_image;
chain->base.queue_present = x11_queue_present;
chain->base.image_fns = image_fns;
+ chain->base.present_mode = pCreateInfo->presentMode;
chain->conn = conn;
chain->window = window;
chain->depth = geometry->depth;