aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
Diffstat (limited to 'render')
-rw-r--r--render/gles2/renderer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index 8e7c37a8..59d46a91 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -139,10 +139,11 @@ error_buffer:
static bool gles2_bind_buffer(struct wlr_renderer *wlr_renderer,
struct wlr_buffer *wlr_buffer) {
- struct wlr_gles2_renderer *renderer =
- gles2_get_renderer_in_context(wlr_renderer);
+ struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer);
if (renderer->current_buffer != NULL) {
+ assert(wlr_egl_is_current(renderer->egl));
+
push_gles2_debug(renderer);
glFlush();
glBindFramebuffer(GL_FRAMEBUFFER, 0);
@@ -153,9 +154,12 @@ static bool gles2_bind_buffer(struct wlr_renderer *wlr_renderer,
}
if (wlr_buffer == NULL) {
+ wlr_egl_unset_current(renderer->egl);
return true;
}
+ wlr_egl_make_current(renderer->egl);
+
struct wlr_gles2_buffer *buffer = get_buffer(renderer, wlr_buffer);
if (buffer == NULL) {
buffer = create_buffer(renderer, wlr_buffer);