Viz: Chrome Graphics Futures
Tokyo, 2017/09/21
About this talk
- If you were here at the last BlinkOn...
- I talked about Mus and Compositing
- We've refined our plans and made some progress since then.
- So an update.
Viz: Two contexualizations
- Servicification
- The Mojo UI service is a core service in Chrome
- Viz (for Visuals) is a sub-service responsible for producing visual output: compositing, rasterization, GPU virtualization.
- Augmenting the GPU Process
- In existing Chrome, the GPU process is responsible for virtualizing a hardware GPU.
- But we are adding additional functionality for compositing and rasterization.
- So a new name.
Servicified Chrome Viz Context
GPU process vs Viz
- Viz is more than just a servicification tickbox.
- Viz is also about making Chrome graphics better for the Web platform:
- Better compositing performance
- Better rasterization performance
- Toll-free rasterization and compositing for site isolation
Current WebPlatform Graphics Pipeline
Viz Tadpole
- Coming to Chrome over the next 2-3 milestones
- A prepatory refactoring for direct compositing: removing the bolded CommandBuffer
- Promises to deliver a 10-15% performance improvement
Viz Tadpole with Direct Skia Compositing
- Tadpole DisplayCompositor uses
GLRenderer
- Replace with
SkiaRenderer
for direct compositing
- Enable the WIP version
--use-skia-renderer
Aside: Why is Tadpole Hard?
- Tadpole is conceptually simple for the web platform
- The before and after picture for renderer processes is unchanged:
- Only have to alter the setup of CompositorFrame transport
- But Tadpole also requires many browser-side changes
UI Graphics Pipeline Changes
- Synchronous function call before
- Asynchronous IPC after:
- Surface References to improve tracking of objects on in 63
- Improved CompositorFrame eviction on in 64
- Surface Synchronization so UI can atomically update sizes of web platform children on in 64
- Cross-process Tab readback on in 64
- Revised event targeting on in 64
- Improved occlusion culling on in 64
- SkiaRenderer performant in 67
Parallel Effort: OOP Rasterization
- Centralizing the display compositor permits reducing command buffer overhead
- So does delegating serialized paint ops to Viz for Out Of Process rasterization
- Partial implementation behind flag:
--enable-gpu-rasterization
--enable-oop-rasterization
OOP Rasterization
- Now: each web platform client generates GL
- Next: OOP rasterization serializes paint ops and rasterizes in Viz
Combined Tadpole and OOP Rasterization
- Note absence of GL command buffers
- Improves both raster and compositing performance
Enabling Vulkan
- Vulkan API is not ammenable to implementing a command buffer
- Skia has a Vulkan backend
- Vulkan promises 10-15% better performance beyond the GL implementation for both SkiaRenderer and paint op rasterization
Aside: WebGL Requires CommandBuffer
- A platform-specific API could permit texture sharing with Native GL
- Angle for Vulkan (aka Vangle) would permit direct interop
Explaining the Site Isolation Graphics Toll
- Site isolation improves security
- With site-isolation, a single top-level page like this:
- Unnecessarily allocates GPU memory and rasterizes the red region:
Now: Aggregation After Rasterization
- Makes rasterization decisions locally in the renderers
- So rasterize everything that might be needed
- Display Compositor aggregates the contributed layers
- Result: redundant rasterization
Salamander: Aggregation Before Raster
- Start with same paint ops
- Add layerization data from property trees
- Aggregate centrally
- Rasterize and composite the smallest necessary set of paint ops
Summary: Viz Status
- Underway now
- Tadpole: relocate the DisplayCompositor to Viz in 66
- OOP Rasterization in Viz Q2 2018
- SkiaRenderer in 67
- After the above starting Q3 2018
- Vulkan graphics
- Salamander: central layerization
Viz Take-aways
- Two ways to think about Viz:
- Servicification of graphics in Chrome
- A better GPU process
- Viz improves webplatform graphics three ways:
- 10-15% performance benefit from removing command buffers
- Vulkan support for another 10-15% performance benefit
- Central aggregation for toll-free site-isolation support