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 mat2() arguments #30543

Merged
merged 5 commits into from
Feb 17, 2025

Conversation

RenaudRohlinger
Copy link
Collaborator

@RenaudRohlinger RenaudRohlinger commented Feb 17, 2025

Description
This PR fixes mat2() incorrectly interpreted as vec4 in the Node Builder. This fix ensures correct type handling.

This contribution is funded by Utsubo

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…o zero if no arguments
Copy link

github-actions bot commented Feb 17, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.36
78.33
336.36
78.33
+0 B
+0 B
WebGPU 518.85
144
518.88
144.01
+26 B
+13 B
WebGPU Nodes 518.32
143.88
518.34
143.9
+26 B
+13 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.35
112.17
465.35
112.17
+0 B
+0 B
WebGPU 590.68
159.95
590.71
159.97
+26 B
+14 B
WebGPU Nodes 545.99
149.43
546.01
149.44
+26 B
+13 B

@RenaudRohlinger RenaudRohlinger changed the title WebGPURenderer: Fix mat2() and matN(x) behaviors WebGPURenderer: Fix mat2() arguments Feb 17, 2025
@RenaudRohlinger
Copy link
Collaborator Author

RenaudRohlinger commented Feb 17, 2025

In WGSL specs, matrices without arguments are Zero Valued. Should we align to the specs or keep identity (GLSL behavior) like now?
https://www.w3.org/TR/WGSL/#zero-value-builtin-function

/cc @Mugen87 @sunag

@sunag
Copy link
Collaborator

sunag commented Feb 17, 2025

I think it's better to follow GLSL behavior as we are doing with other things in order to facilitate TSL Transpiler and code migration.

@sunag sunag added this to the r174 milestone Feb 17, 2025
@sunag sunag merged commit 3ba9864 into mrdoob:dev Feb 17, 2025
12 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.

None yet

2 participants