pub struct MTLRenderPipelineDescriptor { /* private fields */ }MTLRenderPipeline only.Expand description
Implementations§
Source§impl MTLRenderPipelineDescriptor
impl MTLRenderPipelineDescriptor
pub fn label(&self) -> Option<Retained<NSString>>
pub fn vertexFunction( &self, ) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>
MTLLibrary only.Sourcepub fn setVertexFunction(
&self,
vertex_function: Option<&ProtocolObject<dyn MTLFunction>>,
)
Available on crate feature MTLLibrary only.
pub fn setVertexFunction( &self, vertex_function: Option<&ProtocolObject<dyn MTLFunction>>, )
MTLLibrary only.Setter for vertexFunction.
pub fn fragmentFunction( &self, ) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>
MTLLibrary only.Sourcepub fn setFragmentFunction(
&self,
fragment_function: Option<&ProtocolObject<dyn MTLFunction>>,
)
Available on crate feature MTLLibrary only.
pub fn setFragmentFunction( &self, fragment_function: Option<&ProtocolObject<dyn MTLFunction>>, )
MTLLibrary only.Setter for fragmentFunction.
pub fn vertexDescriptor(&self) -> Option<Retained<MTLVertexDescriptor>>
MTLVertexDescriptor only.Sourcepub fn setVertexDescriptor(
&self,
vertex_descriptor: Option<&MTLVertexDescriptor>,
)
Available on crate feature MTLVertexDescriptor only.
pub fn setVertexDescriptor( &self, vertex_descriptor: Option<&MTLVertexDescriptor>, )
MTLVertexDescriptor only.Setter for vertexDescriptor.
This is copied when set.
pub fn sampleCount(&self) -> NSUInteger
Sourcepub fn setSampleCount(&self, sample_count: NSUInteger)
👎Deprecated
pub fn setSampleCount(&self, sample_count: NSUInteger)
Setter for sampleCount.
pub fn rasterSampleCount(&self) -> NSUInteger
Sourcepub fn setRasterSampleCount(&self, raster_sample_count: NSUInteger)
pub fn setRasterSampleCount(&self, raster_sample_count: NSUInteger)
Setter for rasterSampleCount.
pub fn isAlphaToCoverageEnabled(&self) -> bool
Sourcepub fn setAlphaToCoverageEnabled(&self, alpha_to_coverage_enabled: bool)
pub fn setAlphaToCoverageEnabled(&self, alpha_to_coverage_enabled: bool)
Setter for isAlphaToCoverageEnabled.
pub fn isAlphaToOneEnabled(&self) -> bool
Sourcepub fn setAlphaToOneEnabled(&self, alpha_to_one_enabled: bool)
pub fn setAlphaToOneEnabled(&self, alpha_to_one_enabled: bool)
Setter for isAlphaToOneEnabled.
pub fn isRasterizationEnabled(&self) -> bool
Sourcepub fn setRasterizationEnabled(&self, rasterization_enabled: bool)
pub fn setRasterizationEnabled(&self, rasterization_enabled: bool)
Setter for isRasterizationEnabled.
pub fn maxVertexAmplificationCount(&self) -> NSUInteger
Sourcepub unsafe fn setMaxVertexAmplificationCount(
&self,
max_vertex_amplification_count: NSUInteger,
)
pub unsafe fn setMaxVertexAmplificationCount( &self, max_vertex_amplification_count: NSUInteger, )
pub fn colorAttachments( &self, ) -> Retained<MTLRenderPipelineColorAttachmentDescriptorArray>
pub fn depthAttachmentPixelFormat(&self) -> MTLPixelFormat
MTLPixelFormat only.Sourcepub fn setDepthAttachmentPixelFormat(
&self,
depth_attachment_pixel_format: MTLPixelFormat,
)
Available on crate feature MTLPixelFormat only.
pub fn setDepthAttachmentPixelFormat( &self, depth_attachment_pixel_format: MTLPixelFormat, )
MTLPixelFormat only.Setter for depthAttachmentPixelFormat.
pub fn stencilAttachmentPixelFormat(&self) -> MTLPixelFormat
MTLPixelFormat only.Sourcepub fn setStencilAttachmentPixelFormat(
&self,
stencil_attachment_pixel_format: MTLPixelFormat,
)
Available on crate feature MTLPixelFormat only.
pub fn setStencilAttachmentPixelFormat( &self, stencil_attachment_pixel_format: MTLPixelFormat, )
MTLPixelFormat only.Setter for stencilAttachmentPixelFormat.
pub fn inputPrimitiveTopology(&self) -> MTLPrimitiveTopologyClass
Sourcepub unsafe fn setInputPrimitiveTopology(
&self,
input_primitive_topology: MTLPrimitiveTopologyClass,
)
pub unsafe fn setInputPrimitiveTopology( &self, input_primitive_topology: MTLPrimitiveTopologyClass, )
Setter for inputPrimitiveTopology.
pub fn tessellationPartitionMode(&self) -> MTLTessellationPartitionMode
Sourcepub unsafe fn setTessellationPartitionMode(
&self,
tessellation_partition_mode: MTLTessellationPartitionMode,
)
pub unsafe fn setTessellationPartitionMode( &self, tessellation_partition_mode: MTLTessellationPartitionMode, )
Setter for tessellationPartitionMode.
pub fn maxTessellationFactor(&self) -> NSUInteger
Sourcepub unsafe fn setMaxTessellationFactor(
&self,
max_tessellation_factor: NSUInteger,
)
pub unsafe fn setMaxTessellationFactor( &self, max_tessellation_factor: NSUInteger, )
Setter for maxTessellationFactor.
pub fn isTessellationFactorScaleEnabled(&self) -> bool
Sourcepub fn setTessellationFactorScaleEnabled(
&self,
tessellation_factor_scale_enabled: bool,
)
pub fn setTessellationFactorScaleEnabled( &self, tessellation_factor_scale_enabled: bool, )
Setter for isTessellationFactorScaleEnabled.
pub fn tessellationFactorFormat(&self) -> MTLTessellationFactorFormat
Sourcepub fn setTessellationFactorFormat(
&self,
tessellation_factor_format: MTLTessellationFactorFormat,
)
pub fn setTessellationFactorFormat( &self, tessellation_factor_format: MTLTessellationFactorFormat, )
Setter for tessellationFactorFormat.
pub fn tessellationControlPointIndexType( &self, ) -> MTLTessellationControlPointIndexType
Sourcepub unsafe fn setTessellationControlPointIndexType(
&self,
tessellation_control_point_index_type: MTLTessellationControlPointIndexType,
)
pub unsafe fn setTessellationControlPointIndexType( &self, tessellation_control_point_index_type: MTLTessellationControlPointIndexType, )
Setter for tessellationControlPointIndexType.
pub fn tessellationFactorStepFunction( &self, ) -> MTLTessellationFactorStepFunction
Sourcepub fn setTessellationFactorStepFunction(
&self,
tessellation_factor_step_function: MTLTessellationFactorStepFunction,
)
pub fn setTessellationFactorStepFunction( &self, tessellation_factor_step_function: MTLTessellationFactorStepFunction, )
Setter for tessellationFactorStepFunction.
pub fn tessellationOutputWindingOrder(&self) -> MTLWinding
MTLRenderCommandEncoder only.Sourcepub fn setTessellationOutputWindingOrder(
&self,
tessellation_output_winding_order: MTLWinding,
)
Available on crate feature MTLRenderCommandEncoder only.
pub fn setTessellationOutputWindingOrder( &self, tessellation_output_winding_order: MTLWinding, )
MTLRenderCommandEncoder only.Setter for tessellationOutputWindingOrder.
pub fn vertexBuffers(&self) -> Retained<MTLPipelineBufferDescriptorArray>
MTLPipeline only.pub fn fragmentBuffers(&self) -> Retained<MTLPipelineBufferDescriptorArray>
MTLPipeline only.pub fn supportIndirectCommandBuffers(&self) -> bool
Sourcepub fn setSupportIndirectCommandBuffers(
&self,
support_indirect_command_buffers: bool,
)
pub fn setSupportIndirectCommandBuffers( &self, support_indirect_command_buffers: bool, )
Setter for supportIndirectCommandBuffers.
Sourcepub fn binaryArchives(
&self,
) -> Option<Retained<NSArray<ProtocolObject<dyn MTLBinaryArchive>>>>
Available on crate feature MTLBinaryArchive only.
pub fn binaryArchives( &self, ) -> Option<Retained<NSArray<ProtocolObject<dyn MTLBinaryArchive>>>>
MTLBinaryArchive only.The set of MTLBinaryArchive to search for compiled code when creating the pipeline state.
Accelerate pipeline state creation by providing archives of compiled code such that no compilation needs to happen on the fast path.
See: MTLBinaryArchive
Sourcepub fn setBinaryArchives(
&self,
binary_archives: Option<&NSArray<ProtocolObject<dyn MTLBinaryArchive>>>,
)
Available on crate feature MTLBinaryArchive only.
pub fn setBinaryArchives( &self, binary_archives: Option<&NSArray<ProtocolObject<dyn MTLBinaryArchive>>>, )
MTLBinaryArchive only.Setter for binaryArchives.
This is copied when set.
Sourcepub fn vertexPreloadedLibraries(
&self,
) -> Retained<NSArray<ProtocolObject<dyn MTLDynamicLibrary>>>
Available on crate feature MTLDynamicLibrary only.
pub fn vertexPreloadedLibraries( &self, ) -> Retained<NSArray<ProtocolObject<dyn MTLDynamicLibrary>>>
MTLDynamicLibrary only.The set of MTLDynamicLibrary to use to resolve external symbols for the vertexFunction before considering symbols from dependent MTLDynamicLibrary.
Typical workflows use the libraries property of MTLCompileOptions to record dependent libraries at compile time without having to use vertexPreloadedLibraries. This property can be used to override symbols from dependent libraries for experimentation or evaluating alternative implementations. It can also be used to provide dynamic libraries that are dynamically created (for example, from source) that have no stable installName that can be used to automatically load from the file system.
See: MTLDynamicLibrary
Sourcepub fn setVertexPreloadedLibraries(
&self,
vertex_preloaded_libraries: &NSArray<ProtocolObject<dyn MTLDynamicLibrary>>,
)
Available on crate feature MTLDynamicLibrary only.
pub fn setVertexPreloadedLibraries( &self, vertex_preloaded_libraries: &NSArray<ProtocolObject<dyn MTLDynamicLibrary>>, )
MTLDynamicLibrary only.Setter for vertexPreloadedLibraries.
This is copied when set.
Sourcepub fn fragmentPreloadedLibraries(
&self,
) -> Retained<NSArray<ProtocolObject<dyn MTLDynamicLibrary>>>
Available on crate feature MTLDynamicLibrary only.
pub fn fragmentPreloadedLibraries( &self, ) -> Retained<NSArray<ProtocolObject<dyn MTLDynamicLibrary>>>
MTLDynamicLibrary only.The set of MTLDynamicLibrary to use to resolve external symbols for the fragmentFunction before considering symbols from dependent MTLDynamicLibrary.
Typical workflows use the libraries property of MTLCompileOptions to record dependent libraries at compile time without having to use fragmentPreloadedLibraries. This property can be used to override symbols from dependent libraries for experimentation or evaluating alternative implementations. It can also be used to provide dynamic libraries that are dynamically created (for example, from source) that have no stable installName that can be used to automatically load from the file system.
See: MTLDynamicLibrary
Sourcepub fn setFragmentPreloadedLibraries(
&self,
fragment_preloaded_libraries: &NSArray<ProtocolObject<dyn MTLDynamicLibrary>>,
)
Available on crate feature MTLDynamicLibrary only.
pub fn setFragmentPreloadedLibraries( &self, fragment_preloaded_libraries: &NSArray<ProtocolObject<dyn MTLDynamicLibrary>>, )
MTLDynamicLibrary only.Setter for fragmentPreloadedLibraries.
This is copied when set.
Sourcepub fn vertexLinkedFunctions(&self) -> Retained<MTLLinkedFunctions>
Available on crate feature MTLLinkedFunctions only.
pub fn vertexLinkedFunctions(&self) -> Retained<MTLLinkedFunctions>
MTLLinkedFunctions only.The set of functions to be linked with the pipeline state and accessed from the vertex function.
See: MTLLinkedFunctions
Sourcepub fn setVertexLinkedFunctions(
&self,
vertex_linked_functions: Option<&MTLLinkedFunctions>,
)
Available on crate feature MTLLinkedFunctions only.
pub fn setVertexLinkedFunctions( &self, vertex_linked_functions: Option<&MTLLinkedFunctions>, )
MTLLinkedFunctions only.Setter for vertexLinkedFunctions.
This is copied when set.
Sourcepub fn fragmentLinkedFunctions(&self) -> Retained<MTLLinkedFunctions>
Available on crate feature MTLLinkedFunctions only.
pub fn fragmentLinkedFunctions(&self) -> Retained<MTLLinkedFunctions>
MTLLinkedFunctions only.The set of functions to be linked with the pipeline state and accessed from the fragment function.
See: MTLLinkedFunctions
Sourcepub fn setFragmentLinkedFunctions(
&self,
fragment_linked_functions: Option<&MTLLinkedFunctions>,
)
Available on crate feature MTLLinkedFunctions only.
pub fn setFragmentLinkedFunctions( &self, fragment_linked_functions: Option<&MTLLinkedFunctions>, )
MTLLinkedFunctions only.Setter for fragmentLinkedFunctions.
This is copied when set.
Sourcepub fn supportAddingVertexBinaryFunctions(&self) -> bool
pub fn supportAddingVertexBinaryFunctions(&self) -> bool
This flag makes this pipeline support creating a new pipeline by adding binary functions.
Sourcepub fn setSupportAddingVertexBinaryFunctions(
&self,
support_adding_vertex_binary_functions: bool,
)
pub fn setSupportAddingVertexBinaryFunctions( &self, support_adding_vertex_binary_functions: bool, )
Setter for supportAddingVertexBinaryFunctions.
Sourcepub fn supportAddingFragmentBinaryFunctions(&self) -> bool
pub fn supportAddingFragmentBinaryFunctions(&self) -> bool
This flag makes this pipeline support creating a new pipeline by adding binary functions.
Sourcepub fn setSupportAddingFragmentBinaryFunctions(
&self,
support_adding_fragment_binary_functions: bool,
)
pub fn setSupportAddingFragmentBinaryFunctions( &self, support_adding_fragment_binary_functions: bool, )
Setter for supportAddingFragmentBinaryFunctions.
Sourcepub fn maxVertexCallStackDepth(&self) -> NSUInteger
pub fn maxVertexCallStackDepth(&self) -> NSUInteger
The maximum depth of the call stack in stack frames from the shader. Defaults to 1 additional stack frame.
Sourcepub fn setMaxVertexCallStackDepth(
&self,
max_vertex_call_stack_depth: NSUInteger,
)
pub fn setMaxVertexCallStackDepth( &self, max_vertex_call_stack_depth: NSUInteger, )
Setter for maxVertexCallStackDepth.
Sourcepub fn maxFragmentCallStackDepth(&self) -> NSUInteger
pub fn maxFragmentCallStackDepth(&self) -> NSUInteger
The maximum depth of the call stack in stack frames from the shader. Defaults to 1 additional stack frame.
Sourcepub fn setMaxFragmentCallStackDepth(
&self,
max_fragment_call_stack_depth: NSUInteger,
)
pub fn setMaxFragmentCallStackDepth( &self, max_fragment_call_stack_depth: NSUInteger, )
Setter for maxFragmentCallStackDepth.
Sourcepub fn shaderValidation(&self) -> MTLShaderValidation
Available on crate feature MTLPipeline only.
pub fn shaderValidation(&self) -> MTLShaderValidation
MTLPipeline only.Toggle that determines whether Metal Shader Validation should be enabled or disabled for the pipeline.
The value can be overridden using MTL_SHADER_VALIDATION_ENABLE_PIPELINES or MTL_SHADER_VALIDATION_DISABLE_PIPELINES Environment Variables.
Sourcepub fn setShaderValidation(&self, shader_validation: MTLShaderValidation)
Available on crate feature MTLPipeline only.
pub fn setShaderValidation(&self, shader_validation: MTLShaderValidation)
MTLPipeline only.Setter for shaderValidation.
Methods from Deref<Target = NSObject>§
Sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
Sourcepub fn class(&self) -> &'static AnyClass
pub fn class(&self) -> &'static AnyClass
Dynamically find the class of this object.
§Panics
May panic if the object is invalid (which may be the case for objects
returned from unavailable init/new methods).
§Example
Check that an instance of NSObject has the precise class NSObject.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load instead.Use Ivar::load instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T.
See Ivar::load_ptr for details surrounding this.
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
Attempt to downcast the object to a class of type T.
This is the reference-variant. Use Retained::downcast if you want
to convert a retained object to another type.
§Mutable classes
Some classes have immutable and mutable variants, such as NSString
and NSMutableString.
When some Objective-C API signature says it gives you an immutable class, it generally expects you to not mutate that, even though it may technically be mutable “under the hood”.
So using this method to convert a NSString to a NSMutableString,
while not unsound, is generally frowned upon unless you created the
string yourself, or the API explicitly documents the string to be
mutable.
See Apple’s documentation on mutability and on
isKindOfClass: for more details.
§Generic classes
Objective-C generics are called “lightweight generics”, and that’s because they aren’t exposed in the runtime. This makes it impossible to safely downcast to generic collections, so this is disallowed by this method.
You can, however, safely downcast to generic collections where all the
type-parameters are AnyObject.
§Panics
This works internally by calling isKindOfClass:. That means that the
object must have the instance method of that name, and an exception
will be thrown (if CoreFoundation is linked) or the process will abort
if that is not the case. In the vast majority of cases, you don’t need
to worry about this, since both root objects NSObject and
NSProxy implement this method.
§Examples
Cast an NSString back and forth from NSObject.
use objc2::rc::Retained;
use objc2_foundation::{NSObject, NSString};
let obj: Retained<NSObject> = NSString::new().into_super();
let string = obj.downcast_ref::<NSString>().unwrap();
// Or with `downcast`, if we do not need the object afterwards
let string = obj.downcast::<NSString>().unwrap();Try (and fail) to cast an NSObject to an NSString.
use objc2_foundation::{NSObject, NSString};
let obj = NSObject::new();
assert!(obj.downcast_ref::<NSString>().is_none());Try to cast to an array of strings.
use objc2_foundation::{NSArray, NSObject, NSString};
let arr = NSArray::from_retained_slice(&[NSObject::new()]);
// This is invalid and doesn't type check.
let arr = arr.downcast_ref::<NSArray<NSString>>();This fails to compile, since it would require enumerating over the array to ensure that each element is of the desired type, which is a performance pitfall.
Downcast when processing each element instead.
use objc2_foundation::{NSArray, NSObject, NSString};
let arr = NSArray::from_retained_slice(&[NSObject::new()]);
for elem in arr {
if let Some(data) = elem.downcast_ref::<NSString>() {
// handle `data`
}
}Trait Implementations§
Source§impl AsRef<AnyObject> for MTLRenderPipelineDescriptor
impl AsRef<AnyObject> for MTLRenderPipelineDescriptor
Source§impl AsRef<NSObject> for MTLRenderPipelineDescriptor
impl AsRef<NSObject> for MTLRenderPipelineDescriptor
Source§impl Borrow<NSObject> for MTLRenderPipelineDescriptor
impl Borrow<NSObject> for MTLRenderPipelineDescriptor
Source§impl ClassType for MTLRenderPipelineDescriptor
impl ClassType for MTLRenderPipelineDescriptor
Source§const NAME: &'static str = "MTLRenderPipelineDescriptor"
const NAME: &'static str = "MTLRenderPipelineDescriptor"
Source§type ThreadKind = <<MTLRenderPipelineDescriptor as ClassType>::Super as ClassType>::ThreadKind
type ThreadKind = <<MTLRenderPipelineDescriptor as ClassType>::Super as ClassType>::ThreadKind
Source§impl CopyingHelper for MTLRenderPipelineDescriptor
impl CopyingHelper for MTLRenderPipelineDescriptor
Source§type Result = MTLRenderPipelineDescriptor
type Result = MTLRenderPipelineDescriptor
Self if the type has no
immutable counterpart. Read moreSource§impl Debug for MTLRenderPipelineDescriptor
impl Debug for MTLRenderPipelineDescriptor
Source§impl Deref for MTLRenderPipelineDescriptor
impl Deref for MTLRenderPipelineDescriptor
Source§impl Hash for MTLRenderPipelineDescriptor
impl Hash for MTLRenderPipelineDescriptor
Source§impl NSCopying for MTLRenderPipelineDescriptor
impl NSCopying for MTLRenderPipelineDescriptor
Source§impl NSObjectProtocol for MTLRenderPipelineDescriptor
impl NSObjectProtocol for MTLRenderPipelineDescriptor
Source§fn isEqual(&self, other: Option<&AnyObject>) -> bool
fn isEqual(&self, other: Option<&AnyObject>) -> bool
Source§fn hash(&self) -> usize
fn hash(&self) -> usize
Source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
isKindOfClass directly, or cast your objects with AnyObject::downcast_ref