WebGPU module

webgpu_map_buffer

procedure · 1 overloadSource

Map size bytes of buffer at offset for reading (.Read) or writing (.Write) and wait until they are; then wgpuBufferGetConstMappedRange / wgpuBufferGetMappedRange give the bytes and wgpuBufferUnmap ends it. False (and the reason logged) when mapping failed.

webgpu_map_buffer :: (
    instance: WGPUInstance,
    buffer: WGPUBuffer,
    mode: WGPUMapMode,
    offset: u64 = 0,
    size: u64 = WGPU_WHOLE_MAP_SIZE
) -> bool

Map size bytes of buffer at offset for reading (.Read) or writing (.Write) and wait until they are; then wgpuBufferGetConstMappedRange / wgpuBufferGetMappedRange give the bytes and wgpuBufferUnmap ends it. False (and the reason logged) when mapping failed.

Parameters

instance: WGPUInstance
buffer: WGPUBuffer
mode: WGPUMapMode
offset: u64
size: u64

Returns

bool

See also