Αναζήτηση στην υποστήριξη

Προσοχή στις απάτες! Δεν θα σας ζητήσουμε ποτέ να καλέσετε ή να στείλετε μήνυμα σε κάποιον αριθμό τηλεφώνου ή να μοιραστείτε προσωπικά δεδομένα. Αναφέρετε τυχόν ύποπτη δραστηριότητα μέσω της επιλογής «Αναφορά κατάχρησης».

Learn More

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

  • 1 απάντηση
  • 0 έχουν αυτό το πρόβλημα
  • 1 προβολή
  • Τελευταία απάντηση από 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?

Όλες οι απαντήσεις (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.