Skip to content

TSL: Fix redundant min/max calls being generated#33441

Merged
sunag merged 1 commit into
mrdoob:devfrom
shotamatsuda:fix/tsl-min-max
Apr 22, 2026
Merged

TSL: Fix redundant min/max calls being generated#33441
sunag merged 1 commit into
mrdoob:devfrom
shotamatsuda:fix/tsl-min-max

Conversation

@shotamatsuda

@shotamatsuda shotamatsuda commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes TSL's min and max generate redundant function calls.

Before:

min(0, 1, 2, 3) // min( min( min( min( 0.0, 1.0 ), 1.0 ), 2.0 ), 3.0 )

After:

min(0, 1, 2, 3) // min( min( min( 0.0, 1.0 ), 2.0 ), 3.0 )

@github-actions

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 365.31
86.78
365.31
86.78
+0 B
+0 B
WebGPU 639.21
177.47
639.21
177.47
+0 B
+0 B
WebGPU Nodes 637.33
177.18
637.33
177.18
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 497.82
121.45
497.82
121.45
+0 B
+0 B
WebGPU 711.06
192.41
711.06
192.41
+0 B
-2 B
WebGPU Nodes 660.28
179.65
660.28
179.65
+0 B
+0 B

@Mugen87 Mugen87 added this to the r185 milestone Apr 22, 2026
@sunag sunag merged commit 95743af into mrdoob:dev Apr 22, 2026
10 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.

3 participants