hxn

Device

A logical device and its queue; every other object comes from one.

Static methods

function hxnAdopt(hxnRaw:Handle):Device

An object for a value the library returned.

Properties

var hxnRaw:Handle

Methods

function createBuffer(size:Int64, usage:Int):Buffer

A buffer of size bytes in memory the CPU can map, zeroed, with usage bits.

function createBufferWith(bytes:Bytes, usage:Int):Buffer

A buffer holding a copy of bytes.

function createImage(descriptor:ImageDescriptor):Image

A 2D image in device memory, in the undefined layout, with one view of all of it.

function createSampler(min:Filter, mag:Filter, address:AddressMode):Sampler
function createShaderModule(spirv:Bytes):ShaderModule

A shader module from SPIR-V: hxnsl's spirv().

function createSetLayouts(sets:Array<SetLayout>):SetLayouts

The descriptor set layouts of a pipeline, set 0 first: one per hxnsl bind group.

function createPipelineLayout(sets:SetLayouts):PipelineLayout

A pipeline layout of all of sets.

function createDescriptorSet(sets:SetLayouts, index:Int):DescriptorSet

A descriptor set of set index of sets, from a pool of its own.

function createComputePipeline(module:ShaderModule, entry:String, layout:PipelineLayout):Pipeline

A compute pipeline running entry of module: hxnsl's entry point names (main).

function createGraphicsPipeline(vertex:ShaderModule, vertexEntry:String, fragment:ShaderModule, fragmentEntry:String, layout:PipelineLayout, format:Format, topology:Topology, bindings:Array<VertexBinding>, attributes:Array<VertexAttribute>):Pipeline

A graphics pipeline for dynamic rendering into one color attachment of format, with a dynamic viewport and scissor, no blending and no culling.

function createCommandBuffer():CommandBuffer

A primary command buffer, from a pool of its own, ready to record.

function createSwapchain(surface:Surface, width:Int, height:Int, format:Format, vsync:Bool):Swapchain

A swapchain on surface of width by height format images, presenting with the display's refresh when vsync. The window may size it differently: see width.

function submitAndWait(commands:CommandBuffer):Void

Submits commands, ending it first, and waits for the GPU to finish them.

function submit(commands:CommandBuffer):Future<Unit>

Submits commands, ending it first. The future settles when the GPU has finished them.

function close():Void

Releases the native value now. The collector does it otherwise. Using this object afterwards throws.