Fix cube map rendertargets.
We were using the entire level parameter of the cube map, instead
of using the helper functions for cube map ImageIndexes, which
set the layer corresponding to the cube map face.
BUG=angle:849
BUG=440701
Change-Id: Id78db5c8281b6b644392bb961d69a7f869755a34
Reviewed-on: https://chromium-review.googlesource.com/234380
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
diff --git a/src/libANGLE/renderer/d3d/TextureD3D.cpp b/src/libANGLE/renderer/d3d/TextureD3D.cpp
index 1dec77f..bbdb0f4 100644
--- a/src/libANGLE/renderer/d3d/TextureD3D.cpp
+++ b/src/libANGLE/renderer/d3d/TextureD3D.cpp
@@ -1157,14 +1157,14 @@
Image *TextureD3D_Cube::getImage(int level, int layer) const
{
ASSERT(level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS);
- ASSERT(layer < 6);
+ ASSERT(layer >= 0 && layer < 6);
return mImageArray[layer][level];
}
Image *TextureD3D_Cube::getImage(const gl::ImageIndex &index) const
{
ASSERT(index.mipIndex < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS);
- ASSERT(index.layerIndex < 6);
+ ASSERT(index.layerIndex >= 0 && index.layerIndex < 6);
return mImageArray[index.layerIndex][index.mipIndex];
}