Mesa (master): Use proper source row stride when getting depth/ stencil texels.

Michel Dänzer daenzer at kemper.freedesktop.org
Wed Mar 30 08:52:31 UTC 2011


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

Author: Michel Dänzer <daenzer at vmware.com>
Date:   Wed Mar 30 09:02:21 2011 +0200

Use proper source row stride when getting depth/stencil texels.

---

 src/mesa/main/texgetimage.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 21d9140..db2cc84 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -159,6 +159,7 @@ get_tex_depth_stencil(struct gl_context *ctx, GLuint dimensions,
    const GLint width = texImage->Width;
    const GLint height = texImage->Height;
    const GLint depth = texImage->Depth;
+   const GLint rowstride = texImage->RowStride;
    const GLuint *src = (const GLuint *) texImage->Data;
    GLint img, row;
 
@@ -172,7 +173,7 @@ get_tex_depth_stencil(struct gl_context *ctx, GLuint dimensions,
             _mesa_swap4((GLuint *) dest, width);
          }
 
-         src += width * row + width * height * img;
+         src += rowstride;
       }
    }
 }




More information about the mesa-commit mailing list