Open Bug 781084 Opened 12 years ago Updated 2 years ago

WebGL: Use glDiscardFramebufferEXT for TB GPUs (PowerVR, Mali) when not using preserveDrawingBuffer

Categories

(Core :: Graphics, defect)

defect

Tracking

()

People

(Reporter: BenWa, Unassigned)

References

Details

TB GPUs can use SwapBuffers to clear the frame data (polygon list for gpu tiles) for the default frame buffer, however for FBOs clearing is important to signal that it's okay to clear the frame data. This should be called before unbinding the framebuffer.

Another benefit is that this tells the driver that the depth buffer does not need to be copied from the tile buffer to memory.

It should be safe to use this for non TB GPUs since they can ignore the hint.
Even on platforms where DiscardFramebuffer is unavailable, sometimes you can get similar performance by Clear()ing (to anything), since it can optimize to a single color (or depth/stencil), and not bother loading the old buffer(s).

I was toying with this over in bug 766366. I'll pull that patch over here, since it's really addressing a different problem.
Depends on: 766366
OS: Mac OS X → All
Hardware: x86 → All
Is this bug about crafting a WEBGL_discard_framebuffer extension and implementing it to user WebGL codebases? (Or something internal?)

We could implement this in Emscripten GLES2 library_gl.js bridge if/when that extension becomes available, CCing myself to remember about that.
(In reply to Jukka Jylänki from comment #2)
> Is this bug about crafting a WEBGL_discard_framebuffer extension and
> implementing it to user WebGL codebases? (Or something internal?)
> 
> We could implement this in Emscripten GLES2 library_gl.js bridge if/when
> that extension becomes available, CCing myself to remember about that.

No, this is for our WebGL implementation to use DiscardFramebuffer for perf reasons.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.