vulkan: Track whether in shared mode in Swapchain
We need to adjust our behavior in various other places if this is the
case.
Test: build
Change-Id: I749242c4c7f0b19693b6cc5bfcf2dd6e01ed0e5b
diff --git a/vulkan/libvulkan/swapchain.cpp b/vulkan/libvulkan/swapchain.cpp
index 46e83db..202c65a 100644
--- a/vulkan/libvulkan/swapchain.cpp
+++ b/vulkan/libvulkan/swapchain.cpp
@@ -183,7 +183,9 @@
: surface(surface_),
num_images(num_images_),
mailbox_mode(present_mode == VK_PRESENT_MODE_MAILBOX_KHR),
- frame_timestamps_enabled(false) {
+ frame_timestamps_enabled(false),
+ shared(present_mode == VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR ||
+ present_mode == VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR) {
ANativeWindow* window = surface.window.get();
int64_t rdur;
native_window_get_refresh_cycle_duration(
@@ -197,6 +199,7 @@
bool mailbox_mode;
bool frame_timestamps_enabled;
uint64_t refresh_duration;
+ bool shared;
struct Image {
Image() : image(VK_NULL_HANDLE), dequeue_fence(-1), dequeued(false) {}