Add UNPACK_ROW_LENGTH support to D3D11 renderer
Change-Id: I31ccffddcb04a45f19d3c3eb9a396c30e794b218
Reviewed-on: https://chromium-review.googlesource.com/243951
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Minmin Gong <mgong@microsoft.com>
diff --git a/src/libANGLE/formatutils.cpp b/src/libANGLE/formatutils.cpp
index 0ebc67a..c822a96 100644
--- a/src/libANGLE/formatutils.cpp
+++ b/src/libANGLE/formatutils.cpp
@@ -560,15 +560,25 @@
}
}
-GLuint InternalFormat::computeRowPitch(GLenum formatType, GLsizei width, GLint alignment) const
+GLuint InternalFormat::computeRowPitch(GLenum formatType, GLsizei width, GLint alignment, GLint rowLength) const
{
ASSERT(alignment > 0 && isPow2(alignment));
- return rx::roundUp(computeBlockSize(formatType, width, 1), static_cast<GLuint>(alignment));
+ GLuint rowBytes;
+ if (rowLength > 0)
+ {
+ ASSERT(!compressed);
+ rowBytes = pixelBytes * rowLength;
+ }
+ else
+ {
+ rowBytes = computeBlockSize(formatType, width, 1);
+ }
+ return rx::roundUp(rowBytes, static_cast<GLuint>(alignment));
}
-GLuint InternalFormat::computeDepthPitch(GLenum formatType, GLsizei width, GLsizei height, GLint alignment) const
+GLuint InternalFormat::computeDepthPitch(GLenum formatType, GLsizei width, GLsizei height, GLint alignment, GLint rowLength) const
{
- return computeRowPitch(formatType, width, alignment) * height;
+ return computeRowPitch(formatType, width, alignment, rowLength) * height;
}
GLuint InternalFormat::computeBlockSize(GLenum formatType, GLsizei width, GLsizei height) const