[Mesa-dev] [PATCH] texgetimage: fix regression with shadow 1d array

Dave Airlie airlied at gmail.com
Tue Oct 27 19:26:53 PDT 2015


From: Dave Airlie <airlied at redhat.com>

since 1ad305b612f389fb04c6d51847427d5ec72fae03
Brian Paul <brianp at vmware.com>
Date:   Tue Jul 21 18:35:38 2015 -0600

    mesa: plumb offset/size parameters through GetTexSubImage code

I found this testing virgl which exercises a bunch of these
in it's fallbacks.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/mesa/main/texgetimage.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 682b727..b4321fb 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -91,9 +91,10 @@ get_tex_depth(struct gl_context *ctx, GLuint dimensions,
    if (texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY) {
       depth = height;
       height = 1;
-   }
+      assert(zoffset + depth <= texImage->Height);
+   } else
+      assert(zoffset + depth <= texImage->Depth);
 
-   assert(zoffset + depth <= texImage->Depth);
    for (img = 0; img < depth; img++) {
       GLubyte *srcMap;
       GLint srcRowStride;
-- 
2.4.3



More information about the mesa-dev mailing list