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

TSL: Improve warnings #30783

Merged
merged 2 commits into from
Mar 24, 2025
Merged

TSL: Improve warnings #30783

merged 2 commits into from
Mar 24, 2025

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Mar 24, 2025

Description

This should help users find the cause of an error, make TSL more user-friendly in error messages and prevent the renderer from crashing.


Example 1

materialBox.colorNode = sin();

Now

image

Old

image


Example 2

materialBox.colorNode = sin( 1, 2 );

Now

image

Old

image

@sunag sunag added this to the r175 milestone Mar 24, 2025
Copy link

github-actions bot commented Mar 24, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.08
78.29
336.08
78.29
+0 B
+0 B
WebGPU 526.44
146.68
529.98
147.23
+3.54 kB
+554 B
WebGPU Nodes 525.91
146.58
529.45
147.13
+3.54 kB
+554 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.15
112.18
465.15
112.18
+0 B
+0 B
WebGPU 598.64
162.71
601.62
163.19
+2.98 kB
+476 B
WebGPU Nodes 553.72
152.18
556.66
152.63
+2.94 kB
+458 B

@sunag sunag marked this pull request as ready for review March 24, 2025 02:38
@sunag sunag merged commit b0805c2 into mrdoob:dev Mar 24, 2025
12 checks passed
@sunag sunag deleted the dev-tsl-warnings branch March 24, 2025 17:24
@Makio64
Copy link
Contributor

Makio64 commented Mar 24, 2025

@sunag thanks it's time saver, also is there a way to fully output the shader ?

@Mugen87
Copy link
Collaborator

Mugen87 commented Mar 24, 2025

Maybe #28997 helps?

@Makio64
Copy link
Contributor

Makio64 commented Mar 25, 2025

@sunag @Mugen87 Do you think it would be possible to do node.debug() or node.shader() to output the current shader result of the node?

This way it'll be possible to double check the output code easily at different step.
I can open an issue to discuss it.

@Methuselah96
Copy link
Contributor

@sunag Looks like this produces some warnings in the webgpu_compute_texture_pingpong example:
image

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.

4 participants