We now have external scroll offset in the scroll node API for WR. We can use this as a base to make a number of picture caching improvements. Some of these are speculative and require prototyping and investigation. It's likely that some combination of the items below can provide significant improvements to the performance and robustness of picture caching:
- Make use of external scroll offsets to avoid correlation of display lists.
- Use external scroll offsets to avoid needing to calculate tile-relative world space positions for primitive and clip dependencies.
- Store cache dependencies per-picture, allowing caching of multiple slices of the scene.
- Estimate pixel overdraw counts during batching to determine which tiles / slices are worth caching.
- Store primitive origins in primitive / clip templates, to reduce CPU copying overhead in dependency generation.
- Combine slices with a single compositing shader, to reduce framebuffer bandwidth.
- Consider using framebuffer fetch and/or pixel local storage on supported mobile devices to reduce memory bandwidth.