pub struct OwningScope<'a, Recorder: ProfilerCommandRecorder> {
pub profiler: &'a GpuProfiler,
pub recorder: Recorder,
pub scope: Option<GpuProfilerQuery>,
}Expand description
Scope that takes ownership of the encoder/pass.
Calls GpuProfiler::end_query() on drop.
Fields§
§profiler: &'a GpuProfiler§recorder: Recorder§scope: Option<GpuProfilerQuery>Implementations§
Source§impl<'a, R: ProfilerCommandRecorder> OwningScope<'a, R>
impl<'a, R: ProfilerCommandRecorder> OwningScope<'a, R>
Source§impl<'a> OwningScope<'a, CommandEncoder>
impl<'a> OwningScope<'a, CommandEncoder>
Sourcepub fn scoped_render_pass<'b>(
&'b mut self,
label: impl Into<String>,
device: &Device,
pass_descriptor: RenderPassDescriptor<'_>,
) -> OwningScope<'b, RenderPass<'b>>
pub fn scoped_render_pass<'b>( &'b mut self, label: impl Into<String>, device: &Device, pass_descriptor: RenderPassDescriptor<'_>, ) -> OwningScope<'b, RenderPass<'b>>
Start a render pass wrapped in a OwningScope.
Ignores passed wgpu::RenderPassDescriptor::timestamp_writes and replaces it with
timestamp_writes managed by GpuProfiler if profiling is enabled.
This also sets the wgpu::RenderPassDescriptor::label if it’s None (default).
Note that in order to take measurements, this requires the wgpu::Features::TIMESTAMP_QUERY feature.
wgpu::Features::TIMESTAMP_QUERY_INSIDE_ENCODERS & wgpu::Features::TIMESTAMP_QUERY_INSIDE_PASSES are not required.
Sourcepub fn scoped_compute_pass<'b>(
&'b mut self,
label: impl Into<String>,
device: &Device,
) -> OwningScope<'b, ComputePass<'b>>
pub fn scoped_compute_pass<'b>( &'b mut self, label: impl Into<String>, device: &Device, ) -> OwningScope<'b, ComputePass<'b>>
Start a compute pass wrapped in a OwningScope.
Uses passed label both for profiler scope and compute pass label.
timestamp_writes managed by GpuProfiler if profiling is enabled.
Note that in order to take measurements, this requires the wgpu::Features::TIMESTAMP_QUERY feature.
wgpu::Features::TIMESTAMP_QUERY_INSIDE_ENCODERS & wgpu::Features::TIMESTAMP_QUERY_INSIDE_PASSES are not required.