xwayland: Store EGLContext pointer in lastGLContext

We were storing the pointer to struct glamor_context. However, glamor
itself is storing the EGLContext pointer since the commit below. Since
the two values could never be equal, this resulted in constant
superfluous eglMakeCurrent calls. The implicit glFlush triggered by
those couldn't be good for performance.

Fixes: 7c88977d33 "glamor: Store the actual EGL/GLX context pointer in lastGLContext"
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
This commit is contained in:
Michel Dänzer 2021-11-01 13:05:56 +01:00 committed by Michel Dänzer
parent 0099412ea4
commit b656b0aa5d

View File

@ -58,10 +58,12 @@ glamor_egl_make_current(struct glamor_context *glamor_ctx)
void void
xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen) xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen)
{ {
if (lastGLContext == xwl_screen->glamor_ctx) EGLContext ctx = xwl_screen->glamor_ctx->ctx;
if (lastGLContext == ctx)
return; return;
lastGLContext = xwl_screen->glamor_ctx; lastGLContext = ctx;
xwl_screen->glamor_ctx->make_current(xwl_screen->glamor_ctx); xwl_screen->glamor_ctx->make_current(xwl_screen->glamor_ctx);
} }