Struct wgpu_profiler::OwningScope
source · 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<'b, '_>
) -> OwningScope<'b, RenderPass<'b>>
pub fn scoped_render_pass<'b>( &'b mut self, label: impl Into<String>, device: &Device, pass_descriptor: RenderPassDescriptor<'b, '_> ) -> 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
.
Note that in order to take measurements, this does not require the
wgpu::Features::TIMESTAMP_QUERY_INSIDE_PASSES
feature, only wgpu::Features::TIMESTAMP_QUERY
.
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
.
Note that in order to take measurements, this does not require the
wgpu::Features::TIMESTAMP_QUERY_INSIDE_PASSES
feature, only wgpu::Features::TIMESTAMP_QUERY
.
Trait Implementations§
source§impl<'a, R: ProfilerCommandRecorder> Deref for OwningScope<'a, R>
impl<'a, R: ProfilerCommandRecorder> Deref for OwningScope<'a, R>
source§impl<'a, R: ProfilerCommandRecorder> DerefMut for OwningScope<'a, R>
impl<'a, R: ProfilerCommandRecorder> DerefMut for OwningScope<'a, R>
source§impl<'a, R: ProfilerCommandRecorder> Drop for OwningScope<'a, R>
impl<'a, R: ProfilerCommandRecorder> Drop for OwningScope<'a, R>
Auto Trait Implementations§
impl<'a, Recorder> Freeze for OwningScope<'a, Recorder>where
Recorder: Freeze,
impl<'a, Recorder> !RefUnwindSafe for OwningScope<'a, Recorder>
impl<'a, Recorder> Send for OwningScope<'a, Recorder>where
Recorder: Send,
impl<'a, Recorder> Sync for OwningScope<'a, Recorder>where
Recorder: Sync,
impl<'a, Recorder> Unpin for OwningScope<'a, Recorder>where
Recorder: Unpin,
impl<'a, Recorder> !UnwindSafe for OwningScope<'a, Recorder>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more