mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
intel: flush old context before binding new context
Per the GLX spec, when changing rendering contexts, the old context should first be flushed.
This commit is contained in:
parent
5e6a6a2719
commit
55058652b8
1 changed files with 15 additions and 2 deletions
|
|
@ -944,10 +944,23 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
|
||||||
__DRIdrawablePrivate * driReadPriv)
|
__DRIdrawablePrivate * driReadPriv)
|
||||||
{
|
{
|
||||||
__DRIscreenPrivate *psp = driDrawPriv->driScreenPriv;
|
__DRIscreenPrivate *psp = driDrawPriv->driScreenPriv;
|
||||||
|
struct intel_context *intel;
|
||||||
|
GET_CURRENT_CONTEXT(curCtx);
|
||||||
|
|
||||||
|
if (driContextPriv)
|
||||||
|
intel = (struct intel_context *) driContextPriv->driverPrivate;
|
||||||
|
else
|
||||||
|
intel = NULL;
|
||||||
|
|
||||||
|
/* According to the glXMakeCurrent() man page: "Pending commands to
|
||||||
|
* the previous context, if any, are flushed before it is released."
|
||||||
|
* But only flush if we're actually changing contexts.
|
||||||
|
*/
|
||||||
|
if (intel_context(curCtx) && intel_context(curCtx) != intel) {
|
||||||
|
_mesa_flush(curCtx);
|
||||||
|
}
|
||||||
|
|
||||||
if (driContextPriv) {
|
if (driContextPriv) {
|
||||||
struct intel_context *intel =
|
|
||||||
(struct intel_context *) driContextPriv->driverPrivate;
|
|
||||||
struct intel_framebuffer *intel_fb =
|
struct intel_framebuffer *intel_fb =
|
||||||
(struct intel_framebuffer *) driDrawPriv->driverPrivate;
|
(struct intel_framebuffer *) driDrawPriv->driverPrivate;
|
||||||
GLframebuffer *readFb = (GLframebuffer *) driReadPriv->driverPrivate;
|
GLframebuffer *readFb = (GLframebuffer *) driReadPriv->driverPrivate;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue