TSL: Add support packed 4x8 integer operations - #34412
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
|
|
||
| generate( builder, output ) { | ||
|
|
||
| if ( builder.renderer.backend.isWebGPUBackend !== true ) { |
There was a problem hiding this comment.
I think we should also add below check in the if clause:
navigator.gpu.wgslLanguageFeatures.has( 'packed_4x8_integer_dot_product' )|
|
||
| if ( builder.renderer.backend.isWebGPUBackend !== true ) { | ||
|
|
||
| throw new Error( `THREE.TSL: "${this.method}" is only supported by the WebGPU backend.` ); |
There was a problem hiding this comment.
Follow the pattern established by subgroup nodes: expose the WebGPU-only operations directly.
I'm not sure this is the right call here. Subgroup functions can't exist without hardware support, so it's fine to throw errors in that context. But in the context of packed_4x8_integer_dot_product , all eight builtins are emulatable with plain integer bit operations. We only loose hardware acceleration but that is acceptable, imo.
- The pack/unpack functions are shift/mask sequences.
- The dot functions basically unpack both operands and multiply-add the four lanes.
Let's try to use BitcountNode as a template instead.
There was a problem hiding this comment.
Would you like emulation just for WGSL? Or also for GLSL?
There was a problem hiding this comment.
I will add both for now.
🖼️ E2E screenshot tests❌ 1 example(s) failed (full artifacts).
|



packed_4x8_integer_dot_productlanguage extension.