Skip to content

Conversation

@Berthur
Copy link
Contributor

@Berthur Berthur commented Sep 15, 2025

Currently, Three.js supports the WebGPU Render Bundle API through its BundleGroup class. It also supports rendering to multiple render targets on WebGPU.

However, there seems to be no way to use both at the same time. We get a WebGPU error like Attachment state of [RenderPipeline "renderPipeline_NodeMaterial_17"] is not compatible with [RenderBundleEncoder "renderBundleEncoder"]., because the render bundle encoder only contains a single target.

In this pull request, I attempt to add support to multiple render targets when using render bundle, by including all targets in the render bundle encoder.

With this fix, it indeed becomes possible to use these features together. Still, I don't know if this is the best way to do it. I welcome feedback/discussion from someone more familiar with this part of the code.

This contribution is funded by Trimble

@github-actions
Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.24
79.14
338.24
79.14
+0 B
+0 B
WebGPU 584.32
161.46
584.45
161.48
+131 B
+21 B
WebGPU Nodes 582.93
161.22
583.06
161.24
+131 B
+21 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 469.7
113.74
469.7
113.74
+0 B
+0 B
WebGPU 653.67
176.96
653.8
176.98
+131 B
+24 B
WebGPU Nodes 607.78
166.14
607.91
166.16
+131 B
+24 B

@sunag sunag added this to the r181 milestone Sep 15, 2025
@sunag sunag changed the title Make WebGPU render bundle work with multiple render targets WebGPURenderer: Render bundle work with multiple render targets Sep 15, 2025
@sunag sunag merged commit d78c8d9 into mrdoob:dev Sep 22, 2025
9 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.

2 participants