PDA

View Full Version : Firefox: bindFramebuffer?



Coolcat
11-23-2009, 11:19 AM
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?

Coolcat
11-23-2009, 11:32 AM
The implementation (http://mxr.mozilla.org/mozilla-central/source/content/canvas/src/WebGLContextGL.cpp#399) 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 }

Coolcat
11-24-2009, 03:25 AM
It's a known bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=528013

Coolcat
12-23-2009, 04:07 AM
Seems like FBOs are working on Firefox now.