aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-11-30 10:13:14 -0500
committerAlexander Orzechowski <alex@ozal.ski>2023-11-30 10:13:18 -0500
commit484e2484469178e1a0e3628296093a4f934ccd68 (patch)
tree88d460c7f7a56cc79097863fa23a408f2cf08812 /render
parent0d9cd6932a01ad481074cc814857579c5b23e9af (diff)
renderer/gles2: Bail rendering to external buffers when binding them
We can't do it while we're creating them because we'll want to use gles2 buffers for textures soon.
Diffstat (limited to 'render')
-rw-r--r--render/gles2/renderer.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index f064eeb4..fce0906d 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -94,6 +94,11 @@ static const struct wlr_addon_interface buffer_addon_impl = {
};
GLuint gles2_buffer_get_fbo(struct wlr_gles2_buffer *buffer) {
+ if (buffer->external_only) {
+ wlr_log(WLR_ERROR, "DMA-BUF format is external-only");
+ return 0;
+ }
+
if (buffer->fbo) {
return buffer->fbo;
}
@@ -148,18 +153,12 @@ static struct wlr_gles2_buffer *get_or_create_buffer(struct wlr_gles2_renderer *
goto error_buffer;
}
- bool external_only;
buffer->image = wlr_egl_create_image_from_dmabuf(renderer->egl,
- &dmabuf, &external_only);
+ &dmabuf, &buffer->external_only);
if (buffer->image == EGL_NO_IMAGE_KHR) {
goto error_buffer;
}
- if (external_only) {
- wlr_log(WLR_ERROR, "DMA-BUF format is external-only");
- goto error_image;
- }
-
wlr_addon_init(&buffer->addon, &wlr_buffer->addons, renderer,
&buffer_addon_impl);