Struct wgpu_profiler::Scope
source · pub struct Scope<'a, Recorder: ProfilerCommandRecorder> {
pub profiler: &'a GpuProfiler,
pub recorder: &'a mut Recorder,
pub scope: Option<GpuProfilerQuery>,
}
Expand description
Scope that takes a (mutable) reference to the encoder/pass.
Calls GpuProfiler::end_query()
on drop.
Fields§
§profiler: &'a GpuProfiler
§recorder: &'a mut Recorder
§scope: Option<GpuProfilerQuery>
Implementations§
source§impl<'a, R: ProfilerCommandRecorder> Scope<'a, R>
impl<'a, R: ProfilerCommandRecorder> Scope<'a, R>
source§impl<'a> Scope<'a, CommandEncoder>
impl<'a> Scope<'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.
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.