MTLCounterSampleBuffer

Trait MTLCounterSampleBuffer 

Source
pub unsafe trait MTLCounterSampleBuffer: NSObjectProtocol {
    // Provided methods
    fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>
       where Self: Sized + Message { ... }
    fn label(&self) -> Retained<NSString>
       where Self: Sized + Message { ... }
    fn sampleCount(&self) -> NSUInteger
       where Self: Sized + Message { ... }
    unsafe fn resolveCounterRange(
        &self,
        range: NSRange,
    ) -> Option<Retained<NSData>>
       where Self: Sized + Message { ... }
}
Available on crate feature MTLCounters only.
Expand description

The Counter Sample Buffer contains opaque counter samples as well as state needed to request a sample from the API.

See also Apple’s documentation

Provided Methods§

Source

fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>
where Self: Sized + Message,

Available on crate feature MTLDevice only.

to use the sample buffer with this device.

Source

fn label(&self) -> Retained<NSString>
where Self: Sized + Message,

property of the descriptor that is used to create the sample buffer.

Source

fn sampleCount(&self) -> NSUInteger
where Self: Sized + Message,

Source

unsafe fn resolveCounterRange(&self, range: NSRange) -> Option<Retained<NSData>>
where Self: Sized + Message,

Resolve the counters from the sample buffer to an NSData containing the counter values. This may only be used with sample buffers that have MTLStorageModeShared.

Parameter range: The range of indices in the sample buffer to resolve.

Returns: The resolved samples.

Samples that encountered an error during resolve will be set to MTLCounterErrorValue.

§Safety

range might not be bounds-checked.

Trait Implementations§

Source§

impl ProtocolType for dyn MTLCounterSampleBuffer

Source§

const NAME: &'static str = "MTLCounterSampleBuffer"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn MTLCounterSampleBuffer

Implementations on Foreign Types§

Source§

impl<T> MTLCounterSampleBuffer for ProtocolObject<T>

Implementors§