diff options
author | Brian Paul <[email protected]> | 2009-09-14 12:40:53 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-09-14 12:42:18 -0600 |
commit | 8ec456c68cc69349c2506ce64047d06c7113780c (patch) | |
tree | e3f77500b95f9b316aef1880fc9858754ada291f /src | |
parent | 3c3104943946904d0e205166bc4baf28ff2bf81b (diff) |
intel: fix renderbuffer map/unmap regression
Commit 36dd53a3cded9d003ec418732b7fc93c1476aa9b caused a few regressions
because the glReadBuffer() buffer wasn't getting mapped when GL_READ_BUFFER
!= GL_DRAW_BUFFER.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_span.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 1e739434577..97713076dd5 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -448,24 +448,22 @@ intel_map_unmap_framebuffer(struct intel_context *intel, struct gl_framebuffer *fb, GLboolean map) { - GLcontext *ctx = &intel->ctx; GLuint i, j; - /* color buffers */ - if (fb == ctx->DrawBuffer) { - for (j = 0; j < fb->_NumColorDrawBuffers; j++) { - if (map) - intel_renderbuffer_map(intel, fb->_ColorDrawBuffers[j]); - else - intel_renderbuffer_unmap(intel, fb->_ColorDrawBuffers[j]); - } - } else { + /* color draw buffers */ + for (j = 0; j < fb->_NumColorDrawBuffers; j++) { if (map) - intel_renderbuffer_map(intel, fb->_ColorReadBuffer); + intel_renderbuffer_map(intel, fb->_ColorDrawBuffers[j]); else - intel_renderbuffer_unmap(intel, fb->_ColorReadBuffer); + intel_renderbuffer_unmap(intel, fb->_ColorDrawBuffers[j]); } + /* color read buffer */ + if (map) + intel_renderbuffer_map(intel, fb->_ColorReadBuffer); + else + intel_renderbuffer_unmap(intel, fb->_ColorReadBuffer); + /* check for render to textures */ for (i = 0; i < BUFFER_COUNT; i++) { struct gl_renderbuffer_attachment *att = @@ -524,7 +522,8 @@ intelSpanRenderStart(GLcontext * ctx) } intel_map_unmap_framebuffer(intel, ctx->DrawBuffer, GL_TRUE); - intel_map_unmap_framebuffer(intel, ctx->ReadBuffer, GL_TRUE); + if (ctx->ReadBuffer != ctx->DrawBuffer) + intel_map_unmap_framebuffer(intel, ctx->ReadBuffer, GL_TRUE); } /** @@ -547,7 +546,8 @@ intelSpanRenderFinish(GLcontext * ctx) } intel_map_unmap_framebuffer(intel, ctx->DrawBuffer, GL_FALSE); - intel_map_unmap_framebuffer(intel, ctx->ReadBuffer, GL_FALSE); + if (ctx->ReadBuffer != ctx->DrawBuffer) + intel_map_unmap_framebuffer(intel, ctx->ReadBuffer, GL_FALSE); UNLOCK_HARDWARE(intel); } |