mps-rs
Safe Rust bindings for Apple's
MetalPerformanceShaders
framework on macOS.
The GitHub repository is mps-rs; the published crates.io package is
apple-mps because the mps-rs package name is already taken.
Install
Quick start
use MetalDevice;
use ;
let device = system_default.expect;
let queue = device.new_command_queue.expect;
let descriptor = new;
let src = new.expect;
let dst = new.expect;
let blur = new.expect;
let command_buffer = queue.new_command_buffer.expect;
blur.encode_image;
v0.1 surface
ImageDescriptor+Imagefor lazily allocated MPS images or texture-backed images- Float32 image read/write helpers plus raw byte transfer with
MPSDataLayout - Unary image filters:
ImageGaussianBlurImageBoxImageSobelImageMedianImageConvolutionImageBilinearScaleImageLanczosScaleImageThresholdBinaryImageStatisticsMinAndMaxImageStatisticsMeanImageReduceRowMin,ImageReduceRowMax,ImageReduceRowMean,ImageReduceRowSum
ImageHistogramfor histogram-to-MTLBufferworkloadsImageAddplusImageScaleAndAddconvenience semantics backed byMPSImageAddMatrixDescriptor,VectorDescriptor,MatrixMultiplicationDescriptor,Matrix,Vector, andMatrixMultiplication- Shared constants for
MPSKernelOptions,MPSImageEdgeMode,MPSImageFeatureChannelFormat,MPSDataType, andMPSDataLayout
Smoke examples