Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Lazy WebGL buffer re-bind broken

#61

Symptoms

Chromium - with webgl-trace enabled

webgl-trace.js:15gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
webgl-trace.js:15gl.uniformMatrix4fv(uniformLocation10, 0, new WebGLFloatArray( [0.9781476259231567, 0, 0.2079116851091385, 0, 0, 1, 0, 0, -0.2079116851091385, 0, 0.9781476259231567, 0, 120, 0, 140, 1] ));
webgl-trace.js:15gl.uniformMatrix4fv(uniformLocation11, 0, new WebGLFloatArray( [0.9781476259231567, 0, 0.2079116851091385, -146.4853515625, 0, 1, 0, 0, -0.2079116851091385, 0, 0.9781476259231567, -111.99126434326172, 0, 0, 0, 1] ));
webgl-trace.js:15gl.drawElements(gl.TRIANGLES, 36, gl.UNSIGNED_SHORT, 0);
webgl-trace.js:15WebGL error INVALID_OPERATION in drawElements(TRIANGLES, 36, UNSIGNED_SHORT, NONE)

Firefox Logs error: "glDrawElements: must have element array buffer binding!"

Cause

The lazy buffer rebind (first line of snippet below) sometimes binds a null buffer. When that is commented out, all is good.

if (currentBoundGeoType != type) {

for (var i = 0; i < 8; i++) {
            context.disableVertexAttribArray(i);
        }
        SceneJS_eventModule.fireEvent(
                SceneJS_eventModule.GEOMETRY_EXPORTED,
                geo);

        geo.indexBuf.bind(); // Bind index buffer

        currentBoundGeoType = type;



} context.drawElements(geo.primitive, geo.indexBuf.numItems, context.UNSIGNED_SHORT, 0); // <------- Error occurs right after this line executed context.flush();

Reported by lindsay.kay (at xeolabs) · May 9th, 2010 @ 01:09 PM

State: new
Milestone: none

Activity

No comments yet.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.