Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Sep 8, 2025

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
Copy link

github-actions bot commented Sep 8, 2025

📦 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