mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
bug 894007 - WebGLContext::getParameter(GL_MAX_TEXTURE_SIZE) should be a power of two - r=jgilbert
This commit is contained in:
parent
86df43c75a
commit
22086cb170
@ -881,6 +881,18 @@ bool WebGLContext::ValidateStencilParamsForDrawCall()
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline int32_t floorPOT(int32_t x)
|
||||
{
|
||||
MOZ_ASSERT(x > 0);
|
||||
int32_t pot = 1;
|
||||
while (pot < 0x40000000) {
|
||||
if (x < pot*2)
|
||||
break;
|
||||
pot *= 2;
|
||||
}
|
||||
return pot;
|
||||
}
|
||||
|
||||
bool
|
||||
WebGLContext::InitAndValidateGL()
|
||||
{
|
||||
@ -960,6 +972,9 @@ WebGLContext::InitAndValidateGL()
|
||||
gl->fGetIntegerv(LOCAL_GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &mGLMaxVertexTextureImageUnits);
|
||||
}
|
||||
|
||||
mGLMaxTextureSize = floorPOT(mGLMaxTextureSize);
|
||||
mGLMaxRenderbufferSize = floorPOT(mGLMaxRenderbufferSize);
|
||||
|
||||
if (MinCapabilityMode()) {
|
||||
mGLMaxFragmentUniformVectors = MINVALUE_GL_MAX_FRAGMENT_UNIFORM_VECTORS;
|
||||
mGLMaxVertexUniformVectors = MINVALUE_GL_MAX_VERTEX_UNIFORM_VECTORS;
|
||||
|
Loading…
Reference in New Issue
Block a user