Skip to main content

RecordDiagnostics

Trait RecordDiagnostics 

Source
pub trait RecordDiagnostics: Send + Sync {
    // Required methods
    fn record_f32<N>(
        &self,
        command_encoder: &mut CommandEncoder,
        buffer: &BufferSlice<'_>,
        name: N,
    )
       where N: Into<Cow<'static, str>>;
    fn record_u32<N>(
        &self,
        command_encoder: &mut CommandEncoder,
        buffer: &BufferSlice<'_>,
        name: N,
    )
       where N: Into<Cow<'static, str>>;

    // Provided methods
    fn time_span<E, N>(
        &self,
        encoder: &mut E,
        name: N,
    ) -> TimeSpanGuard<'_, Self, E>
       where E: WriteTimestamp,
             N: Into<Cow<'static, str>> { ... }
    fn pass_span<P, N>(
        &self,
        pass: &mut P,
        name: N,
    ) -> PassSpanGuard<'_, Self, P>
       where P: Pass,
             N: Into<Cow<'static, str>> { ... }
}
Expand description

Allows recording diagnostic spans.

Required Methods§

Source

fn record_f32<N>( &self, command_encoder: &mut CommandEncoder, buffer: &BufferSlice<'_>, name: N, )
where N: Into<Cow<'static, str>>,

Reads a f32 from the specified buffer and uploads it as a diagnostic.

The provided buffer slice must be 4 bytes long, and the buffer must have wgpu::BufferUsages::COPY_SRC;

Source

fn record_u32<N>( &self, command_encoder: &mut CommandEncoder, buffer: &BufferSlice<'_>, name: N, )
where N: Into<Cow<'static, str>>,

Reads a u32 from the specified buffer and uploads it as a diagnostic.

The provided buffer slice must be 4 bytes long, and the buffer must have wgpu::BufferUsages::COPY_SRC;

Provided Methods§

Source

fn time_span<E, N>( &self, encoder: &mut E, name: N, ) -> TimeSpanGuard<'_, Self, E>
where E: WriteTimestamp, N: Into<Cow<'static, str>>,

Begin a time span, which will record elapsed CPU and GPU time.

Returns a guard, which will panic on drop unless you end the span.

Source

fn pass_span<P, N>(&self, pass: &mut P, name: N) -> PassSpanGuard<'_, Self, P>
where P: Pass, N: Into<Cow<'static, str>>,

Begin a pass span, which will record elapsed CPU and GPU time, as well as pipeline statistics on supported platforms.

Returns a guard, which will panic on drop unless you end the span.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, T: RecordDiagnostics> RecordDiagnostics for Option<&'a T>

Source§

fn record_f32<N>( &self, command_encoder: &mut CommandEncoder, buffer: &BufferSlice<'_>, name: N, )
where N: Into<Cow<'static, str>>,

Source§

fn record_u32<N>( &self, command_encoder: &mut CommandEncoder, buffer: &BufferSlice<'_>, name: N, )
where N: Into<Cow<'static, str>>,

Source§

impl<T: RecordDiagnostics> RecordDiagnostics for Option<Arc<T>>

Source§

fn record_f32<N>( &self, command_encoder: &mut CommandEncoder, buffer: &BufferSlice<'_>, name: N, )
where N: Into<Cow<'static, str>>,

Source§

fn record_u32<N>( &self, command_encoder: &mut CommandEncoder, buffer: &BufferSlice<'_>, name: N, )
where N: Into<Cow<'static, str>>,

Implementors§