Module Vulkan_api.Kernel

type t = {
  1. shader_module : Vulkan_types.vk_shader_module;
  2. pipeline : Vulkan_types.vk_pipeline;
  3. pipeline_layout : Vulkan_types.vk_pipeline_layout;
  4. descriptor_set_layout : Vulkan_types.vk_descriptor_set_layout;
  5. descriptor_pool : Vulkan_types.vk_descriptor_pool;
  6. descriptor_set : Vulkan_types.vk_descriptor_set;
  7. name : string;
  8. num_bindings : int;
  9. device : Device.t;
}
type arg =
  1. | ArgBuffer : _ Memory.buffer -> arg
  2. | ArgInt32 : int32 -> arg
  3. | ArgInt64 : int64 -> arg
  4. | ArgFloat32 : float -> arg
  5. | ArgFloat64 : float -> arg
  6. | ArgPtr : nativeint -> arg
type any_buffer =
  1. | AnyBuf : 'a Memory.buffer -> any_buffer

Existential wrapper to hide buffer type parameter

type args = {
  1. mutable bindings : (int * any_buffer) list;
  2. mutable descriptor_set : Vulkan_types.vk_descriptor_set;
  3. mutable push_constants : bytes option;
  4. mutable push_constant_offset : int;
  5. mutable buffer_binding : int;
}
val cache : (string, t) Stdlib.Hashtbl.t
val create_shader_module : Device.t -> string -> Vulkan_types.vk_shader_module

Create shader module from SPIR-V

val compile : Device.t -> name:string -> source:string -> t

Compile GLSL source to compute pipeline

val compile_cached : Device.t -> name:string -> source:string -> t
val clear_cache : unit -> unit
val create_args : unit -> args
val set_arg_buffer : args -> 'a -> 'b Memory.buffer -> unit
val ensure_push_constants : args -> bytes
val set_arg_int32 : args -> 'a -> int32 -> unit
val set_arg_int64 : args -> 'a -> int64 -> unit
val set_arg_float32 : args -> 'a -> float -> unit
val set_arg_float64 : args -> 'a -> float -> unit
val set_arg_ptr : 'a -> 'b -> 'c -> 'd
val launch : t -> args:args -> grid:Spoc_framework.Framework_sig.dims -> block:Spoc_framework.Framework_sig.dims -> shared_mem:'a -> stream:Stream.t option -> unit