Module Vulkan_api.Device

type t = {
  1. id : int;
  2. physical_device : Vulkan_types.vk_physical_device Ctypes.structure Ctypes.ptr;
  3. device : Vulkan_types.vk_device Ctypes.structure Ctypes.ptr;
  4. compute_queue : Vulkan_types.vk_queue Ctypes.structure Ctypes.ptr;
  5. queue_family : int;
  6. instance : Vulkan_types.vk_instance Ctypes.structure Ctypes.ptr;
  7. name : string;
  8. api_version : int * int * int;
  9. memory_properties : Vulkan_types.vk_physical_device_memory_properties Ctypes.structure;
  10. command_pool : Vulkan_types.vk_command_pool;
}
val instance_ref : Vulkan_types.vk_instance Ctypes.structure Ctypes.ptr option Stdlib.ref
val initialized : bool Stdlib.ref
val device_cache : (int, t) Stdlib.Hashtbl.t
val get_total_device_memory : Vulkan_types.vk_physical_device_memory_properties Ctypes.structure -> int64

Calculate total device memory from memory heaps

Sums all memory heaps that have VK_MEMORY_HEAP_DEVICE_LOCAL_BIT set. This gives us the actual GPU memory for discrete GPUs, or the largest device-accessible heap for integrated GPUs (which may be shared system RAM).

VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001 per Vulkan spec.

val init : unit -> unit
val get_or_create_instance : unit -> Vulkan_types.vk_instance Ctypes.structure Ctypes.ptr

Create Vulkan instance (shared among all devices)

val count : unit -> int
val find_compute_queue_family : Vulkan_types.vk_physical_device Ctypes.structure Ctypes_static.ptr -> int

Find compute queue family index

val get : int -> t
val set_current : 'a -> unit
val synchronize : t -> unit
val destroy : t -> unit