pub struct ArgumentEncoder(/* private fields */);Expand description
An encoder for encoding resources into argument buffers.
C++ equivalent: MTL::ArgumentEncoder
Implementations§
Source§impl ArgumentEncoder
impl ArgumentEncoder
Sourcepub fn alignment(&self) -> UInteger
pub fn alignment(&self) -> UInteger
Get the alignment of the encoded data.
C++ equivalent: NS::UInteger alignment() const
Sourcepub fn constant_data(&self, index: UInteger) -> *mut c_void
pub fn constant_data(&self, index: UInteger) -> *mut c_void
Get a pointer to the constant data at the given index.
C++ equivalent: void* constantData(NS::UInteger index)
Sourcepub fn device(&self) -> Device
pub fn device(&self) -> Device
Get the device that created this encoder.
C++ equivalent: Device* device() const
Sourcepub fn encoded_length(&self) -> UInteger
pub fn encoded_length(&self) -> UInteger
Get the encoded length in bytes.
C++ equivalent: NS::UInteger encodedLength() const
Sourcepub fn set_label(&self, label: &str)
pub fn set_label(&self, label: &str)
Set the label.
C++ equivalent: void setLabel(const NS::String* label)
Sourcepub fn new_argument_encoder(&self, index: UInteger) -> Option<ArgumentEncoder>
pub fn new_argument_encoder(&self, index: UInteger) -> Option<ArgumentEncoder>
Create a new argument encoder for a nested buffer at the given index.
C++ equivalent: ArgumentEncoder* newArgumentEncoder(NS::UInteger index)
Sourcepub fn set_argument_buffer(&self, buffer: &Buffer, offset: UInteger)
pub fn set_argument_buffer(&self, buffer: &Buffer, offset: UInteger)
Set the argument buffer to encode into.
C++ equivalent: void setArgumentBuffer(const MTL::Buffer* argumentBuffer, NS::UInteger offset)
Sourcepub fn set_argument_buffer_with_array_element(
&self,
buffer: &Buffer,
start_offset: UInteger,
array_element: UInteger,
)
pub fn set_argument_buffer_with_array_element( &self, buffer: &Buffer, start_offset: UInteger, array_element: UInteger, )
Set the argument buffer with array element.
C++ equivalent: void setArgumentBuffer(const MTL::Buffer*, NS::UInteger, NS::UInteger)
Sourcepub fn set_buffer(&self, buffer: &Buffer, offset: UInteger, index: UInteger)
pub fn set_buffer(&self, buffer: &Buffer, offset: UInteger, index: UInteger)
Set a buffer at the given index.
C++ equivalent: void setBuffer(const MTL::Buffer*, NS::UInteger, NS::UInteger)
Sourcepub fn set_texture(&self, texture: &Texture, index: UInteger)
pub fn set_texture(&self, texture: &Texture, index: UInteger)
Set a texture at the given index.
C++ equivalent: void setTexture(const MTL::Texture*, NS::UInteger)
Sourcepub fn set_sampler_state(&self, sampler: &SamplerState, index: UInteger)
pub fn set_sampler_state(&self, sampler: &SamplerState, index: UInteger)
Set a sampler state at the given index.
C++ equivalent: void setSamplerState(const MTL::SamplerState*, NS::UInteger)
Sourcepub fn set_render_pipeline_state(
&self,
pipeline: &RenderPipelineState,
index: UInteger,
)
pub fn set_render_pipeline_state( &self, pipeline: &RenderPipelineState, index: UInteger, )
Set a render pipeline state at the given index.
C++ equivalent: void setRenderPipelineState(const MTL::RenderPipelineState*, NS::UInteger)
Sourcepub fn set_compute_pipeline_state(
&self,
pipeline: &ComputePipelineState,
index: UInteger,
)
pub fn set_compute_pipeline_state( &self, pipeline: &ComputePipelineState, index: UInteger, )
Set a compute pipeline state at the given index.
C++ equivalent: void setComputePipelineState(const MTL::ComputePipelineState*, NS::UInteger)
Sourcepub fn set_depth_stencil_state(
&self,
state: &DepthStencilState,
index: UInteger,
)
pub fn set_depth_stencil_state( &self, state: &DepthStencilState, index: UInteger, )
Set a depth stencil state at the given index.
C++ equivalent: void setDepthStencilState(const MTL::DepthStencilState*, NS::UInteger)
Sourcepub fn set_acceleration_structure(
&self,
acceleration_structure: &AccelerationStructure,
index: UInteger,
)
pub fn set_acceleration_structure( &self, acceleration_structure: &AccelerationStructure, index: UInteger, )
Set an acceleration structure at the given index.
C++ equivalent: void setAccelerationStructure(const MTL::AccelerationStructure*, NS::UInteger)
Sourcepub fn set_indirect_command_buffer_ptr(
&self,
buffer: *const c_void,
index: UInteger,
)
pub fn set_indirect_command_buffer_ptr( &self, buffer: *const c_void, index: UInteger, )
Set an indirect command buffer at the given index.
C++ equivalent: void setIndirectCommandBuffer(const MTL::IndirectCommandBuffer*, NS::UInteger)
Sourcepub fn set_visible_function_table_ptr(
&self,
table: *const c_void,
index: UInteger,
)
pub fn set_visible_function_table_ptr( &self, table: *const c_void, index: UInteger, )
Set a visible function table at the given index.
C++ equivalent: void setVisibleFunctionTable(const MTL::VisibleFunctionTable*, NS::UInteger)
Sourcepub fn set_intersection_function_table_ptr(
&self,
table: *const c_void,
index: UInteger,
)
pub fn set_intersection_function_table_ptr( &self, table: *const c_void, index: UInteger, )
Set an intersection function table at the given index.
C++ equivalent: void setIntersectionFunctionTable(const MTL::IntersectionFunctionTable*, NS::UInteger)