render/allocator: add wlr_allocator.buffer_caps

This allows users to know the capabilities of the buffers that
will be allocated. The buffer capability is important to
know when negotiating buffer formats.
This commit is contained in:
Simon Ser 2021-05-31 20:16:32 +02:00 committed by Simon Zeni
parent 5c30cf3d94
commit 766a24fa77
5 changed files with 33 additions and 10 deletions

View file

@ -19,6 +19,9 @@ struct wlr_allocator_interface {
struct wlr_allocator {
const struct wlr_allocator_interface *impl;
// Capabilites of the buffers created with this allocator
uint32_t buffer_caps;
struct {
struct wl_signal destroy;
} events;
@ -44,7 +47,7 @@ struct wlr_buffer *wlr_allocator_create_buffer(struct wlr_allocator *alloc,
// For wlr_allocator implementors
void wlr_allocator_init(struct wlr_allocator *alloc,
const struct wlr_allocator_interface *impl);
const struct wlr_allocator_interface *impl, uint32_t buffer_caps);
struct wlr_allocator *allocator_autocreate_with_drm_fd(
struct wlr_backend *backend, struct wlr_renderer *renderer, int drm_fd);