Mesa (master): i965/blorp: Handle DrawBuffers properly.

Paul Berry stereotype441 at kemper.freedesktop.org
Tue Jul 24 22:22:55 UTC 2012


Module: Mesa
Branch: master
Commit: ff9313fac70fa85d051dd4d2b9d3402d39f67cea
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ff9313fac70fa85d051dd4d2b9d3402d39f67cea

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Fri Jul 13 14:59:13 2012 -0700

i965/blorp: Handle DrawBuffers properly.

When the client program uses glDrawBuffer() or glDrawBuffers() to
select more than one color buffer for drawing into, and then performs
a blit, we need to blit into every single enabled draw buffer.

+2 oglconforms.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50407

Reviewed-by: Chad Versace <chad.versace at linux.intel.com>

---

 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 0c42e85..fbda7b0 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -233,13 +233,16 @@ try_blorp_blit(struct intel_context *intel,
    switch (buffer_bit) {
    case GL_COLOR_BUFFER_BIT:
       src_rb = read_fb->_ColorReadBuffer;
-      dst_rb =
-         draw_fb->Attachment[
-            draw_fb->_ColorDrawBufferIndexes[0]].Renderbuffer;
-      if (!formats_match(buffer_bit, src_rb, dst_rb))
-         return false;
-      do_blorp_blit(intel, buffer_bit, src_rb, dst_rb, srcX0, srcY0,
-                    dstX0, dstY0, dstX1, dstY1, mirror_x, mirror_y);
+      for (unsigned i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; ++i) {
+         dst_rb = ctx->DrawBuffer->_ColorDrawBuffers[i];
+         if (dst_rb && !formats_match(buffer_bit, src_rb, dst_rb))
+            return false;
+      }
+      for (unsigned i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; ++i) {
+         dst_rb = ctx->DrawBuffer->_ColorDrawBuffers[i];
+         do_blorp_blit(intel, buffer_bit, src_rb, dst_rb, srcX0, srcY0,
+                       dstX0, dstY0, dstX1, dstY1, mirror_x, mirror_y);
+      }
       break;
    case GL_DEPTH_BUFFER_BIT:
       src_rb = read_fb->Attachment[BUFFER_DEPTH].Renderbuffer;




More information about the mesa-commit mailing list