Vyhľadajte odpoveď

Vyhnite sa podvodom s podporou. Nikdy vás nebudeme žiadať, aby ste zavolali alebo poslali SMS na telefónne číslo alebo zdieľali osobné informácie. Nahláste prosím podozrivú aktivitu použitím voľby “Nahlásiť zneužitie”.

Learn More

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

  • 1 odpoveď
  • 0 má tento problém
  • 1 zobrazenie
  • Posledná odpoveď od 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?

Všetky odpovede (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.