aboutsummaryrefslogtreecommitdiff
path: root/include/render
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-07-27 18:36:31 +0200
committerSimon Ser <contact@emersion.fr>2020-11-15 22:48:42 +0100
commitc11c6c45685c96e1b525b2f944bc278be20c119e (patch)
treee36103d3af28ff714ab6cc07fdb232bd9a501f12 /include/render
parentef846a883950e59f95507daa6d3f96f0e84da3af (diff)
render/swapchain: add support for buffer age
Diffstat (limited to 'include/render')
-rw-r--r--include/render/swapchain.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/render/swapchain.h b/include/render/swapchain.h
index 57a0cd3f..243f0404 100644
--- a/include/render/swapchain.h
+++ b/include/render/swapchain.h
@@ -10,6 +10,7 @@
struct wlr_swapchain_slot {
struct wlr_buffer *buffer;
bool acquired; // waiting for release
+ int age;
struct wl_listener release;
};
@@ -35,7 +36,15 @@ void wlr_swapchain_destroy(struct wlr_swapchain *swapchain);
* The returned buffer is locked. When the caller is done with it, they must
* unlock it by calling wlr_buffer_unlock.
*/
-struct wlr_buffer *wlr_swapchain_acquire(
- struct wlr_swapchain *swapchain);
+struct wlr_buffer *wlr_swapchain_acquire(struct wlr_swapchain *swapchain,
+ int *age);
+/**
+ * Mark the buffer as submitted for presentation. This needs to be called by
+ * swap chain users on frame boundaries.
+ *
+ * If the buffer hasn't been created via the swap chain, the call is ignored.
+ */
+void wlr_swapchain_set_buffer_submitted(struct wlr_swapchain *swapchain,
+ struct wlr_buffer *buffer);
#endif