Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGPURenderer: Fix integer uniforms #29976

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

holtsetio
Copy link
Contributor

@holtsetio holtsetio commented Nov 26, 2024

Related issue: Closes #29952

Description

Before this fix, int/ivec/uint/uvec uniforms were uploaded as floats while still being treated as integers by webgpu, thus causing nonsense values.
The Compute Attractors Particles Demo was also modified to use an uint uniform for the number of attractors instead of float, for best practice and to showcase the integer uniform fix.

@holtsetio holtsetio changed the title Fix web gpu integer uniforms Fix WebGPU integer uniforms Nov 26, 2024
Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 339.14
78.99
339.14
78.99
+0 B
+0 B
WebGPU 483
134.08
483.59
134.17
+594 B
+91 B
WebGPU Nodes 482.46
133.98
483.06
134.07
+594 B
+90 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 464.62
111.98
464.62
111.98
+0 B
+0 B
WebGPU 552.12
149.43
552.72
149.52
+594 B
+95 B
WebGPU Nodes 508
139.14
508.6
139.24
+594 B
+98 B

@sunag sunag added this to the r171 milestone Nov 26, 2024
@sunag sunag changed the title Fix WebGPU integer uniforms WebGPURenderer: Fix integer uniforms Nov 26, 2024
@sunag sunag merged commit 92e60c2 into mrdoob:dev Nov 26, 2024
12 checks passed
@holtsetio holtsetio deleted the fix-WebGPUIntegerUniforms branch November 26, 2024 17:00
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.

Integer uniforms get uploaded to the GPU as Floats
2 participants