Skip to main content

RenderCommandEncoder

Struct RenderCommandEncoder 

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

A command encoder for rendering operations.

C++ equivalent: MTL::RenderCommandEncoder

Render encoders are used to encode drawing commands, set render state, and bind resources for rendering operations.

Implementations§

Source§

impl RenderCommandEncoder

Source

pub fn memory_barrier_with_scope( &self, scope: BarrierScope, after_stages: RenderStages, before_stages: RenderStages, )

Insert a memory barrier with scope.

C++ equivalent: void memoryBarrier(MTL::BarrierScope, MTL::RenderStages, MTL::RenderStages)

Source

pub fn texture_barrier(&self)

Insert a texture barrier (deprecated).

C++ equivalent: void textureBarrier()

Source

pub unsafe fn memory_barrier_with_resources_ptr( &self, resources: *const *const c_void, count: UInteger, after_stages: RenderStages, before_stages: RenderStages, )

Insert a memory barrier for specific resources (raw pointer version).

C++ equivalent: void memoryBarrier(const Resource* const*, NS::UInteger, MTL::RenderStages, MTL::RenderStages)

§Safety

The resources pointer must be a valid array with the specified count.

Source

pub unsafe fn use_resource_ptr( &self, resource: *const c_void, usage: ResourceUsage, )

Declare that a resource will be used (raw pointer version).

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

§Safety

The resource pointer must be a valid Metal resource object.

Source

pub unsafe fn use_resource_ptr_with_stages( &self, resource: *const c_void, usage: ResourceUsage, stages: RenderStages, )

Declare that a resource will be used with stages (raw pointer version).

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

§Safety

The resource pointer must be a valid Metal resource object.

Source

pub fn use_buffer(&self, buffer: &Buffer, usage: ResourceUsage)

Declare that a buffer will be used.

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

Source

pub fn use_texture(&self, texture: &Texture, usage: ResourceUsage)

Declare that a texture will be used.

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

Source

pub unsafe fn use_heap_ptr(&self, heap: *const c_void)

Declare that a heap will be used (raw pointer version).

C++ equivalent: void useHeap(const Heap*)

§Safety

The heap pointer must be a valid Metal heap object.

Source

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

Declare that a heap will be used.

C++ equivalent: void useHeap(const Heap*)

Source

pub unsafe fn use_heap_ptr_with_stages( &self, heap: *const c_void, stages: RenderStages, )

Declare that a heap will be used with stages (raw pointer version).

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

§Safety

The heap pointer must be a valid Metal heap object.

Source

pub unsafe fn use_heaps_ptr(&self, heaps: *const *const c_void, count: UInteger)

Declare that multiple heaps will be used (raw pointer version).

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

§Safety

The heaps pointer must be a valid array of heap pointers with the specified count.

Source

pub unsafe fn use_heaps_with_stages_ptr( &self, heaps: *const *const c_void, count: UInteger, stages: RenderStages, )

Declare that multiple heaps will be used with stages (raw pointer version).

C++ equivalent: void useHeaps(const Heap* const*, NS::UInteger, MTL::RenderStages)

§Safety

The heaps pointer must be a valid array of heap pointers with the specified count.

Source

pub unsafe fn use_resources_ptr( &self, resources: *const *const c_void, count: UInteger, usage: ResourceUsage, )

Declare that multiple resources will be used (raw pointer version).

C++ equivalent: void useResources(const Resource* const*, NS::UInteger, MTL::ResourceUsage)

§Safety

The resources pointer must be a valid array of resource pointers with the specified count.

Source

pub unsafe fn use_resources_with_stages_ptr( &self, resources: *const *const c_void, count: UInteger, usage: ResourceUsage, stages: RenderStages, )

Declare that multiple resources will be used with stages (raw pointer version).

C++ equivalent: void useResources(const Resource* const*, NS::UInteger, MTL::ResourceUsage, MTL::RenderStages)

§Safety

The resources pointer must be a valid array of resource pointers with the specified count.

Source

pub unsafe fn update_fence_ptr( &self, fence: *const c_void, stages: RenderStages, )

Update a fence (raw pointer version).

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

§Safety

The fence pointer must be a valid Metal fence object.

Source

pub fn update_fence(&self, fence: &Fence, stages: RenderStages)

