diff options
author | Simon Ser <contact@emersion.fr> | 2019-09-30 11:32:19 +0300 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-10-16 09:40:26 -0400 |
commit | 6bb7639a0f35317cc8f29034577710c2387ebcd1 (patch) | |
tree | 59bf13dedb492db6169b2ee21d4ab091c87db38f /render/gles2 | |
parent | 5bddb5a909f9cf768cfcdbdd2bb943eb01484961 (diff) |
render/gles2: don't unset the current EGL surface when destroying texture
When a texture is destroyed between wlr_egl_make_current and
wlr_egl_swap_buffers, it resets the current EGL surface to NULL. This
makes wlr_egl_swap_buffers fail.
If the EGL context is already current, there's no need to reset it.
Diffstat (limited to 'render/gles2')
-rw-r--r-- | render/gles2/texture.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/render/gles2/texture.c b/render/gles2/texture.c index 5f982e2c..992084af 100644 --- a/render/gles2/texture.c +++ b/render/gles2/texture.c @@ -115,7 +115,9 @@ static void gles2_texture_destroy(struct wlr_texture *wlr_texture) { struct wlr_gles2_texture *texture = gles2_get_texture(wlr_texture); - wlr_egl_make_current(texture->egl, EGL_NO_SURFACE, NULL); + if (!wlr_egl_is_current(texture->egl)) { + wlr_egl_make_current(texture->egl, EGL_NO_SURFACE, NULL); + } PUSH_GLES2_DEBUG; |