Skip to main content

mtl_gpu/enums/
counter.rs

1//! Counter enumerations.
2//!
3//! Corresponds to `Metal/MTLCounters.hpp`.
4
5use mtl_foundation::Integer;
6
7/// Counter sample buffer error codes.
8///
9/// C++ equivalent: `MTL::CounterSampleBufferError`
10#[repr(transparent)]
11#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash)]
12pub struct CounterSampleBufferError(pub Integer);
13
14impl CounterSampleBufferError {
15    pub const OUT_OF_MEMORY: Self = Self(0);
16    pub const INVALID: Self = Self(1);
17    pub const INTERNAL: Self = Self(2);
18}
19
20#[cfg(test)]
21mod tests {
22    use super::*;
23
24    #[test]
25    fn test_counter_sample_buffer_error_values() {
26        assert_eq!(CounterSampleBufferError::OUT_OF_MEMORY.0, 0);
27        assert_eq!(CounterSampleBufferError::INVALID.0, 1);
28        assert_eq!(CounterSampleBufferError::INTERNAL.0, 2);
29    }
30}