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>

source

pub fn scope( &mut self, label: impl Into<String>, device: &Device ) -> Scope<'_, R>

Starts a new profiler scope nested within this one.

source§

impl<'a> OwningScope<'a, CommandEncoder>

source

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.

source

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>

§

type Target = R

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a, R: ProfilerCommandRecorder> DerefMut for OwningScope<'a, R>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'a, R: ProfilerCommandRecorder> Drop for OwningScope<'a, R>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<T> WasmNotSend for T
where T: Send,

source§

impl<T> WasmNotSendSync for T

source§

impl<T> WasmNotSync for T
where T: Sync,