mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
intel: remove a buffer equality test in _mesa_make_current()
Before, if we called glXMakeCurrent() to change a context's window binding while an FBO was bound, we weren't updating the intel->driDrawable and intel->driReadDrawable fields. This could cause us to dereference a null pointer elsewhere.
This commit is contained in:
parent
a8768bbc9d
commit
3b29dcbb5e
1 changed files with 23 additions and 29 deletions
|
|
@ -993,41 +993,35 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
|
|||
|
||||
_mesa_make_current(&intel->ctx, &intel_fb->Base, readFb);
|
||||
|
||||
/* The drawbuffer won't always be updated by _mesa_make_current:
|
||||
*/
|
||||
if (intel->ctx.DrawBuffer == &intel_fb->Base) {
|
||||
intel->driReadDrawable = driReadPriv;
|
||||
|
||||
if (intel->driReadDrawable != driReadPriv)
|
||||
intel->driReadDrawable = driReadPriv;
|
||||
if (intel->driDrawable != driDrawPriv) {
|
||||
if (driDrawPriv->swap_interval == (unsigned)-1) {
|
||||
int i;
|
||||
|
||||
if (intel->driDrawable != driDrawPriv) {
|
||||
if (driDrawPriv->swap_interval == (unsigned)-1) {
|
||||
int i;
|
||||
driDrawPriv->vblFlags = (intel->intelScreen->irq_active != 0)
|
||||
? driGetDefaultVBlankFlags(&intel->optionCache)
|
||||
: VBLANK_FLAG_NO_IRQ;
|
||||
|
||||
driDrawPriv->vblFlags = (intel->intelScreen->irq_active != 0)
|
||||
? driGetDefaultVBlankFlags(&intel->optionCache)
|
||||
: VBLANK_FLAG_NO_IRQ;
|
||||
/* Prevent error printf if one crtc is disabled, this will
|
||||
* be properly calculated in intelWindowMoved() next.
|
||||
*/
|
||||
driDrawPriv->vblFlags = intelFixupVblank(intel, driDrawPriv);
|
||||
|
||||
/* Prevent error printf if one crtc is disabled, this will
|
||||
* be properly calculated in intelWindowMoved() next.
|
||||
*/
|
||||
driDrawPriv->vblFlags = intelFixupVblank(intel, driDrawPriv);
|
||||
(*psp->systemTime->getUST) (&intel_fb->swap_ust);
|
||||
driDrawableInitVBlank(driDrawPriv);
|
||||
intel_fb->vbl_waited = driDrawPriv->vblSeq;
|
||||
|
||||
(*psp->systemTime->getUST) (&intel_fb->swap_ust);
|
||||
driDrawableInitVBlank(driDrawPriv);
|
||||
intel_fb->vbl_waited = driDrawPriv->vblSeq;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (intel_fb->color_rb[i])
|
||||
intel_fb->color_rb[i]->vbl_pending = driDrawPriv->vblSeq;
|
||||
}
|
||||
}
|
||||
intel->driDrawable = driDrawPriv;
|
||||
intelWindowMoved(intel);
|
||||
}
|
||||
|
||||
intel_draw_buffer(&intel->ctx, &intel_fb->Base);
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (intel_fb->color_rb[i])
|
||||
intel_fb->color_rb[i]->vbl_pending = driDrawPriv->vblSeq;
|
||||
}
|
||||
}
|
||||
intel->driDrawable = driDrawPriv;
|
||||
intelWindowMoved(intel);
|
||||
}
|
||||
|
||||
intel_draw_buffer(&intel->ctx, &intel_fb->Base);
|
||||
}
|
||||
else {
|
||||
_mesa_make_current(NULL, NULL, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue