Skip to main content

RenderCommandEncoder

Struct RenderCommandEncoder 

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

MTL4 render command encoder.

C++ equivalent: MTL4::RenderCommandEncoder

RenderCommandEncoder encodes render commands including draw calls, state changes, and resource bindings.

Implementations§

Source§

impl RenderCommandEncoder

Source

pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>

Create a RenderCommandEncoder from a raw pointer.

Source

pub fn as_raw(&self) -> *mut c_void

Get the raw pointer.

Source

pub fn device(&self) -> Option<Device>

Get the device.

C++ equivalent: MTL::Device* device() const

Source

pub fn label(&self) -> Option<String>

Get the label.

C++ equivalent: NS::String* label() const

Source

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

Set the label.

C++ equivalent: void setLabel(const NS::String*)

Source

pub fn set_render_pipeline_state(&self, pipeline: &RenderPipelineState)

Set the render pipeline state.

C++ equivalent: void setRenderPipelineState(const MTL::RenderPipelineState*)

Source

pub fn set_vertex_argument_table(&self, table: *const c_void, index: UInteger)

Set vertex argument table at index.

C++ equivalent: void setVertexArgumentTable(const MTL4::ArgumentTable*, NS::UInteger)

Source

pub fn set_fragment_argument_table(&self, table: *const c_void, index: UInteger)

Set fragment argument table at index.

C++ equivalent: void setFragmentArgumentTable(const MTL4::ArgumentTable*, NS::UInteger)

Source

pub fn set_tile_argument_table(&self, table: *const c_void, index: UInteger)

Set tile argument table at index.

C++ equivalent: void setTileArgumentTable(const MTL4::ArgumentTable*, NS::UInteger)

Source

pub fn set_object_argument_table(&self, table: *const c_void, index: UInteger)

Set object argument table at index.

C++ equivalent: void setObjectArgumentTable(const MTL4::ArgumentTable*, NS::UInteger)

Source

pub fn set_mesh_argument_table(&self, table: *const c_void, index: UInteger)

Set mesh argument table at index.

C++ equivalent: void setMeshArgumentTable(const MTL4::ArgumentTable*, NS::UInteger)

Source

pub fn set_vertex_buffer( &self, buffer: *const c_void, offset: UInteger, index: UInteger, )

Set vertex buffer at index.

C++ equivalent: void setVertexBuffer(const MTL::Buffer*, NS::UInteger, NS::UInteger)

Source

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

Set vertex bytes at index.

C++ equivalent: void setVertexBytes(const void*, NS::UInteger, NS::UInteger)

Source

pub fn set_vertex_texture(&self, texture: *const c_void, index: UInteger)

Set vertex texture at index.

C++ equivalent: void setVertexTexture(const MTL::Texture*, NS::UInteger)

Source

pub fn set_vertex_sampler_state(&self, sampler: *const c_void, index: UInteger)

Set vertex sampler state at index.

C++ equivalent: void setVertexSamplerState(const MTL::SamplerState*, NS::UInteger)

Source

pub fn set_fragment_buffer( &self, buffer: *const c_void, offset: UInteger, index: UInteger, )

Set fragment buffer at index.

C++ equivalent: void setFragmentBuffer(const MTL::Buffer*, NS::UInteger, NS::UInteger)

Source

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

Set fragment bytes at index.

C++ equivalent: void setFragmentBytes(const void*, NS::UInteger, NS::UInteger)

Source

pub fn set_fragment_texture(&self, texture: *const c_void, index: UInteger)

Set fragment texture at index.

C++ equivalent: void setFragmentTexture(const MTL::Texture*, NS::UInteger)

Source

pub fn set_fragment_sampler_state( &self, sampler: *const c_void, index: UInteger, )

Set fragment sampler state at index.

C++ equivalent: void setFragmentSamplerState(const MTL::SamplerState*, NS::UInteger)

Source

pub fn set_tile_buffer( &self, buffer: *const c_void, offset: UInteger, index: UInteger, )

Set tile buffer at index.

C++ equivalent: void setTileBuffer(const MTL::Buffer*, NS::UInteger, NS::UInteger)

