Sarek_vulkan.Vulkan_api_baseval memcpy :
unit Ctypes_static.ptr ->
unit Ctypes_static.ptr ->
Unsigned.size_t ->
unit Ctypes_static.ptrmemcpy from libc for memory transfers
exception Vk_result_error of Vulkan_types.vk_result * stringDeprecated: no longer raised. check below now raises the canonical Vulkan_error.Vulkan_error (a Backend_error alias) via the shared Sarek_backend_error.Backend_error.Make.check funnel. Kept only so out-of-tree code matching on Vulkan_api_base.Vk_result_error (code, ctx) (or the re-exported Vulkan_api.Vk_result_error) still compiles (this library is opam-published).
val check : string -> Vulkan_types.vk_result -> unitCheck Vulkan result and raise a canonical Backend_error on failure.
Interval between warnings while a fence wait goes on, in nanoseconds.
Optional bound on a fence wait, from SPOC_VULKAN_FENCE_TIMEOUT_S (seconds, positive), read once when the library is loaded. Unset means unbounded: a wait on submitted work ends only when the work completes or the device reports an error, because a caller that gave up early could free memory the GPU still uses. The bound exists for tests that use it as a hang detector. A malformed value is kept as Error and refused by check_fence_wait_bound, called when a device is created, so it never surfaces after a submission.
val inject_wait_failure : Vulkan_types.vk_result option Stdlib.refTest hook: while Some r, every fence wait fails with r before waiting (the caller should have made the queue idle first and clears the hook).
Test instrumentation, not an API: number of vkWaitForFences sequences started and of fence-carrying vkQueueSubmits that succeeded, since the library was loaded. Instrumentation for tests that assert how many host waits a run of launches costs.
val wait_fence :
string ->
Vulkan_types.vk_device Ctypes.structure Ctypes_static.ptr ->
Vulkan_types.vk_fence ->
unitWait for fence on device until it is signalled. Logs a warning naming ctx every fence_warn_interval_ns. Raises the canonical error of check on a device error, and Synchronization_failed only when fence_wait_bound_parsed sets a bound and it is reached.
val inject_status_failure : Vulkan_types.vk_result option Stdlib.refTest hook: while Some r, every fence status query returns r.
val fence_signalled :
string ->
Vulkan_types.vk_device Ctypes.structure Ctypes_static.ptr ->
Vulkan_types.vk_fence ->
boolWhether fence has signalled, without blocking. Raises the canonical error of check on a device error.
val reset_fence :
string ->
Vulkan_types.vk_device Ctypes.structure Ctypes_static.ptr ->
Vulkan_types.vk_fence ->
unitReset fence on device. The fence must not be pending in a queue.
A fence with its submission state. Invariant: pending = true implies the fence was handed to a successful vkQueueSubmit and has not been waited for since. Waits happen only when pending is set, so a fence that was never submitted (or whose submission failed) is never waited on.
val create_tracked_fence :
Vulkan_types.vk_device Ctypes.structure Ctypes_static.ptr ->
tracked_fenceval await_fence :
string ->
Vulkan_types.vk_device Ctypes.structure Ctypes_static.ptr ->
tracked_fence ->
unitWait for fence if it is pending, then mark it not pending.
val submit_with_fence :
string ->
Vulkan_types.vk_device Ctypes.structure Ctypes_static.ptr ->
tracked_fence ->
(Vulkan_types.vk_fence -> Vulkan_types.vk_result) ->
unitReset fence and pass it to submit; mark it pending only when submit returns VK_SUCCESS. The fence must not be pending.
val destroy_tracked_fence :
string ->
Vulkan_types.vk_device Ctypes.structure Ctypes_static.ptr ->
tracked_fence ->
unitWait out a pending submission, then destroy fence (VUID-vkDestroyFence-fence-01120).
A shader that uses subgroup operations (GL_KHR_shader_subgroup_*, emitted by the warp shuffles) needs SPIR-V 1.3, i.e. the Vulkan 1.1 target environment. It is requested for those shaders ONLY: Vulkan 1.1 changes the storage class of buffer blocks, which the note below keeps away from every other shader. The device side is already at 1.2 (Vulkan_api_device).
Compile GLSL to SPIR-V using glslangValidator. Requires glslangValidator in PATH.
Compile GLSL to SPIR-V using Shaderc if available, otherwise fallback to CLI