pub struct Function(/* private fields */);Expand description
A compiled shader function.
C++ equivalent: MTL::Function
Implementations§
Source§impl Function
impl Function
Sourcepub fn label(&self) -> Option<String>
pub fn label(&self) -> Option<String>
Get the label for this function.
C++ equivalent: NS::String* label() const
Sourcepub fn set_label(&self, label: &str)
pub fn set_label(&self, label: &str)
Set the label for this function.
C++ equivalent: void setLabel(const NS::String*)
Sourcepub fn device(&self) -> Device
pub fn device(&self) -> Device
Get the device that created this function.
C++ equivalent: Device* device() const
Sourcepub fn name(&self) -> Option<String>
pub fn name(&self) -> Option<String>
Get the function name.
C++ equivalent: NS::String* name() const
Sourcepub fn function_type(&self) -> FunctionType
pub fn function_type(&self) -> FunctionType
Get the function type.
C++ equivalent: FunctionType functionType() const
Sourcepub fn patch_type(&self) -> PatchType
pub fn patch_type(&self) -> PatchType
Get the patch type (for tessellation shaders).
C++ equivalent: PatchType patchType() const
Sourcepub fn patch_control_point_count(&self) -> Integer
pub fn patch_control_point_count(&self) -> Integer
Get the patch control point count (for tessellation shaders).
C++ equivalent: NS::Integer patchControlPointCount() const
Sourcepub fn options(&self) -> FunctionOptions
pub fn options(&self) -> FunctionOptions
Get the function options.
C++ equivalent: FunctionOptions options() const
Sourcepub fn function_constants_dictionary_raw(&self) -> *mut c_void
pub fn function_constants_dictionary_raw(&self) -> *mut c_void
Get the function constants dictionary (raw NSDictionary pointer).
C++ equivalent: NS::Dictionary* functionConstantsDictionary() const
Sourcepub fn stage_input_attributes_raw(&self) -> *mut c_void
pub fn stage_input_attributes_raw(&self) -> *mut c_void
Get the stage input attributes (raw NSArray pointer).
C++ equivalent: NS::Array* stageInputAttributes() const
Returns an array of Attribute objects.
Sourcepub fn vertex_attributes_raw(&self) -> *mut c_void
pub fn vertex_attributes_raw(&self) -> *mut c_void
Get the vertex attributes (raw NSArray pointer).
C++ equivalent: NS::Array* vertexAttributes() const
Returns an array of VertexAttribute objects (for vertex functions).
Sourcepub fn new_argument_encoder(
&self,
buffer_index: UInteger,
) -> Option<ArgumentEncoder>
pub fn new_argument_encoder( &self, buffer_index: UInteger, ) -> Option<ArgumentEncoder>
Create a new argument encoder for the buffer at the specified index.
C++ equivalent: ArgumentEncoder* newArgumentEncoder(NS::UInteger bufferIndex)
Sourcepub unsafe fn new_argument_encoder_with_reflection(
&self,
buffer_index: UInteger,
reflection: *mut *mut c_void,
) -> Option<ArgumentEncoder>
pub unsafe fn new_argument_encoder_with_reflection( &self, buffer_index: UInteger, reflection: *mut *mut c_void, ) -> Option<ArgumentEncoder>
Create a new argument encoder with reflection for the buffer at the specified index.
C++ equivalent: ArgumentEncoder* newArgumentEncoder(NS::UInteger bufferIndex, const AutoreleasedArgument* reflection)
§Safety
The reflection pointer must be a valid pointer to an Argument pointer, or null.