Skip to main content

RenderCommandEncoder

Struct RenderCommandEncoder 

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

Methods from Deref<Target = RenderCommandEncoderRef>§

Source

pub fn set_render_pipeline_state(&self, pipeline_state: &RenderPipelineStateRef)

Source

pub fn set_viewport(&self, viewport: MTLViewport)

Source

pub fn set_viewports(&self, viewports: &[MTLViewport])

Source

pub fn set_front_facing_winding(&self, winding: MTLWinding)

Source

pub fn set_cull_mode(&self, mode: MTLCullMode)

Source

pub fn set_depth_clip_mode(&self, mode: MTLDepthClipMode)

Source

pub fn set_depth_bias(&self, bias: f32, scale: f32, clamp: f32)

Source

pub fn set_scissor_rect(&self, rect: MTLScissorRect)

Source

pub fn set_scissor_rects(&self, rects: &[MTLScissorRect])

Source

pub fn set_triangle_fill_mode(&self, mode: MTLTriangleFillMode)

Source

pub fn set_blend_color(&self, red: f32, green: f32, blue: f32, alpha: f32)

Source

pub fn set_depth_stencil_state( &self, depth_stencil_state: &DepthStencilStateRef, )

Source

pub fn set_stencil_reference_value(&self, value: u32)

Source

pub fn set_stencil_front_back_reference_value(&self, front: u32, back: u32)

Source

pub fn set_visibility_result_mode( &self, mode: MTLVisibilityResultMode, offset: NSUInteger, )

Source

pub fn set_vertex_amplification_count( &self, count: NSUInteger, view_mappings: Option<&[VertexAmplificationViewMapping]>, )

Source

pub fn set_vertex_bytes( &self, index: NSUInteger, length: NSUInteger, bytes: *const c_void, )

Source

pub fn set_vertex_buffer( &self, index: NSUInteger, buffer: Option<&BufferRef>, offset: NSUInteger, )

Source

pub fn set_vertex_buffer_offset(&self, index: NSUInteger, offset: NSUInteger)

Source

pub fn set_vertex_buffers( &self, start_index: NSUInteger, data: &[Option<&BufferRef>], offsets: &[NSUInteger], )

Source

pub fn set_vertex_texture( &self, index: NSUInteger, texture: Option<&TextureRef>, )

Source

pub fn set_vertex_textures( &self, start_index: NSUInteger, data: &[Option<&TextureRef>], )

Source

pub fn set_vertex_sampler_state( &self, index: NSUInteger, sampler: Option<&SamplerStateRef>, )

Source

pub fn set_vertex_sampler_states( &self, start_index: NSUInteger, data: &[Option<&SamplerStateRef>], )

Source

pub fn set_vertex_sampler_state_with_lod( &self, index: NSUInteger, sampler: Option<&SamplerStateRef>, lod_clamp: Range<f32>, )

Source

pub fn set_vertex_acceleration_structure( &self, index: NSUInteger, accel: Option<&AccelerationStructureRef>, )

Only available in (macos(12.0), ios(15.0))

Source

pub fn set_vertex_intersection_function_table( &self, index: NSUInteger, table: Option<&IntersectionFunctionTableRef>, )

Only available in (macos(12.0), ios(15.0))

Source

pub fn set_vertex_visible_function_table( &self, buffer_index: NSUInteger, visible_function_table: Option<&VisibleFunctionTableRef>, )

Source

pub fn set_vertex_visible_function_tables( &self, buffer_start_index: NSUInteger, visible_function_tables: &[&VisibleFunctionTableRef], )

Source

pub fn set_object_buffer( &self, index: NSUInteger, buffer: Option<&BufferRef>, offset: NSUInteger, )

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

Source

pub fn set_object_buffer_offset(&self, index: NSUInteger, offset: NSUInteger)

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

Source

pub fn set_object_bytes( &self, index: NSUInteger, length: NSUInteger, bytes: *const c_void, )

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

Source

