I think you are slightly misunderstanding both preserveDrawingBuffer and DiscardFramebufferEXT.This proposed preserveDrawingBuffer change probably would not decrease WebGL's efficiency in the majority of browsers and on the majority of OSs. The browser can still use DiscardFramebufferEXT for the depth and stencil buffers when presenting the WebGL canvas to the compositor. In my understanding, it's never been possible to discard the color buffer, because the page compositor needs it in case the page needs to be redrawn using the same WebGL results from the previous frame. Since the color buffer is always available after compositing, it can be made available to toDataURL and other APIs at no cost.
IIUC, all browsers render into framebuffer objects. They use the
resulting framebuffer for compositing with the rest of the web
page. The browser must either
The purpose of DiscardFramebufferEXT is to tell a tiling GPU that
is does not need to copy the data corresponding to the current
tile from the framebuffer of the previous frame into the tile
memory prior to rendering. It has no effect whatsoever on the
content of a framebuffer. Copy-to-tile only needs to be done
when pDB==true. When pDB==false, the browser can always call DFExt
before calling the WebGL app's draw function.
I suspect most browsers use the multiple buffer model. So it
seems sensible to define that toDataURL and drawImage receive the
data from the current compositing buffer rather than the current
drawing buffer whose content is likely still a work in progress.
It makes sense for the tex*Image2D calls too. The proposed change
means that tex*Image2D(..., canvas), where canvas is the current
canvas, would actually capture the content of the previous frame.
I think this is okay. If the app wants to capture the content of
the current drawing buffer, it can use copyTexImage which is much
more efficient anyway.
NOTE: This electronic mail message may contain confidential and privileged information from HI Corporation. If you are not the intended recipient, any disclosure, photocopying, distribution or use of the contents of the received information is prohibited. If you have received this e-mail in error, please notify the sender immediately and permanently delete this message and all related copies.