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

Michel Dänzer daenzer at kemper.freedesktop.org
Wed Mar 30 09:19:04 UTC 2011


Module: Mesa
Branch: 7.10
Commit: 5bbaf1992c7715def090bbc30081fdd086998e7c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5bbaf1992c7715def090bbc30081fdd086998e7c

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.
(cherry picked from commit b082e04619224b0affc46fb6953c0efd5685fc17)

---

 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 c94f88e..800ee31 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -156,6 +156,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;
 
@@ -169,7 +170,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