pub fn set_object_sampler_state( &self, index: NSUInteger, sampler: Option<&SamplerStateRef>, )

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

Source

pub fn set_object_sampler_state_with_lod( &self, index: NSUInteger, sampler: Option<&SamplerStateRef>, lod_clamp: Range<f32>, )

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

Source

pub fn set_object_texture( &self, index: NSUInteger, texture: Option<&TextureRef>, )

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

Source

pub fn set_object_threadgroup_memory_length( &self, index: NSUInteger, length: NSUInteger, )

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

Source

pub fn set_object_buffers( &self, start_index: NSUInteger, data: &[Option<&BufferRef>], offsets: &[NSUInteger], )

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

Source

pub fn set_object_sampler_states( &self, start_index: NSUInteger, data: &[Option<&SamplerStateRef>], )

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

Source

pub fn set_object_textures( &self, start_index: NSUInteger, data: &[Option<&TextureRef>], )

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

Source

pub fn set_mesh_buffer( &self, index: NSUInteger, buffer: Option<&BufferRef>, offset: NSUInteger, )

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

Source

pub fn set_mesh_buffer_offset(&self, index: NSUInteger, offset: NSUInteger)

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

Source

pub fn set_mesh_bytes( &self, index: NSUInteger, length: NSUInteger, bytes: *const c_void, )

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

Source

pub fn set_mesh_sampler_state( &self, index: NSUInteger, sampler: Option<&SamplerStateRef>, )

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

Source

pub fn set_mesh_sampler_state_with_lod( &self, index: NSUInteger, sampler: Option<&SamplerStateRef>, lod_clamp: Range<f32>, )

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

Source

pub fn set_mesh_texture(&self, index: NSUInteger, texture: Option<&TextureRef>)

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

Source

pub fn set_mesh_buffers( &self, start_index: NSUInteger, data: &[Option<&BufferRef>], offsets: &[NSUInteger], )

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

Source

pub fn set_mesh_sampler_states( &self, start_index: NSUInteger, data: &[Option<&SamplerStateRef>], )

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

Source

pub fn set_mesh_textures( &self, start_index: NSUInteger, data: &[Option<&TextureRef>], )

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

Source

pub fn set_fragment_bytes( &self, index: NSUInteger, length: NSUInteger, bytes: *const c_void, )

Source

pub fn set_fragment_buffer( &self, index: NSUInteger, buffer: Option<&BufferRef>, offset: NSUInteger, )

Source

pub fn set_fragment_buffer_offset(&self, index: NSUInteger, offset: NSUInteger)

Source

pub fn set_fragment_buffers( &self, start_index: NSUInteger, data: &[Option<&BufferRef>], offsets: &[NSUInteger], )

Source

pub fn set_fragment_texture( &self, index: NSUInteger, texture: Option<&TextureRef>, )

Source

pub fn set_fragment_textures( &self, start_index: NSUInteger, data: &[Option<&TextureRef>], )

Source

pub fn set_fragment_sampler_state( &self, index: NSUInteger, sampler: Option<&SamplerStateRef>, )

Source

pub fn set_fragment_sampler_states( &self, start_index: NSUInteger, data: &[Option<&SamplerStateRef>], )

Source

pub fn set_fragment_sampler_state_with_lod( &self, index: NSUInteger, sampler: Option<&SamplerStateRef>, lod_clamp: Range<f32>, )

Source

pub fn set_fragment_acceleration_structure( &self, index: NSUInteger, accel: Option<&AccelerationStructureRef>, )

Only available in (macos(12.0), ios(15.0))

Source

pub fn set_fragment_intersection_function_table( &self, index: NSUInteger, table: Option<&IntersectionFunctionTableRef>, )

Only available in (macos(12.0), ios(15.0))

Source

pub fn set_fragment_visible_function_table( &self, buffer_index: NSUInteger, visible_function_table: Option<&VisibleFunctionTableRef>, )

Source

pub fn set_fragment_visible_function_tables( &self, buffer_start_index: NSUInteger, visible_function_tables: &[&VisibleFunctionTableRef], )

