Class Buffer

A handle to a GPU-accessible buffer.

class Buffer ;

Created with Device.createBuffer.

Fields

NameTypeDescription
descriptor const(__C.WGPUBufferDescriptor)Describes this Buffer.
label const(string)Optional, human-readable debug label.
status BufferMapAsyncStatusResult of a call to Buffer.mapReadAsync or Buffer.mapWriteAsync.

Methods

NameDescription
binding (location, offset) Creates a buffer binding starting at offset and ending at the end of the buffer.
binding (location, offset, size) Creates a buffer binding starting at offset and ending at offset+size.
bindingLayout (location, visibility, type, hasDynamicOffset, minBindingSize)
destroy () Release the given handle.
getMappedRange (start, size) Get the sliced Buffer data requested by either Buffer.mapReadAsync or Buffer.mapWriteAsync.
mapReadAsync (start, size) Map the buffer for reading asynchronously.
mapWriteAsync (start, size) Map the buffer for writing asynchronously.
unmap () Flushes any pending write operations and unmaps the buffer from host memory.

See Also

wgpu::Buffer