Skip to content

Conversation

@sunag
Copy link
Collaborator

@sunag sunag commented Jul 26, 2025

Fixes #31479

Description

If a boolean uniform is declared, TSL will convert the uniform input to a uint and create a bool variable as a cache, which will be used as a reference for the uniform node throughout the rest of the code. This works around the non-host-shareable limitation.

@sunag sunag added this to the r179 milestone Jul 26, 2025
@github-actions
Copy link

github-actions bot commented Jul 26, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.37
78.9
338.37
78.9
+0 B
+0 B
WebGPU 561.4
155.29
561.71
155.37
+309 B
+82 B
WebGPU Nodes 560.01
155.05
560.32
155.13
+309 B
+83 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 469.75
113.6
469.75
113.6
+0 B
+0 B
WebGPU 636.14
172.14
636.45
172.23
+309 B
+94 B
WebGPU Nodes 590.79
161.38
591.1
161.46
+309 B
+82 B

@sunag sunag marked this pull request as ready for review July 26, 2025 03:23
@sunag sunag merged commit a1d8dde into mrdoob:dev Jul 26, 2025
9 checks passed
@sunag sunag deleted the dev-add-bool branch July 26, 2025 03:58
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.

TSL: Unable to use "bool" uniform

1 participant