Skip to content

RenderTarget: Fix resize of 3D textures.#31854

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev4
Sep 8, 2025
Merged

RenderTarget: Fix resize of 3D textures.#31854
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev4

Conversation

@Mugen87

@Mugen87 Mugen87 commented Sep 8, 2025

Copy link
Copy Markdown
Collaborator

Fixed #31693.

Description

Makes sure 3D textures don't get the isArrayTexture set to true during a resize. This currently happens and breaks the 3D texture in the backend. The texture is rendered black and the following WebGPU warning is logged:

Dimension (TextureViewDimension::e3D) of [TextureView "colorAttachment_0"] doesn't match the expected dimension (TextureViewDimension::e2DArray).
While validating entries[1] as a Sampled Texture.
Expected entry layout: {sampleType: TextureSampleType::Float, viewDimension: TextureViewDimension::e2DArray, multisampled: 0}
While validating [BindGroupDescriptor ""bindGroup_object""] against [BindGroupLayout (unlabeled)]
While calling [Device].CreateBindGroup([BindGroupDescriptor ""bindGroup_object""]).

You can reproduce the issue by making a resize of the 3D render target in webgpu_rendertarget_2d-array_3d.

I've added a TODO comment in the source since we maybe have to refactor the code from #30959 to avoid setting isArrayTexture in RenderTarget.setSize() and the ctor of Texture.

@Mugen87 Mugen87 added this to the r181 milestone Sep 8, 2025
@github-actions

github-actions Bot commented Sep 8, 2025

Copy link
Copy Markdown

📦 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 579.75
160.19
579.75
160.19
+0 B
+0 B
WebGPU Nodes 578.36
159.95
578.36
159.95
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 469.83
113.84
469.88
113.85
+41 B
+12 B
WebGPU 649.45
175.84
649.49
175.85
+41 B
+12 B
WebGPU Nodes 603.56
165
603.6
165.01
+41 B
+12 B

@Mugen87 Mugen87 merged commit 8683d96 into mrdoob:dev Sep 8, 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.

WebGPU: Resizing RenderTarget3D converts its texture from texture_3d to texture_2d_array

1 participant