Skip to content

Conversation

@cmhhelgeson
Copy link
Contributor

Related issue: #31990

Description

Adds a GPGPU Prefix Sum module to the addons for the WebGPURenderer and adjusts some of the syntax in the other GPGPU examples.

In draft till #31990 is complete since it relies heavily on countTrailingZeros and needs to be rebased.

work on src

use setup approach and register functions that need to be created

bitcountNode

revert glslNodeBuilder changes

lint-fix

revert unintended changes to glslNodeBuilder and MathNode, change bitCount helper function names

remove extra _include

change mainLayout function to accurately reflect WGSL documentation (component wise bitCounts rather than accumulative bitCounts

fix nodeType

init branch

fix

prefix sum from other branch

eod

changes

validate reduction, fix display/debug issues

fix prefix sum errors

fix

fix spine scan and work on fixing downsweep

add comments

work

work

working prefix sum
@github-actions
Copy link

github-actions bot commented Nov 9, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 356.24
86.47
356.24
86.47
+0 B
+0 B
WebGPU 610.57
171.28
613.69
172.2
+3.12 kB
+912 B
WebGPU Nodes 609.18
171.02
612.3
171.94
+3.12 kB
+921 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 488.03
121.24
488.03
121.24
+0 B
+0 B
WebGPU 679.51
186.54
683.14
187.49
+3.63 kB
+956 B
WebGPU Nodes 621.23
169.71
624.86
170.73
+3.63 kB
+1.01 kB

import {
StorageInstancedBufferAttribute
} from 'three';
import { Fn, If, instancedArray, invocationLocalIndex, countTrailingZeros, Loop, workgroupArray, subgroupSize, workgroupBarrier, workgroupId, uint, select, invocationSubgroupIndex, dot, uvec4, vec4, float, subgroupAdd, array, subgroupShuffle, subgroupInclusiveAdd, subgroupBroadcast, invocationSubgroupMetaIndex, arrayBuffer, storage } from 'three/tsl';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import arrayBuffer.
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.

1 participant