Do not apply UNPACK_SKIP_IMAGES for 2D textures on D3D
GLES 3.0.4 section 3.8.3:
"For the purposes of decoding the texture image, TexImage2D is
equivalent to calling TexImage3D with corresponding arguments and
depth of 1, except that UNPACK_SKIP_IMAGES is ignored."
An "applySkipImages" boolean parameter is added to the functions in
the D3D backend that apply skip offset to the unpack pointer. In case
2D texture data is uploaded, the parameter is set to false and
UNPACK_SKIP_IMAGES is not applied.
BUG=angleproject:1406
TEST=angle_end2end_tests
Change-Id: Iedc2b05377adee8d5c2504511a87421f4b1db18d
Reviewed-on: https://chromium-review.googlesource.com/350465
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
index a7c1b2a..634f345 100644
--- a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
+++ b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
@@ -247,7 +247,7 @@
sizedFormatInfo.computeRowPitch(type, area.width, packState.alignment, packState.rowLength),
outputPitch);
GLsizei outputSkipBytes = sizedFormatInfo.computeSkipPixels(
- outputPitch, 0, 0, packState.skipRows, packState.skipPixels);
+ outputPitch, 0, 0, packState.skipRows, packState.skipPixels, false);
return readPixelsImpl(area, format, type, outputPitch, packState,
reinterpret_cast<uint8_t *>(pixels) + outputSkipBytes);