MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / reserve_gpu_pair

Method reserve_gpu_pair

native/shared/src/profiler.rs:175–184  ·  view source on GitHub ↗

Reserve a pair of GPU timestamp slot indices for the given label. Callers combine the returned indices with `query_set()` to build a `RenderPassTimestampWrites` for the pass descriptor. Returns None when profiling or GPU queries are disabled, or when no slots remain.

(&mut self, label: &'static str)

Source from the content-addressed store, hash-verified

173 /// `RenderPassTimestampWrites` for the pass descriptor. Returns None
174 /// when profiling or GPU queries are disabled, or when no slots remain.
175 pub fn reserve_gpu_pair(&mut self, label: &'static str) -> Option<(u32, u32)> {
176 if !self.enabled || !self.gpu_enabled { return None; }
177 self.query_set.as_ref()?;
178 if self.next_query + 2 > MAX_GPU_PAIRS * 2 { return None; }
179 let begin = self.next_query;
180 let end = self.next_query + 1;
181 self.next_query += 2;
182 self.pending_gpu.push((label, begin, end));
183 Some((begin, end))
184 }
185
186 pub fn query_set(&self) -> Option<&wgpu::QuerySet> {
187 self.query_set.as_ref()

Callers 2

pass_timestamp_writesMethod · 0.80

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected