Skip to content

Examples - Fix Readback in Reduce Example - #34924

Merged
Mugen87 merged 8 commits into
mrdoob:devfrom
cmhhelgeson:cmh/fix_readback
Oct 9, 2026
Merged

Mugen87 merged 8 commits into
mrdoob:devfrom
cmhhelgeson:cmh/fix_readback

Conversation

@cmhhelgeson

Copy link
Copy Markdown
Contributor

Description

Logging buffers in the reduce example was not working after the ReadbackBuffer PR because the ReadbackBuffer was not being properly passed to the getArrayBufferAsync function. Logging now works as intended. Additionally, the arguments of getArrayBufferAsync now match the order in which they are intended to be passed.

/**
 * This method performs a readback operation by moving buffer data from
 * a storage buffer attribute from the GPU to the CPU. ReadbackBuffer can
 * be used to retain and reuse handles to the intermediate buffers and prevent
 * new allocation.
 *
 * @async
 * @param {BufferAttribute} attribute - The storage buffer attribute to read frm.
 * @param {ReadbackBuffer|ArrayBuffer} target - The storage buffer attribute.
 * @param {number} count - The offset from which to start reading the
 * @param {number} offset - The storage buffer attribute.
 * @return {Promise<ArrayBuffer|ReadbackBuffer>} A promise that resolves with the buffer data when the data are ready.
 */
async getArrayBufferAsync( attribute, target = null, offset = 0, count = - 1 ) {

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

📦 Bundle size

Full ESM build including core, minified and gzipped.

Before After Diff
Core 390.53
102.46
390.53
102.46
+0 B
+0 B
WebGL 776.95
194.03
776.95
194.03
+0 B
+0 B
WebGPU 1089.44
293.70
1089.44
293.70
+0 B
+0 B
WebGPU Nodes 1087.39
293.35
1087.39
293.35
+0 B
+0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 518.47
124.58
518.47
124.58
+0 B
+0 B
WebGPU 769.15
206.21
769.15
206.21
+0 B
+0 B
WebGPU Nodes 716.41
192.98
716.41
192.98
+0 B
+0 B

Comment thread examples/webgpu_compute_audio.html Fixed
@Mugen87 Mugen87 added this to the r187 milestone Oct 9, 2026
@Mugen87
Mugen87 merged commit 5d8e8a8 into mrdoob:dev Oct 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants