use crate::common::*;
use crate::Foundation::*;
use crate::Metal::*;
ns_enum!(
#[underlying(NSUInteger)]
pub enum MTLPrimitiveType {
MTLPrimitiveTypePoint = 0,
MTLPrimitiveTypeLine = 1,
MTLPrimitiveTypeLineStrip = 2,
MTLPrimitiveTypeTriangle = 3,
MTLPrimitiveTypeTriangleStrip = 4,
}
);
ns_enum!(
#[underlying(NSUInteger)]
pub enum MTLVisibilityResultMode {
MTLVisibilityResultModeDisabled = 0,
MTLVisibilityResultModeBoolean = 1,
MTLVisibilityResultModeCounting = 2,
}
);
extern_struct!(
#[encoding_name("?")]
pub struct MTLScissorRect {
pub x: NSUInteger,
pub y: NSUInteger,
pub width: NSUInteger,
pub height: NSUInteger,
}
);
extern_struct!(
#[encoding_name("?")]
pub struct MTLViewport {
pub originX: c_double,
pub originY: c_double,
pub width: c_double,
pub height: c_double,
pub znear: c_double,
pub zfar: c_double,
}
);
ns_enum!(
#[underlying(NSUInteger)]
pub enum MTLCullMode {
MTLCullModeNone = 0,
MTLCullModeFront = 1,
MTLCullModeBack = 2,
}
);
ns_enum!(
#[underlying(NSUInteger)]
pub enum MTLWinding {
MTLWindingClockwise = 0,
MTLWindingCounterClockwise = 1,
}
);
ns_enum!(
#[underlying(NSUInteger)]
pub enum MTLDepthClipMode {
MTLDepthClipModeClip = 0,
MTLDepthClipModeClamp = 1,
}
);
ns_enum!(
#[underlying(NSUInteger)]
pub enum MTLTriangleFillMode {
MTLTriangleFillModeFill = 0,
MTLTriangleFillModeLines = 1,
}
);
extern_struct!(
#[encoding_name("?")]
pub struct MTLDrawPrimitivesIndirectArguments {
pub vertexCount: u32,
pub instanceCount: u32,
pub vertexStart: u32,
pub baseInstance: u32,
}
);
extern_struct!(
#[encoding_name("?")]
pub struct MTLDrawIndexedPrimitivesIndirectArguments {
pub indexCount: u32,
pub instanceCount: u32,
pub indexStart: u32,
pub baseVertex: i32,
pub baseInstance: u32,
}
);
extern_struct!(
#[encoding_name("?")]
pub struct MTLVertexAmplificationViewMapping {
pub viewportArrayIndexOffset: u32,
pub renderTargetArrayIndexOffset: u32,
}
);
extern_struct!(
#[encoding_name("?")]
pub struct MTLDrawPatchIndirectArguments {
pub patchCount: u32,
pub instanceCount: u32,
pub patchStart: u32,
pub baseInstance: u32,
}
);
extern_struct!(
#[encoding_name("?")]
pub struct MTLQuadTessellationFactorsHalf {
pub edgeTessellationFactor: [u16; 4],
pub insideTessellationFactor: [u16; 2],
}
);
extern_struct!(
#[encoding_name("?")]
pub struct MTLTriangleTessellationFactorsHalf {
pub edgeTessellationFactor: [u16; 3],
pub insideTessellationFactor: u16,
}
);
ns_options!(
#[underlying(NSUInteger)]
pub enum MTLRenderStages {
MTLRenderStageVertex = 1 << 0,
MTLRenderStageFragment = 1 << 1,
MTLRenderStageTile = 1 << 2,
MTLRenderStageObject = 1 << 3,
MTLRenderStageMesh = 1 << 4,
}
);
extern_protocol!(
pub unsafe trait MTLRenderCommandEncoder: MTLCommandEncoder {
#[method(setRenderPipelineState:)]
fn setRenderPipelineState(
&self,
pipeline_state: &ProtocolObject<dyn MTLRenderPipelineState>,
);
#[method(setVertexBytes:length:atIndex:)]
unsafe fn setVertexBytes_length_atIndex(
&self,
bytes: NonNull<c_void>,
length: NSUInteger,
index: NSUInteger,
);
#[method(setVertexBuffer:offset:atIndex:)]
unsafe fn setVertexBuffer_offset_atIndex(
&self,
buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
offset: NSUInteger,
index: NSUInteger,
);
#[method(setVertexBufferOffset:atIndex:)]
unsafe fn setVertexBufferOffset_atIndex(&self, offset: NSUInteger, index: NSUInteger);
#[method(setVertexBuffers:offsets:withRange:)]
unsafe fn setVertexBuffers_offsets_withRange(
&self,
buffers: NonNull<*const ProtocolObject<dyn MTLBuffer>>,
offsets: NonNull<NSUInteger>,
range: NSRange,
);
#[method(setVertexBuffer:offset:attributeStride:atIndex:)]
unsafe fn setVertexBuffer_offset_attributeStride_atIndex(
&self,
buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
offset: NSUInteger,
stride: NSUInteger,
index: NSUInteger,
);
#[method(setVertexBuffers:offsets:attributeStrides:withRange:)]
unsafe fn setVertexBuffers_offsets_attributeStrides_withRange(
&self,
buffers: NonNull<*const ProtocolObject<dyn MTLBuffer>>,
offsets: NonNull<NSUInteger>,
strides: NonNull<NSUInteger>,
range: NSRange,
);
#[method(setVertexBufferOffset:attributeStride:atIndex:)]
unsafe fn setVertexBufferOffset_attributeStride_atIndex(
&self,
offset: NSUInteger,
stride: NSUInteger,
index: NSUInteger,
);
#[method(setVertexBytes:length:attributeStride:atIndex:)]
unsafe fn setVertexBytes_length_attributeStride_atIndex(
&self,
bytes: NonNull<c_void>,
length: NSUInteger,
stride: NSUInteger,
index: NSUInteger,
);
#[method(setVertexTexture:atIndex:)]
unsafe fn setVertexTexture_atIndex(
&self,
texture: Option<&ProtocolObject<dyn MTLTexture>>,
index: NSUInteger,
);
#[method(setVertexTextures:withRange:)]
unsafe fn setVertexTextures_withRange(
&self,
textures: NonNull<*const ProtocolObject<dyn MTLTexture>>,
range: NSRange,
);
#[method(setVertexSamplerState:atIndex:)]
unsafe fn setVertexSamplerState_atIndex(
&self,
sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
index: NSUInteger,
);
#[method(setVertexSamplerStates:withRange:)]
unsafe fn setVertexSamplerStates_withRange(
&self,
samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
range: NSRange,
);
#[method(setVertexSamplerState:lodMinClamp:lodMaxClamp:atIndex:)]
unsafe fn setVertexSamplerState_lodMinClamp_lodMaxClamp_atIndex(
&self,
sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
lod_min_clamp: c_float,
lod_max_clamp: c_float,
index: NSUInteger,
);
#[method(setVertexSamplerStates:lodMinClamps:lodMaxClamps:withRange:)]
unsafe fn setVertexSamplerStates_lodMinClamps_lodMaxClamps_withRange(
&self,
samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
lod_min_clamps: NonNull<c_float>,
lod_max_clamps: NonNull<c_float>,
range: NSRange,
);
#[method(setVertexVisibleFunctionTable:atBufferIndex:)]
unsafe fn setVertexVisibleFunctionTable_atBufferIndex(
&self,
function_table: Option<&ProtocolObject<dyn MTLVisibleFunctionTable>>,
buffer_index: NSUInteger,
);
#[method(setVertexVisibleFunctionTables:withBufferRange:)]
unsafe fn setVertexVisibleFunctionTables_withBufferRange(
&self,
function_tables: NonNull<*const ProtocolObject<dyn MTLVisibleFunctionTable>>,
range: NSRange,
);
#[method(setVertexIntersectionFunctionTable:atBufferIndex:)]
unsafe fn setVertexIntersectionFunctionTable_atBufferIndex(
&self,
intersection_function_table: Option<&ProtocolObject<dyn MTLIntersectionFunctionTable>>,
buffer_index: NSUInteger,
);
#[method(setVertexIntersectionFunctionTables:withBufferRange:)]
unsafe fn setVertexIntersectionFunctionTables_withBufferRange(
&self,
intersection_function_tables: NonNull<
*const ProtocolObject<dyn MTLIntersectionFunctionTable>,
>,
range: NSRange,
);
#[method(setVertexAccelerationStructure:atBufferIndex:)]
unsafe fn setVertexAccelerationStructure_atBufferIndex(
&self,
acceleration_structure: Option<&ProtocolObject<dyn MTLAccelerationStructure>>,
buffer_index: NSUInteger,
);
#[method(setViewport:)]
fn setViewport(&self, viewport: MTLViewport);
#[method(setViewports:count:)]
unsafe fn setViewports_count(&self, viewports: NonNull<MTLViewport>, count: NSUInteger);
#[method(setFrontFacingWinding:)]
fn setFrontFacingWinding(&self, front_facing_winding: MTLWinding);
#[method(setVertexAmplificationCount:viewMappings:)]
unsafe fn setVertexAmplificationCount_viewMappings(
&self,
count: NSUInteger,
view_mappings: *mut MTLVertexAmplificationViewMapping,
);
#[method(setCullMode:)]
fn setCullMode(&self, cull_mode: MTLCullMode);
#[method(setDepthClipMode:)]
fn setDepthClipMode(&self, depth_clip_mode: MTLDepthClipMode);
#[method(setDepthBias:slopeScale:clamp:)]
fn setDepthBias_slopeScale_clamp(
&self,
depth_bias: c_float,
slope_scale: c_float,
clamp: c_float,
);
#[method(setScissorRect:)]
fn setScissorRect(&self, rect: MTLScissorRect);
#[method(setScissorRects:count:)]
unsafe fn setScissorRects_count(
&self,
scissor_rects: NonNull<MTLScissorRect>,
count: NSUInteger,
);
#[method(setTriangleFillMode:)]
fn setTriangleFillMode(&self, fill_mode: MTLTriangleFillMode);
#[method(setFragmentBytes:length:atIndex:)]
unsafe fn setFragmentBytes_length_atIndex(
&self,
bytes: NonNull<c_void>,
length: NSUInteger,
index: NSUInteger,
);
#[method(setFragmentBuffer:offset:atIndex:)]
unsafe fn setFragmentBuffer_offset_atIndex(
&self,
buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
offset: NSUInteger,
index: NSUInteger,
);
#[method(setFragmentBufferOffset:atIndex:)]
unsafe fn setFragmentBufferOffset_atIndex(&self, offset: NSUInteger, index: NSUInteger);
#[method(setFragmentBuffers:offsets:withRange:)]
unsafe fn setFragmentBuffers_offsets_withRange(
&self,
buffers: NonNull<*const ProtocolObject<dyn MTLBuffer>>,
offsets: NonNull<NSUInteger>,
range: NSRange,
);
#[method(setFragmentTexture:atIndex:)]
unsafe fn setFragmentTexture_atIndex(
&self,
texture: Option<&ProtocolObject<dyn MTLTexture>>,
index: NSUInteger,
);
#[method(setFragmentTextures:withRange:)]
unsafe fn setFragmentTextures_withRange(
&self,
textures: NonNull<*const ProtocolObject<dyn MTLTexture>>,
range: NSRange,
);
#[method(setFragmentSamplerState:atIndex:)]
unsafe fn setFragmentSamplerState_atIndex(
&self,
sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
index: NSUInteger,
);
#[method(setFragmentSamplerStates:withRange:)]
unsafe fn setFragmentSamplerStates_withRange(
&self,
samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
range: NSRange,
);
#[method(setFragmentSamplerState:lodMinClamp:lodMaxClamp:atIndex:)]
unsafe fn setFragmentSamplerState_lodMinClamp_lodMaxClamp_atIndex(
&self,
sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
lod_min_clamp: c_float,
lod_max_clamp: c_float,
index: NSUInteger,
);
#[method(setFragmentSamplerStates:lodMinClamps:lodMaxClamps:withRange:)]
unsafe fn setFragmentSamplerStates_lodMinClamps_lodMaxClamps_withRange(
&self,
samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
lod_min_clamps: NonNull<c_float>,
lod_max_clamps: NonNull<c_float>,
range: NSRange,
);
#[method(setFragmentVisibleFunctionTable:atBufferIndex:)]
unsafe fn setFragmentVisibleFunctionTable_atBufferIndex(
&self,
function_table: Option<&ProtocolObject<dyn MTLVisibleFunctionTable>>,
buffer_index: NSUInteger,
);
#[method(setFragmentVisibleFunctionTables:withBufferRange:)]
unsafe fn setFragmentVisibleFunctionTables_withBufferRange(
&self,
function_tables: NonNull<*const ProtocolObject<dyn MTLVisibleFunctionTable>>,
range: NSRange,
);
#[method(setFragmentIntersectionFunctionTable:atBufferIndex:)]
unsafe fn setFragmentIntersectionFunctionTable_atBufferIndex(
&self,
intersection_function_table: Option<&ProtocolObject<dyn MTLIntersectionFunctionTable>>,
buffer_index: NSUInteger,
);
#[method(setFragmentIntersectionFunctionTables:withBufferRange:)]
unsafe fn setFragmentIntersectionFunctionTables_withBufferRange(
&self,
intersection_function_tables: NonNull<
*const ProtocolObject<dyn MTLIntersectionFunctionTable>,
>,
range: NSRange,
);
#[method(setFragmentAccelerationStructure:atBufferIndex:)]
unsafe fn setFragmentAccelerationStructure_atBufferIndex(
&self,
acceleration_structure: Option<&ProtocolObject<dyn MTLAccelerationStructure>>,
buffer_index: NSUInteger,
);
#[method(setBlendColorRed:green:blue:alpha:)]
fn setBlendColorRed_green_blue_alpha(
&self,
red: c_float,
green: c_float,
blue: c_float,
alpha: c_float,
);
#[method(setDepthStencilState:)]
fn setDepthStencilState(
&self,
depth_stencil_state: Option<&ProtocolObject<dyn MTLDepthStencilState>>,
);
#[method(setStencilReferenceValue:)]
fn setStencilReferenceValue(&self, reference_value: u32);
#[method(setStencilFrontReferenceValue:backReferenceValue:)]
fn setStencilFrontReferenceValue_backReferenceValue(
&self,
front_reference_value: u32,
back_reference_value: u32,
);
#[method(setVisibilityResultMode:offset:)]
fn setVisibilityResultMode_offset(&self, mode: MTLVisibilityResultMode, offset: NSUInteger);
#[method(setColorStoreAction:atIndex:)]
unsafe fn setColorStoreAction_atIndex(
&self,
store_action: MTLStoreAction,
color_attachment_index: NSUInteger,
);
#[method(setDepthStoreAction:)]
unsafe fn setDepthStoreAction(&self, store_action: MTLStoreAction);
#[method(setStencilStoreAction:)]
unsafe fn setStencilStoreAction(&self, store_action: MTLStoreAction);
#[method(setColorStoreActionOptions:atIndex:)]
unsafe fn setColorStoreActionOptions_atIndex(
&self,
store_action_options: MTLStoreActionOptions,
color_attachment_index: NSUInteger,
);
#[method(setDepthStoreActionOptions:)]
unsafe fn setDepthStoreActionOptions(&self, store_action_options: MTLStoreActionOptions);
#[method(setStencilStoreActionOptions:)]
unsafe fn setStencilStoreActionOptions(&self, store_action_options: MTLStoreActionOptions);
#[method(setObjectBytes:length:atIndex:)]
unsafe fn setObjectBytes_length_atIndex(
&self,
bytes: NonNull<c_void>,
length: NSUInteger,
index: NSUInteger,
);
#[method(setObjectBuffer:offset:atIndex:)]
unsafe fn setObjectBuffer_offset_atIndex(
&self,
buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
offset: NSUInteger,
index: NSUInteger,
);
#[method(setObjectBufferOffset:atIndex:)]
unsafe fn setObjectBufferOffset_atIndex(&self, offset: NSUInteger, index: NSUInteger);
#[method(setObjectBuffers:offsets:withRange:)]
unsafe fn setObjectBuffers_offsets_withRange(
&self,
buffers: NonNull<*const ProtocolObject<dyn MTLBuffer>>,
offsets: NonNull<NSUInteger>,
range: NSRange,
);
#[method(setObjectTexture:atIndex:)]
unsafe fn setObjectTexture_atIndex(
&self,
texture: Option<&ProtocolObject<dyn MTLTexture>>,
index: NSUInteger,
);
#[method(setObjectTextures:withRange:)]
unsafe fn setObjectTextures_withRange(
&self,
textures: NonNull<*const ProtocolObject<dyn MTLTexture>>,
range: NSRange,
);
#[method(setObjectSamplerState:atIndex:)]
unsafe fn setObjectSamplerState_atIndex(
&self,
sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
index: NSUInteger,
);
#[method(setObjectSamplerStates:withRange:)]
unsafe fn setObjectSamplerStates_withRange(
&self,
samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
range: NSRange,
);
#[method(setObjectSamplerState:lodMinClamp:lodMaxClamp:atIndex:)]
unsafe fn setObjectSamplerState_lodMinClamp_lodMaxClamp_atIndex(
&self,
sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
lod_min_clamp: c_float,
lod_max_clamp: c_float,
index: NSUInteger,
);
#[method(setObjectSamplerStates:lodMinClamps:lodMaxClamps:withRange:)]
unsafe fn setObjectSamplerStates_lodMinClamps_lodMaxClamps_withRange(
&self,
samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
lod_min_clamps: NonNull<c_float>,
lod_max_clamps: NonNull<c_float>,
range: NSRange,
);
#[method(setObjectThreadgroupMemoryLength:atIndex:)]
unsafe fn setObjectThreadgroupMemoryLength_atIndex(
&self,
length: NSUInteger,
index: NSUInteger,
);
#[method(setMeshBytes:length:atIndex:)]
unsafe fn setMeshBytes_length_atIndex(
&self,
bytes: NonNull<c_void>,
length: NSUInteger,
index: NSUInteger,
);
#[method(setMeshBuffer:offset:atIndex:)]
unsafe fn setMeshBuffer_offset_atIndex(
&self,
buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
offset: NSUInteger,
index: NSUInteger,
);
#[method(setMeshBufferOffset:atIndex:)]
unsafe fn setMeshBufferOffset_atIndex(&self, offset: NSUInteger, index: NSUInteger);
#[method(setMeshBuffers:offsets:withRange:)]
unsafe fn setMeshBuffers_offsets_withRange(
&self,
buffers: NonNull<*const ProtocolObject<dyn MTLBuffer>>,
offsets: NonNull<NSUInteger>,
range: NSRange,
);
#[method(setMeshTexture:atIndex:)]
unsafe fn setMeshTexture_atIndex(
&self,
texture: Option<&ProtocolObject<dyn MTLTexture>>,
index: NSUInteger,
);
#[method(setMeshTextures:withRange:)]
unsafe fn setMeshTextures_withRange(
&self,
textures: NonNull<*const ProtocolObject<dyn MTLTexture>>,
range: NSRange,
);
#[method(setMeshSamplerState:atIndex:)]
unsafe fn setMeshSamplerState_atIndex(
&self,
sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
index: NSUInteger,
);
#[method(setMeshSamplerStates:withRange:)]
unsafe fn setMeshSamplerStates_withRange(
&self,
samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
range: NSRange,
);
#[method(setMeshSamplerState:lodMinClamp:lodMaxClamp:atIndex:)]
unsafe fn setMeshSamplerState_lodMinClamp_lodMaxClamp_atIndex(
&self,
sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
lod_min_clamp: c_float,
lod_max_clamp: c_float,
index: NSUInteger,
);
#[method(setMeshSamplerStates:lodMinClamps:lodMaxClamps:withRange:)]
unsafe fn setMeshSamplerStates_lodMinClamps_lodMaxClamps_withRange(
&self,
samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
lod_min_clamps: NonNull<c_float>,
lod_max_clamps: NonNull<c_float>,
range: NSRange,
);
#[method(drawMeshThreadgroups:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:)]
unsafe fn drawMeshThreadgroups_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup(
&self,
threadgroups_per_grid: MTLSize,
threads_per_object_threadgroup: MTLSize,
threads_per_mesh_threadgroup: MTLSize,
);
#[method(drawMeshThreads:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:)]
unsafe fn drawMeshThreads_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup(
&self,
threads_per_grid: MTLSize,
threads_per_object_threadgroup: MTLSize,
threads_per_mesh_threadgroup: MTLSize,
);
#[method(drawMeshThreadgroupsWithIndirectBuffer:indirectBufferOffset:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:)]
unsafe fn drawMeshThreadgroupsWithIndirectBuffer_indirectBufferOffset_threadsPerObjectThreadgroup_threadsPerMeshThreadgroup(
&self,
indirect_buffer: &ProtocolObject<dyn MTLBuffer>,
indirect_buffer_offset: NSUInteger,
threads_per_object_threadgroup: MTLSize,
threads_per_mesh_threadgroup: MTLSize,
);
#[method(drawPrimitives:vertexStart:vertexCount:instanceCount:)]
unsafe fn drawPrimitives_vertexStart_vertexCount_instanceCount(
&self,
primitive_type: MTLPrimitiveType,
vertex_start: NSUInteger,
vertex_count: NSUInteger,
instance_count: NSUInteger,
);
#[method(drawPrimitives:vertexStart:vertexCount:)]
unsafe fn drawPrimitives_vertexStart_vertexCount(
&self,
primitive_type: MTLPrimitiveType,
vertex_start: NSUInteger,
vertex_count: NSUInteger,
);
#[method(drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:)]
unsafe fn drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferOffset_instanceCount(
&self,
primitive_type: MTLPrimitiveType,
index_count: NSUInteger,
index_type: MTLIndexType,
index_buffer: &ProtocolObject<dyn MTLBuffer>,
index_buffer_offset: NSUInteger,
instance_count: NSUInteger,
);
#[method(drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:)]
unsafe fn drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferOffset(
&self,
primitive_type: MTLPrimitiveType,
index_count: NSUInteger,
index_type: MTLIndexType,
index_buffer: &ProtocolObject<dyn MTLBuffer>,
index_buffer_offset: NSUInteger,
);
#[method(drawPrimitives:vertexStart:vertexCount:instanceCount:baseInstance:)]
unsafe fn drawPrimitives_vertexStart_vertexCount_instanceCount_baseInstance(
&self,
primitive_type: MTLPrimitiveType,
vertex_start: NSUInteger,
vertex_count: NSUInteger,
instance_count: NSUInteger,
base_instance: NSUInteger,
);
#[method(drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:baseVertex:baseInstance:)]
unsafe fn drawIndexedPrimitives_indexCount_indexType_indexBuffer_indexBufferOffset_instanceCount_baseVertex_baseInstance(
&self,
primitive_type: MTLPrimitiveType,
index_count: NSUInteger,
index_type: MTLIndexType,
index_buffer: &ProtocolObject<dyn MTLBuffer>,
index_buffer_offset: NSUInteger,
instance_count: NSUInteger,
base_vertex: NSInteger,
base_instance: NSUInteger,
);
#[method(drawPrimitives:indirectBuffer:indirectBufferOffset:)]
unsafe fn drawPrimitives_indirectBuffer_indirectBufferOffset(
&self,
primitive_type: MTLPrimitiveType,
indirect_buffer: &ProtocolObject<dyn MTLBuffer>,
indirect_buffer_offset: NSUInteger,
);
#[method(drawIndexedPrimitives:indexType:indexBuffer:indexBufferOffset:indirectBuffer:indirectBufferOffset:)]
unsafe fn drawIndexedPrimitives_indexType_indexBuffer_indexBufferOffset_indirectBuffer_indirectBufferOffset(
&self,
primitive_type: MTLPrimitiveType,
index_type: MTLIndexType,
index_buffer: &ProtocolObject<dyn MTLBuffer>,
index_buffer_offset: NSUInteger,
indirect_buffer: &ProtocolObject<dyn MTLBuffer>,
indirect_buffer_offset: NSUInteger,
);
#[deprecated]
#[method(textureBarrier)]
unsafe fn textureBarrier(&self);
#[method(updateFence:afterStages:)]
fn updateFence_afterStages(
&self,
fence: &ProtocolObject<dyn MTLFence>,
stages: MTLRenderStages,
);
#[method(waitForFence:beforeStages:)]
fn waitForFence_beforeStages(
&self,
fence: &ProtocolObject<dyn MTLFence>,
stages: MTLRenderStages,
);
#[method(setTessellationFactorBuffer:offset:instanceStride:)]
unsafe fn setTessellationFactorBuffer_offset_instanceStride(
&self,
buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
offset: NSUInteger,
instance_stride: NSUInteger,
);
#[method(setTessellationFactorScale:)]
unsafe fn setTessellationFactorScale(&self, scale: c_float);
#[method(drawPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:)]
unsafe fn drawPatches_patchStart_patchCount_patchIndexBuffer_patchIndexBufferOffset_instanceCount_baseInstance(
&self,
number_of_patch_control_points: NSUInteger,
patch_start: NSUInteger,
patch_count: NSUInteger,
patch_index_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
patch_index_buffer_offset: NSUInteger,
instance_count: NSUInteger,
base_instance: NSUInteger,
);
#[method(drawPatches:patchIndexBuffer:patchIndexBufferOffset:indirectBuffer:indirectBufferOffset:)]
unsafe fn drawPatches_patchIndexBuffer_patchIndexBufferOffset_indirectBuffer_indirectBufferOffset(
&self,
number_of_patch_control_points: NSUInteger,
patch_index_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
patch_index_buffer_offset: NSUInteger,
indirect_buffer: &ProtocolObject<dyn MTLBuffer>,
indirect_buffer_offset: NSUInteger,
);
#[method(drawIndexedPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:instanceCount:baseInstance:)]
unsafe fn drawIndexedPatches_patchStart_patchCount_patchIndexBuffer_patchIndexBufferOffset_controlPointIndexBuffer_controlPointIndexBufferOffset_instanceCount_baseInstance(
&self,
number_of_patch_control_points: NSUInteger,
patch_start: NSUInteger,
patch_count: NSUInteger,
patch_index_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
patch_index_buffer_offset: NSUInteger,
control_point_index_buffer: &ProtocolObject<dyn MTLBuffer>,
control_point_index_buffer_offset: NSUInteger,
instance_count: NSUInteger,
base_instance: NSUInteger,
);
#[method(drawIndexedPatches:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:indirectBuffer:indirectBufferOffset:)]
unsafe fn drawIndexedPatches_patchIndexBuffer_patchIndexBufferOffset_controlPointIndexBuffer_controlPointIndexBufferOffset_indirectBuffer_indirectBufferOffset(
&self,
number_of_patch_control_points: NSUInteger,
patch_index_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
patch_index_buffer_offset: NSUInteger,
control_point_index_buffer: &ProtocolObject<dyn MTLBuffer>,
control_point_index_buffer_offset: NSUInteger,
indirect_buffer: &ProtocolObject<dyn MTLBuffer>,
indirect_buffer_offset: NSUInteger,
);
#[method(tileWidth)]
unsafe fn tileWidth(&self) -> NSUInteger;
#[method(tileHeight)]
unsafe fn tileHeight(&self) -> NSUInteger;
#[method(setTileBytes:length:atIndex:)]
unsafe fn setTileBytes_length_atIndex(
&self,
bytes: NonNull<c_void>,
length: NSUInteger,
index: NSUInteger,
);
#[method(setTileBuffer:offset:atIndex:)]
unsafe fn setTileBuffer_offset_atIndex(
&self,
buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
offset: NSUInteger,
index: NSUInteger,
);
#[method(setTileBufferOffset:atIndex:)]
unsafe fn setTileBufferOffset_atIndex(&self, offset: NSUInteger, index: NSUInteger);
#[method(setTileBuffers:offsets:withRange:)]
unsafe fn setTileBuffers_offsets_withRange(
&self,
buffers: NonNull<*const ProtocolObject<dyn MTLBuffer>>,
offsets: NonNull<NSUInteger>,
range: NSRange,
);
#[method(setTileTexture:atIndex:)]
unsafe fn setTileTexture_atIndex(
&self,
texture: Option<&ProtocolObject<dyn MTLTexture>>,
index: NSUInteger,
);
#[method(setTileTextures:withRange:)]
unsafe fn setTileTextures_withRange(
&self,
textures: NonNull<*const ProtocolObject<dyn MTLTexture>>,
range: NSRange,
);
#[method(setTileSamplerState:atIndex:)]
unsafe fn setTileSamplerState_atIndex(
&self,
sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
index: NSUInteger,
);
#[method(setTileSamplerStates:withRange:)]
unsafe fn setTileSamplerStates_withRange(
&self,
samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
range: NSRange,
);
#[method(setTileSamplerState:lodMinClamp:lodMaxClamp:atIndex:)]
unsafe fn setTileSamplerState_lodMinClamp_lodMaxClamp_atIndex(
&self,
sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
lod_min_clamp: c_float,
lod_max_clamp: c_float,
index: NSUInteger,
);
#[method(setTileSamplerStates:lodMinClamps:lodMaxClamps:withRange:)]
unsafe fn setTileSamplerStates_lodMinClamps_lodMaxClamps_withRange(
&self,
samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
lod_min_clamps: NonNull<c_float>,
lod_max_clamps: NonNull<c_float>,
range: NSRange,
);
#[method(setTileVisibleFunctionTable:atBufferIndex:)]
unsafe fn setTileVisibleFunctionTable_atBufferIndex(
&self,
function_table: Option<&ProtocolObject<dyn MTLVisibleFunctionTable>>,
buffer_index: NSUInteger,
);
#[method(setTileVisibleFunctionTables:withBufferRange:)]
unsafe fn setTileVisibleFunctionTables_withBufferRange(
&self,
function_tables: NonNull<*const ProtocolObject<dyn MTLVisibleFunctionTable>>,
range: NSRange,
);
#[method(setTileIntersectionFunctionTable:atBufferIndex:)]
unsafe fn setTileIntersectionFunctionTable_atBufferIndex(
&self,
intersection_function_table: Option<&ProtocolObject<dyn MTLIntersectionFunctionTable>>,
buffer_index: NSUInteger,
);
#[method(setTileIntersectionFunctionTables:withBufferRange:)]
unsafe fn setTileIntersectionFunctionTables_withBufferRange(
&self,
intersection_function_tables: NonNull<
*const ProtocolObject<dyn MTLIntersectionFunctionTable>,
>,
range: NSRange,
);
#[method(setTileAccelerationStructure:atBufferIndex:)]
unsafe fn setTileAccelerationStructure_atBufferIndex(
&self,
acceleration_structure: Option<&ProtocolObject<dyn MTLAccelerationStructure>>,
buffer_index: NSUInteger,
);
#[method(dispatchThreadsPerTile:)]
unsafe fn dispatchThreadsPerTile(&self, threads_per_tile: MTLSize);
#[method(setThreadgroupMemoryLength:offset:atIndex:)]
unsafe fn setThreadgroupMemoryLength_offset_atIndex(
&self,
length: NSUInteger,
offset: NSUInteger,
index: NSUInteger,
);
#[deprecated]
#[method(useResource:usage:)]
fn useResource_usage(
&self,
resource: &ProtocolObject<dyn MTLResource>,
usage: MTLResourceUsage,
);
#[deprecated]
#[method(useResources:count:usage:)]
unsafe fn useResources_count_usage(
&self,
resources: NonNull<NonNull<ProtocolObject<dyn MTLResource>>>,
count: NSUInteger,
usage: MTLResourceUsage,
);
#[method(useResource:usage:stages:)]
fn useResource_usage_stages(
&self,
resource: &ProtocolObject<dyn MTLResource>,
usage: MTLResourceUsage,
stages: MTLRenderStages,
);
#[method(useResources:count:usage:stages:)]
unsafe fn useResources_count_usage_stages(
&self,
resources: NonNull<NonNull<ProtocolObject<dyn MTLResource>>>,
count: NSUInteger,
usage: MTLResourceUsage,
stages: MTLRenderStages,
);
#[deprecated]
#[method(useHeap:)]
fn useHeap(&self, heap: &ProtocolObject<dyn MTLHeap>);
#[deprecated]
#[method(useHeaps:count:)]
unsafe fn useHeaps_count(
&self,
heaps: NonNull<NonNull<ProtocolObject<dyn MTLHeap>>>,
count: NSUInteger,
);
#[method(useHeap:stages:)]
fn useHeap_stages(&self, heap: &ProtocolObject<dyn MTLHeap>, stages: MTLRenderStages);
#[method(useHeaps:count:stages:)]
unsafe fn useHeaps_count_stages(
&self,
heaps: NonNull<NonNull<ProtocolObject<dyn MTLHeap>>>,
count: NSUInteger,
stages: MTLRenderStages,
);
#[method(executeCommandsInBuffer:withRange:)]
unsafe fn executeCommandsInBuffer_withRange(
&self,
indirect_command_buffer: &ProtocolObject<dyn MTLIndirectCommandBuffer>,
execution_range: NSRange,
);
#[method(executeCommandsInBuffer:indirectBuffer:indirectBufferOffset:)]
unsafe fn executeCommandsInBuffer_indirectBuffer_indirectBufferOffset(
&self,
indirect_commandbuffer: &ProtocolObject<dyn MTLIndirectCommandBuffer>,
indirect_range_buffer: &ProtocolObject<dyn MTLBuffer>,
indirect_buffer_offset: NSUInteger,
);
#[method(memoryBarrierWithScope:afterStages:beforeStages:)]
unsafe fn memoryBarrierWithScope_afterStages_beforeStages(
&self,
scope: MTLBarrierScope,
after: MTLRenderStages,
before: MTLRenderStages,
);
#[method(memoryBarrierWithResources:count:afterStages:beforeStages:)]
unsafe fn memoryBarrierWithResources_count_afterStages_beforeStages(
&self,
resources: NonNull<NonNull<ProtocolObject<dyn MTLResource>>>,
count: NSUInteger,
after: MTLRenderStages,
before: MTLRenderStages,
);
#[method(sampleCountersInBuffer:atSampleIndex:withBarrier:)]
unsafe fn sampleCountersInBuffer_atSampleIndex_withBarrier(
&self,
sample_buffer: &ProtocolObject<dyn MTLCounterSampleBuffer>,
sample_index: NSUInteger,
barrier: bool,
);
}
unsafe impl ProtocolType for dyn MTLRenderCommandEncoder {}
);