pub struct MTLIndirectCommandBufferDescriptor { /* private fields */ }MTLIndirectCommandBuffer only.Expand description
Describes the limits and features that can be used in an indirect command
See also Apple’s documentation
Implementations§
Source§impl MTLIndirectCommandBufferDescriptor
impl MTLIndirectCommandBufferDescriptor
Sourcepub fn commandTypes(&self) -> MTLIndirectCommandType
pub fn commandTypes(&self) -> MTLIndirectCommandType
A bitfield of the command types that be encoded.
MTLCommandTypeDispatch cannot be mixed with any other command type.
Sourcepub fn setCommandTypes(&self, command_types: MTLIndirectCommandType)
pub fn setCommandTypes(&self, command_types: MTLIndirectCommandType)
Setter for commandTypes.
Sourcepub fn inheritPipelineState(&self) -> bool
pub fn inheritPipelineState(&self) -> bool
Whether the render or compute pipeline are inherited from the encoder
Sourcepub fn setInheritPipelineState(&self, inherit_pipeline_state: bool)
pub fn setInheritPipelineState(&self, inherit_pipeline_state: bool)
Setter for inheritPipelineState.
Sourcepub fn inheritBuffers(&self) -> bool
pub fn inheritBuffers(&self) -> bool
Whether the render or compute pipeline can set arguments.
Sourcepub fn setInheritBuffers(&self, inherit_buffers: bool)
pub fn setInheritBuffers(&self, inherit_buffers: bool)
Setter for inheritBuffers.
Sourcepub fn inheritDepthStencilState(&self) -> bool
pub fn inheritDepthStencilState(&self) -> bool
Configures whether the indirect command buffer inherits the depth stencil state from the encoder.
The property’s default value is <doc ://com.apple.documentation/documentation/swift/true>.
Sourcepub fn setInheritDepthStencilState(&self, inherit_depth_stencil_state: bool)
pub fn setInheritDepthStencilState(&self, inherit_depth_stencil_state: bool)
Setter for inheritDepthStencilState.
Sourcepub fn inheritDepthBias(&self) -> bool
pub fn inheritDepthBias(&self) -> bool
Configures whether the indirect command buffer inherits the depth bias from the encoder.
The property’s default value is <doc ://com.apple.documentation/documentation/swift/true>.
Sourcepub fn setInheritDepthBias(&self, inherit_depth_bias: bool)
pub fn setInheritDepthBias(&self, inherit_depth_bias: bool)
Setter for inheritDepthBias.
Sourcepub fn inheritDepthClipMode(&self) -> bool
pub fn inheritDepthClipMode(&self) -> bool
Configures whether the indirect command buffer inherits the depth clip mode from the encoder.
The property’s default value is <doc ://com.apple.documentation/documentation/swift/true>.
Sourcepub fn setInheritDepthClipMode(&self, inherit_depth_clip_mode: bool)
pub fn setInheritDepthClipMode(&self, inherit_depth_clip_mode: bool)
Setter for inheritDepthClipMode.
Sourcepub fn inheritCullMode(&self) -> bool
pub fn inheritCullMode(&self) -> bool
Configures whether the indirect command buffer inherits the cull mode from the encoder.
The property’s default value is <doc ://com.apple.documentation/documentation/swift/true>.
Sourcepub fn setInheritCullMode(&self, inherit_cull_mode: bool)
pub fn setInheritCullMode(&self, inherit_cull_mode: bool)
Setter for inheritCullMode.
Sourcepub fn inheritFrontFacingWinding(&self) -> bool
pub fn inheritFrontFacingWinding(&self) -> bool
Configures whether the indirect command buffer inherits the front facing winding from the encoder.
The property’s default value is <doc ://com.apple.documentation/documentation/swift/true>.
Sourcepub fn setInheritFrontFacingWinding(&self, inherit_front_facing_winding: bool)
pub fn setInheritFrontFacingWinding(&self, inherit_front_facing_winding: bool)
Setter for inheritFrontFacingWinding.
Sourcepub fn inheritTriangleFillMode(&self) -> bool
pub fn inheritTriangleFillMode(&self) -> bool
Configures whether the indirect command buffer inherits the triangle fill mode from the encoder.
The property’s default value is <doc ://com.apple.documentation/documentation/swift/true>.
Sourcepub fn setInheritTriangleFillMode(&self, inherit_triangle_fill_mode: bool)
pub fn setInheritTriangleFillMode(&self, inherit_triangle_fill_mode: bool)
Setter for inheritTriangleFillMode.
Sourcepub fn maxVertexBufferBindCount(&self) -> NSUInteger
pub fn maxVertexBufferBindCount(&self) -> NSUInteger
The maximum bind index of vertex argument buffers that can be set per command.
Sourcepub fn setMaxVertexBufferBindCount(
&self,
max_vertex_buffer_bind_count: NSUInteger,
)
pub fn setMaxVertexBufferBindCount( &self, max_vertex_buffer_bind_count: NSUInteger, )
Setter for maxVertexBufferBindCount.
Sourcepub fn maxFragmentBufferBindCount(&self) -> NSUInteger
pub fn maxFragmentBufferBindCount(&self) -> NSUInteger
The maximum bind index of fragment argument buffers that can be set per command.
Sourcepub fn setMaxFragmentBufferBindCount(
&self,
max_fragment_buffer_bind_count: NSUInteger,
)
pub fn setMaxFragmentBufferBindCount( &self, max_fragment_buffer_bind_count: NSUInteger, )
Setter for maxFragmentBufferBindCount.
Sourcepub fn maxKernelBufferBindCount(&self) -> NSUInteger
pub fn maxKernelBufferBindCount(&self) -> NSUInteger
The maximum bind index of kernel (or tile) argument buffers that can be set per command.
Sourcepub fn setMaxKernelBufferBindCount(
&self,
max_kernel_buffer_bind_count: NSUInteger,
)
pub fn setMaxKernelBufferBindCount( &self, max_kernel_buffer_bind_count: NSUInteger, )
Setter for maxKernelBufferBindCount.
Sourcepub fn maxKernelThreadgroupMemoryBindCount(&self) -> NSUInteger
pub fn maxKernelThreadgroupMemoryBindCount(&self) -> NSUInteger
The maximum bind index of kernel (or tile) threadgroup memory that can be set per command. The default value is 31.
Sourcepub unsafe fn setMaxKernelThreadgroupMemoryBindCount(
&self,
max_kernel_threadgroup_memory_bind_count: NSUInteger,
)
pub unsafe fn setMaxKernelThreadgroupMemoryBindCount( &self, max_kernel_threadgroup_memory_bind_count: NSUInteger, )
Sourcepub fn maxObjectBufferBindCount(&self) -> NSUInteger
pub fn maxObjectBufferBindCount(&self) -> NSUInteger
The maximum bind index of object stage buffers that can be set per render command.
Sourcepub unsafe fn setMaxObjectBufferBindCount(
&self,
max_object_buffer_bind_count: NSUInteger,
)
pub unsafe fn setMaxObjectBufferBindCount( &self, max_object_buffer_bind_count: NSUInteger, )
Sourcepub fn maxMeshBufferBindCount(&self) -> NSUInteger
pub fn maxMeshBufferBindCount(&self) -> NSUInteger
The maximum bind index of mesh stage buffers that can be set per render command.
Sourcepub unsafe fn setMaxMeshBufferBindCount(
&self,
max_mesh_buffer_bind_count: NSUInteger,
)
pub unsafe fn setMaxMeshBufferBindCount( &self, max_mesh_buffer_bind_count: NSUInteger, )
Sourcepub fn maxObjectThreadgroupMemoryBindCount(&self) -> NSUInteger
pub fn maxObjectThreadgroupMemoryBindCount(&self) -> NSUInteger
The maximum bind index of object threadgroup memory that can be set per render command. The default value is 0.
Sourcepub unsafe fn setMaxObjectThreadgroupMemoryBindCount(
&self,
max_object_threadgroup_memory_bind_count: NSUInteger,
)
pub unsafe fn setMaxObjectThreadgroupMemoryBindCount( &self, max_object_threadgroup_memory_bind_count: NSUInteger, )
Sourcepub fn supportRayTracing(&self) -> bool
pub fn supportRayTracing(&self) -> bool
Whether the render or compute commands can use ray tracing. Default value is NO.
Sourcepub fn setSupportRayTracing(&self, support_ray_tracing: bool)
pub fn setSupportRayTracing(&self, support_ray_tracing: bool)
Setter for supportRayTracing.
Sourcepub fn supportDynamicAttributeStride(&self) -> bool
pub fn supportDynamicAttributeStride(&self) -> bool
allows binding pipelines that have at least one MTLBufferLayout with a
stride of MTLBufferLayoutStrideDynamic
will allow setting attributeStride in setVertexBuffer / setKernelBuffer
calls
Sourcepub fn setSupportDynamicAttributeStride(
&self,
support_dynamic_attribute_stride: bool,
)
pub fn setSupportDynamicAttributeStride( &self, support_dynamic_attribute_stride: bool, )
Setter for supportDynamicAttributeStride.
Sourcepub fn supportColorAttachmentMapping(&self) -> bool
pub fn supportColorAttachmentMapping(&self) -> bool
Specifies if the indirect command buffer should support color attachment mapping.
Sourcepub fn setSupportColorAttachmentMapping(
&self,
support_color_attachment_mapping: bool,
)
pub fn setSupportColorAttachmentMapping( &self, support_color_attachment_mapping: bool, )
Setter for supportColorAttachmentMapping.
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 ClassType for MTLIndirectCommandBufferDescriptor
impl ClassType for MTLIndirectCommandBufferDescriptor
Source§const NAME: &'static str = "MTLIndirectCommandBufferDescriptor"
const NAME: &'static str = "MTLIndirectCommandBufferDescriptor"
Source§type ThreadKind = <<MTLIndirectCommandBufferDescriptor as ClassType>::Super as ClassType>::ThreadKind
type ThreadKind = <<MTLIndirectCommandBufferDescriptor as ClassType>::Super as ClassType>::ThreadKind
Source§impl CopyingHelper for MTLIndirectCommandBufferDescriptor
impl CopyingHelper for MTLIndirectCommandBufferDescriptor
Source§type Result = MTLIndirectCommandBufferDescriptor
type Result = MTLIndirectCommandBufferDescriptor
Self if the type has no
immutable counterpart. Read moreSource§impl NSCopying for MTLIndirectCommandBufferDescriptor
impl NSCopying for MTLIndirectCommandBufferDescriptor
Source§impl NSObjectProtocol for MTLIndirectCommandBufferDescriptor
impl NSObjectProtocol for MTLIndirectCommandBufferDescriptor
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