From e76548dd8f106b4f44cac024d6847c58cbb59339 Mon Sep 17 00:00:00 2001 From: Vladimir Vukicevic Date: Sun, 6 Dec 2009 19:29:17 -0800 Subject: [PATCH] [webgl] revert part of previous commit, exposes strange latent bug --- content/canvas/src/WebGLContextGL.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/content/canvas/src/WebGLContextGL.cpp b/content/canvas/src/WebGLContextGL.cpp index 96a6151bb44..6c0c37d2d88 100644 --- a/content/canvas/src/WebGLContextGL.cpp +++ b/content/canvas/src/WebGLContextGL.cpp @@ -2909,14 +2909,25 @@ WebGLContext::ValidateGL() // make sure that the opengl stuff that we need is supported GLint val = 0; - MakeContextCurrent(); + // XXX this exposes some strange latent bug; what's going on? + //MakeContextCurrent(); gl->fGetIntegerv(LOCAL_GL_MAX_VERTEX_ATTRIBS, &val); + if (val == 0) { + LogMessage("GL_MAX_VERTEX_ATTRIBS is 0!"); + return PR_FALSE; + } + mAttribBuffers.SetLength(val); //fprintf(stderr, "GL_MAX_VERTEX_ATTRIBS: %d\n", val); gl->fGetIntegerv(LOCAL_GL_MAX_TEXTURE_UNITS, &val); + if (val == 0) { + LogMessage("GL_MAX_TEXTURE_UNITS is 0!"); + return PR_FALSE; + } + mBound2DTextures.SetLength(val); mBoundCubeMapTextures.SetLength(val);