GpuProfiler

Trait GpuProfiler 

Source
pub trait GpuProfiler: Send + Sync {
    // Required method
    fn backend(&self) -> GpuProfilerBackend;

    // Provided methods
    fn is_available(&self) -> bool { ... }
    fn start_capture(&self) -> Result<(), ProfilerError> { ... }
    fn end_capture(&self) -> Result<(), ProfilerError> { ... }
    fn trigger_capture(&self) -> Result<(), ProfilerError> { ... }
    fn push_range(&self, name: &str, _color: ProfilerColor) -> ProfilerRange { ... }
    fn pop_range(&self) { ... }
    fn mark(&self, _name: &str, _color: ProfilerColor) { ... }
    fn set_thread_name(&self, _name: &str) { ... }
    fn message(&self, _text: &str) { ... }
    fn register_allocation(&self, _ptr: u64, _size: usize, _name: &str) { ... }
    fn unregister_allocation(&self, _ptr: u64) { ... }
}
Expand description

Trait for GPU profiler integration.

Implement this trait to integrate with specific GPU profiling tools. The default implementation is a no-op for when no profiler is attached.

Required Methods§

Source

fn backend(&self) -> GpuProfilerBackend

Get the profiler backend type.

Provided Methods§

Source

fn is_available(&self) -> bool

Check if the profiler is available and attached.

Source

fn start_capture(&self) -> Result<(), ProfilerError>

Start a profiler capture session.

Source

fn end_capture(&self) -> Result<(), ProfilerError>

End a profiler capture session.

Source

fn trigger_capture(&self) -> Result<(), ProfilerError>

Trigger a frame/dispatch capture.

Source

fn push_range(&self, name: &str, _color: ProfilerColor) -> ProfilerRange

Push a named range onto the profiler stack.

Source

fn pop_range(&self)

Pop the current range from the profiler stack.

Source

fn mark(&self, _name: &str, _color: ProfilerColor)

Insert an instantaneous marker.

Source

fn set_thread_name(&self, _name: &str)

Set a per-thread name for the profiler.

Source

fn message(&self, _text: &str)

Add a message to the profiler output.

Source

fn register_allocation(&self, _ptr: u64, _size: usize, _name: &str)

Register a GPU memory allocation.

Source

fn unregister_allocation(&self, _ptr: u64)

Unregister a GPU memory allocation.

Implementors§