Skip to content

vello_gpu: add pipeline cache to RenderSettings - #1981

Open
taj-p wants to merge 1 commit into
mainfrom
tajp/pipeline-cache
Open

taj-p wants to merge 1 commit into
mainfrom
tajp/pipeline-cache

Conversation

@taj-p

@taj-p taj-p commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Background

Testing Vello GPU on a Samsung A24 (Mali-G57) and A05s (Adreno 610) sees pipeline compilation take 763ms and 1241ms respectively. This impacts perceived start up performance.

Intent

Use a pipeline cache to push pipeline compilation latency to several milliseconds.

AI Contribution: Codex Astra + Claude Fable

Adds an optional `wgpu::PipelineCache` to `RenderSettings` for use by
`Renderer::new_with`. The cache defaults to `None` and is available with the
`wgpu` feature. Settings are now Clone rather than Copy because they own the
cache handle.

The driver's shader compilation dominates the renderer's creation on mobile
GPUs: 763 ms on a Mali-G57 MC2 and 1241 ms on an Adreno 610 from a cold start,
measured in an Android host with simpleperf (libGLES_mali / libllvm-qgl, not
naga). A cache the host persists between runs (`PipelineCache::get_data`)
makes that a few milliseconds.
@taj-p
taj-p force-pushed the tajp/pipeline-cache branch from ca904ea to 332a7ba Compare October 5, 2026 19:40
Comment thread vello_gpu/src/scene.rs
///
/// Requires [`wgpu::Features::PIPELINE_CACHE`] on the device.
#[cfg(feature = "wgpu")]
pub pipeline_cache: Option<wgpu::PipelineCache>,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having public struct fields gated behind features is usually a bad idea. If someone depends on Vello GPU to only use the WebGL backend, but then some other dependency in the tree activates the wgpu backend as well, their code will fail to compile. I think we should either make the fields in RenderSettings private and turn it into a builder pattern, or instead have new_with take the pipeline cache directly. The second is probably easier for now? Even if it requires updating more call sites.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants