Commit b3319dfe by Jamie Madill

Fix npot Texture level 0 validation.

We were rejecting npot textures for level 0, even though it is valid in GLES 2 for non-mipped textures to have npot size. BUG=381495 Change-Id: Iacc3ab50d6487ecba804fd8963aa0a2ada2f1cae Reviewed-on: https://chromium-review.googlesource.com/205220Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarNicolas Capens <nicolascapens@chromium.org> Change-Id: Iad3f5d007e878e60a87180bba3a2c1e246c311ca Reviewed-on: https://chromium-review.googlesource.com/207121Reviewed-by: 's avatarNicolas Capens <capn@chromium.org>
parent a1bb2d5a
...@@ -166,14 +166,16 @@ bool ValidMipLevel(const Context *context, GLenum target, GLint level) ...@@ -166,14 +166,16 @@ bool ValidMipLevel(const Context *context, GLenum target, GLint level)
return level < maxLevel; return level < maxLevel;
} }
bool ValidImageSize(const gl::Context *context, GLenum target, GLint level, GLsizei width, GLsizei height, GLsizei depth) bool ValidImageSize(const gl::Context *context, GLenum target, GLint level,
GLsizei width, GLsizei height, GLsizei depth)
{ {
if (level < 0 || width < 0 || height < 0 || depth < 0) if (level < 0 || width < 0 || height < 0 || depth < 0)
{ {
return false; return false;
} }
if (!context->supportsNonPower2Texture() && (level != 0 || !gl::isPow2(width) || !gl::isPow2(height) || !gl::isPow2(depth))) if (!context->supportsNonPower2Texture() &&
(level != 0 && (!gl::isPow2(width) || !gl::isPow2(height) || !gl::isPow2(depth))))
{ {
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment