DarkBASIC Professional Help File

DX11 CREATE CBUFFER

Creates a constant buffer (“cbuffer”) that holds the given number of bytes.
Constant buffers are used to send data to the GPU for use in shaders. Currently these can only be
assigned to shader techniques, but it would be possible to set them on a per-object or per-limb basis
later on, although doing that will cause some overhead if the constant data has to be swapped about a lot
for different objects / limbs.

Syntax

    Return Dword = DX11 CREATE CBUFFER(size, [createDynamic])

Parameters

    size

> Dword
> The size in bytes of the constant buffer to create. Will be scaled up to the nearest multiple of 16; the last bytes will be mere padding in that case and you do not need to set them.

    [Optional] createDynamic

> Boolean
> Set to true if you're going to be updating the buffer contents often (like every frame) or false otherwise. Updates will be slightly faster when true, while GPU reads are slower. Defaults to true if omitted.

Returns

The created constant buffer.

See also

CONSTANTBUFFER Functions Menu
DX11 Function Categories