aboutsummaryrefslogtreecommitdiff
path: root/include/render
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-06-25 05:36:11 -0400
committerAlexander Orzechowski <alex@ozal.ski>2023-11-30 10:13:18 -0500
commitcb5f67431b782ab20a9ea8dd68471740e5d20f7b (patch)
tree9a1ddc48dc41742741d8518de6fe20da7a051c74 /include/render
parent665055a1a04610c1464567d1d2eebe7fb7cfe633 (diff)
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
Diffstat (limited to 'include/render')
-rw-r--r--include/render/gles2.h6
1 files changed, 5 insertions, 1 deletions
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);