2. Runtime — result checking, array interop, ownership, versioning

Low-level runtime helpers shared by the rest of the boost layer: vk_check turns a VkResult into a panic (or forwards it to a caller-supplied var result), array_addr bridges a daslang array<T> to the raw pointer Vulkan expects, weak_copy produces a non-owning duplicate of a handle wrapper, and make_api_version packs a version triple.

2.1. Result checking

vk_check(r: VkResult; out: VkResult? )

def vk_check (r: VkResult; var out: VkResult?)

Arguments:

2.2. Array interop

array_addr(a: array<auto(TT)> ): TT?

def array_addr (var a: array<auto(TT)>) : TT?

Arguments:
  • a : array<auto(TT)>

2.3. Ownership

weak_copy(b: auto(TT) ): TT

def weak_copy (b: auto(TT)) : TT

Arguments:
  • b : auto(TT)

2.4. Versioning

make_api_version(major: uint; minor: uint; patch: uint ): uint

def make_api_version (major: uint; minor: uint; patch: uint) : uint

Arguments:
  • major : uint

  • minor : uint

  • patch : uint