26class GPUTracerVK :
public std::enable_shared_from_this<GPUTracerVK> {
28 GPUTracerVK(std::weak_ptr<ContextVK> context,
bool enable_gpu_tracing);
54 static const constexpr size_t kTraceStatesSize = 16u;
59 void OnFenceComplete(
size_t frame);
63 void RecordCmdBufferStart(
const vk::CommandBuffer& buffer,
GPUProbe& probe);
67 void RecordCmdBufferEnd(
const vk::CommandBuffer& buffer,
GPUProbe& probe);
69 std::weak_ptr<ContextVK> context_;
71 struct GPUTraceState {
72 size_t current_index = 0;
73 size_t pending_buffers = 0;
74 vk::UniqueQueryPool query_pool;
77 mutable Mutex trace_state_mutex_;
81 std::vector<size_t>
IPLR_GUARDED_BY(trace_state_mutex_) states_to_reset_ = {};
84 float timestamp_period_ = 1;
93 bool in_frame_ =
false;
97 std::thread::id raster_thread_id_;
98 bool enabled_ =
false;