From 4614009956df0a0a0438b8a858d8e9ca73b0fdfc Mon Sep 17 00:00:00 2001 From: Alexis Hetu Date: Thu, 15 Oct 2015 17:05:30 -0400 Subject: [PATCH] Unpack row length fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The unpack row length was supposed to replace the width, not the pitch, of the input image, which explains why related tests were failing. Change-Id: I7bd46e057bae4113b31d072fd6748d9dd6043feb Reviewed-on: https://swiftshader-review.googlesource.com/4080 Tested-by: Alexis Hétu Reviewed-by: Nicolas Capens --- src/OpenGL/common/Image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenGL/common/Image.cpp b/src/OpenGL/common/Image.cpp index a0f7ac6ea..b77f6a785 100644 --- a/src/OpenGL/common/Image.cpp +++ b/src/OpenGL/common/Image.cpp @@ -762,7 +762,7 @@ namespace egl void Image::loadImageData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const UnpackInfo& unpackInfo, const void *input) { - GLsizei inputPitch = (unpackInfo.rowLength == 0) ? ComputePitch(width, format, type, unpackInfo.alignment) : unpackInfo.rowLength; + GLsizei inputPitch = ComputePitch((unpackInfo.rowLength == 0) ? width : unpackInfo.rowLength, format, type, unpackInfo.alignment); GLsizei inputHeight = (unpackInfo.imageHeight == 0) ? height : unpackInfo.imageHeight; input = ((char*)input) + (unpackInfo.skipImages * inputHeight + unpackInfo.skipRows) * inputPitch + unpackInfo.skipPixels; -- 2.11.0