WebGL Error 1286=”Invalid Framebuffer Operation” when changing Canvas Size in mobile Safari

393 views
Skip to first unread message

Helmut Emmelmann

unread,
Sep 9, 2016, 1:01:15 PM9/9/16
to WebGL Dev List

I  get a WebGL Error 1286=”Invalid Framebuffer Operation” not on any WebGL operation but apparently when changing canvas dimensions. According to the spec the 1286 can/must occur after  specific erroneous WebGL calls but it does not explain what this error means on resizing the canvas.


This happens on my pages http://www.taccgl.org/blog/popup.html (after clicking on one of the buttons to run an animation and scrolling) only on mobile safari.


I use the following code to resize the canvas      


   var wpr=Math.round(w*pr), hpr=Math.round(h*pr);

   cv.width=wpr;  cv.style.width=w+"px"; cv.height=hpr; cv.style.height=h+"px";


whereby cv denotes the 3D canvas. Gl.getError returns 0 before this snipplet and 1286 afterwards.

I did not find anything in the spec regarding this error on resizing the canvas, what could possibly be wrong?

Kenneth Russell

unread,
Sep 9, 2016, 5:53:48 PM9/9/16
to WebGL Dev List
Thanks for reporting this. I've pointed out your post to one of the engineers who works on Safari and hopefully they'll follow up. It sounds like a bug in the WebGL implementation on mobile Safari.

Out of curiosity, does this conformance test pass or fail on your device?

If none of the conformance tests catch this error, it would be ideal if you could put together a minimal test case that shows this problem. The online test harness is at:

and you can submit pull requests to add new conformance tests or changes to existing ones here:

Thanks,

-Ken



--
You received this message because you are subscribed to the Google Groups "WebGL Dev List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webgl-dev-list+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dean Jackson

unread,
Sep 9, 2016, 7:08:47 PM9/9/16
to WebGL Dev List
Have you tried this on any of the iOS 10 betas? This sounds like something I fixed in the last year, and I am unable to reproduce the issue on a device running the iOS 10 GM.

Dean

Helmut Emmelmann

unread,
Sep 12, 2016, 11:15:13 AM9/12/16
to WebGL Dev List
Have you tried this on any of the iOS 10 betas? This sounds like something I fixed in the last year, and I am unable to reproduce the issue on a device running the iOS 10 GM.

Dean


Thanks for the quick answer. Unfortunately I do not own the device myself, so I can´t test with another OS. The problem occurred on a (iPhone; CPU iPhone OS 9_3_4 like Mac OS X). I will try to create a simpler test case that could fit in the test suite.


Meanwhile here is a more detailed description on how to reproduce the problem: Open http://www.taccgl.org/blog/popup.html?dbg=t and click on a red RUN button to start a WebGL animation. Then perform various scroll operations (for me it took up to 30 sec), even after the animation stopped. Then again click on one of the red run buttons which will show a yellow 2D sign on top of the page (instead of the usual green 3D sign) indicating that the WebGL crashed (and further animations are limited using canvas 2D). The dbg=t parameter loads uncompressed versions of the js libs.



The page uses a full screen 3D canvas that is positioned and possibly resized in an onscroll event handler to always cover the visible part of the document. After several scroll operations with successful move and resize of the canvas, suddenly a canvas resize operation delivers the 1286 error. In my tests this happened at a time, when the WebGL animation itself had already stopped (no requestAnimation frame call back and no drawing taking place, canvas invisible, but the onscroll handler still active). To the user the problem only becomes apparent when clicking on a Run button again.

 

 Helmut 

Catalin

unread,
Sep 12, 2016, 11:30:12 AM9/12/16
to webgl-d...@googlegroups.com
Try this http://www.taccgl.org/blog/popup.html will working.
> --
> You received this message because you are subscribed to the Google Groups
> "WebGL Dev List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to webgl-dev-lis...@googlegroups.com.

Helmut Emmelmann

unread,
Sep 15, 2016, 12:46:15 PM9/15/16
to WebGL Dev List


Out of curiosity, does this conformance test pass or fail on your device?


@ Ken :  I tried to reproduce the problem in the test suite by modifying the rapid-resizing.html test. I replaced the automatic resizing in the test by position and size adjustment of the canvas during onscroll.  This modified test, however,  works fine, so it is probably not helpful.


http://www.taccgl.org/blog/popup.html still has the problem (up to now, I could only test on OS 9_3_4 ) that, however, becomes apparent only after pressing a RUN button twice and doing 30 seconds of manual scrolling in between (just as described in my previous post).  ?dbg=t can be appended as URL parameter for debugging output on the console and non-minimized libs, tested on Chrome, FF, IE only.

Kenneth Russell

unread,
Sep 15, 2016, 1:30:34 PM9/15/16
to WebGL Dev List
Hmm. Unfortunate that it seems so difficult to reduce this to a small test case. If you can keep trying, and figure something out, we'll be happy to help integrate it into the WebGL conformance suite.

-Ken

Helmut Emmelmann

unread,
Sep 19, 2016, 2:20:20 PM9/19/16
to WebGL Dev List

I meanwhile tested on OS 10.0 and there the problem is gone, just as Dean wrote. I also programmed around the problem in http://www.taccgl.org/blog/popup.html and a new version of my taccgl library eliminating many unnecessary canvas resize operations, so that I no longer can reproduce the problem with this page. I will send a small test program to Ken to keep it reproducible.


Helmut

 
Reply all
Reply to author
Forward
0 new messages