ابحث في الدعم

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

WebGL2.0 doesn't allow flipping frame with blitFramebuffer()

  • 1 (رد واحد)
  • 0 have this problem
  • 1 view
  • آخر ردّ كتبه TyDraniu

more options

Hi. So in desktop OpenGL it is totally valid to write the following in order to flip the frame vertically into dst buffer:

 glBlitFramebuffer(0, h, w, 0, 0, 0, w, h, GL_COLOR_BUFFER_BIT, GL_NEAREST));

In WebGL if I do this:

gl.blitFramebuffer(0, h,w,0 , 0, 0, w, h, gl.COLOR_BUFFER_BIT, gl.NEAREST);

I am getting WebGL warning: blitFramebuffer: If the source is multisampled, then the source and dest regions must match exactly.

Similar error is reported in Chrome.

When I am looking into the related C++ code I can see this:

        if (dstX0 != srcX0 ||
           dstX1 != srcX1 ||
           dstY0 != srcY0 ||
           dstY1 != srcY1)
       {
           webgl->ErrorInvalidOperation("%s: If the source is multisampled, then the"
                                        " source and dest regions must match exactly.",
                                        funcName);
           return;
       }

I am not sure why this restriction has been imposed. GLES2/3 support this kind of dimensions setup with no errors. Can someone explain the reason behind this? And if it is a bug/missed functionality, where should it be reported?

Hi. So in desktop OpenGL it is totally valid to write the following in order to flip the frame vertically into dst buffer: glBlitFramebuffer(0, h, w, 0, 0, 0, w, h, GL_COLOR_BUFFER_BIT, GL_NEAREST)); In WebGL if I do this: gl.blitFramebuffer(0, h,w,0 , 0, 0, w, h, gl.COLOR_BUFFER_BIT, gl.NEAREST); I am getting '''WebGL warning: blitFramebuffer: If the source is multisampled, then the source and dest regions must match exactly.''' Similar error is reported in Chrome. When I am looking into the [https://github.com/mozilla/spiderweb/blob/master/dom/canvas/WebGLFramebuffer.cpp related C++ code] I can see this: if (dstX0 != srcX0 || dstX1 != srcX1 || dstY0 != srcY0 || dstY1 != srcY1) { webgl->ErrorInvalidOperation("%s: If the source is multisampled, then the" " source and dest regions must match exactly.", funcName); return; } I am not sure why this restriction has been imposed. GLES2/3 support this kind of dimensions setup with no errors. Can someone explain the reason behind this? And if it is a bug/missed functionality, where should it be reported?

All Replies (1)

more options

Hi, it has been introduced in bug 1498070 and 1679052. I guess it's due to some security issues.

You still can report it on Bugzilla.