Capítulo 765 de 859

Chapter 765: ReadbackBuffer

Core Idea

A readback buffer is used to transfer data from the GPU to the CPU. It is primarily used to read back compute shader results.

Key Concepts

  • buffer : ArrayBuffer | null: The mapped, read back array buffer.
  • isReadbackBuffer : boolean (readonly): This flag can be used for type testing.
  • maxByteLength : number: The maximum size of the buffer to be read back.
  • name : string: Name used for debugging purposes.

Reference Tables

Constructor

Signature
new ReadbackBuffer( maxByteLength : number )

Properties

PropertyDescription
`.buffer : ArrayBuffernull`
.isReadbackBuffer : boolean (readonly)This flag can be used for type testing.
.maxByteLength : numberThe maximum size of the buffer to be read back.
.name : stringName used for debugging purposes.

Methods

MethodDescription
.dispose()Frees internal resources.
.release()Releases the mapped buffer data so the GPU buffer can be used by the GPU again.

Key Takeaways

  1. ReadbackBuffer extends: EventDispatcher
  2. Most relevant properties: buffer, isReadbackBuffer, maxByteLength, name.
  3. Key methods: dispose, release.

Connects To