hxn

Device

A GPUDevice and its queue.

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, a multiple of 4, for usage (BufferUsage bits).

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

A buffer holding bytes, padded with zeros to a multiple of 4, for usage (BufferUsage bits).

function createTexture(width:Int, height:Int, format:Format, usage:Int):Texture

A 2D texture of one level, for usage (TextureUsage bits), with one view of all of it.

function createSampler(filter:Filter, address:AddressMode):Sampler

A sampler filtering with filter for magnification, minification and mipmaps, and addressing with address on every axis.

function createShaderModule(wgsl:String):ShaderModule

A shader module of WGSL source.

function createBindGroupLayouts(groups:Array<GroupLayout>):BindGroupLayouts

A bind group layout for each of groups, group 0 first.

function createPipelineLayout(layouts:BindGroupLayouts):PipelineLayout

A pipeline layout of layouts.

function createComputePipeline(module:ShaderModule, entry:String, layout:PipelineLayout, constants:Array<Constant>):ComputePipeline

A compute pipeline running entry of module, with constants set.

function createRenderPipeline(module:ShaderModule, vertexEntry:String, fragmentEntry:String, layout:PipelineLayout, format:Format, topology:Topology, stride:Int, attributes:Array<VertexAttribute>, constants:Array<Constant>):RenderPipeline

A render pipeline drawing topology into one color target of format, from one vertex buffer of stride bytes per vertex laid out as attributes, with constants set in both stages.

function createBindGroup(layouts:BindGroupLayouts, group:Int, entries:BindGroupEntries):BindGroup

Bind group group of layouts, of the resources entries holds.

function createCommandEncoder():CommandEncoder

An empty command encoder.

function submit(encoder:CommandEncoder):Void

Finishes encoder and submits its commands to the queue.

function writeBuffer(buffer:Buffer, offset:Int64, bytes:Bytes):Void

Writes bytes, a multiple of 4, at offset in buffer, in queue order.

function writeTexture(texture:Texture, bytes:Bytes, bytesPerRow:Int):Void

Writes all of texture from bytes, rows bytes_per_row apart, in queue order.

function completed():Future<Unit>

Settles when the GPU has finished the work submitted so far.

function close():Void

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