objc2_metal_kit

Function MTKMetalVertexDescriptorFromModelIO

Source
pub unsafe extern "C-unwind" fn MTKMetalVertexDescriptorFromModelIO(
    model_io_descriptor: &MDLVertexDescriptor,
) -> Option<Retained<MTLVertexDescriptor>>
Available on crate features MTKModel and objc2-model-io only.
Expand description

Partially converts a Model I/O vertex descriptor to a Metal vertex descriptor

This method can only set vertex format, offset, bufferIndex, and stride information in the produced Metal vertex descriptor. It simply copies attributes 1 for 1. Thus attributes in the given Model I/O vertex descriptor must be arranged in the correct order for the resulting descriptor to properly map mesh data to vertex shader inputs. Layout stepFunction and stepRates for the resulting MTLVertexDescriptor must also be set by application.