Firefox: bindFramebuffer?

Does anyone have tried to use FramebufferObjects on Firefox yet?

When calling

gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);

current Firefox Nightly just says

glBindFramebuffer: invalid target

gl.FRAMEBUFFER has the correct value 0x8d40 (= 36160), so why do I get this error? :?

Any ideas?

The implementation looks a bit strange? What has target to do with LOCAL_GL__ATTACHMENT ? According to spec the only valid value is FRAMEBUFFER. :shock:

398 NS_IMETHODIMP
399 WebGLContext::BindFramebuffer(GLenum target, nsIWebGLFramebuffer *fb)
400 {
401     WebGLFramebuffer *wfb = static_cast<WebGLFramebuffer*>(fb);
402 
403     if (wfb && wfb->Deleted())
404         return ErrorMessage("glBindFramebuffer: framebuffer has already been deleted!");
405 
406     MakeContextCurrent();
407 
408     if (target >= LOCAL_GL_COLOR_ATTACHMENT0 &&
409         target < (LOCAL_GL_COLOR_ATTACHMENT0 + mBoundColorFramebuffers.Length()))
410     {
411         int targetOffset = target - LOCAL_GL_COLOR_ATTACHMENT0;
412         mBoundColorFramebuffers[targetOffset] = wfb;
413     } else if (target == LOCAL_GL_DEPTH_ATTACHMENT) {
414         mBoundDepthFramebuffer = wfb;
415     } else if (target == LOCAL_GL_STENCIL_ATTACHMENT) {
416         mBoundStencilFramebuffer = wfb;
417     } else {
418         return ErrorMessage("glBindFramebuffer: invalid target");
419     }
420 
421     gl->fBindFramebuffer(target, wfb ? wfb->GLName() : 0);
422 
423     return NS_OK;
424 }

It’s a known bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=528013

Seems like FBOs are working on Firefox now.