render: unify getter for texture formats

Instead of having separate getters for shm formats and DMA-BUF
formats, use the same pattern as wlr_output_impl.get_primary_formats
with a single function which takes buffer caps as input.
This commit is contained in:
Simon Ser 2024-04-12 11:27:57 +02:00 committed by Kenny Levinsen
parent c63275d75e
commit 85c1eda721
12 changed files with 78 additions and 67 deletions

View file

@ -44,6 +44,8 @@ struct wlr_gles2_renderer {
struct wlr_egl *egl;
int drm_fd;
struct wlr_drm_format_set shm_texture_formats;
const char *exts_str;
struct {
bool EXT_read_format_bgra;
@ -143,8 +145,8 @@ bool is_gles2_pixel_format_supported(const struct wlr_gles2_renderer *renderer,
const struct wlr_gles2_pixel_format *get_gles2_format_from_drm(uint32_t fmt);
const struct wlr_gles2_pixel_format *get_gles2_format_from_gl(
GLint gl_format, GLint gl_type, bool alpha);
const uint32_t *get_gles2_shm_formats(const struct wlr_gles2_renderer *renderer,
size_t *len);
void get_gles2_shm_formats(const struct wlr_gles2_renderer *renderer,
struct wlr_drm_format_set *out);
GLuint gles2_buffer_get_fbo(struct wlr_gles2_buffer *buffer);