Update a fence.

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

Source

pub unsafe fn wait_for_fence_ptr( &self, fence: *const c_void, stages: RenderStages, )

Wait for a fence (raw pointer version).

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

§Safety

The fence pointer must be a valid Metal fence object.

Source

pub fn wait_for_fence(&self, fence: &Fence, stages: RenderStages)

Wait for a fence.

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

Source

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

Set vertex amplification count.

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

Source

pub unsafe fn set_vertex_acceleration_structure_ptr( &self, acceleration_structure: *const c_void, buffer_index: UInteger, )

Set a vertex acceleration structure (raw pointer version).

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

§Safety

The acceleration structure pointer must be valid.

Source

pub fn set_vertex_acceleration_structure( &self, acceleration_structure: &AccelerationStructure, buffer_index: UInteger, )

Set a vertex acceleration structure.

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

Source

pub unsafe fn set_fragment_acceleration_structure_ptr( &self, acceleration_structure: *const c_void, buffer_index: UInteger, )

Set a fragment acceleration structure (raw pointer version).

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

§Safety

The acceleration structure pointer must be valid.

Source

pub fn set_fragment_acceleration_structure( &self, acceleration_structure: &AccelerationStructure, buffer_index: UInteger, )

Set a fragment acceleration structure.

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

Source

pub unsafe fn set_tile_acceleration_structure_ptr( &self, acceleration_structure: *const c_void, buffer_index: UInteger, )

Set a tile acceleration structure (raw pointer version).

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

§Safety

The acceleration structure pointer must be valid.

Source

pub fn set_tile_acceleration_structure( &self, acceleration_structure: &AccelerationStructure, buffer_index: UInteger, )

Set a tile acceleration structure.

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

Source

pub unsafe fn set_vertex_visible_function_table_ptr( &self, function_table: *const c_void, buffer_index: UInteger, )

Set a vertex visible function table (raw pointer version).

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

§Safety

The function table pointer must be valid.

Source

