Skip to content

Conversation

@cmhhelgeson
Copy link
Contributor

Description

Adds the ability to access compute built-ins that are already defined by default directly within TSL. There are a few changes I made that I think might deserve further consideration.

  1. Enabling subgroups by default if the feature is accessible: I largely did this to obviate the need for further logic within ComputeBuiltin that enables subgroups and activates the built-in should it be requested, or creating a separate node specifically for subgroup_size. However, we might not want to enable subgroups by default in every shader.

  2. Creating ComputeBuiltinNode: A lot of the logic is similar to AttributeNode, however, I figured it would be better to separate accessing these builtins from accessing vertex attributes, as they serve different purposes, even if they are both considered 'attributes' within the context of the NodeBuilder.

@github-actions
Copy link

github-actions bot commented Sep 22, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 687.32
170.19
687.32
170.19
+0 B
+0 B
WebGPU 835.97
224.07
837.63
224.53
+1.66 kB
+454 B
WebGPU Nodes 835.48
223.95
837.14
224.41
+1.66 kB
+457 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 463.24
111.86
463.24
111.86
+0 B
+0 B
WebGPU 532.38
143.56
532.97
143.68
+585 B
+123 B
WebGPU Nodes 489.04
133.42
489.63
133.53
+585 B
+109 B

@cmhhelgeson cmhhelgeson force-pushed the webgpu_access_compute_builtin branch from 7374f40 to b3c0fbf Compare September 23, 2024 03:19
@sunag sunag added this to the r169 milestone Sep 23, 2024
@sunag sunag merged commit 7d73099 into mrdoob:dev Sep 25, 2024
@cmhhelgeson cmhhelgeson deleted the webgpu_access_compute_builtin branch September 25, 2024 04:25
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.

2 participants