Skip to content

Conversation

@sunag
Copy link
Collaborator

@sunag sunag commented Aug 23, 2025

Related issue: #27628

Description

Add webgpu_multiple_elements for WebGPURenderer and update the scissor limits if it is misconfigured making the example executable.

@sunag sunag added this to the r180 milestone Aug 23, 2025
@github-actions
Copy link

github-actions bot commented Aug 23, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.91
79.1
338.91
79.1
+0 B
+0 B
WebGPU 577.78
159.15
578.02
159.2
+234 B
+50 B
WebGPU Nodes 576.39
158.91
576.63
158.96
+234 B
+51 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 470.7
113.91
470.7
113.91
+0 B
+0 B
WebGPU 648.33
175.2
648.56
175.25
+234 B
+52 B
WebGPU Nodes 602.42
164.32
602.66
164.38
+234 B
+51 B

@sunag sunag marked this pull request as ready for review August 23, 2025 17:16
@sunag sunag changed the title Examples: Add webgpu_multiple_elements for WebGPURenderer Examples: Add webgpu_multiple_elements Aug 23, 2025
@sunag sunag merged commit fd6a1be into mrdoob:dev Aug 23, 2025
13 of 14 checks passed
@sunag sunag deleted the dev-webgpu-example branch August 23, 2025 19:19
@Mugen87
Copy link
Collaborator

Mugen87 commented Sep 21, 2025

I've done a bit more testing on dev and noticed that webgpu_multiple_elements reports warnings when used with a high resolution screen. This also happens on prod so the issue has not been introduced in the current sprint. On a 5K display, the following WebGPU warning is reported:

Viewport width (8468.000000) exceeds the maximum (8192). This adapter supports a higher maxTextureDimension2D of 16384, which can be specified in requiredLimits when calling requestDevice(). Limits differ by hardware, so always check the adapter limits prior to requesting a higher limit.
While encoding [RenderPassEncoder (unlabeled)].SetViewport(0.000000, 0.000000, 8468.000000, 4812.000000, 0.000000, 1.000000).
While finishing [CommandEncoder "renderContext_1"].

A viewport width of 8468 seems strange. Maybe a bug?

Side note: When reducing the size of the browser window, the warnings eventually disappear. Besides, the WebGL backend seems fine.

@sunag
Copy link
Collaborator Author

sunag commented Sep 21, 2025

On a 5K display, the following WebGPU warning is reported:
A viewport width of 8468 seems strange. Maybe a bug?

Could your pixel ratio be greater than 1?

@Mugen87
Copy link
Collaborator

Mugen87 commented Sep 22, 2025

Yes, the pixel ratio is 2.

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