You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apps that tune layer density or level of detail need per-draw render cost from deck.gl. Today metrics.gpuTime is a one-second aggregate that requires deviceProps.debugGPUTime, and it cannot be attributed to individual draws.
Proposal
Add an experimental, opt-in Deck prop that reports CPU time and, when the device supports 'timestamp-query', GPU time for each draw:
When the prop is not set, no query sets are created. gpuMs is omitted when timestamp queries are unavailable or fail.
Measurement contract
A sample covers one Deck draw operation, not an individual layer or GPU draw command. A standalone frame normally produces one sample; interleaved Mapbox/MapLibre rendering may produce several layer-group samples per displayed frame.
cpuMs covers renderLayers, including effect passes. It excludes layer updates, picking, widgets, timestamp readback and the callback itself.
gpuMs spans the first through last layers render pass, potentially including gaps. It excludes effect pre/post-render passes and is not a sum of pass durations.
Samples with GPU readback arrive asynchronously; CPU-only samples without a GPU query arrive synchronously. Samples can arrive out of draw order. The initial callback has no frame identifier, so consumers must not pair samples to frames by callback order. Exact frame correlation would require a separately specified identifier.
Unsupported, failed, or skipped GPU measurements omit gpuMs. Multi-canvas draws and WebGL draws with luma's debug GPU profiler are CPU-only. Interrupted draws produce no sample, and finalization suppresses pending callbacks.
Disabled instrumentation creates no timing query sets. Enabled instrumentation has overhead, including asynchronous query readback that is excluded from cpuMs.
Implementation and detailed API documentation: #10778.
Contract update from review of #10778: the fields are now cpuTime/gpuTime (matching DeckMetrics), and gpuTime is the sum of per-pass GPU durations instead of the span from the first pass to the last, so idle time between passes is not counted. Multi-canvas draws are now GPU timed too. GPU time is omitted (CPU-only samples) whenever luma's debug GPU timer is active, on both WebGL and WebGPU.
Activity
akre54 commentedon Oct 1, 2026
Contract update from review of #10778: the fields are now
cpuTime/gpuTime(matchingDeckMetrics), andgpuTimeis the sum of per-pass GPU durations instead of the span from the first pass to the last, so idle time between passes is not counted. Multi-canvas draws are now GPU timed too. GPU time is omitted (CPU-only samples) whenever luma's debug GPU timer is active, on both WebGL and WebGPU.