Source

pub fn draw_primitives( &self, primitive_type: MTLPrimitiveType, vertex_start: NSUInteger, vertex_count: NSUInteger, )

Source

pub fn draw_primitives_instanced( &self, primitive_type: MTLPrimitiveType, vertex_start: NSUInteger, vertex_count: NSUInteger, instance_count: NSUInteger, )

Source

pub fn draw_primitives_instanced_base_instance( &self, primitive_type: MTLPrimitiveType, vertex_start: NSUInteger, vertex_count: NSUInteger, instance_count: NSUInteger, base_instance: NSUInteger, )

Source

pub fn draw_primitives_indirect( &self, primitive_type: MTLPrimitiveType, indirect_buffer: &BufferRef, indirect_buffer_offset: NSUInteger, )

Source

pub fn draw_indexed_primitives( &self, primitive_type: MTLPrimitiveType, index_count: NSUInteger, index_type: MTLIndexType, index_buffer: &BufferRef, index_buffer_offset: NSUInteger, )

Source

pub fn draw_indexed_primitives_instanced( &self, primitive_type: MTLPrimitiveType, index_count: NSUInteger, index_type: MTLIndexType, index_buffer: &BufferRef, index_buffer_offset: NSUInteger, instance_count: NSUInteger, )

Source

pub fn draw_indexed_primitives_instanced_base_instance( &self, primitive_type: MTLPrimitiveType, index_count: NSUInteger, index_type: MTLIndexType, index_buffer: &BufferRef, index_buffer_offset: NSUInteger, instance_count: NSUInteger, base_vertex: NSInteger, base_instance: NSUInteger, )

Source

pub fn draw_indexed_primitives_indirect( &self, primitive_type: MTLPrimitiveType, index_type: MTLIndexType, index_buffer: &BufferRef, index_buffer_offset: NSUInteger, indirect_buffer: &BufferRef, indirect_buffer_offset: NSUInteger, )

Source

pub fn draw_mesh_threadgroups( &self, threadgroups_per_grid: MTLSize, threads_per_object_threadgroup: MTLSize, threads_per_mesh_threadgroup: MTLSize, )

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

Source

pub fn draw_mesh_threadgroups_with_indirect_buffer( &self, indirect_buffer: &BufferRef, indirect_buffer_offset: NSUInteger, threads_per_object_threadgroup: MTLSize, threads_per_mesh_threadgroup: MTLSize, )

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

Source

pub fn draw_mesh_threads( &self, threads_per_grid: MTLSize, threads_per_object_threadgroup: MTLSize, threads_per_mesh_threadgroup: MTLSize, )

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

Source

pub fn use_resource(&self, resource: &ResourceRef, usage: MTLResourceUsage)

👎Deprecated:

Use use_resource_at instead

Adds an untracked resource to the render pass.

Availability: iOS 11.0+, macOS 10.13+

§Arguments
  • resource: A resource within an argument buffer.
  • usage: Options for describing how a graphics function uses the resource.

See https://developer.apple.com/documentation/metal/mtlrendercommandencoder/2866168-useresource?language=objc

Source

pub fn use_resource_at( &self, resource: &ResourceRef, usage: MTLResourceUsage, stages: MTLRenderStages, )

Adds an untracked resource to the render pass, specifying which render stages need it.

Availability: iOS 13.0+, macOS 10.15+

§Arguments
  • resource: A resource within an argument buffer.
  • usage: Options for describing how a graphics function uses the resource.
  • stages: The render stages where the resource must be resident.

See https://developer.apple.com/documentation/metal/mtlrendercommandencoder/3043404-useresource

Source

pub fn use_resources( &self, resources: &[&ResourceRef], usage: MTLResourceUsage, stages: MTLRenderStages, )

Adds an array of untracked resources to the render pass, specifying which stages need them.

When working with color render targets, call this method as late as possible to improve performance.

Availability: iOS 13.0+, macOS 10.15+

