Pure-MoonBit Apple Metal bindings (zero Objective-C compiler flags, runtime-loaded Metal.framework / QuartzCore / Foundation)
pub struct BindlessHeap {
raw : UInt64
}pub struct Buffer {
raw : UInt64
}pub struct CommandBuffer {
raw : UInt64
}fn CommandBuffer::begin_render_pass(self : CommandBuffer, color_texs : FixedArray[UInt64], resolve_texs : FixedArray[UInt64], color_load_ops : FixedArray[Int], color_store_ops : FixedArray[Int], clear_rgba : FixedArray[Float], color_layers : FixedArray[Int], color_mips : FixedArray[Int], color_count : Int, depth_tex : UInt64, depth_load : Int, depth_store : Int, clear_depth : Float, stencil_load : Int, stencil_store : Int, clear_stencil : UInt, depth_layer : Int, depth_mip : Int) -> Boolfn CommandBuffer::begin_swapchain_pass(self : CommandBuffer, sc : Swapchain, load_op : Int, r : Float, g : Float, b : Float, a : Float) -> Boolfn CommandBuffer::bind_bindless(self : CommandBuffer, heap : BindlessHeap, is_compute : Bool) -> Unitfn CommandBuffer::bind_buffer(self : CommandBuffer, binding : Int, buf : Buffer, offset : Int, is_compute : Bool) -> Unitfn CommandBuffer::bind_index(self : CommandBuffer, buf : Buffer, is_u32 : Bool, offset : Int) -> Unitfn CommandBuffer::bind_texture(self : CommandBuffer, binding : Int, tex : Texture, smp_raw : UInt64, is_compute : Bool) -> Unitfn CommandBuffer::blit_texture(self : CommandBuffer, src : Texture, dst : Texture, linear : Bool) -> Boolfn CommandBuffer::copy_buffer(self : CommandBuffer, src : Buffer, dst : Buffer, bytes : Int) -> Unitfn CommandBuffer::draw(self : CommandBuffer, vertex_count : Int, instance_count : Int, first_vertex : Int, first_instance : Int) -> Unitfn CommandBuffer::draw_indexed(self : CommandBuffer, index_count : Int, instance_count : Int, first_index : Int, vertex_offset : Int, first_instance : Int) -> Unitfn CommandBuffer::draw_indexed_indirect(self : CommandBuffer, buf : Buffer, offset : Int, draw_count : Int, stride : Int) -> Unitfn CommandBuffer::draw_indexed_indirect_count(self : CommandBuffer, buf : Buffer, count_buf : Buffer, offset : Int, count_offset : Int, max_draws : Int, stride : Int) -> Unitfn CommandBuffer::draw_indirect(self : CommandBuffer, buf : Buffer, offset : Int, draw_count : Int, stride : Int) -> Unitfn CommandBuffer::draw_indirect_count(self : CommandBuffer, buf : Buffer, count_buf : Buffer, offset : Int, count_offset : Int, max_draws : Int, stride : Int) -> Unitfn CommandBuffer::push_constants(self : CommandBuffer, data : Bytes, len : Int, is_compute : Bool) -> Unitfn CommandBuffer::push_constants_floats(self : CommandBuffer, data : FixedArray[Float], count : Int, is_compute : Bool) -> Unitfn CommandBuffer::set_viewport(self : CommandBuffer, x : Float, y : Float, w : Float, h : Float) -> Unitfn CommandBuffer::write_timestamp(self : CommandBuffer, pool : TimestampPool, index : Int, is_end : Bool) -> Unitpub struct ComputePipeline {
raw : UInt64
}fn ComputePipeline::create(dev : Device, cs_words : FixedArray[UInt], local_x : Int, local_y : Int, local_z : Int) -> ComputePipeline?pub struct Device {
raw : UInt64
}pub(all) struct DeviceCaps {
name : String
is_discrete : Bool
arg_buf_tier : Int
d24s8_supported : Bool
max_samples : Int
supports_raytracing : Bool
supports_mesh : Bool
max_dim_2d : Int
max_anisotropy : Int
}pub struct Fence {
raw : UInt64
}pub struct RenderPipeline {
raw : UInt64
}fn RenderPipeline::create(dev : Device, vs_words : FixedArray[UInt], fs_words : FixedArray[UInt], vs_entry : String, fs_entry : String, state : FixedArray[Int], bias_const : Float, bias_slope : Float, color_formats : FixedArray[Int], blend_params : FixedArray[Int], vtx_layouts : FixedArray[Int], vtx_attrs : FixedArray[Int]) -> RenderPipeline?pub struct Sampler {
raw : UInt64
}pub struct Swapchain {
raw : UInt64
}fn Swapchain::begin_frame(self : Swapchain, begin_pass : Bool, r : Float, g : Float, b : Float, a : Float) -> CommandBuffer?pub struct Texture {
raw : UInt64
}pub struct TimestampPool {
raw : UInt64
}Install
Download zipPure-MoonBit Apple Metal bindings (zero Objective-C compiler flags, runtime-loaded Metal.framework / QuartzCore / Foundation)