render/swapchain: Add-on to get swapchain from buffer

This can be used to cache things shared between render buffers (e.g.,
blending buffers) on the swapchain instance itself.
This commit is contained in:
Kenny Levinsen 2024-07-07 13:31:56 +02:00
parent 5432108846
commit 827ea06c44
2 changed files with 50 additions and 0 deletions

View file

@ -4,6 +4,7 @@
#include <stdbool.h>
#include <wayland-server-core.h>
#include <wlr/render/drm_format_set.h>
#include <wlr/util/addon.h>
#define WLR_SWAPCHAIN_CAP 4
@ -23,6 +24,8 @@ struct wlr_swapchain {
struct wlr_swapchain_slot slots[WLR_SWAPCHAIN_CAP];
struct wl_listener allocator_destroy;
struct wlr_addon_set addons;
};
struct wlr_swapchain *wlr_swapchain_create(
@ -43,4 +46,7 @@ struct wlr_buffer *wlr_swapchain_acquire(struct wlr_swapchain *swapchain);
bool wlr_swapchain_has_buffer(struct wlr_swapchain *swapchain,
struct wlr_buffer *buffer);
struct wlr_swapchain *wlr_swapchain_try_from_wlr_buffer(
struct wlr_buffer *buffer);
#endif