Convenience: build a `RenderPassTimestampWrites` for a pass in one call. Returns None when GPU queries are disabled — the caller should plug the returned `Option` straight into `RenderPassDescriptor.timestamp_writes`.
(&mut self, label: &'static str)
| 191 | /// Returns None when GPU queries are disabled — the caller should plug |
| 192 | /// the returned `Option` straight into `RenderPassDescriptor.timestamp_writes`. |
| 193 | pub fn pass_timestamp_writes(&mut self, label: &'static str) -> Option<wgpu::RenderPassTimestampWrites<'_>> { |
| 194 | let (b, e) = self.reserve_gpu_pair(label)?; |
| 195 | let qs = self.query_set.as_ref()?; |
| 196 | Some(wgpu::RenderPassTimestampWrites { |
| 197 | query_set: qs, |
| 198 | beginning_of_pass_write_index: Some(b), |
| 199 | end_of_pass_write_index: Some(e), |
| 200 | }) |
| 201 | } |
| 202 | |
| 203 | /// Same as `pass_timestamp_writes` but for a compute pass descriptor. |
| 204 | pub fn compute_pass_timestamp_writes(&mut self, label: &'static str) -> Option<wgpu::ComputePassTimestampWrites<'_>> { |
no test coverage detected