[Webkit-unassigned] [Bug 72452] [Chromium] Avoid clear and color mask operations for root layers

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 16 13:06:54 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=72452





--- Comment #9 from Antoine Labour <piman at chromium.org>  2011-11-16 13:06:54 PST ---
(In reply to comment #7)
> (In reply to comment #4)
> > View in context: https://bugs.webkit.org/attachment.cgi?id=115300&action=review
> > 
> > > Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp:394
> > >      m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
> > 
> > Note: depending on the gpu architecture, doing the clear may actually be a performance improvement. For example, on a tiled architecture, clearing usually permits the driver to avoid loading in the previous frame's back buffer, saving bandwidth. But obviously on others, it has the cost of writing the back buffer with pixels that will be overwritten later. Not sure which way to go, maybe we'll want to make that an option at some point.
> 
> Wait, turning off blending for the root layer and turning off masking out of the alpha channel means that it does not have to read anything from the back buffer, right? And that is the purpose of my patch, i.e. instead of writing the source alpha values, just write out 1.0, so it should always be a perf win.

On a tiled architecture, the GPU has a piece of embedded memory / cache that is smaller than the frame buffer. It collects all screen-space draw operations (clear, triangles post transform etc.), map them to a set of tiles that fit into the cache, then goes for all the tiles:
1- read frame buffer from memory to cache
2- do all draw operations scissored to the tile
3- write frame buffer from cache to memory

If you clear first, it can skip (1) because it's easy to know it will erase all the data. Otherwise, it would have to go through all the triangles and check whether or not they fully cover the tile which would be expensive, so it generally doesn't do that.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list