Bug 1310222 - Relax PoT requirement for resource size limits in WebGL. - r=daoshengmu
MozReview-Commit-ID: 33kGMdPOHkT
--- a/dom/canvas/WebGLContextValidate.cpp
+++ b/dom/canvas/WebGLContextValidate.cpp
@@ -534,31 +534,16 @@ WebGLContext::InitAndValidateGL(FailureR
mImplMax3DTextureSize = 0;
if (!gl->GetPotentialInteger(LOCAL_GL_MAX_ARRAY_TEXTURE_LAYERS, (GLint*)&mImplMaxArrayTextureLayers))
mImplMaxArrayTextureLayers = 0;
gl->fGetIntegerv(LOCAL_GL_MAX_TEXTURE_IMAGE_UNITS, &mGLMaxTextureImageUnits);
gl->fGetIntegerv(LOCAL_GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &mGLMaxVertexTextureImageUnits);
}
- // If we don't support a target, its max size is 0. We should only floor-to-POT if the
- // value if it's non-zero. (NB log2(0) is -Inf, so zero isn't an integer power-of-two)
- const auto fnFloorPOTIfSupported = [](uint32_t& val) {
- if (val) {
- val = FloorPOT(val);
- }
- };
-
- fnFloorPOTIfSupported(mImplMaxTextureSize);
- fnFloorPOTIfSupported(mImplMaxCubeMapTextureSize);
- fnFloorPOTIfSupported(mImplMaxRenderbufferSize);
-
- fnFloorPOTIfSupported(mImplMax3DTextureSize);
- fnFloorPOTIfSupported(mImplMaxArrayTextureLayers);
-
////////////////
mGLMaxColorAttachments = 1;
mGLMaxDrawBuffers = 1;
gl->GetPotentialInteger(LOCAL_GL_MAX_COLOR_ATTACHMENTS,
(GLint*)&mGLMaxColorAttachments);
gl->GetPotentialInteger(LOCAL_GL_MAX_DRAW_BUFFERS, (GLint*)&mGLMaxDrawBuffers);