diff options
Diffstat (limited to 'render/egl.c')
-rw-r--r-- | render/egl.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/render/egl.c b/render/egl.c index 6382c0c3..2180c7a1 100644 --- a/render/egl.c +++ b/render/egl.c @@ -158,10 +158,16 @@ static void init_dmabuf_formats(struct wlr_egl *egl) { if (modifiers_len == 0) { wlr_drm_format_set_add(&egl->dmabuf_formats, fmt, DRM_FORMAT_MOD_INVALID); + wlr_drm_format_set_add(&egl->dmabuf_render_formats, fmt, + DRM_FORMAT_MOD_INVALID); } for (int j = 0; j < modifiers_len; j++) { wlr_drm_format_set_add(&egl->dmabuf_formats, fmt, modifiers[j]); + if (!external_only[j]) { + wlr_drm_format_set_add(&egl->dmabuf_render_formats, fmt, + modifiers[j]); + } } free(modifiers); @@ -397,6 +403,7 @@ void wlr_egl_finish(struct wlr_egl *egl) { } free(egl->external_only_dmabuf_formats); + wlr_drm_format_set_finish(&egl->dmabuf_render_formats); wlr_drm_format_set_finish(&egl->dmabuf_formats); eglMakeCurrent(egl->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); @@ -809,6 +816,11 @@ const struct wlr_drm_format_set *wlr_egl_get_dmabuf_formats(struct wlr_egl *egl) return &egl->dmabuf_formats; } +const struct wlr_drm_format_set *wlr_egl_get_dmabuf_render_formats( + struct wlr_egl *egl) { + return &egl->dmabuf_render_formats; +} + bool wlr_egl_export_image_to_dmabuf(struct wlr_egl *egl, EGLImageKHR image, int32_t width, int32_t height, uint32_t flags, struct wlr_dmabuf_attributes *attribs) { |