Bug 159608

Summary: preserveDrawingBuffer=true wrongly double-buffers on current iOS h/w
Product: WebKit Reporter: Reuben Scratton <reuben.scratton>
Component: WebGLAssignee: Dean Jackson <dino>
Status: RESOLVED WONTFIX    
Severity: Normal CC: dino, gman, kbr
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: iPhone / iPad   
OS: iOS 9.2   
Bug Depends on:    
Bug Blocks: 183151    
Attachments:
Description Flags
webgl preservedrawingbuffer issue ios safari demonstration none

Description Reuben Scratton 2016-07-10 03:52:43 PDT
[F.A.O. Dean Jackson]

Using preserveDrawingBuffer=true on iOS wrongly expects that rendering is done to two alternating backbuffers, i.e. normal double-buffering. As far as I can tell other WebGL implementations treat preserveDrawingBuffer=true as rendering to a single backbuffer which is then copied to the front buffer rather than swapped. 

Here is a simple demo of preserveDrawingBuffer=true written by Gregg Tavares:

http://greggman.com/downloads/examples/webgl/lessons/resources/webgl-preservedrawingbuffer-true.html

This demo looks fine on all desktop browsers and Android but flickers dreadfully on mobile Safari on iOS 9.x and 8.x because of the unexpected double-buffering.

I reported the issue to Gregg and he advised me to report it here, marked for the attention of Dean.
Comment 1 Gregg Tavares 2016-07-12 23:12:52 PDT
Created attachment 283491 [details]
webgl preservedrawingbuffer issue ios safari demonstration

Can also go here

https://jsfiddle.net/greggman/boffbn3k/
Comment 2 Gregg Tavares 2016-07-12 23:18:12 PDT
I don't remember if I'm supposed to report this stuff but I also filed it as an apple bug 27317599

Also the conformance test fails on iOS

https://www.khronos.org/registry/webgl/sdk/tests/conformance/context/context-attribute-preserve-drawing-buffer.html?webglVersion=1&quiet=0
Comment 3 Reuben Scratton 2016-08-16 15:21:57 PDT
*crickets*
Comment 4 Dean Jackson 2016-08-19 12:13:54 PDT
<rdar://problem/27317599>
Comment 5 Kenneth Russell 2020-05-08 14:31:17 PDT
This bug might be fixed with the fix for Bug 183151, or it might have been fixed since it was filed.
Comment 6 Dean Jackson 2020-05-08 16:01:44 PDT
This doesn't reproduce on current tip-of-tree iOS, but I think that's because we're now using the same compositing/back-buffer approach as macOS (now that both are using ANGLE).
Comment 7 Kenneth Russell 2020-05-08 16:03:30 PDT
Great. Thanks Dean for confirming. It looked to me like the antialias:true path for preserveDrawingBuffer:true was working correctly, and that's what this test case uses. Closing as WontFix - no longer reproducible.