pub struct GpuProfilerSettings {
    pub enable_timer_queries: bool,
    pub enable_debug_groups: bool,
    pub max_num_pending_frames: usize,
}
Expand description

Settings passed on initialization of [GpuProfiler].

Fields§

§enable_timer_queries: bool

Enables/disables gpu timer queries.

If false, the profiler will not emit any timer queries, making most operations on [GpuProfiler] no-ops.

Since all resource creation is done lazily, this provides an effective way of disabling the profiler at runtime without the need of special build configurations or code to handle enabled/disabled profiling.

§enable_debug_groups: bool

Enables/disables debug markers for all scopes on the respective encoder or pass.

This is useful for debugging with tools like RenderDoc. Debug markers will be emitted even if the device does not support timer queries or disables them via GpuProfilerSettings::enable_timer_queries.

§max_num_pending_frames: usize

The profiler queues up to max_num_pending_frames “profiler-frames” at a time.

A profiler-frame is regarded as in-flight until its queries have been successfully resolved using [GpuProfiler::process_finished_frame]. How long this takes to happen, depends on how fast buffer mappings return successfully which in turn primarily depends on how fast the device is able to finish work queued to the wgpu::Queue.

If this threshold is exceeded, [GpuProfiler::end_frame] will silently drop frames. Newer frames will be dropped first in order to get results back eventually. (If the profiler were to drop the oldest frame, one may end up in a situation where there is never frame that is fully processed and thus never any results to be retrieved).

Good values for max_num_pending_frames are 2-4 but may depend on your application workload and GPU-CPU syncing strategy. Must be greater than 0.

Implementations§

Trait Implementations§

source§

impl Clone for GpuProfilerSettings

source§

fn clone(&self) -> GpuProfilerSettings

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GpuProfilerSettings

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for GpuProfilerSettings

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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,