Struct Device

Source
pub struct Device(/* private fields */);

Implementations§

Methods from Deref<Target = DeviceRef>§

Source

pub fn name(&self) -> &str

Source

pub fn registry_id(&self) -> u64

Source

pub fn location(&self) -> MTLDeviceLocation

Source

pub fn location_number(&self) -> u64

Source

pub fn max_threadgroup_memory_length(&self) -> u64

Source

pub fn max_threads_per_threadgroup(&self) -> MTLSize

Source

pub fn is_low_power(&self) -> bool

Source

pub fn is_headless(&self) -> bool

Source

pub fn is_removable(&self) -> bool

Source

pub fn supports_raytracing(&self) -> bool

Only available on (macos(11.0), ios(14.0))

Source

pub fn has_unified_memory(&self) -> bool

Source

pub fn recommended_max_working_set_size(&self) -> u64

Source

pub fn max_transfer_rate(&self) -> u64

Source

pub fn supports_feature_set(&self, feature: MTLFeatureSet) -> bool

Source

pub fn supports_family(&self, family: MTLGPUFamily) -> bool

Source

pub fn supports_vertex_amplification_count(&self, count: u64) -> bool

Source

pub fn supports_texture_sample_count(&self, count: u64) -> bool

Source

pub fn supports_shader_barycentric_coordinates(&self) -> bool

Source

pub fn supports_function_pointers(&self) -> bool

Source

pub fn supports_dynamic_libraries(&self) -> bool

Only available on (macos(11.0), ios(14.0))

Source

pub fn supports_counter_sampling( &self, sampling_point: MTLCounterSamplingPoint, ) -> bool

Only available on (macos(11.0), ios(14.0))

Source

pub fn d24_s8_supported(&self) -> bool

Source

pub fn new_fence(&self) -> Fence

Source

pub fn new_command_queue(&self) -> CommandQueue

Source

pub fn new_command_queue_with_max_command_buffer_count( &self, count: u64, ) -> CommandQueue

Source

pub fn new_default_library(&self) -> Library

Source

pub fn new_library_with_source( &self, src: &str, options: &CompileOptionsRef, ) -> Result<Library, String>

Source

pub fn new_library_with_file<P>(&self, file: P) -> Result<Library, String>
where P: AsRef<Path>,

Source

pub fn new_library_with_data( &self, library_data: &[u8], ) -> Result<Library, String>

Source

pub fn new_dynamic_library( &self, library: &LibraryRef, ) -> Result<DynamicLibrary, String>

Only available on (macos(11.0), ios(14.0))

Source

pub fn new_dynamic_library_with_url( &self, url: &URLRef, ) -> Result<DynamicLibrary, String>

Only available on (macos(11.0), ios(14.0))

Source

pub fn new_binary_archive_with_descriptor( &self, descriptor: &BinaryArchiveDescriptorRef, ) -> Result<BinaryArchive, String>

Only available on (macos(11.0), ios(14.0))

Source

pub fn new_render_pipeline_state_with_reflection( &self, descriptor: &RenderPipelineDescriptorRef, reflection_options: MTLPipelineOption, ) -> Result<(RenderPipelineState, RenderPipelineReflection), String>

Synchronously creates a render pipeline state object and associated reflection information.

Source

pub fn new_render_pipeline_state( &self, descriptor: &RenderPipelineDescriptorRef, ) -> Result<RenderPipelineState, String>

Source

pub fn new_mesh_render_pipeline_state_with_reflection( &self, descriptor: &MeshRenderPipelineDescriptorRef, reflection_options: MTLPipelineOption, ) -> Result<(RenderPipelineState, RenderPipelineReflection), String>

Only available on (macos(13.0), ios(16.0))

Source

pub fn new_mesh_render_pipeline_state( &self, descriptor: &MeshRenderPipelineDescriptorRef, ) -> Result<RenderPipelineState, String>

Only available on (macos(13.0), ios(16.0))

Source

pub fn new_compute_pipeline_state_with_function( &self, function: &FunctionRef, ) -> Result<ComputePipelineState, String>

Source

pub fn new_compute_pipeline_state( &self, descriptor: &ComputePipelineDescriptorRef, ) -> Result<ComputePipelineState, String>

Source

pub fn new_compute_pipeline_state_with_reflection( &self, descriptor: &ComputePipelineDescriptorRef, reflection_options: MTLPipelineOption, ) -> Result<(ComputePipelineState, ComputePipelineReflection), String>

Synchronously creates a compute pipeline state object and associated reflection information, using a compute pipeline descriptor.

Source

pub fn new_buffer(&self, length: u64, options: MTLResourceOptions) -> Buffer

Source

pub fn new_buffer_with_bytes_no_copy( &self, bytes: *const c_void, length: u64, options: MTLResourceOptions, deallocator: Option<&Block<(*const c_void, u64), ()>>, ) -> Buffer

Source

pub fn new_buffer_with_data( &self, bytes: *const c_void, length: u64, options: MTLResourceOptions, ) -> Buffer