pub unsafe fn set_vertex_visible_function_tables_ptr( &self, function_tables: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple vertex visible function tables (raw pointer version).

C++ equivalent: void setVertexVisibleFunctionTables(const VisibleFunctionTable* const*, NS::Range)

§Safety

The function tables pointer must be a valid array with at least range.length elements.

Source

pub unsafe fn set_vertex_intersection_function_table_ptr( &self, function_table: *const c_void, buffer_index: UInteger, )

Set a vertex intersection function table (raw pointer version).

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

§Safety

The function table pointer must be valid.

Source

pub unsafe fn set_vertex_intersection_function_tables_ptr( &self, function_tables: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple vertex intersection function tables (raw pointer version).

C++ equivalent: void setVertexIntersectionFunctionTables(const IntersectionFunctionTable* const*, NS::Range)

§Safety

The function tables pointer must be a valid array with at least range.length elements.

Source

pub unsafe fn set_fragment_visible_function_table_ptr( &self, function_table: *const c_void, buffer_index: UInteger, )

Set a fragment visible function table (raw pointer version).

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

§Safety

The function table pointer must be valid.

Source

pub unsafe fn set_fragment_visible_function_tables_ptr( &self, function_tables: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple fragment visible function tables (raw pointer version).

C++ equivalent: void setFragmentVisibleFunctionTables(const VisibleFunctionTable* const*, NS::Range)

§Safety

The function tables pointer must be a valid array with at least range.length elements.

Source

pub unsafe fn set_fragment_intersection_function_table_ptr( &self, function_table: *const c_void, buffer_index: UInteger, )

Set a fragment intersection function table (raw pointer version).

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

§Safety

The function table pointer must be valid.

Source

pub unsafe fn set_fragment_intersection_function_tables_ptr( &self, function_tables: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple fragment intersection function tables (raw pointer version).

C++ equivalent: void setFragmentIntersectionFunctionTables(const IntersectionFunctionTable* const*, NS::Range)

§Safety

The function tables pointer must be a valid array with at least range.length elements.

Source

pub unsafe fn set_tile_visible_function_table_ptr( &self, function_table: *const c_void, buffer_index: UInteger, )

Set a tile visible function table (raw pointer version).

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

§Safety

The function table pointer must be valid.

Source

pub unsafe fn set_tile_visible_function_tables_ptr( &self, function_tables: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple tile visible function tables (raw pointer version).

C++ equivalent: void setTileVisibleFunctionTables(const VisibleFunctionTable* const*, NS::Range)

§Safety

The function tables pointer must be a valid array with at least range.length elements.

Source

pub unsafe fn set_tile_intersection_function_table_ptr( &self, function_table: *const c_void, buffer_index: UInteger, )

Set a tile intersection function table (raw pointer version).

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

§Safety

The function table pointer must be valid.

Source

pub unsafe fn set_tile_intersection_function_tables_ptr( &self, function_tables: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple tile intersection function tables (raw pointer version).

C++ equivalent: void setTileIntersectionFunctionTables(const IntersectionFunctionTable* const*, NS::Range)

§Safety

The function tables pointer must be a valid array with at least range.length elements.

Source

pub unsafe fn execute_commands_in_buffer_ptr( &self, indirect_command_buffer: *const c_void, offset: UInteger, length: UInteger, )

Execute commands from an indirect command buffer (raw pointer version).

C++ equivalent: void executeCommandsInBuffer(const IndirectCommandBuffer*, NS::Range)

§Safety

The indirect command buffer pointer must be valid.

Source

pub unsafe fn execute_commands_in_buffer_with_indirect_range_ptr( &self, indirect_command_buffer: *const c_void, indirect_range_buffer: *const c_void, indirect_buffer_offset: UInteger, )

Execute commands from an indirect command buffer with indirect range (raw pointer version).

C++ equivalent: void executeCommandsInBuffer(const IndirectCommandBuffer*, const Buffer*, NS::UInteger)

§Safety

The indirect command buffer and range buffer pointers must be valid.

Source

pub unsafe fn sample_counters_in_buffer_ptr( &self, sample_buffer: *const c_void, sample_index: UInteger, barrier: bool, )

Sample counters (raw pointer version).

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

§Safety

The sample buffer pointer must be a valid counter sample buffer object.

Source

pub unsafe fn set_color_attachment_map_ptr(&self, mapping: *const c_void)

Set the color attachment map (raw pointer version).

C++ equivalent: void setColorAttachmentMap(const LogicalToPhysicalColorAttachmentMap*)

§Safety

The mapping pointer must be valid.

Source§

impl RenderCommandEncoder

Source

pub fn set_vertex_buffer( &self, buffer: &Buffer, offset: UInteger, index: UInteger, )

Set a vertex buffer.

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

Source

pub fn set_vertex_buffer_with_stride( &self, buffer: &Buffer, offset: UInteger, stride: UInteger, index: UInteger, )

Set a vertex buffer with attribute stride.

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

Source

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

Set the vertex buffer offset.

C++ equivalent: void setVertexBufferOffset(NS::UInteger, NS::UInteger)

Source

pub fn set_vertex_bytes(&self, bytes: &[u8], index: UInteger)

Set inline vertex bytes.

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

Source

pub fn set_vertex_bytes_with_stride( &self, bytes: &[u8], stride: UInteger, index: UInteger, )

Set inline vertex bytes with attribute stride.

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

Source

pub fn set_vertex_buffer_offset_with_stride( &self, offset: UInteger, stride: UInteger, index: UInteger, )

Set the vertex buffer offset with attribute stride.

C++ equivalent: void setVertexBufferOffset(NS::UInteger, NS::UInteger, NS::UInteger)

Source

pub unsafe fn set_vertex_buffers_ptr( &self, buffers: *const *const c_void, offsets: *const UInteger, range_location: UInteger, range_length: UInteger, )

Set multiple vertex buffers at a range of indices (raw pointer version).

C++ equivalent: void setVertexBuffers(const Buffer* const*, const NS::UInteger*, NS::Range)

§Safety

The buffers and offsets pointers must be valid arrays with at least range.length elements.

Source

pub unsafe fn set_vertex_buffers_with_strides_ptr( &self, buffers: *const *const c_void, offsets: *const UInteger, strides: *const UInteger, range_location: UInteger, range_length: UInteger, )

Set multiple vertex buffers with strides at a range of indices (raw pointer version).

C++ equivalent: void setVertexBuffers(const Buffer* const*, const NS::UInteger*, const NS::UInteger*, NS::Range)

§Safety

The buffers, offsets, and strides pointers must be valid arrays with at least range.length elements.

Source

pub fn set_vertex_texture(&self, texture: &Texture, index: UInteger)

Set a vertex texture.

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

Source

pub unsafe fn set_vertex_textures_ptr( &self, textures: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple vertex textures at a range of indices (raw pointer version).

C++ equivalent: void setVertexTextures(const Texture* const*, NS::Range)

§Safety

The textures pointer must be a valid array with at least range.length elements.

Source

pub fn set_vertex_sampler_state(&self, sampler: &SamplerState, index: UInteger)

Set a vertex sampler state.

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

Source

pub fn set_vertex_sampler_state_with_lod_clamps( &self, sampler: &SamplerState, lod_min_clamp: f32, lod_max_clamp: f32, index: UInteger, )

Set a vertex sampler state with LOD clamps.

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

Source

pub unsafe fn set_vertex_sampler_states_ptr( &self, samplers: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple vertex sampler states at a range of indices (raw pointer version).

C++ equivalent: void setVertexSamplerStates(const SamplerState* const*, NS::Range)

§Safety

The samplers pointer must be a valid array with at least range.length elements.

Source

pub unsafe fn set_vertex_sampler_states_with_lod_clamps_ptr( &self, samplers: *const *const c_void, lod_min_clamps: *const f32, lod_max_clamps: *const f32, range_location: UInteger, range_length: UInteger, )

Set multiple vertex sampler states with LOD clamps at a range of indices (raw pointer version).

C++ equivalent: void setVertexSamplerStates(const SamplerState* const*, const float*, const float*, NS::Range)

§Safety

The samplers, lod_min_clamps, and lod_max_clamps pointers must be valid arrays with at least range.length elements.

Source

pub fn set_fragment_buffer( &self, buffer: &Buffer, offset: UInteger, index: UInteger, )

Set a fragment buffer.

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

Source

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

Set the fragment buffer offset.

C++ equivalent: void setFragmentBufferOffset(NS::UInteger, NS::UInteger)

Source

pub fn set_fragment_bytes(&self, bytes: &[u8], index: UInteger)

Set inline fragment bytes.

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

Source

pub unsafe fn set_fragment_buffers_ptr( &self, buffers: *const *const c_void, offsets: *const UInteger, range_location: UInteger, range_length: UInteger, )

Set multiple fragment buffers at a range of indices (raw pointer version).

C++ equivalent: void setFragmentBuffers(const Buffer* const*, const NS::UInteger*, NS::Range)

§Safety

The buffers and offsets pointers must be valid arrays with at least range.length elements.

Source

pub fn set_fragment_texture(&self, texture: &Texture, index: UInteger)

Set a fragment texture.

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

Source

pub unsafe fn set_fragment_textures_ptr( &self, textures: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple fragment textures at a range of indices (raw pointer version).

C++ equivalent: void setFragmentTextures(const Texture* const*, NS::Range)

§Safety

The textures pointer must be a valid array with at least range.length elements.

Source

pub fn set_fragment_sampler_state( &self, sampler: &SamplerState, index: UInteger, )

Set a fragment sampler state.

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

Source

pub fn set_fragment_sampler_state_with_lod_clamps( &self, sampler: &SamplerState, lod_min_clamp: f32, lod_max_clamp: f32, index: UInteger, )

Set a fragment sampler state with LOD clamps.

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

Source

pub unsafe fn set_fragment_sampler_states_ptr( &self, samplers: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple fragment sampler states at a range of indices (raw pointer version).

C++ equivalent: void setFragmentSamplerStates(const SamplerState* const*, NS::Range)

§Safety

The samplers pointer must be a valid array with at least range.length elements.

Source

pub unsafe fn set_fragment_sampler_states_with_lod_clamps_ptr( &self, samplers: *const *const c_void, lod_min_clamps: *const f32, lod_max_clamps: *const f32, range_location: UInteger, range_length: UInteger, )

Set multiple fragment sampler states with LOD clamps at a range of indices (raw pointer version).

C++ equivalent: void setFragmentSamplerStates(const SamplerState* const*, const float*, const float*, NS::Range)

§Safety

The samplers, lod_min_clamps, and lod_max_clamps pointers must be valid arrays with at least range.length elements.

Source§

impl RenderCommandEncoder

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_instance( &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_primitives_indirect( &self, primitive_type: PrimitiveType, indirect_buffer: &Buffer, indirect_buffer_offset: UInteger, )

Draw primitives using an indirect buffer.

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

Source

pub fn draw_indexed_primitives( &self, primitive_type: PrimitiveType, index_count: UInteger, index_type: IndexType, index_buffer: &Buffer, index_buffer_offset: UInteger, )

Draw indexed primitives.

C++ equivalent: void drawIndexedPrimitives(MTL::PrimitiveType, NS::UInteger, MTL::IndexType, const Buffer*, NS::UInteger)

Source

pub fn draw_indexed_primitives_instanced( &self, primitive_type: PrimitiveType, index_count: UInteger, index_type: IndexType, index_buffer: &Buffer, index_buffer_offset: UInteger, instance_count: UInteger, )

Draw indexed primitives with instance count.

C++ equivalent: void drawIndexedPrimitives(MTL::PrimitiveType, NS::UInteger, MTL::IndexType, const Buffer*, NS::UInteger, NS::UInteger)

Source

pub fn draw_indexed_primitives_instanced_base_vertex_base_instance( &self, primitive_type: PrimitiveType, index_count: UInteger, index_type: IndexType, index_buffer: &Buffer, index_buffer_offset: UInteger, instance_count: UInteger, base_vertex: Integer, base_instance: UInteger, )

Draw indexed primitives with base vertex and base instance.

C++ equivalent: void drawIndexedPrimitives(...instanceCount: baseVertex: baseInstance:)

Source

pub fn draw_indexed_primitives_indirect( &self, primitive_type: PrimitiveType, index_type: IndexType, index_buffer: &Buffer, index_buffer_offset: UInteger, indirect_buffer: &Buffer, indirect_buffer_offset: UInteger, )

Draw indexed primitives using an indirect buffer.

C++ equivalent: void drawIndexedPrimitives(MTL::PrimitiveType, MTL::IndexType, const Buffer*, NS::UInteger, const Buffer*, NS::UInteger)

Source

pub fn set_tessellation_factor_buffer( &self, buffer: &Buffer, offset: UInteger, instance_stride: UInteger, )

Set the tessellation factor buffer.

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

Source

pub fn set_tessellation_factor_scale(&self, scale: f32)

Set the tessellation factor scale.

C++ equivalent: void setTessellationFactorScale(float)

Source

pub fn draw_patches( &self, number_of_patch_control_points: UInteger, patch_start: UInteger, patch_count: UInteger, patch_index_buffer: Option<&Buffer>, patch_index_buffer_offset: UInteger, instance_count: UInteger, base_instance: UInteger, )

Draw patches.

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

Source

pub fn draw_indexed_patches( &self, number_of_patch_control_points: UInteger, patch_start: UInteger, patch_count: UInteger, patch_index_buffer: Option<&Buffer>, patch_index_buffer_offset: UInteger, control_point_index_buffer: &Buffer, control_point_index_buffer_offset: UInteger, instance_count: UInteger, base_instance: UInteger, )

Draw indexed patches.

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

Source

pub fn draw_indexed_patches_indirect( &self, number_of_patch_control_points: UInteger, patch_index_buffer: Option<&Buffer>, patch_index_buffer_offset: UInteger, control_point_index_buffer: &Buffer, control_point_index_buffer_offset: UInteger, indirect_buffer: &Buffer, indirect_buffer_offset: UInteger, )

Draw indexed patches with indirect buffer.

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

Source

pub fn draw_patches_indirect( &self, number_of_patch_control_points: UInteger, patch_index_buffer: Option<&Buffer>, patch_index_buffer_offset: UInteger, indirect_buffer: &Buffer, indirect_buffer_offset: UInteger, )

Draw patches with indirect buffer.

C++ equivalent: void drawPatches(...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_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 draw_mesh_threadgroups_indirect( &self, indirect_buffer: &Buffer, 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 Buffer*, NS::UInteger, MTL::Size, MTL::Size)

Source

pub fn dispatch_threads_per_tile(&self, threads_per_tile: Size)

Dispatch threads per tile.

C++ equivalent: void dispatchThreadsPerTile(MTL::Size)

Source§

impl RenderCommandEncoder

Source

pub fn set_object_buffer( &self, buffer: &Buffer, offset: UInteger, index: UInteger, )

Set an object buffer.

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

Source

pub fn set_object_texture(&self, texture: &Texture, index: UInteger)

Set an object texture.

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

Source

pub fn set_object_sampler_state(&self, sampler: &SamplerState, index: UInteger)

Set an object sampler state.

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

Source

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

Set the object threadgroup memory length.

C++ equivalent: void setObjectThreadgroupMemoryLength(NS::UInteger, NS::UInteger)

Source

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

Set the object buffer offset.

C++ equivalent: void setObjectBufferOffset(NS::UInteger, NS::UInteger)

Source

pub fn set_object_bytes(&self, bytes: &[u8], index: UInteger)

Set inline object bytes.

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

Source

pub unsafe fn set_object_buffers_ptr( &self, buffers: *const *const c_void, offsets: *const UInteger, range_location: UInteger, range_length: UInteger, )

Set multiple object buffers at a range of indices (raw pointer version).

C++ equivalent: void setObjectBuffers(const Buffer* const*, const NS::UInteger*, NS::Range)

§Safety

The buffers and offsets pointers must be valid arrays with at least range.length elements.

Source

pub unsafe fn set_object_textures_ptr( &self, textures: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple object textures at a range of indices (raw pointer version).

C++ equivalent: void setObjectTextures(const Texture* const*, NS::Range)

§Safety

The textures pointer must be a valid array with at least range.length elements.

Source

pub fn set_object_sampler_state_with_lod_clamps( &self, sampler: &SamplerState, lod_min_clamp: f32, lod_max_clamp: f32, index: UInteger, )

Set an object sampler state with LOD clamps.

C++ equivalent: void setObjectSamplerState(const SamplerState*, float, float, NS::UInteger)

Source

pub unsafe fn set_object_sampler_states_ptr( &self, samplers: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple object sampler states at a range of indices (raw pointer version).

C++ equivalent: void setObjectSamplerStates(const SamplerState* const*, NS::Range)

§Safety

The samplers pointer must be a valid array with at least range.length elements.

Source

pub unsafe fn set_object_sampler_states_with_lod_clamps_ptr( &self, samplers: *const *const c_void, lod_min_clamps: *const f32, lod_max_clamps: *const f32, range_location: UInteger, range_length: UInteger, )

Set multiple object sampler states with LOD clamps at a range of indices (raw pointer version).

C++ equivalent: void setObjectSamplerStates(const SamplerState* const*, const float*, const float*, NS::Range)

§Safety

The samplers, lod_min_clamps, and lod_max_clamps pointers must be valid arrays with at least range.length elements.

Source

pub fn set_mesh_buffer( &self, buffer: &Buffer, offset: UInteger, index: UInteger, )

Set a mesh buffer.

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

Source

pub fn set_mesh_texture(&self, texture: &Texture, index: UInteger)

Set a mesh texture.

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

Source

pub fn set_mesh_sampler_state(&self, sampler: &SamplerState, index: UInteger)

Set a mesh sampler state.

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

Source

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

Set the mesh buffer offset.

C++ equivalent: void setMeshBufferOffset(NS::UInteger, NS::UInteger)

Source

pub fn set_mesh_bytes(&self, bytes: &[u8], index: UInteger)

Set inline mesh bytes.

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

Source

pub unsafe fn set_mesh_buffers_ptr( &self, buffers: *const *const c_void, offsets: *const UInteger, range_location: UInteger, range_length: UInteger, )

Set multiple mesh buffers at a range of indices (raw pointer version).

C++ equivalent: void setMeshBuffers(const Buffer* const*, const NS::UInteger*, NS::Range)

§Safety

The buffers and offsets pointers must be valid arrays with at least range.length elements.

Source

pub unsafe fn set_mesh_textures_ptr( &self, textures: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple mesh textures at a range of indices (raw pointer version).

C++ equivalent: void setMeshTextures(const Texture* const*, NS::Range)

§Safety

The textures pointer must be a valid array with at least range.length elements.

Source

pub fn set_mesh_sampler_state_with_lod_clamps( &self, sampler: &SamplerState, lod_min_clamp: f32, lod_max_clamp: f32, index: UInteger, )

Set a mesh sampler state with LOD clamps.

C++ equivalent: void setMeshSamplerState(const SamplerState*, float, float, NS::UInteger)

Source

pub unsafe fn set_mesh_sampler_states_ptr( &self, samplers: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple mesh sampler states at a range of indices (raw pointer version).

C++ equivalent: void setMeshSamplerStates(const SamplerState* const*, NS::Range)

§Safety

The samplers pointer must be a valid array with at least range.length elements.

Source

pub unsafe fn set_mesh_sampler_states_with_lod_clamps_ptr( &self, samplers: *const *const c_void, lod_min_clamps: *const f32, lod_max_clamps: *const f32, range_location: UInteger, range_length: UInteger, )

Set multiple mesh sampler states with LOD clamps at a range of indices (raw pointer version).

C++ equivalent: void setMeshSamplerStates(const SamplerState* const*, const float*, const float*, NS::Range)

§Safety

The samplers, lod_min_clamps, and lod_max_clamps pointers must be valid arrays with at least range.length elements.

Source§

impl RenderCommandEncoder

Source

pub fn set_cull_mode(&self, cull_mode: CullMode)

Set the cull mode.

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

Source

pub fn set_front_facing_winding(&self, winding: Winding)

Set the front-facing winding order.

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

Source

pub fn set_triangle_fill_mode(&self, fill_mode: TriangleFillMode)

Set the triangle fill mode.

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

Source

pub fn set_depth_clip_mode(&self, mode: DepthClipMode)

Set the 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 the depth bias.

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

Source

pub fn set_depth_test_bounds(&self, min_bound: f32, max_bound: f32)

Set the depth test bounds.

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

Source

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

Set the depth stencil state.

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

Source

pub fn set_stencil_reference_value(&self, value: u32)

Set the stencil reference value (same for front and back).

C++ equivalent: void setStencilReferenceValue(uint32_t)

Source

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

Set the stencil reference values (separate front and back).

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

Source

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

Set the blend color.

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

Source

pub fn set_visibility_result_mode( &self, mode: VisibilityResultMode, offset: UInteger, )

Set the visibility result mode.

C++ equivalent: void setVisibilityResultMode(MTL::VisibilityResultMode, NS::UInteger)

Source

pub fn set_color_store_action( &self, store_action: StoreAction, attachment_index: UInteger, )

Set the color store action for an attachment.

C++ equivalent: void setColorStoreAction(MTL::StoreAction, NS::UInteger)

Source

pub fn set_color_store_action_options( &self, options: StoreActionOptions, attachment_index: UInteger, )

Set the color store action options for an attachment.

C++ equivalent: void setColorStoreActionOptions(MTL::StoreActionOptions, NS::UInteger)

Source

pub fn set_depth_store_action(&self, store_action: StoreAction)

Set the depth store action.

C++ equivalent: void setDepthStoreAction(MTL::StoreAction)

Source

pub fn set_depth_store_action_options(&self, options: StoreActionOptions)

Set the depth store action options.

C++ equivalent: void setDepthStoreActionOptions(MTL::StoreActionOptions)

Source

pub fn set_stencil_store_action(&self, store_action: StoreAction)

Set the stencil store action.

C++ equivalent: void setStencilStoreAction(MTL::StoreAction)

Source

pub fn set_stencil_store_action_options(&self, options: StoreActionOptions)

Set the stencil store action options.

C++ equivalent: void setStencilStoreActionOptions(MTL::StoreActionOptions)

Source§

impl RenderCommandEncoder

Source

pub fn set_tile_buffer( &self, buffer: &Buffer, offset: UInteger, index: UInteger, )

Set a tile buffer.

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

Source

pub fn set_tile_texture(&self, texture: &Texture, index: UInteger)

Set a tile texture.

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

Source

pub fn set_tile_sampler_state(&self, sampler: &SamplerState, index: UInteger)

Set a tile sampler state.

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

Source

pub fn set_tile_bytes(&self, bytes: &[u8], index: UInteger)

Set inline tile bytes.

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

Source

pub fn set_tile_buffer_offset(&self, offset: UInteger, index: UInteger)

Set the tile buffer offset.

C++ equivalent: void setTileBufferOffset(NS::UInteger, NS::UInteger)

Source

pub unsafe fn set_tile_buffers_ptr( &self, buffers: *const *const c_void, offsets: *const UInteger, range_location: UInteger, range_length: UInteger, )

Set multiple tile buffers at a range of indices (raw pointer version).

C++ equivalent: void setTileBuffers(const Buffer* const*, const NS::UInteger*, NS::Range)

§Safety

The buffers and offsets pointers must be valid arrays with at least range.length elements.

Source

pub unsafe fn set_tile_textures_ptr( &self, textures: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple tile textures at a range of indices (raw pointer version).

C++ equivalent: void setTileTextures(const Texture* const*, NS::Range)

§Safety

The textures pointer must be a valid array with at least range.length elements.

Source

pub fn set_tile_sampler_state_with_lod_clamps( &self, sampler: &SamplerState, lod_min_clamp: f32, lod_max_clamp: f32, index: UInteger, )

Set a tile sampler state with LOD clamps.

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

Source

pub unsafe fn set_tile_sampler_states_ptr( &self, samplers: *const *const c_void, range_location: UInteger, range_length: UInteger, )

Set multiple tile sampler states at a range of indices (raw pointer version).

C++ equivalent: void setTileSamplerStates(const SamplerState* const*, NS::Range)

§Safety

The samplers pointer must be a valid array with at least range.length elements.

Source

pub unsafe fn set_tile_sampler_states_with_lod_clamps_ptr( &self, samplers: *const *const c_void, lod_min_clamps: *const f32, lod_max_clamps: *const f32, range_location: UInteger, range_length: UInteger, )

Set multiple tile sampler states with LOD clamps at a range of indices (raw pointer version).

C++ equivalent: void setTileSamplerStates(const SamplerState* const*, const float*, const float*, NS::Range)

§Safety

The samplers, lod_min_clamps, and lod_max_clamps pointers must be valid arrays with at least range.length elements.

Source

pub fn tile_width(&self) -> UInteger

Get the tile width.

C++ equivalent: NS::UInteger tileWidth() const

Source

pub fn tile_height(&self) -> UInteger

Get the tile height.

C++ equivalent: NS::UInteger tileHeight() const

Source

pub fn set_threadgroup_memory_length( &self, length: UInteger, offset: UInteger, index: UInteger, )

Set the threadgroup memory length at an index with offset.

C++ equivalent: void setThreadgroupMemoryLength(NS::UInteger, NS::UInteger, NS::UInteger)

Source§

impl RenderCommandEncoder

Source

pub fn set_viewport(&self, viewport: Viewport)

Set the viewport.

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

Source

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

Set multiple viewports.

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

Source

pub fn set_scissor_rect(&self, rect: ScissorRect)

Set the scissor rectangle.

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

Source

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

Set multiple scissor rectangles.

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

Source§

impl RenderCommandEncoder

Source

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

Create a RenderCommandEncoder from a raw pointer.

§Safety

The pointer must be a valid Metal render command encoder object.

Source

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

Get the raw pointer to the encoder.

Source

pub fn device(&self) -> Device

Get the device that created this encoder.

C++ equivalent: Device* device() const

Source

pub fn command_buffer(&self) -> CommandBuffer

Get the command buffer that this encoder is encoding into.

C++ equivalent: CommandBuffer* commandBuffer() const

Source

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

Get the label for this encoder.

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

Source

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

Set the label for this encoder.

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

Source

pub fn end_encoding(&self)

End encoding commands with this encoder.

C++ equivalent: void endEncoding()

Source

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

Insert a debug signpost.

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

Source

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

Push a debug group.

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

Source

pub fn pop_debug_group(&self)

Pop the current debug group.

C++ equivalent: void popDebugGroup()

Source

pub fn barrier_after_queue_stages( &self, after_stages: Stages, before_stages: Stages, )

Insert a barrier to synchronize queue stages.

C++ equivalent: void barrierAfterQueueStages(Stages, Stages)

Source

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

Set the render pipeline state.

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

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.