Skip to content

WebGPURenderer: Introduce initRenderTarget().#32867

Merged
Mugen87 merged 2 commits into
mrdoob:devfrom
Mugen87:dev4
Jan 27, 2026
Merged

WebGPURenderer: Introduce initRenderTarget().#32867
Mugen87 merged 2 commits into
mrdoob:devfrom
Mugen87:dev4

Conversation

@Mugen87

@Mugen87 Mugen87 commented Jan 27, 2026

Copy link
Copy Markdown
Collaborator

Related issue: -

Description

TRAA and other code sometimes requires to copy render target data. Render targets might be in a state though where they are not initialized yet e.g. right after a dispose() due to a resize.

Previously we initialized the render targets by clearing them once but that was just a workaround which introduced unnecessary clears. The PR introduces initRenderTarget() (similar to WebGLRenderer.initRenderTarget()) that only performs the needed operations meaning setting up correct render context data and for the WebGL backend configure the framebuffer state.

@github-actions

github-actions Bot commented Jan 27, 2026

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 357.49
84.84
357.49
84.84
+0 B
+0 B
WebGPU 622.1
172.81
622.71
172.91
+607 B
+103 B
WebGPU Nodes 620.7
172.57
621.31
172.67
+607 B
+104 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 490.47
119.9
490.47
119.9
+0 B
+0 B
WebGPU 693.21
188.1
693.82
188.21
+607 B
+103 B
WebGPU Nodes 642.59
175.2
643.2
175.31
+607 B
+104 B

@Mugen87 Mugen87 changed the title Renderer: Introduce initRenderTarget(). WebGPURenderer: Introduce initRenderTarget(). Jan 27, 2026
@Mugen87 Mugen87 added this to the r183 milestone Jan 27, 2026
@Mugen87

Mugen87 commented Jan 27, 2026

Copy link
Copy Markdown
Collaborator Author

I'll go ahead and merge since I need initRenderTarget() on dev to investigate another bug.

@Mugen87 Mugen87 merged commit b59b5e7 into mrdoob:dev Jan 27, 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.

1 participant