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§
Sourcefn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>
Available on crate feature MTLDevice only.
fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>
MTLDevice only.to use the sample buffer with this device.
Sourcefn label(&self) -> Retained<NSString>
fn label(&self) -> Retained<NSString>
property of the descriptor that is used to create the sample buffer.
fn sampleCount(&self) -> NSUInteger
Sourceunsafe fn resolveCounterRange(&self, range: NSRange) -> Option<Retained<NSData>>
unsafe fn resolveCounterRange(&self, range: NSRange) -> Option<Retained<NSData>>
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.