Struct wgpu_profiler::scope::ManualOwningScope[][src]

pub struct ManualOwningScope<'a, W: ProfilerCommandRecorder> { /* fields omitted */ }

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

impl<'a, W: ProfilerCommandRecorder> ManualOwningScope<'a, W>[src]

#[must_use]
pub fn start(
    label: &str,
    profiler: &'a mut GpuProfiler,
    recorder: W,
    device: &Device
) -> Self
[src]

Starts a new profiler scope. Scope is NOT closed on drop and needs to be closed manually with ManualOwningScope::end_scope

#[must_use]
pub fn scope(&mut self, label: &str, device: &Device) -> Scope<'_, W>
[src]

Starts a scope nested within this one

#[must_use]
pub fn end_scope(self) -> (W, &'a mut GpuProfiler)
[src]

Ends the scope allowing the extraction of owned the ProfilerCommandRecorder and the mutable reference to the GpuProfiler.

impl<'a> ManualOwningScope<'a, CommandEncoder>[src]

pub fn scoped_render_pass<'b>(
    &'b mut self,
    label: &str,
    device: &Device,
    pass_descriptor: &RenderPassDescriptor<'b, '_>
) -> OwningScope<'b, RenderPass<'b>>
[src]

Start a render pass wrapped in an OwningScope.

pub fn scoped_compute_pass(
    &mut self,
    label: &str,
    device: &Device,
    pass_descriptor: &ComputePassDescriptor<'_>
) -> OwningScope<'_, ComputePass<'_>>
[src]

Start a compute pass wrapped in an OwningScope.

Trait Implementations

impl<'a, W: ProfilerCommandRecorder> Deref for ManualOwningScope<'a, W>[src]

type Target = W

The resulting type after dereferencing.

impl<'a, W: ProfilerCommandRecorder> DerefMut for ManualOwningScope<'a, W>[src]

Auto Trait Implementations

impl<'a, W> !RefUnwindSafe for ManualOwningScope<'a, W>

impl<'a, W> !Send for ManualOwningScope<'a, W>

impl<'a, W> !Sync for ManualOwningScope<'a, W>

impl<'a, W> Unpin for ManualOwningScope<'a, W> where
    W: Unpin

impl<'a, W> !UnwindSafe for ManualOwningScope<'a, W>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast<T> for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Upcast<T> for T