gl-renderer: do not unbind the context on output destroy

If we make EGL_NO_CONTEXT current, all following GL calls are
no-ops. This will be a problem when gl-renderer introduces
gl_renderer_color_transform containing GL textures and needs to destroy
them when weston_color_transform is destroyed. Mesa would print the the
warning that glDeleteTextures is no-op.

To fix this, keep our GL context current when destroying a GL output.

In case EGL_KHR_surfaceless_context is not available, we must use
dummy_surface.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 4 years ago
parent 21b8ad5a16
commit 6d0aa8f0e9
  1. 3
      libweston/renderer-gl/gl-renderer.c

@ -3442,8 +3442,7 @@ gl_renderer_output_destroy(struct weston_output *output)
gl_fbo_texture_fini(&go->shadow); gl_fbo_texture_fini(&go->shadow);
eglMakeCurrent(gr->egl_display, eglMakeCurrent(gr->egl_display,
EGL_NO_SURFACE, EGL_NO_SURFACE, gr->dummy_surface, gr->dummy_surface, gr->egl_context);
EGL_NO_CONTEXT);
weston_platform_destroy_egl_surface(gr->egl_display, go->egl_surface); weston_platform_destroy_egl_surface(gr->egl_display, go->egl_surface);

Loading…
Cancel
Save