Bind the framebuffer before calling glDiscardFramebuffer

This patch just adds a call to _cogl_framebuffer_flush_state to ensure
the correct framebuffer is bound before discarding its buffers.
Previously it would presumably just discard the buffers of whatever
framebuffer happened to be used last.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 37c390a5b33d4f65ff6c834e9be2f8de716635ee)
This commit is contained in:
Neil Roberts 2013-02-11 17:12:31 +00:00
parent 0494e70955
commit 7d9e075917

View File

@ -1023,6 +1023,9 @@ _cogl_framebuffer_gl_discard_buffers (CoglFramebuffer *framebuffer,
attachments[i++] = GL_STENCIL_ATTACHMENT;
}
_cogl_framebuffer_flush_state (framebuffer,
framebuffer,
COGL_FRAMEBUFFER_STATE_BIND);
GE (ctx, glDiscardFramebuffer (GL_FRAMEBUFFER, i, attachments));
}
#endif /* GL_EXT_discard_framebuffer */