mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-26 06:35:58 +01:00
render: stop making EGL context current in wlr_egl_init
This leaves an EGL context current behind. wlr_gles2_renderer_create was assuming the EGL context was already current because of this (because it called a GL function right off the bat).
This commit is contained in:
parent
019fe8bb7e
commit
e91417ea8d
2 changed files with 4 additions and 11 deletions
|
@ -289,12 +289,6 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *remote_display,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!eglMakeCurrent(egl->display, EGL_NO_SURFACE, EGL_NO_SURFACE,
|
|
||||||
egl->context)) {
|
|
||||||
wlr_log(WLR_ERROR, "Failed to make EGL context current");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
|
|
@ -558,6 +558,10 @@ extern const GLchar tex_fragment_src_rgbx[];
|
||||||
extern const GLchar tex_fragment_src_external[];
|
extern const GLchar tex_fragment_src_external[];
|
||||||
|
|
||||||
struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
|
struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
|
||||||
|
if (!wlr_egl_make_current(egl, EGL_NO_SURFACE, NULL)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
const char *exts_str = (const char *)glGetString(GL_EXTENSIONS);
|
const char *exts_str = (const char *)glGetString(GL_EXTENSIONS);
|
||||||
if (exts_str == NULL) {
|
if (exts_str == NULL) {
|
||||||
wlr_log(WLR_ERROR, "Failed to get GL_EXTENSIONS");
|
wlr_log(WLR_ERROR, "Failed to get GL_EXTENSIONS");
|
||||||
|
@ -572,11 +576,6 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
|
||||||
wlr_renderer_init(&renderer->wlr_renderer, &renderer_impl);
|
wlr_renderer_init(&renderer->wlr_renderer, &renderer_impl);
|
||||||
|
|
||||||
renderer->egl = egl;
|
renderer->egl = egl;
|
||||||
if (!wlr_egl_make_current(renderer->egl, EGL_NO_SURFACE, NULL)) {
|
|
||||||
free(renderer);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
renderer->exts_str = exts_str;
|
renderer->exts_str = exts_str;
|
||||||
|
|
||||||
wlr_log(WLR_INFO, "Using %s", glGetString(GL_VERSION));
|
wlr_log(WLR_INFO, "Using %s", glGetString(GL_VERSION));
|
||||||
|
|
Loading…
Reference in a new issue