From cb5f67431b782ab20a9ea8dd68471740e5d20f7b Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Sun, 25 Jun 2023 05:36:11 -0400 Subject: render/gles2: Don't double import dmabuf We can double import a dmabuf if we use it as a texture target and a render target. Instead, let's unify render targets and texture dmabuf imports to use wlr_gles2_buffer which manages the EGLImageKHR --- include/render/gles2.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/render') diff --git a/include/render/gles2.h b/include/render/gles2.h index c8ee3142..c868fe05 100644 --- a/include/render/gles2.h +++ b/include/render/gles2.h @@ -108,6 +108,7 @@ struct wlr_gles2_buffer { EGLImageKHR image; GLuint rbo; GLuint fbo; + GLuint tex; struct wlr_addon addon; }; @@ -121,6 +122,7 @@ struct wlr_gles2_texture { // GL_TEXTURE_2D == mutable // GL_TEXTURE_EXTERNAL_OES == immutable GLenum target; + bool owns_tex; GLuint tex; EGLImageKHR image; @@ -130,7 +132,7 @@ struct wlr_gles2_texture { // Only affects target == GL_TEXTURE_2D uint32_t drm_format; // used to interpret upload data // If imported from a wlr_buffer - struct wlr_buffer *buffer; + struct wlr_gles2_buffer *buffer; struct wlr_addon buffer_addon; }; @@ -157,6 +159,8 @@ struct wlr_gles2_render_timer *gles2_get_render_timer( struct wlr_render_timer *timer); struct wlr_gles2_texture *gles2_get_texture( struct wlr_texture *wlr_texture); +struct wlr_gles2_buffer *gles2_buffer_get_or_create(struct wlr_gles2_renderer *renderer, + struct wlr_buffer *wlr_buffer); struct wlr_texture *gles2_texture_from_buffer(struct wlr_renderer *wlr_renderer, struct wlr_buffer *buffer); -- cgit v1.2.3