Source

pub fn set_tile_bytes( &self, bytes: *const c_void, length: UInteger, index: UInteger, )

Set tile bytes at index.

C++ equivalent: void setTileBytes(const void*, NS::UInteger, NS::UInteger)

Source

pub fn set_tile_texture(&self, texture: *const c_void, index: UInteger)

Set tile texture at index.

C++ equivalent: void setTileTexture(const MTL::Texture*, NS::UInteger)

Source

pub fn set_tile_sampler_state(&self, sampler: *const c_void, index: UInteger)

Set tile sampler state at index.

C++ equivalent: void setTileSamplerState(const MTL::SamplerState*, NS::UInteger)

Source

pub fn set_viewport(&self, viewport: Viewport)

Set viewport.

C++ equivalent: void setViewport(MTL::Viewport)

Source

pub fn set_viewports(&self, viewports: *const Viewport, count: UInteger)

Set multiple viewports.

C++ equivalent: void setViewports(const MTL::Viewport*, NS::UInteger)

Source

pub fn set_scissor_rect(&self, rect: ScissorRect)

Set scissor rect.

C++ equivalent: void setScissorRect(MTL::ScissorRect)

Source

pub fn set_scissor_rects(&self, rects: *const ScissorRect, count: UInteger)

Set multiple scissor rects.

C++ equivalent: void setScissorRects(const MTL::ScissorRect*, NS::UInteger)

Source

pub fn set_front_facing_winding(&self, winding: Winding)

Set front facing winding.

C++ equivalent: void setFrontFacingWinding(MTL::Winding)

Source

pub fn set_cull_mode(&self, mode: CullMode)

Set cull mode.

C++ equivalent: void setCullMode(MTL::CullMode)

Source

pub fn set_triangle_fill_mode(&self, mode: TriangleFillMode)

Set triangle fill mode.

C++ equivalent: void setTriangleFillMode(MTL::TriangleFillMode)

Source

pub fn set_depth_clip_mode(&self, mode: DepthClipMode)

Set depth clip mode.

C++ equivalent: void setDepthClipMode(MTL::DepthClipMode)

Source

pub fn set_depth_bias(&self, depth_bias: f32, slope_scale: f32, clamp: f32)

Set depth bias.

C++ equivalent: void setDepthBias(float, float, float)

Source

pub fn set_depth_stencil_state(&self, state: &DepthStencilState)

Set depth stencil state.

C++ equivalent: void setDepthStencilState(const MTL::DepthStencilState*)

Source

pub fn set_stencil_reference_value(&self, value: u32)

Set stencil reference value.

C++ equivalent: void setStencilReferenceValue(uint32_t)

Source

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

Set front and back stencil reference values.

C++ equivalent: void setStencilReferenceValues(uint32_t, uint32_t)

Source

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

Set blend color.

C++ equivalent: void setBlendColor(float, float, float, float)

Source

pub fn draw_primitives( &self, primitive_type: PrimitiveType, vertex_start: UInteger, vertex_count: UInteger, )

Draw primitives.

C++ equivalent: void drawPrimitives(MTL::PrimitiveType, NS::UInteger, NS::UInteger)

Source

pub fn draw_primitives_instanced( &self, primitive_type: PrimitiveType, vertex_start: UInteger, vertex_count: UInteger, instance_count: UInteger, )

Draw primitives with instance count.

C++ equivalent: void drawPrimitives(MTL::PrimitiveType, NS::UInteger, NS::UInteger, NS::UInteger)

Source

pub fn draw_primitives_instanced_base( &self, primitive_type: PrimitiveType, vertex_start: UInteger, vertex_count: UInteger, instance_count: UInteger, base_instance: UInteger, )

Draw primitives with instance count and base instance.

C++ equivalent: void drawPrimitives(MTL::PrimitiveType, NS::UInteger, NS::UInteger, NS::UInteger, NS::UInteger)

Source

pub fn draw_indexed_primitives( &self, primitive_type: PrimitiveType, index_count: UInteger, index_type: UInteger, index_buffer: *const c_void, index_buffer_offset: UInteger, )

