5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_GPU_TRACER_MTL_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_GPU_TRACER_MTL_H_
8 #include <Metal/Metal.h>
23 class GPUTracerMTL :
public std::enable_shared_from_this<GPUTracerMTL> {
38 struct GPUTraceState {
39 Scalar smallest_timestamp = std::numeric_limits<float>::max();
40 Scalar largest_timestamp = 0;
41 size_t pending_buffers = 0;
44 mutable Mutex trace_state_mutex_;
45 GPUTraceState trace_states_[16] IPLR_GUARDED_BY(trace_state_mutex_);
46 size_t current_state_ IPLR_GUARDED_BY(trace_state_mutex_) = 0u;
Approximate the GPU frame time by computing a difference between the smallest GPUStartTime and larges...
void RecordCmdBuffer(id< MTLCommandBuffer > buffer)
Record the current cmd buffer GPU execution timestamps into an aggregate frame workload metric.
void MarkFrameEnd()
Record that the current frame has ended. Any additional cmd buffers will be attributed to the "next" ...