Fix bugs in 2D Array Texture support.
This fixes assertion failures and other errors, reproducible
by running the dEQP Texture Format tests.
BUG=angle:813
Change-Id: I3b97f89323f9656b45f617211fb4579a24013951
Reviewed-on: https://chromium-review.googlesource.com/229351
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
diff --git a/src/libGLESv2/renderer/d3d/TextureD3D.cpp b/src/libGLESv2/renderer/d3d/TextureD3D.cpp
index 56f3a45..a5bfd32 100644
--- a/src/libGLESv2/renderer/d3d/TextureD3D.cpp
+++ b/src/libGLESv2/renderer/d3d/TextureD3D.cpp
@@ -2362,7 +2362,7 @@
const void *layerPixels = pixels ? (reinterpret_cast<const unsigned char*>(pixels) + (inputDepthPitch * i)) : NULL;
gl::ImageIndex index = gl::ImageIndex::Make2DArray(level, layer);
- gl::Error error = TextureD3D::subImage(xoffset, yoffset, zoffset, width, height, 1, format, type,
+ gl::Error error = TextureD3D::subImage(xoffset, yoffset, 0, width, height, 1, format, type,
unpack, layerPixels, index);
if (error.isError())
{
@@ -2513,7 +2513,7 @@
{
int baseWidth = getBaseLevelWidth();
int baseHeight = getBaseLevelHeight();
- int baseDepth = getBaseLevelDepth();
+ int baseDepth = getLayerCount(0);
GLenum baseFormat = getBaseLevelInternalFormat();
// Purge array levels 1 through q and reset them to represent the generated mipmap levels.