xref: /aosp_15_r20/external/skia/relnotes/GpuStats.md (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1*c8dee2aaSAndroid Build Coastguard WorkerGraphite's `Context` now provides an interface to report the GPU time spent processing a recording. The client provides
2*c8dee2aaSAndroid Build Coastguard Workera different finished proc of type `skgpu::graphite::GpuFinishedWithStatsProc` using
3*c8dee2aaSAndroid Build Coastguard Worker`skgpu::graphite::InsertRecordingInfo::fFinishedWithStatsProc` and sets the flag
4*c8dee2aaSAndroid Build Coastguard Worker`skgpu::graphite::InsertRecordingInfo::fGpuStatsFlag` to `skgpu::GpuStatsFlags::kElapsedTime`. The new callback takes a
5*c8dee2aaSAndroid Build Coastguard Workernew struct, `skgpu::GpuStats`, which has an `elapsedTime` field that will indicate the amount of GPU time used by the
6*c8dee2aaSAndroid Build Coastguard Workerrecording. This is implemented for the Dawn backend only. In WASM on WebGPU the reported time excludes any GPU transfers
7*c8dee2aaSAndroid Build Coastguard Workerthat occur before the first render/compute pass or after the last pass because of limitations in the WebGPU timestamp
8*c8dee2aaSAndroid Build Coastguard Workerquery API.
9*c8dee2aaSAndroid Build Coastguard Worker
10*c8dee2aaSAndroid Build Coastguard Worker`GrDirectContext` provides a similar interface to report the GPU time spent in a flush. The client uses a new callback
11*c8dee2aaSAndroid Build Coastguard Workertype, `GrGpuFinishedWithStatsProc` and sets the same flag on `GrFlushInfo`. This is implemented for GL
12*c8dee2aaSAndroid Build Coastguard Worker(including GLES and WebGL).
13