mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 894007 - WebGLContext::getParameter(GL_MAX_TEXTURE_SIZE) should be a power of two - r=jgilbert
This commit is contained in:
parent
8d86b320b1
commit
fc19fe386a
@ -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