Source

pub fn new_counter_sample_buffer_with_descriptor( &self, descriptor: &CounterSampleBufferDescriptorRef, ) -> Result<CounterSampleBuffer, String>

Source

pub fn new_indirect_command_buffer_with_descriptor( &self, descriptor: &IndirectCommandBufferDescriptorRef, max_command_count: u64, options: MTLResourceOptions, ) -> IndirectCommandBuffer

Source

pub fn new_texture(&self, descriptor: &TextureDescriptorRef) -> Texture

Source

pub fn new_sampler(&self, descriptor: &SamplerDescriptorRef) -> SamplerState

Source

pub fn new_depth_stencil_state( &self, descriptor: &DepthStencilDescriptorRef, ) -> DepthStencilState

Source

pub fn argument_buffers_support(&self) -> MTLArgumentBuffersTier

Source

pub fn read_write_texture_support(&self) -> MTLReadWriteTextureTier

Source

pub fn raster_order_groups_supported(&self) -> bool

Source

pub fn supports_32bit_float_filtering(&self) -> bool

Only available on (macos(11.0), ios(14.0))

Source

pub fn supports_32bit_MSAA(&self) -> bool

Only available on (macos(11.0), ios(14.0))

Source

pub fn supports_query_texture_LOD(&self) -> bool

Only available on (macos(11.0), ios(14.0))

Source

pub fn supports_BC_texture_compression(&self) -> bool

Only available on (macos(11.0), ios(14.0))

Source

pub fn supports_pull_model_interpolation(&self) -> bool

Only available on (macos(11.0), ios(14.0))

Source

pub fn new_argument_encoder( &self, arguments: &ArrayRef<ArgumentDescriptor>, ) -> ArgumentEncoder

Source

pub fn new_heap(&self, descriptor: &HeapDescriptorRef) -> Heap

Source

pub fn new_event(&self) -> Event

Source

pub fn new_shared_event(&self) -> SharedEvent

Source

pub fn heap_buffer_size_and_align( &self, length: u64, options: MTLResourceOptions, ) -> MTLSizeAndAlign

Source

pub fn heap_acceleration_structure_size_and_align_with_size( &self, size: u64, ) -> MTLSizeAndAlign

Only available on macos(13.0), ios(16.0)

Source

pub fn heap_texture_size_and_align( &self, descriptor: &TextureDescriptorRef, ) -> MTLSizeAndAlign

Source

pub fn minimum_linear_texture_alignment_for_pixel_format( &self, format: MTLPixelFormat, ) -> u64

Source

pub fn minimum_texture_buffer_alignment_for_pixel_format( &self, format: MTLPixelFormat, ) -> u64

Source

pub fn max_argument_buffer_sampler_count(&self) -> u64

Source

pub fn current_allocated_size(&self) -> u64

Source

pub fn max_buffer_length(&self) -> u64

Only available on (macos(10.14), ios(12.0), tvos(12.0))

Source

pub fn acceleration_structure_sizes_with_descriptor( &self, desc: &AccelerationStructureDescriptorRef, ) -> MTLAccelerationStructureSizes

Source

pub fn new_acceleration_structure_with_size( &self, size: u64, ) -> AccelerationStructure

Source

pub fn sample_timestamps( &self, cpu_timestamp: &mut u64, gpu_timestamp: &mut u64, )

Source

pub fn counter_sets(&self) -> Vec<CounterSet>

Trait Implementations§

Source§

impl AsMut<DeviceRef> for Device

Source§

fn as_mut(&mut self) -> &mut DeviceRef

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<DeviceRef> for Device

Source§

fn as_ref(&self) -> &DeviceRef

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<DeviceRef> for Device

Source§

fn borrow(&self) -> &DeviceRef

Immutably borrows from an owned value. Read more
Source§

impl BorrowMut<DeviceRef> for Device

Source§

fn borrow_mut(&mut self) -> &mut DeviceRef

Mutably borrows from an owned value. Read more
Source§

impl Clone for Device

Source§

fn clone(&self) -> Device

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Device

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Deref for Device

Source§

type Target = DeviceRef

The resulting type after dereferencing.
Source§

fn deref(&self) -> &DeviceRef

Dereferences the value.
Source§

impl DerefMut for Device

Source§

fn deref_mut(&mut self) -> &mut DeviceRef

Mutably dereferences the value.
Source§

impl Drop for Device

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl ForeignType for Device

Source§

type CType = MTLDevice

The raw C type.
Source§

type Ref = DeviceRef

The type representing a reference to this type.
Source§

unsafe fn from_ptr(ptr: *mut MTLDevice) -> Device

Constructs an instance of this type from its raw type. Read more
Source§

fn as_ptr(&self) -> *mut MTLDevice

Returns a raw pointer to the wrapped value.
Source§

fn into_ptr(self) -> *mut Self::CType

Consumes the wrapper and returns the raw pointer.
Source§

impl Send for Device

Source§

impl Sync for Device

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,