Struct wgpu_profiler::scope::ManualOwningScope
source · [−]pub struct ManualOwningScope<'a, W: ProfilerCommandRecorder> { /* private fields */ }Expand description
Scope that takes ownership of the encoder/pass.
Does NOT call end_scope on drop.
This construct is just for completeness in cases where working with scopes is preferred but one can’t rely on the Drop call in the right place.
This is useful when the owned value needs to be recovered after the end of the scope.
In particular, to submit a CommandEncoder to a queue ownership of the encoder is necessary.
Implementations
sourceimpl<'a, W: ProfilerCommandRecorder> ManualOwningScope<'a, W>
impl<'a, W: ProfilerCommandRecorder> ManualOwningScope<'a, W>
sourcepub fn start(
label: &str,
profiler: &'a mut GpuProfiler,
recorder: W,
device: &Device
) -> Self
pub fn start(
label: &str,
profiler: &'a mut GpuProfiler,
recorder: W,
device: &Device
) -> Self
Starts a new profiler scope. Scope is NOT closed on drop and needs to be closed manually with ManualOwningScope::end_scope
sourcepub fn scope(&mut self, label: &str, device: &Device) -> Scope<'_, W>
pub fn scope(&mut self, label: &str, device: &Device) -> Scope<'_, W>
Starts a scope nested within this one
sourcepub fn end_scope(self) -> (W, &'a mut GpuProfiler)
pub fn end_scope(self) -> (W, &'a mut GpuProfiler)
Ends the scope allowing the extraction of owned the ProfilerCommandRecorder and the mutable reference to the GpuProfiler.
sourceimpl<'a> ManualOwningScope<'a, CommandEncoder>
impl<'a> ManualOwningScope<'a, CommandEncoder>
sourcepub fn scoped_render_pass<'b>(
&'b mut self,
label: &str,
device: &Device,
pass_descriptor: &RenderPassDescriptor<'b, '_>
) -> OwningScope<'b, RenderPass<'b>>
pub fn scoped_render_pass<'b>(
&'b mut self,
label: &str,
device: &Device,
pass_descriptor: &RenderPassDescriptor<'b, '_>
) -> OwningScope<'b, RenderPass<'b>>
Start a render pass wrapped in an OwningScope.
sourcepub fn scoped_compute_pass(
&mut self,
label: &str,
device: &Device,
pass_descriptor: &ComputePassDescriptor<'_>
) -> OwningScope<'_, ComputePass<'_>>
pub fn scoped_compute_pass(
&mut self,
label: &str,
device: &Device,
pass_descriptor: &ComputePassDescriptor<'_>
) -> OwningScope<'_, ComputePass<'_>>
Start a compute pass wrapped in an OwningScope.
Trait Implementations
sourceimpl<'a, W: ProfilerCommandRecorder> Deref for ManualOwningScope<'a, W>
impl<'a, W: ProfilerCommandRecorder> Deref for ManualOwningScope<'a, W>
sourceimpl<'a, W: ProfilerCommandRecorder> DerefMut for ManualOwningScope<'a, W>
impl<'a, W: ProfilerCommandRecorder> DerefMut for ManualOwningScope<'a, W>
Auto Trait Implementations
impl<'a, W> !RefUnwindSafe for ManualOwningScope<'a, W>
impl<'a, W> Send for ManualOwningScope<'a, W> where
W: Send,
impl<'a, W> Sync for ManualOwningScope<'a, W> where
W: Sync,
impl<'a, W> Unpin for ManualOwningScope<'a, W> where
W: Unpin,
impl<'a, W> !UnwindSafe for ManualOwningScope<'a, W>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more