hxn

Device

A device and its direct 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, heap:Heap, initial:Int, unordered:Bool):Buffer

A buffer of size bytes in heap, in the state each heap requires (generic read for upload, copy destination for readback, initial for default), allowing unordered access when unordered is true.

function createBufferWith(bytes:Bytes):Buffer

An upload buffer holding a copy of bytes.

function createTexture(descriptor:TextureDescriptor):Texture

A 2D texture in the default heap, in the common state, with a render target view when its usage includes TextureUsage.RenderTarget.

function compile(source:String, entry:String, profile:String):Bytes

HLSL source compiled to shader model 5.1 bytecode for entry and profile (cs_5_1, vs_5_1, ps_5_1), with the compiler that ships with Windows.

function createRootSignature(parameters:Array<RootParameter>):RootSignature

A root signature of root descriptors, in parameter order.

function createComputePipeline(bytecode:Bytes, signature:RootSignature):PipelineState

A compute pipeline state from compute shader bytecode.

function createGraphicsPipeline(vertex:Bytes, pixel:Bytes, signature:RootSignature, format:Format, topology:Topology, attributes:Array<VertexAttribute>):PipelineState

A graphics pipeline state rendering into one target of format, with no blending, no culling and no depth.

function createDescriptorHeap(kind:HeapKind, count:Int):DescriptorHeap

A shader-visible descriptor heap of count descriptors: texture views, or samplers.

function supportsEnhancedBarriers():Bool

Whether the device takes enhanced barriers (CommandList.bufferBarrier, textureBarrier).

function createCommandList():CommandList

A direct command list and its allocator, open for recording.

function executeAndWait(commands:CommandList):Void

Closes and executes commands, and waits for the GPU to finish them.

function execute(commands:CommandList):Future<Unit>

Closes and executes commands. 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.