Fix determining texture mipmap completeness
The code didn't previously take base level properly into account
when determining how many levels to check when checking for texture
completeness.
The code is refactored so that the "q" value in spec, that is the
maximum mipmap level for determining completeness, can be queried from
TextureState. This value is used now for checking completeness.
This requires moving ImageDescs under TextureState. Functions that
operate on the ImageDesc array are also moved from Texture to
TextureState. TextureState members are also renamed to start with the
"m" prefix and made private.
Also handle levels outside the base/max level range consistently in
eglCreateImageKHR validation. We interpret the spec so that if the
level used for the EGL image is not a part of the texture levels that
affect texture completeness, an error is generated.
BUG=angleproject:596
TEST=angle_end2end_tests
Change-Id: I038ef24aa83e0a6905ca3c0bbada5989eecb00d9
Reviewed-on: https://chromium-review.googlesource.com/344880
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/libANGLE/Framebuffer.cpp b/src/libANGLE/Framebuffer.cpp
index 071b718..0c661ad 100644
--- a/src/libANGLE/Framebuffer.cpp
+++ b/src/libANGLE/Framebuffer.cpp
@@ -437,7 +437,8 @@
// TODO(jmadill): Check if OpenGL ES2 drivers enforce cube completeness.
const Texture *texture = colorAttachment.getTexture();
ASSERT(texture);
- if (texture->getTarget() == GL_TEXTURE_CUBE_MAP && !texture->isCubeComplete())
+ if (texture->getTarget() == GL_TEXTURE_CUBE_MAP &&
+ !texture->getTextureState().isCubeComplete())
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}