Device
A GPU, and the maker of every other Metal object.
Static methods
function hxnAdopt(hxnRaw:Handle):DeviceAn object for a value the library returned.
function systemDefault():DeviceThe system's default GPU. Fails where there is none, such as a virtual machine without one.
Properties
var hxnRaw:HandleMethods
function name():Stringfunction newBuffer(length:Int64):BufferA buffer of length bytes in memory the CPU and GPU share, zeroed.
function newBufferWith(bytes:Bytes):BufferA shared buffer holding a copy of bytes.
function newLibraryFromSource(msl:String):LibraryA library from MSL source, compiled now: hxnsl's MSL.
function newLibraryFromSourceAsync(msl:String):Future<Library>A library from MSL source, compiled on Metal's threads; the future settles when it is.
function newLibrary(metallib:Bytes):LibraryA library from a compiled .metallib.
function newCommandQueue():CommandQueuefunction newComputePipeline(function_:Function):ComputePipelinefunction newComputePipelineAsync(function_:Function):Future<ComputePipeline>A compute pipeline, compiled on Metal's threads; the future settles when it is.
function newRenderPipeline(vertex:Function, fragment:Function, format:PixelFormat, attributes:Array<VertexAttribute>, layouts:Array<VertexLayout>):RenderPipelineA render pipeline drawing to one color target of format, with vertex buffers laid out as attributes and layouts describe (both empty when the vertex stage reads none).
function newRenderPipelineAsync(vertex:Function, fragment:Function, format:PixelFormat, attributes:Array<VertexAttribute>, layouts:Array<VertexLayout>):Future<RenderPipeline>new_render_pipeline, compiled on Metal's threads; the future settles when it is. Fails at once for a vertex layout Metal cannot take.
function newTexture(descriptor:TextureDescriptor):Texturefunction newSampler(descriptor:SamplerDescriptor):Samplerfunction close():VoidReleases the native value now. The collector does it otherwise. Using this object afterwards throws.