Bug 1461293 - TexStorage needs only one of w,h,d>>(levels-1) to be non-zero. - r=kvark

MozReview-Commit-ID: IUlrfWrLdUc
This commit is contained in:
Jeff Gilbert 2018-05-15 17:00:31 -07:00
parent dc7e617a12
commit d94ed3573f

View File

@ -1146,10 +1146,10 @@ WebGLTexture::TexStorage(const char* funcName, TexTarget target, GLsizei levels,
const auto lastLevelHeight = uint32_t(height) >> lastLevel;
// If these are all zero, then some earlier level was the final 1x1(x1) level.
bool ok = lastLevelWidth && lastLevelHeight;
bool ok = lastLevelWidth || lastLevelHeight;
if (target == LOCAL_GL_TEXTURE_3D) {
const auto lastLevelDepth = uint32_t(depth) >> lastLevel;
ok &= bool(lastLevelDepth);
ok |= bool(lastLevelDepth);
}
return ok;
}();