Interface GPUBuffer

Hierarchy

Properties

label: string
size: number
usage: number

Methods

  • Destroys the GPUBuffer. Note: It is valid to destroy a buffer multiple times. Note: Since no further operations can be enqueued using this buffer, implementations can free resource allocations, including mapped memory that was just unmapped.

    Returns undefined

  • Returns an ArrayBuffer with the contents of the GPUBuffer in the given mapped range.

    Parameters

    • Optional offset: number

      Offset in bytes into the buffer to return buffer contents from.

    • Optional size: number

      Size in bytes of the ArrayBuffer to return.

    Returns ArrayBuffer

  • Maps the given range of the GPUBuffer and resolves the returned Promise when the GPUBuffer's content is ready to be accessed with getMappedRange. The resolution of the returned Promise only indicates that the buffer has been mapped. It does not guarantee the completion of any other operations visible to the content timeline, and in particular does not imply that any other Promise returned from () or mapAsync on other GPUBuffers have resolved. The resolution of the Promise returned from onSubmittedWorkDone does imply the completion of mapAsync calls made prior to that call, on GPUBuffers last used exclusively on that queue.

    Parameters

    • mode: number

      Whether the buffer should be mapped for reading or writing.

    • Optional offset: number

      Offset in bytes into the buffer to the start of the range to map.

    • Optional size: number

      Size in bytes of the range to map.

    Returns Promise<undefined>

  • Unmaps the mapped range of the GPUBuffer and makes it's contents available for use by the GPU again.

    Returns undefined

Generated using TypeDoc