pub struct MetalMemoryBackend { /* private fields */ }Expand description
Metal memory backend implementation
Implementations§
Source§impl MetalMemoryBackend
impl MetalMemoryBackend
Sourcepub fn new(config: MetalConfig) -> Result<Self, MetalError>
pub fn new(config: MetalConfig) -> Result<Self, MetalError>
Create new Metal backend
Sourcepub fn allocate(
&mut self,
size: usize,
memory_type: MetalMemoryType,
) -> Result<*mut c_void, MetalError>
pub fn allocate( &mut self, size: usize, memory_type: MetalMemoryType, ) -> Result<*mut c_void, MetalError>
Allocate memory
Sourcepub fn free(
&mut self,
ptr: *mut c_void,
memory_type: MetalMemoryType,
) -> Result<(), MetalError>
pub fn free( &mut self, ptr: *mut c_void, memory_type: MetalMemoryType, ) -> Result<(), MetalError>
Free memory
Sourcepub fn blit_copy(
&mut self,
src: *const c_void,
dst: *mut c_void,
size: usize,
queue_id: u32,
) -> Result<(), MetalError>
pub fn blit_copy( &mut self, src: *const c_void, dst: *mut c_void, size: usize, queue_id: u32, ) -> Result<(), MetalError>
Copy memory using Metal blit encoder
Sourcepub fn create_command_queue(
&mut self,
label: Option<String>,
priority: MetalQueuePriority,
) -> Result<u32, MetalError>
pub fn create_command_queue( &mut self, label: Option<String>, priority: MetalQueuePriority, ) -> Result<u32, MetalError>
Create command queue
Sourcepub fn get_device_properties(&self) -> &MetalDeviceProperties
pub fn get_device_properties(&self) -> &MetalDeviceProperties
Get device properties
Sourcepub fn get_stats(&self) -> &MetalStats
pub fn get_stats(&self) -> &MetalStats
Get statistics
Sourcepub fn wait_until_idle(&mut self) -> Result<(), MetalError>
pub fn wait_until_idle(&mut self) -> Result<(), MetalError>
Wait for all operations to complete
Trait Implementations§
impl Send for MetalMemoryBackend
impl Sync for MetalMemoryBackend
Auto Trait Implementations§
impl Freeze for MetalMemoryBackend
impl RefUnwindSafe for MetalMemoryBackend
impl Unpin for MetalMemoryBackend
impl UnsafeUnpin for MetalMemoryBackend
impl UnwindSafe for MetalMemoryBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more