§Arguments
  • resources: A slice of resources within an argument buffer.
  • usage: Options for describing how a graphics function uses the resources.
  • stages: The render stages where the resources must be resident.
Source

pub fn use_heap(&self, heap: &HeapRef)

👎Deprecated:

Use use_heap_at instead

Adds the resources in a heap to the render pass.

Availability: iOS 11.0+, macOS 10.13+

§Arguments:
  • heap: A heap that contains resources within an argument buffer.

See https://developer.apple.com/documentation/metal/mtlrendercommandencoder/2866163-useheap?language=objc

Source

pub fn use_heap_at(&self, heap: &HeapRef, stages: MTLRenderStages)

Adds the resources in a heap to the render pass, specifying which render stages need them.

Availability: iOS 13.0+, macOS 10.15+

§Arguments
  • heap: A heap that contains resources within an argument buffer.
  • stages: The render stages where the resources must be resident.
Source

pub fn use_heaps(&self, heaps: &[&HeapRef], stages: MTLRenderStages)

Adds the resources in an array of heaps to the render pass, specifying which render stages need them.

Availability: iOS 13.0+, macOS 10.15+

§Arguments
  • heaps: A slice of heaps that contains resources within an argument buffer.
  • stages: The render stages where the resources must be resident.
Source

pub fn execute_commands_in_buffer( &self, buffer: &IndirectCommandBufferRef, with_range: NSRange, )

Source

pub fn update_fence(&self, fence: &FenceRef, after_stages: MTLRenderStages)

Source

pub fn wait_for_fence(&self, fence: &FenceRef, before_stages: MTLRenderStages)

Source

pub fn sample_counters_in_buffer( &self, sample_buffer: &CounterSampleBufferRef, sample_index: NSUInteger, with_barrier: bool, )

Methods from Deref<Target = CommandEncoderRef>§

Source

pub fn label(&self) -> &str

Source

pub fn set_label(&self, label: &str)

Source

pub fn end_encoding(&self)

Source

pub fn insert_debug_signpost(&self, name: &str)

Source

pub fn push_debug_group(&self, name: &str)

Source

pub fn pop_debug_group(&self)

Trait Implementations§

Source§

impl AsMut<RenderCommandEncoderRef> for RenderCommandEncoder

Source§

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

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

impl AsRef<RenderCommandEncoderRef> for RenderCommandEncoder

Source§

fn as_ref(&self) -> &RenderCommandEncoderRef

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

impl Borrow<RenderCommandEncoderRef> for RenderCommandEncoder

Source§

fn borrow(&self) -> &RenderCommandEncoderRef

Immutably borrows from an owned value. Read more
Source§

impl BorrowMut<RenderCommandEncoderRef> for RenderCommandEncoder

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl Clone for RenderCommandEncoder

Source§

fn clone(&self) -> RenderCommandEncoder

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for RenderCommandEncoder

Source§

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

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

impl Deref for RenderCommandEncoder

Source§

type Target = RenderCommandEncoderRef

The resulting type after dereferencing.
Source§

fn deref(&self) -> &RenderCommandEncoderRef

Dereferences the value.
Source§

impl DerefMut for RenderCommandEncoder

Source§

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

Mutably dereferences the value.
Source§

impl Drop for RenderCommandEncoder

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl ForeignType for RenderCommandEncoder

Source§

type CType = MTLRenderCommandEncoder

The raw C type.
Source§

type Ref = RenderCommandEncoderRef

The type representing a reference to this type.
Source§

unsafe fn from_ptr(ptr: *mut MTLRenderCommandEncoder) -> RenderCommandEncoder

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

fn as_ptr(&self) -> *mut MTLRenderCommandEncoder

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 From<RenderCommandEncoder> for CommandEncoder

Source§

fn from(item: RenderCommandEncoder) -> Self

Converts to this type from the input type.
Source§

impl Send for RenderCommandEncoder

Source§

impl Sync for RenderCommandEncoder

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.