Module Sarek_vulkan.Vulkan_api_host_ffi

VK_EXT_external_memory_host: structures and entry points for importing a range of host memory as device memory (specs/vulkan-async-api.md).

The extension's entry point is not exported by the loader, so it is resolved through vkGetDeviceProcAddr, the way Vulkan_bindings resolves the cooperative-matrix query.

val extension_name : string
val structure_type_external_memory_buffer_create_info : int
val structure_type_import_memory_host_pointer_info : int
val structure_type_memory_host_pointer_properties : int
val structure_type_physical_device_external_memory_host_properties : int
val handle_type_host_allocation : int

VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT.

val u32 : int -> Unsigned.UInt32.t
type external_buffer_info

VkExternalMemoryBufferCreateInfo.

val external_buffer_info : external_buffer_info Ctypes.structure Ctypes.typ
val ext_buf_sType : (Unsigned.uint32, external_buffer_info Ctypes.structure) Ctypes.field
val ext_buf_pNext : (unit Ctypes_static.ptr, external_buffer_info Ctypes.structure) Ctypes.field
val ext_buf_handleTypes : (Unsigned.uint32, external_buffer_info Ctypes.structure) Ctypes.field
type import_host_pointer_info

VkImportMemoryHostPointerInfoEXT.

val import_host_pointer_info : import_host_pointer_info Ctypes.structure Ctypes.typ
val import_sType : (Unsigned.uint32, import_host_pointer_info Ctypes.structure) Ctypes.field
val import_pNext : (unit Ctypes_static.ptr, import_host_pointer_info Ctypes.structure) Ctypes.field
val import_handleType : (Unsigned.uint32, import_host_pointer_info Ctypes.structure) Ctypes.field
val import_pHostPointer : (unit Ctypes_static.ptr, import_host_pointer_info Ctypes.structure) Ctypes.field
type host_pointer_properties

VkMemoryHostPointerPropertiesEXT.

val host_pointer_properties : host_pointer_properties Ctypes.structure Ctypes.typ
val hp_sType : (Unsigned.uint32, host_pointer_properties Ctypes.structure) Ctypes.field
val hp_pNext : (unit Ctypes_static.ptr, host_pointer_properties Ctypes.structure) Ctypes.field
val hp_memoryTypeBits : (Unsigned.uint32, host_pointer_properties Ctypes.structure) Ctypes.field
type external_memory_host_properties

VkPhysicalDeviceExternalMemoryHostPropertiesEXT.

val external_memory_host_properties : external_memory_host_properties Ctypes.structure Ctypes.typ
val emh_sType : (Unsigned.uint32, external_memory_host_properties Ctypes.structure) Ctypes.field
val emh_pNext : (unit Ctypes_static.ptr, external_memory_host_properties Ctypes.structure) Ctypes.field
val emh_minImportedHostPointerAlignment : (Vulkan_types.vk_device_size, external_memory_host_properties Ctypes.structure) Ctypes.field
val structure_type_physical_device_external_buffer_info : int
val structure_type_external_buffer_properties : int
val memory_feature_importable : int

VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT.

type external_buffer_query

VkPhysicalDeviceExternalBufferInfo.

val external_buffer_query : external_buffer_query Ctypes.structure Ctypes.typ
val query_sType : (Unsigned.uint32, external_buffer_query Ctypes.structure) Ctypes.field
val query_pNext : (unit Ctypes_static.ptr, external_buffer_query Ctypes.structure) Ctypes.field
val query_flags : (Unsigned.uint32, external_buffer_query Ctypes.structure) Ctypes.field
val query_usage : (Unsigned.uint32, external_buffer_query Ctypes.structure) Ctypes.field
val query_handleType : (Unsigned.uint32, external_buffer_query Ctypes.structure) Ctypes.field
type external_buffer_result

VkExternalBufferProperties, with the leading field of its embedded VkExternalMemoryProperties flattened: only externalMemoryFeatures is read, and the two handle-type masks that follow it are padding here.

val external_buffer_result : external_buffer_result Ctypes.structure Ctypes.typ
val result_sType : (Unsigned.uint32, external_buffer_result Ctypes.structure) Ctypes.field
val result_pNext : (unit Ctypes_static.ptr, external_buffer_result Ctypes.structure) Ctypes.field
val result_features : (Unsigned.uint32, external_buffer_result Ctypes.structure) Ctypes.field
val result_exportFrom : (Unsigned.uint32, external_buffer_result Ctypes.structure) Ctypes.field
val result_compatible : (Unsigned.uint32, external_buffer_result Ctypes.structure) Ctypes.field
val vkGetPhysicalDeviceExternalBufferProperties_lazy : (Vulkan_types.vk_physical_device Ctypes.structure Ctypes_static.ptr -> external_buffer_query Ctypes.structure Ctypes_static.ptr -> external_buffer_result Ctypes.structure Ctypes_static.ptr -> unit) lazy_t
val buffer_import_supported : Vulkan_types.vk_physical_device Ctypes.structure Ctypes_static.ptr -> usage:int -> bool

Whether phys_dev can import a host allocation as a transfer buffer (vkGetPhysicalDeviceExternalBufferProperties, core in Vulkan 1.1).

val query_import_alignment : Vulkan_types.vk_physical_device Ctypes.structure Ctypes_static.ptr -> int

minImportedHostPointerAlignment of phys_dev: the alignment required of both the address and the size of an imported range. Only meaningful when the device advertises extension_name.

val vkGetDeviceProcAddr_lazy : (Vulkan_types.vk_device Ctypes.structure Ctypes_static.ptr -> string -> unit Ctypes_static.ptr) lazy_t
type properties_fn = Vulkan_types.vk_device Ctypes.structure Ctypes.ptr -> Unsigned.uint32 -> unit Ctypes.ptr -> host_pointer_properties Ctypes.structure Ctypes.ptr -> Vulkan_types.vk_result
val resolve_properties_fn : Vulkan_types.vk_device Ctypes.structure Ctypes_static.ptr -> properties_fn option

Resolve vkGetMemoryHostPointerPropertiesEXT for device. vkGetDeviceProcAddr returns the entry point of the driver that owns the device (an address inside that driver's library), so the result belongs to this device only: it is kept in the device record and never shared, because a second device may come from another driver. None when the driver does not know the function.

val get_memory_host_pointer_properties : properties_fn -> Vulkan_types.vk_device Ctypes.structure Ctypes.ptr -> unit Ctypes.ptr -> host_pointer_properties Ctypes.structure Ctypes.ptr -> Vulkan_types.vk_result

vkGetMemoryHostPointerPropertiesEXT through fn, the function resolved for device: the memory types host_ptr can be imported as. The device must have been created with extension_name enabled.