pub struct Device(/* private fields */);Implementations§
Source§impl Device
impl Device
Sourcepub fn sys_default() -> Option<R<Device>>
pub fn sys_default() -> Option<R<Device>>
use cidre::mtl;
let device = mtl::Device::sys_default().unwrap();pub fn name_ar(&self) -> Rar<String>
pub fn name(&self) -> R<String>
pub fn registry_id(&self) -> u64
pub fn sample_timestamps(&self, cpu_ts: &mut Timestamp, gpu_ts: &mut Timestamp)
pub fn max_threads_per_threadgroup(&self) -> Size
pub fn has_unified_memory(&self) -> bool
pub fn read_write_texture_support(&self) -> ReadWriteTextureTier
pub fn argument_bufs_support(&self) -> ArgBufsTier
pub fn new_cmd_queue(&self) -> Option<R<CmdQueue>>
pub fn new_cmd_queue_max_cmd_buf_count( &self, max_cmd_buf_count: usize, ) -> Option<R<CmdQueue>>
pub fn new_texture(&self, descriptor: &TextureDesc) -> Option<R<Texture>>
pub fn new_texture_with_surf( &self, descriptor: &TextureDesc, surf: &Surf, plane: usize, ) -> Option<R<Texture>>
pub fn new_default_lib(&self) -> Option<R<Lib>>
pub unsafe fn new_default_lib_with_bundle_err<'ear>( &self, bundle: &Bundle, err: *mut Option<&'ear Error>, ) -> Option<R<Lib>>
pub fn new_default_lib_with_bundle<'ear>( &self, bundle: &Bundle, ) -> Result<'ear, R<Lib>>
pub unsafe fn new_lib_with_src_err<'ear>( &self, src: &String, opts: Option<&CompileOpts>, err: *mut Option<&'ear Error>, ) -> Option<R<Lib>>
pub fn new_lib_with_src_blocking<'ear>( &self, src: &String, opts: Option<&CompileOpts>, ) -> Result<'ear, R<Lib>>
pub async fn new_lib_with_src_opts( &self, src: &String, opts: Option<&CompileOpts>, ) -> Result<R<Lib>, R<Error>>
pub fn new_lib_with_src_ch( &self, src: &String, ops: Option<&CompileOpts>, ch: &mut ResultCh<Lib>, )
pub unsafe fn new_lib_with_stitched_desc_err<'ear>( &self, desc: FnStitchedLibDesc, error: *mut Option<&'ear Error>, ) -> Option<R<Lib>>
pub fn new_lib_with_stitched_desc_blocking<'ear>( &self, desc: FnStitchedLibDesc, ) -> Result<'ear, R<Lib>>
pub fn new_lib_with_stitched_desc_ch( &self, desc: FnStitchedLibDesc, ch: &mut ResultCh<Lib>, )
pub async fn new_lib_with_stitched_desc( &self, desc: FnStitchedLibDesc, ) -> Result<R<Lib>, R<Error>>
pub unsafe fn new_compute_ps_with_fn_err<'ear>( &self, function: &Fn, err: *mut Option<&'ear Error>, ) -> Option<R<ComputePipelineState>>
pub unsafe fn new_render_ps_err<'ear>( &self, desc: &RenderPipelineDesc, err: *mut Option<&'ear Error>, ) -> Option<R<RenderPipelineState>>
pub fn new_render_ps<'ear>( &self, desc: &RenderPipelineDesc, ) -> Result<'ear, R<RenderPipelineState>>
pub fn new_compute_ps_with_fn<'ear>( &self, function: &Fn, ) -> Result<'ear, R<ComputePipelineState>>
pub unsafe fn new_compute_ps_err<'ear, 'rar>( &self, desc: &ComputePipelineDesc, opts: PipelineOpt, reflection: *mut Option<&'rar ComputePipelineReflection>, err: *mut Option<&'ear Error>, ) -> Option<R<ComputePipelineState>>
pub fn new_compute_ps<'ear>( &self, desc: &ComputePipelineDesc, opts: PipelineOpt, ) -> Result<'ear, R<ComputePipelineState>>
pub unsafe fn new_tile_render_ps_err<'ear, 'rar>( &self, desc: &TileRenderPipelineDesc, opts: PipelineOpt, reflection: *mut Option<&'rar RenderPipelineReflection>, err: *mut Option<&'ear Error>, ) -> Option<R<RenderPipelineState>>
pub fn new_tile_render_ps<'ear>( &self, desc: &TileRenderPipelineDesc, opts: PipelineOpt, ) -> Result<'ear, R<RenderPipelineState>>
pub fn new_buf(&self, len: usize, options: ResOpts) -> Option<R<Buf>>
pub fn new_buf_of<T: Sized>(&self, len: usize, opts: ResOpts) -> Option<R<Buf>>
pub fn new_buf_with_bytes( &self, bytes: *const u8, len: usize, opts: ResOpts, ) -> Option<R<Buf>>
pub fn new_buf_with_slice<T: Sized>( &self, slice: &[T], opts: ResOpts, ) -> Option<R<Buf>>
pub fn new_buf_from_vec<T: Sized>( &self, vec: Vec<T>, opts: ResOpts, ) -> Option<R<Buf>>
pub fn new_depth_stencil_state( &self, descr: &DepthStencilDesc, ) -> Option<R<DepthStencilState>>
pub fn new_fence(&self) -> Option<R<Fence>>
Sourcepub fn new_indirect_cmd_buf(
&self,
desc: &IndirectCmdBufDesc,
max_command_count: usize,
options: ResOpts,
) -> Option<R<IndirectCmdBuf>>
pub fn new_indirect_cmd_buf( &self, desc: &IndirectCmdBufDesc, max_command_count: usize, options: ResOpts, ) -> Option<R<IndirectCmdBuf>>
Creates a new indirect command buffer with the given descriptor and count.
Sourcepub fn sel_new_indirect_cmd_buf() -> &'static Sel
pub fn sel_new_indirect_cmd_buf() -> &'static Sel
@selector(newIndirectCommandBufferWithDescriptor:maxCommandCount:options:) but dynamic
use this function to check if object responds to selector
Sourcepub fn new_event(&self) -> Option<R<Event>>
pub fn new_event(&self) -> Option<R<Event>>
New single-device non-shareable Metal event object.
New shareable multi-device event.
pub fn max_buf_len(&self) -> usize
Sourcepub fn heap_texture_size_and_align(&self, descriptor: &TextureDesc) -> SizeAlign
pub fn heap_texture_size_and_align(&self, descriptor: &TextureDesc) -> SizeAlign
Returns the size and alignment, in bytes, of a texture if you create it from a heap.
Sourcepub fn heap_buf_size_and_align(&self, len: usize, opts: ResOpts) -> SizeAlign
pub fn heap_buf_size_and_align(&self, len: usize, opts: ResOpts) -> SizeAlign
Returns the size and alignment, in bytes, of a buffer if you create it from a heap.
pub fn new_heap_desc(&self, descriptor: &HeapDesc) -> Option<R<Heap>>
Sourcepub fn max_threadgroup_memory_len(&self) -> usize
pub fn max_threadgroup_memory_len(&self) -> usize
The maximum threadgroup memory available to a compute kernel, in bytes.
Sourcepub fn max_argument_buf_sampler_count(&self) -> usize
pub fn max_argument_buf_sampler_count(&self) -> usize
The maximum number of unique argument buffer samplers per app.
This limit is only applicable to samplers that have their supportArgumentBuffers
property set to true. A mtl::SamplerState object is considered unique if the
configuration of its originating mtl::SamplerDescriptor properties is unique.
For example, two samplers with equal min_filter values but different mag_filter values
are considered unique.
Sourcepub fn supports_raytracing(&self) -> bool
pub fn supports_raytracing(&self) -> bool
Query device support for using ray tracing from compute pipelines.
Sourcepub fn supports_fn_pointers(&self) -> bool
pub fn supports_fn_pointers(&self) -> bool
Query device support for using function pointers from compute pipelines.
Sourcepub fn sel_supports_fn_pointers() -> &'static Sel
pub fn sel_supports_fn_pointers() -> &'static Sel
@selector(supportsFunctionPointers) but dynamic
use this function to check if object responds to selector
Sourcepub fn supports_fn_pointers_from_render(&self) -> bool
pub fn supports_fn_pointers_from_render(&self) -> bool
Query device support for using function pointers from render pipeline stages.
Sourcepub fn supports_raytracing_from_render(&self) -> bool
pub fn supports_raytracing_from_render(&self) -> bool
Query device support for using ray tracing from render pipeline stages.
Sourcepub fn supports_primitive_motion_blur(&self) -> bool
pub fn supports_primitive_motion_blur(&self) -> bool
Query device support for using ray tracing primitive motion blur.
Sourcepub fn sel_supports_primitive_motion_blur() -> &'static Sel
pub fn sel_supports_primitive_motion_blur() -> &'static Sel
@selector(supportsPrimitiveMotionBlur) but dynamic
use this function to check if object responds to selector
pub fn max_concurrent_compilation_task_count(&self) -> usize
Sourcepub fn sel_max_concurrent_compilation_task_count() -> &'static Sel
pub fn sel_max_concurrent_compilation_task_count() -> &'static Sel
@selector(maximumConcurrentCompilationTaskCount) but dynamic
use this function to check if object responds to selector
pub fn supports_family(&self, val: GpuFamily) -> bool
Sourcepub fn sel_supports_family() -> &'static Sel
pub fn sel_supports_family() -> &'static Sel
@selector(supportsFamily:) but dynamic
use this function to check if object responds to selector
Sourcepub unsafe fn min_linear_texture_alignment_for_pixel_format_throws(
&self,
format: PixelFormat,
) -> usize
pub unsafe fn min_linear_texture_alignment_for_pixel_format_throws( &self, format: PixelFormat, ) -> usize
Returns the minimum alignment required for offset and rowBytes when creating a linear texture. An error is thrown for queries with invalid pixel formats (depth, stencil, or compressed formats).
pub fn min_linear_texture_alignment_for_pixel_format<'ear>( &self, format: PixelFormat, ) -> ExResult<'ear, usize>
pub fn min_texture_buffer_alignment_for_pixel_format( &self, format: PixelFormat, ) -> usize
pub unsafe fn new_residency_set_err<'ear>( &self, desc: &ResidencySetDesc, err: *mut Option<&'ear Error>, ) -> Option<R<ResidencySet>>
Sourcepub fn sel_new_residency_set_err() -> &'static Sel
pub fn sel_new_residency_set_err() -> &'static Sel
@selector(newResidencySetWithDescriptor:error:) but dynamic
use this function to check if object responds to selector
Sourcepub fn new_residency_set<'ear>(
&self,
desc: &ResidencySetDesc,
) -> Result<'ear, R<ResidencySet>>
pub fn new_residency_set<'ear>( &self, desc: &ResidencySetDesc, ) -> Result<'ear, R<ResidencySet>>
Creates a new residency set with a descriptor.
§Availability
macos_15_0, ios_18_0, tvos_18_0, visionos_2_0, maccatalyst_18_0
Sourcepub fn tensor_size_align_with_desc(&self, desc: &TensorDesc) -> SizeAlign
pub fn tensor_size_align_with_desc(&self, desc: &TensorDesc) -> SizeAlign
Determines the size and alignment required to hold the data of a tensor you create with a descriptor in a buffer.
Sourcepub fn sel_new_tensor_err() -> &'static Sel
pub fn sel_new_tensor_err() -> &'static Sel
@selector(newTensorWithDescriptor:error:) but dynamic
use this function to check if object responds to selector
pub unsafe fn new_tensor_err<'ear>( &self, desc: &TensorDesc, err: *mut Option<&'ear Error>, ) -> Option<R<Tensor>>
Sourcepub unsafe fn new_tensor<'ear>(
&self,
desc: &TensorDesc,
) -> Result<'ear, R<Tensor>>
pub unsafe fn new_tensor<'ear>( &self, desc: &TensorDesc, ) -> Result<'ear, R<Tensor>>
§Availability
Not macos_26_0, ios_26_0, tvos_26_0, visionos_26_0, maccatalyst_26_0
Sourcepub fn sel_fn_handle() -> &'static Sel
pub fn sel_fn_handle() -> &'static Sel
@selector(functionHandleWithFunction:) but dynamic
use this function to check if object responds to selector
pub unsafe fn fn_handle_ar(&self, f: &Fn) -> Option<Rar<AnyFnHandle>>
Sourcepub unsafe fn fn_handle(&self, f: &Fn) -> Option<R<AnyFnHandle>>
pub unsafe fn fn_handle(&self, f: &Fn) -> Option<R<AnyFnHandle>>
Check availability with selector1 Self::sel_fn_handle()
Sourcepub fn sel_new_cmd_allocator() -> &'static Sel
pub fn sel_new_cmd_allocator() -> &'static Sel
@selector(newCommandAllocator) but dynamic
use this function to check if object responds to selector
pub unsafe fn new_cmd_allocator(&self) -> Option<R<CmdAllocator>>
Sourcepub fn sel_new_cmd_allocator_desc_err() -> &'static Sel
pub fn sel_new_cmd_allocator_desc_err() -> &'static Sel
@selector(newCommandAllocatorWithDescriptor:error:) but dynamic
use this function to check if object responds to selector
pub unsafe fn new_cmd_allocator_desc_err<'ear>( &self, desc: &CmdAllocator, err: *mut Option<&'ear Error>, ) -> Option<R<CmdAllocator>>
Sourcepub unsafe fn new_cmd_allocator_desc<'ear>(
&self,
desc: &CmdAllocator,
) -> Result<'ear, R<CmdAllocator>>
pub unsafe fn new_cmd_allocator_desc<'ear>( &self, desc: &CmdAllocator, ) -> Result<'ear, R<CmdAllocator>>
§Availability
Not macos_26_0, ios_26_0, tvos_26_0, visionos_26_0, maccatalyst_26_0
Sourcepub fn sel_new_mtl4_cmd_queue() -> &'static Sel
pub fn sel_new_mtl4_cmd_queue() -> &'static Sel
@selector(newMTL4CommandQueue) but dynamic
use this function to check if object responds to selector
pub unsafe fn new_mtl4_cmd_queue(&self) -> Option<R<CmdQueue>>
Sourcepub fn sel_new_mtl4_cmd_queue_desc_err() -> &'static Sel
pub fn sel_new_mtl4_cmd_queue_desc_err() -> &'static Sel
@selector(newMTL4CommandQueueWithDescriptor:error:) but dynamic
use this function to check if object responds to selector
pub unsafe fn new_mtl4_cmd_queue_desc_err<'ear>( &self, desc: &CmdQueueDesc, err: *mut Option<&'ear Error>, ) -> Option<R<CmdQueue>>
Sourcepub unsafe fn new_mtl4_cmd_queue_desc<'ear>(
&self,
desc: &CmdQueueDesc,
) -> Result<'ear, R<CmdQueue>>
pub unsafe fn new_mtl4_cmd_queue_desc<'ear>( &self, desc: &CmdQueueDesc, ) -> Result<'ear, R<CmdQueue>>
§Availability
Not macos_26_0, ios_26_0, tvos_26_0, visionos_26_0, maccatalyst_26_0
Sourcepub fn sel_new_cmd_buf() -> &'static Sel
pub fn sel_new_cmd_buf() -> &'static Sel
@selector(newCommandBuffer) but dynamic
use this function to check if object responds to selector
pub unsafe fn new_cmd_buf(&self) -> Option<R<CmdBuf>>
Sourcepub fn sel_new_arg_table_err() -> &'static Sel
pub fn sel_new_arg_table_err() -> &'static Sel
@selector(newArgumentTableWithDescriptor:error:) but dynamic
use this function to check if object responds to selector
pub unsafe fn new_arg_table_err<'ear>( &self, desc: &ArgTableDesc, err: *mut Option<&'ear Error>, ) -> Option<R<ArgTable>>
Sourcepub unsafe fn new_arg_table<'ear>(
&self,
desc: &ArgTableDesc,
) -> Result<'ear, R<ArgTable>>
pub unsafe fn new_arg_table<'ear>( &self, desc: &ArgTableDesc, ) -> Result<'ear, R<ArgTable>>
§Availability
Not macos_26_0, ios_26_0, tvos_26_0, visionos_26_0, maccatalyst_26_0
Sourcepub fn sel_new_compiler_err() -> &'static Sel
pub fn sel_new_compiler_err() -> &'static Sel
@selector(newCompilerWithDescriptor:error:) but dynamic
use this function to check if object responds to selector
pub unsafe fn new_compiler_err<'ear>( &self, desc: &CompilerDesc, err: *mut Option<&'ear Error>, ) -> Option<R<Compiler>>
Sourcepub unsafe fn new_compiler<'ear>(
&self,
desc: &CompilerDesc,
) -> Result<'ear, R<Compiler>>
pub unsafe fn new_compiler<'ear>( &self, desc: &CompilerDesc, ) -> Result<'ear, R<Compiler>>
§Availability
Not macos_26_0, ios_26_0, tvos_26_0, visionos_26_0, maccatalyst_26_0