Module Lit.Renderer.Buf

module Buf: sig .. end
Renderer specific buffer functions.


Mapping GPU buffers in CPU


val map : Lit.renderer ->
[ `R | `RW | `W ] ->
Lit.Buf.t -> ('a, 'b) Bigarray.kind -> ('a, 'b) Lit.bigarray
map r access b kind maps the GPU buffer of b with access access.

Warning. A mapped buffer cannot be used in a render operation, you need to Lit.Renderer.Buf.unmap it first. Once unmapped the bigarray becomes invalid. Don't try to access it, it may result in program termination.
Raises Invalid_argument if kind does not match buf's scalar type.

val unmap : Lit.renderer -> Lit.Buf.t -> unit
unmap r b unmaps the buffer b.

Warning. This invalidates the memory pointed to by the bigarray returned by Lit.Renderer.Buf.map, do not try to access it after this function has been called it may result in program termination.