Draw indexed primitives.

C++ equivalent: void drawIndexedPrimitives(...)

Source

pub fn draw_indexed_primitives_indirect( &self, primitive_type: PrimitiveType, index_type: UInteger, index_buffer: *const c_void, index_buffer_offset: UInteger, indirect_buffer: *const c_void, indirect_buffer_offset: UInteger, )

Draw indexed primitives with indirect buffer.

C++ equivalent: void drawIndexedPrimitives(... indirectBuffer ...)

Source

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

Draw mesh threadgroups.

C++ equivalent: void drawMeshThreadgroups(MTL::Size, MTL::Size, MTL::Size)

Source

pub fn draw_mesh_threadgroups_indirect( &self, indirect_buffer: *const c_void, indirect_buffer_offset: UInteger, threads_per_object_threadgroup: Size, threads_per_mesh_threadgroup: Size, )

Draw mesh threadgroups with indirect buffer.

C++ equivalent: void drawMeshThreadgroups(const MTL::Buffer*, NS::UInteger, MTL::Size, MTL::Size)

Source

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

Draw mesh threads.

C++ equivalent: void drawMeshThreads(MTL::Size, MTL::Size, MTL::Size)

Source

pub fn barrier(&self)

Insert a barrier.

C++ equivalent: void barrier()

Source

pub fn barrier_buffer( &self, buffer: *const c_void, visibility: VisibilityOptions, )

Insert a barrier for a buffer.

C++ equivalent: void barrier(const MTL::Buffer*, MTL4::VisibilityOptions)

Source

pub fn barrier_texture( &self, texture: *const c_void, visibility: VisibilityOptions, )

Insert a barrier for a texture.

C++ equivalent: void barrier(const MTL::Texture*, MTL4::VisibilityOptions)

Source

pub fn update_fence(&self, fence: *const c_void)

Update a fence.

C++ equivalent: void updateFence(const MTL::Fence*)

Source

pub fn wait_for_fence(&self, fence: *const c_void)

Wait for a fence.

C++ equivalent: void waitForFence(const MTL::Fence*)

Source

pub fn use_resource(&self, resource: *const c_void, usage: UInteger)

Use resource.

C++ equivalent: void useResource(const MTL::Resource*, MTL::ResourceUsage)

Source

pub fn use_heap(&self, heap: *const c_void, usage: UInteger)

Use heap.

C++ equivalent: void useHeap(const MTL::Heap*, MTL::ResourceUsage)

Source

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

Push a debug group.

C++ equivalent: void pushDebugGroup(const NS::String*)

Source

pub fn pop_debug_group(&self)

Pop a debug group.

C++ equivalent: void popDebugGroup()

Source

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

Insert a debug signpost.

C++ equivalent: void insertDebugSignpost(const NS::String*)

Source

pub fn write_timestamp( &self, granularity: TimestampGranularity, stage: RenderStages, counter_heap: *const c_void, index: UInteger, )

Write a timestamp to a counter heap.

C++ equivalent: void writeTimestamp(MTL4::TimestampGranularity, MTL::RenderStages, const MTL4::CounterHeap*, NS::UInteger)

Source

pub fn end_encoding(&self)

End encoding.

C++ equivalent: void endEncoding()

Trait Implementations§

Source§

impl Clone for RenderCommandEncoder

Source§

fn clone(&self) -> Self

Returns a duplicate 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 RenderCommandEncoder

Source§

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

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

impl Drop for RenderCommandEncoder

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Referencing for RenderCommandEncoder

Source§

fn as_ptr(&self) -> *const c_void

Get the raw pointer to the Objective-C object.
Source§

fn as_mut_ptr(&self) -> *mut c_void

Get the raw mutable pointer to the Objective-C object.
Source§

fn retain(&self) -> Self
where Self: Clone,

Retain the object, incrementing its reference count. Read more
Source§

fn release(&self)

Release the object, decrementing its reference count. Read more
Source§

fn autorelease(&self) -> Self
where Self: Clone,

Autorelease the object. Read more
Source§

fn retain_count(&self) -> usize

Get the retain count of the object. Read more
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<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.