Module Sarek_vulkan.Vulkan_api_stream

Streams (specs/vulkan-async-launches.md).

A launch is appended to the stream's open command buffer and returns (Vulkan_api_batch.record_dispatch). The buffer is submitted, not waited for, when it holds batch_limit dispatches, when another stream of the device launches, and at any synchronisation point. The host blocks at synchronize, at Vulkan_api_device.drain_pending (host access to device memory, device wait, kernel eviction, device destroy) and when a command buffer is reused. A stream has two command buffers, so one can be recorded while the other runs.

All streams of a device submit to one queue, in launch order, because a launch first submits the open batches of the device's other streams; dispatches are ordered in memory by barriers (Vulkan_api_barrier).

module Device = Vulkan_api_device
val batch_limit : int Stdlib.ref
val max_deferred_bytes : int Stdlib.ref
val record_dispatch : Vulkan_api_slot.stream -> kernel:string -> layout:Vulkan_types.vk_descriptor_set_layout -> descriptors:int -> record: (Vulkan_types.vk_command_buffer Ctypes.structure Ctypes.ptr -> Vulkan_types.vk_descriptor_set -> unit) -> unit
val flush_device : Sarek_vulkan.Vulkan_api_batch.Device.t -> unit
val synchronize : Vulkan_api_slot.stream -> unit
val pending_launches : Sarek_vulkan.Vulkan_api_batch.Device.t -> int
val forget_default : Vulkan_api_slot.stream -> unit
val destroy : Vulkan_api_slot.stream -> unit

Nothing is unregistered if the wait for pending work raises: the stream stays reachable and intact.