diff options
author | Eric Anholt <eric@anholt.net> | 2009-06-19 22:12:52 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-06-19 22:18:16 -0700 |
commit | df70d3049a396af3601d2a1747770635a74120bb (patch) | |
tree | 04442a2ccd4ef78dc31b3a926fa732f9f74ca174 /src/mesa/drivers/dri/intel/intel_buffers.c | |
parent | afc981ee46791838f3cb83e11eb33938aa3efc83 (diff) |
intel: Also get the DRI2 front buffer when doing front buffer reading.
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_buffers.c')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_buffers.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index df5c3fc176..e7357e78c5 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -345,6 +345,23 @@ intelDrawBuffer(GLcontext * ctx, GLenum mode) static void intelReadBuffer(GLcontext * ctx, GLenum mode) { + if ((ctx->DrawBuffer != NULL) && (ctx->DrawBuffer->Name == 0)) { + struct intel_context *const intel = intel_context(ctx); + const GLboolean was_front_buffer_reading = + intel->is_front_buffer_reading; + + intel->is_front_buffer_reading = (mode == GL_FRONT_LEFT) + || (mode == GL_FRONT); + + /* If we weren't front-buffer reading before but we are now, make sure + * that the front-buffer has actually been allocated. + */ + if (!was_front_buffer_reading && intel->is_front_buffer_reading) { + intel_update_renderbuffers(intel->driContext, + intel->driContext->driDrawablePriv); + } + } + if (ctx->ReadBuffer == ctx->DrawBuffer) { /* This will update FBO completeness status. * A framebuffer will be incomplete if the GL_READ_BUFFER setting |