glamor: Use lastGLContext to coordinate the context with GLX.
This gets us some more context changes that are needed to make sure the two sides render to the right drawables and manipulate the right objects. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
ab6e958a2e
commit
b5e394b3f5
|
@ -100,14 +100,12 @@ glamor_egl_get_context(struct glamor_context *glamor_ctx)
|
||||||
if (glamor_ctx->get_count++)
|
if (glamor_ctx->get_count++)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (glamor_ctx->ctx != eglGetCurrentContext()) {
|
eglMakeCurrent(glamor_ctx->display, EGL_NO_SURFACE,
|
||||||
eglMakeCurrent(glamor_ctx->display, EGL_NO_SURFACE,
|
EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||||
EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
if (!eglMakeCurrent(glamor_ctx->display,
|
||||||
if (!eglMakeCurrent(glamor_ctx->display,
|
EGL_NO_SURFACE, EGL_NO_SURFACE,
|
||||||
EGL_NO_SURFACE, EGL_NO_SURFACE,
|
glamor_ctx->ctx)) {
|
||||||
glamor_ctx->ctx)) {
|
FatalError("Failed to make EGL context current\n");
|
||||||
FatalError("Failed to make EGL context current\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,15 +36,9 @@
|
||||||
static void
|
static void
|
||||||
glamor_glx_get_context(struct glamor_context *glamor_ctx)
|
glamor_glx_get_context(struct glamor_context *glamor_ctx)
|
||||||
{
|
{
|
||||||
GLXContext old_ctx;
|
|
||||||
|
|
||||||
if (glamor_ctx->get_count++)
|
if (glamor_ctx->get_count++)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
old_ctx = glXGetCurrentContext();
|
|
||||||
if (old_ctx == glamor_ctx->ctx)
|
|
||||||
return;
|
|
||||||
|
|
||||||
glXMakeCurrent(glamor_ctx->display, glamor_ctx->drawable_xid,
|
glXMakeCurrent(glamor_ctx->display, glamor_ctx->drawable_xid,
|
||||||
glamor_ctx->ctx);
|
glamor_ctx->ctx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1501,7 +1501,10 @@ __fls(unsigned long x)
|
||||||
static inline void
|
static inline void
|
||||||
glamor_get_context(glamor_screen_private * glamor_priv)
|
glamor_get_context(glamor_screen_private * glamor_priv)
|
||||||
{
|
{
|
||||||
glamor_priv->ctx.get_context(&glamor_priv->ctx);
|
if (lastGLContext != &glamor_priv->ctx) {
|
||||||
|
lastGLContext = &glamor_priv->ctx;
|
||||||
|
glamor_priv->ctx.get_context(&glamor_priv->ctx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user