WebGPU Headers
The WebGPU C API
 
Loading...
Searching...
No Matches
WGPUBuffer methods

Functions whose first argument has type WGPUBuffer. More...

Functions

void wgpuBufferDestroy (WGPUBuffer buffer)
 
void const * wgpuBufferGetConstMappedRange (WGPUBuffer buffer, size_t offset, size_t size)
 
WGPUBufferMapState wgpuBufferGetMapState (WGPUBuffer buffer)
 
void * wgpuBufferGetMappedRange (WGPUBuffer buffer, size_t offset, size_t size)
 
uint64_t wgpuBufferGetSize (WGPUBuffer buffer)
 
WGPUBufferUsage wgpuBufferGetUsage (WGPUBuffer buffer)
 
WGPUFuture wgpuBufferMapAsync (WGPUBuffer buffer, WGPUMapMode mode, size_t offset, size_t size, WGPUBufferMapCallbackInfo callbackInfo)
 
void wgpuBufferSetLabel (WGPUBuffer buffer, WGPUStringView label)
 
void wgpuBufferUnmap (WGPUBuffer buffer)
 
void wgpuBufferAddRef (WGPUBuffer buffer)
 
void wgpuBufferRelease (WGPUBuffer buffer)
 

Detailed Description

Functions whose first argument has type WGPUBuffer.

Function Documentation

◆ wgpuBufferGetConstMappedRange()

void const * wgpuBufferGetConstMappedRange ( WGPUBuffer buffer,
size_t offset,
size_t size )
Parameters
offsetByte offset relative to the beginning of the buffer.
sizeByte size of the range to get. The returned pointer is valid for exactly this many bytes.
Returns
Returns a const pointer to beginning of the mapped range. It must not be written; writing to this range causes undefined behavior. Returns NULL with Implementation-Defined Logging if:
  • There is any content-timeline error as defined in the WebGPU specification for getMappedRange() (alignments, overlaps, etc.) except for overlaps with other const ranges, which are allowed in C. (JS does not allow this because const ranges do not exist.)

◆ wgpuBufferGetMappedRange()

void * wgpuBufferGetMappedRange ( WGPUBuffer buffer,
size_t offset,
size_t size )
Parameters
offsetByte offset relative to the beginning of the buffer.
sizeByte size of the range to get. The returned pointer is valid for exactly this many bytes.
Returns
Returns a mutable pointer to beginning of the mapped range. Returns NULL with Implementation-Defined Logging if:
  • There is any content-timeline error as defined in the WebGPU specification for getMappedRange() (alignments, overlaps, etc.)
  • The buffer is not mapped with WGPUMapMode_Write.