Mesa (master): i965/pixel_read: Don' t try to do a tiled_memcpy from a multisampled buffer

Jason Ekstrand jekstrand at kemper.freedesktop.org
Sat Jan 31 16:56:59 UTC 2015


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

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Fri Jan 30 18:47:59 2015 -0800

i965/pixel_read: Don't try to do a tiled_memcpy from a multisampled buffer

The GL spec guarantees that glGetTexImage will never get a multisampled
texture, but this is not true for glReadPixels.  If we get a multisampled
buffer, we have to do a multisample resolve on it before we can pull the
data down for the user.  Since this isn't practical to handle in
tiled_memcpy, we just fall back to the other paths that can handle this.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/intel_pixel_read.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/intel_pixel_read.c b/src/mesa/drivers/dri/i965/intel_pixel_read.c
index 15f9e38..f3ab05c 100644
--- a/src/mesa/drivers/dri/i965/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/i965/intel_pixel_read.c
@@ -125,6 +125,13 @@ intel_readpixels_tiled_memcpy(struct gl_context * ctx,
       yoffset += irb->mt->level[level].level_y;
    }
 
+   /* It is possible that the renderbuffer (or underlying texture) is
+    * multisampled.  Since ReadPixels from a multisampled buffer requires a
+    * multisample resolve, we can't handle this here
+    */
+   if (rb->NumSamples > 1)
+      return false;
+
    if (!intel_get_memcpy(rb->Format, format, type, &mem_copy, &cpp))
       return false;
 




More information about the mesa-commit mailing list