aboutsummaryrefslogtreecommitdiff
path: root/render/gles2/renderer.c
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 /render/gles2/renderer.c
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 'render/gles2/renderer.c')
-rw-r--r--render/gles2/renderer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index d5a57184..327d197e 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -72,6 +72,7 @@ static void destroy_buffer(struct wlr_gles2_buffer *buffer) {
glDeleteFramebuffers(1, &buffer->fbo);
glDeleteRenderbuffers(1, &buffer->rbo);
+ glDeleteTextures(1, &buffer->tex);
pop_gles2_debug(buffer->renderer);
@@ -131,7 +132,7 @@ GLuint gles2_buffer_get_fbo(struct wlr_gles2_buffer *buffer) {
return buffer->fbo;
}
-static struct wlr_gles2_buffer *get_or_create_buffer(struct wlr_gles2_renderer *renderer,
+struct wlr_gles2_buffer *gles2_buffer_get_or_create(struct wlr_gles2_renderer *renderer,
struct wlr_buffer *wlr_buffer) {
struct wlr_addon *addon =
wlr_addon_find(&wlr_buffer->addons, renderer, &buffer_addon_impl);
@@ -202,7 +203,7 @@ static bool gles2_bind_buffer(struct wlr_renderer *wlr_renderer,
return false;
}
- struct wlr_gles2_buffer *buffer = get_or_create_buffer(renderer, wlr_buffer);
+ struct wlr_gles2_buffer *buffer = gles2_buffer_get_or_create(renderer, wlr_buffer);
if (buffer == NULL) {
return false;
}
@@ -442,7 +443,7 @@ static struct wlr_render_pass *gles2_begin_buffer_pass(struct wlr_renderer *wlr_
clock_gettime(CLOCK_MONOTONIC, &timer->cpu_start);
}
- struct wlr_gles2_buffer *buffer = get_or_create_buffer(renderer, wlr_buffer);
+ struct wlr_gles2_buffer *buffer = gles2_buffer_get_or_create(renderer, wlr_buffer);
if (!buffer) {
return NULL;
}