@nodetool-ai/gpu 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/blend/blendModes.d.ts +67 -0
- package/dist/blend/blendModes.d.ts.map +1 -0
- package/dist/blend/blendModes.js +80 -0
- package/dist/blend/blendModes.js.map +1 -0
- package/dist/blend/index.d.ts +10 -0
- package/dist/blend/index.d.ts.map +1 -0
- package/dist/blend/index.js +10 -0
- package/dist/blend/index.js.map +1 -0
- package/dist/blend/wgsl.d.ts +16 -0
- package/dist/blend/wgsl.d.ts.map +1 -0
- package/dist/blend/wgsl.js +85 -0
- package/dist/blend/wgsl.js.map +1 -0
- package/dist/compositor/compositor.d.ts +112 -0
- package/dist/compositor/compositor.d.ts.map +1 -0
- package/dist/compositor/compositor.js +353 -0
- package/dist/compositor/compositor.js.map +1 -0
- package/dist/compositor/headless.d.ts +47 -0
- package/dist/compositor/headless.d.ts.map +1 -0
- package/dist/compositor/headless.js +158 -0
- package/dist/compositor/headless.js.map +1 -0
- package/dist/compositor/index.d.ts +8 -0
- package/dist/compositor/index.d.ts.map +1 -0
- package/dist/compositor/index.js +8 -0
- package/dist/compositor/index.js.map +1 -0
- package/dist/compositor/shaders.d.ts +24 -0
- package/dist/compositor/shaders.d.ts.map +1 -0
- package/dist/compositor/shaders.js +241 -0
- package/dist/compositor/shaders.js.map +1 -0
- package/dist/compositor/transform.d.ts +49 -0
- package/dist/compositor/transform.d.ts.map +1 -0
- package/dist/compositor/transform.js +74 -0
- package/dist/compositor/transform.js.map +1 -0
- package/dist/context.d.ts +108 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +205 -0
- package/dist/context.js.map +1 -0
- package/dist/debug/premulValidator.d.ts +85 -0
- package/dist/debug/premulValidator.d.ts.map +1 -0
- package/dist/debug/premulValidator.js +239 -0
- package/dist/debug/premulValidator.js.map +1 -0
- package/dist/executor.d.ts +74 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/executor.js +413 -0
- package/dist/executor.js.map +1 -0
- package/dist/fullscreenQuad.d.ts +11 -0
- package/dist/fullscreenQuad.d.ts.map +1 -0
- package/dist/fullscreenQuad.js +31 -0
- package/dist/fullscreenQuad.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/module.d.ts +162 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +100 -0
- package/dist/module.js.map +1 -0
- package/dist/node.d.ts +38 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +140 -0
- package/dist/node.js.map +1 -0
- package/dist/pool.d.ts +30 -0
- package/dist/pool.d.ts.map +1 -0
- package/dist/pool.js +33 -0
- package/dist/pool.js.map +1 -0
- package/dist/recipe.d.ts +148 -0
- package/dist/recipe.d.ts.map +1 -0
- package/dist/recipe.js +181 -0
- package/dist/recipe.js.map +1 -0
- package/dist/registry.d.ts +49 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +100 -0
- package/dist/registry.js.map +1 -0
- package/dist/shaders/_canary/passthrough/v1/module.d.ts +13 -0
- package/dist/shaders/_canary/passthrough/v1/module.d.ts.map +1 -0
- package/dist/shaders/_canary/passthrough/v1/module.js +71 -0
- package/dist/shaders/_canary/passthrough/v1/module.js.map +1 -0
- package/dist/shaders/alpha/premulToStraight/v1/module.d.ts +16 -0
- package/dist/shaders/alpha/premulToStraight/v1/module.d.ts.map +1 -0
- package/dist/shaders/alpha/premulToStraight/v1/module.js +62 -0
- package/dist/shaders/alpha/premulToStraight/v1/module.js.map +1 -0
- package/dist/shaders/alpha/straightToPremul/v1/module.d.ts +19 -0
- package/dist/shaders/alpha/straightToPremul/v1/module.d.ts.map +1 -0
- package/dist/shaders/alpha/straightToPremul/v1/module.js +61 -0
- package/dist/shaders/alpha/straightToPremul/v1/module.js.map +1 -0
- package/dist/shaders/color/brightnessContrast/v1/module.d.ts +17 -0
- package/dist/shaders/color/brightnessContrast/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/brightnessContrast/v1/module.js +84 -0
- package/dist/shaders/color/brightnessContrast/v1/module.js.map +1 -0
- package/dist/shaders/color/cdl/v1/module.d.ts +35 -0
- package/dist/shaders/color/cdl/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/cdl/v1/module.js +106 -0
- package/dist/shaders/color/cdl/v1/module.js.map +1 -0
- package/dist/shaders/color/channelMerge/v1/module.d.ts +22 -0
- package/dist/shaders/color/channelMerge/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/channelMerge/v1/module.js +101 -0
- package/dist/shaders/color/channelMerge/v1/module.js.map +1 -0
- package/dist/shaders/color/channelShuffle/v1/module.d.ts +29 -0
- package/dist/shaders/color/channelShuffle/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/channelShuffle/v1/module.js +94 -0
- package/dist/shaders/color/channelShuffle/v1/module.js.map +1 -0
- package/dist/shaders/color/channelSplit/v1/module.d.ts +18 -0
- package/dist/shaders/color/channelSplit/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/channelSplit/v1/module.js +90 -0
- package/dist/shaders/color/channelSplit/v1/module.js.map +1 -0
- package/dist/shaders/color/colorBalance/v1/module.d.ts +18 -0
- package/dist/shaders/color/colorBalance/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/colorBalance/v1/module.js +86 -0
- package/dist/shaders/color/colorBalance/v1/module.js.map +1 -0
- package/dist/shaders/color/cubeLut/v1/module.d.ts +14 -0
- package/dist/shaders/color/cubeLut/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/cubeLut/v1/module.js +78 -0
- package/dist/shaders/color/cubeLut/v1/module.js.map +1 -0
- package/dist/shaders/color/curves/v1/module.d.ts +31 -0
- package/dist/shaders/color/curves/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/curves/v1/module.js +102 -0
- package/dist/shaders/color/curves/v1/module.js.map +1 -0
- package/dist/shaders/color/exposure/v1/module.d.ts +15 -0
- package/dist/shaders/color/exposure/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/exposure/v1/module.js +78 -0
- package/dist/shaders/color/exposure/v1/module.js.map +1 -0
- package/dist/shaders/color/exposureTone/v1/module.d.ts +28 -0
- package/dist/shaders/color/exposureTone/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/exposureTone/v1/module.js +107 -0
- package/dist/shaders/color/exposureTone/v1/module.js.map +1 -0
- package/dist/shaders/color/filmLook/v1/module.d.ts +28 -0
- package/dist/shaders/color/filmLook/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/filmLook/v1/module.js +103 -0
- package/dist/shaders/color/filmLook/v1/module.js.map +1 -0
- package/dist/shaders/color/grade/v1/module.d.ts +35 -0
- package/dist/shaders/color/grade/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/grade/v1/module.js +182 -0
- package/dist/shaders/color/grade/v1/module.js.map +1 -0
- package/dist/shaders/color/grayscale/v1/module.d.ts +14 -0
- package/dist/shaders/color/grayscale/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/grayscale/v1/module.js +79 -0
- package/dist/shaders/color/grayscale/v1/module.js.map +1 -0
- package/dist/shaders/color/hsb/v1/module.d.ts +20 -0
- package/dist/shaders/color/hsb/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/hsb/v1/module.js +131 -0
- package/dist/shaders/color/hsb/v1/module.js.map +1 -0
- package/dist/shaders/color/hslAdjust/v1/module.d.ts +30 -0
- package/dist/shaders/color/hslAdjust/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/hslAdjust/v1/module.js +170 -0
- package/dist/shaders/color/hslAdjust/v1/module.js.map +1 -0
- package/dist/shaders/color/invert/v1/module.d.ts +15 -0
- package/dist/shaders/color/invert/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/invert/v1/module.js +85 -0
- package/dist/shaders/color/invert/v1/module.js.map +1 -0
- package/dist/shaders/color/levels/v1/module.d.ts +33 -0
- package/dist/shaders/color/levels/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/levels/v1/module.js +116 -0
- package/dist/shaders/color/levels/v1/module.js.map +1 -0
- package/dist/shaders/color/liftGammaGain/v1/module.d.ts +40 -0
- package/dist/shaders/color/liftGammaGain/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/liftGammaGain/v1/module.js +114 -0
- package/dist/shaders/color/liftGammaGain/v1/module.js.map +1 -0
- package/dist/shaders/color/posterize/v1/module.d.ts +16 -0
- package/dist/shaders/color/posterize/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/posterize/v1/module.js +80 -0
- package/dist/shaders/color/posterize/v1/module.js.map +1 -0
- package/dist/shaders/color/solarize/v1/module.d.ts +15 -0
- package/dist/shaders/color/solarize/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/solarize/v1/module.js +83 -0
- package/dist/shaders/color/solarize/v1/module.js.map +1 -0
- package/dist/shaders/color/splitToning/v1/module.d.ts +26 -0
- package/dist/shaders/color/splitToning/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/splitToning/v1/module.js +95 -0
- package/dist/shaders/color/splitToning/v1/module.js.map +1 -0
- package/dist/shaders/filters/blur/gaussian/v1/module.d.ts +23 -0
- package/dist/shaders/filters/blur/gaussian/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/blur/gaussian/v1/module.js +110 -0
- package/dist/shaders/filters/blur/gaussian/v1/module.js.map +1 -0
- package/dist/shaders/filters/blur/separable/v1/module.d.ts +18 -0
- package/dist/shaders/filters/blur/separable/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/blur/separable/v1/module.js +64 -0
- package/dist/shaders/filters/blur/separable/v1/module.js.map +1 -0
- package/dist/shaders/filters/convolve3x3/v1/module.d.ts +23 -0
- package/dist/shaders/filters/convolve3x3/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/convolve3x3/v1/module.js +128 -0
- package/dist/shaders/filters/convolve3x3/v1/module.js.map +1 -0
- package/dist/shaders/filters/glow/v1/module.d.ts +26 -0
- package/dist/shaders/filters/glow/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/glow/v1/module.js +102 -0
- package/dist/shaders/filters/glow/v1/module.js.map +1 -0
- package/dist/shaders/filters/grain/v1/module.d.ts +38 -0
- package/dist/shaders/filters/grain/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/grain/v1/module.js +110 -0
- package/dist/shaders/filters/grain/v1/module.js.map +1 -0
- package/dist/shaders/filters/pixelate/v1/module.d.ts +14 -0
- package/dist/shaders/filters/pixelate/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/pixelate/v1/module.js +76 -0
- package/dist/shaders/filters/pixelate/v1/module.js.map +1 -0
- package/dist/shaders/filters/sharpen/unsharpMask/v1/module.d.ts +17 -0
- package/dist/shaders/filters/sharpen/unsharpMask/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/sharpen/unsharpMask/v1/module.js +93 -0
- package/dist/shaders/filters/sharpen/unsharpMask/v1/module.js.map +1 -0
- package/dist/shaders/filters/threshold/v1/module.d.ts +17 -0
- package/dist/shaders/filters/threshold/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/threshold/v1/module.js +71 -0
- package/dist/shaders/filters/threshold/v1/module.js.map +1 -0
- package/dist/shaders/filters/vignette/v1/module.d.ts +18 -0
- package/dist/shaders/filters/vignette/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/vignette/v1/module.js +78 -0
- package/dist/shaders/filters/vignette/v1/module.js.map +1 -0
- package/dist/shaders/filters/visualFx/v1/module.d.ts +24 -0
- package/dist/shaders/filters/visualFx/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/visualFx/v1/module.js +210 -0
- package/dist/shaders/filters/visualFx/v1/module.js.map +1 -0
- package/dist/shaders/index.d.ts +86 -0
- package/dist/shaders/index.d.ts.map +1 -0
- package/dist/shaders/index.js +161 -0
- package/dist/shaders/index.js.map +1 -0
- package/dist/shaders/keyer/chromaKey/v1/module.d.ts +25 -0
- package/dist/shaders/keyer/chromaKey/v1/module.d.ts.map +1 -0
- package/dist/shaders/keyer/chromaKey/v1/module.js +111 -0
- package/dist/shaders/keyer/chromaKey/v1/module.js.map +1 -0
- package/dist/shaders/keyer/lumaKey/v1/module.d.ts +22 -0
- package/dist/shaders/keyer/lumaKey/v1/module.d.ts.map +1 -0
- package/dist/shaders/keyer/lumaKey/v1/module.js +89 -0
- package/dist/shaders/keyer/lumaKey/v1/module.js.map +1 -0
- package/dist/shaders/mask/apply/v1/module.d.ts +16 -0
- package/dist/shaders/mask/apply/v1/module.d.ts.map +1 -0
- package/dist/shaders/mask/apply/v1/module.js +79 -0
- package/dist/shaders/mask/apply/v1/module.js.map +1 -0
- package/dist/shaders/mask/fromImage/v1/module.d.ts +18 -0
- package/dist/shaders/mask/fromImage/v1/module.d.ts.map +1 -0
- package/dist/shaders/mask/fromImage/v1/module.js +99 -0
- package/dist/shaders/mask/fromImage/v1/module.js.map +1 -0
- package/dist/shaders/mask/invert/v1/module.d.ts +12 -0
- package/dist/shaders/mask/invert/v1/module.d.ts.map +1 -0
- package/dist/shaders/mask/invert/v1/module.js +57 -0
- package/dist/shaders/mask/invert/v1/module.js.map +1 -0
- package/dist/shaders/mixer/add/v1/module.d.ts +17 -0
- package/dist/shaders/mixer/add/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/add/v1/module.js +73 -0
- package/dist/shaders/mixer/add/v1/module.js.map +1 -0
- package/dist/shaders/mixer/colorOverlay/v1/module.d.ts +26 -0
- package/dist/shaders/mixer/colorOverlay/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/colorOverlay/v1/module.js +81 -0
- package/dist/shaders/mixer/colorOverlay/v1/module.js.map +1 -0
- package/dist/shaders/mixer/dropShadow/v1/module.d.ts +28 -0
- package/dist/shaders/mixer/dropShadow/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/dropShadow/v1/module.js +104 -0
- package/dist/shaders/mixer/dropShadow/v1/module.js.map +1 -0
- package/dist/shaders/mixer/outline/v1/module.d.ts +27 -0
- package/dist/shaders/mixer/outline/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/outline/v1/module.js +105 -0
- package/dist/shaders/mixer/outline/v1/module.js.map +1 -0
- package/dist/shaders/mixer/over/v1/module.d.ts +16 -0
- package/dist/shaders/mixer/over/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/over/v1/module.js +71 -0
- package/dist/shaders/mixer/over/v1/module.js.map +1 -0
- package/dist/shaders/mixer/shadowCompose/v1/module.d.ts +26 -0
- package/dist/shaders/mixer/shadowCompose/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/shadowCompose/v1/module.js +95 -0
- package/dist/shaders/mixer/shadowCompose/v1/module.js.map +1 -0
- package/dist/shaders/sources/angularGradient/v1/module.d.ts +18 -0
- package/dist/shaders/sources/angularGradient/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/angularGradient/v1/module.js +67 -0
- package/dist/shaders/sources/angularGradient/v1/module.js.map +1 -0
- package/dist/shaders/sources/checkerboard/v1/module.d.ts +19 -0
- package/dist/shaders/sources/checkerboard/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/checkerboard/v1/module.js +70 -0
- package/dist/shaders/sources/checkerboard/v1/module.js.map +1 -0
- package/dist/shaders/sources/diamondGradient/v1/module.d.ts +18 -0
- package/dist/shaders/sources/diamondGradient/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/diamondGradient/v1/module.js +61 -0
- package/dist/shaders/sources/diamondGradient/v1/module.js.map +1 -0
- package/dist/shaders/sources/gaussianNoise/v1/module.d.ts +21 -0
- package/dist/shaders/sources/gaussianNoise/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/gaussianNoise/v1/module.js +72 -0
- package/dist/shaders/sources/gaussianNoise/v1/module.js.map +1 -0
- package/dist/shaders/sources/linearGradient/v1/module.d.ts +21 -0
- package/dist/shaders/sources/linearGradient/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/linearGradient/v1/module.js +72 -0
- package/dist/shaders/sources/linearGradient/v1/module.js.map +1 -0
- package/dist/shaders/sources/radialGradient/v1/module.d.ts +18 -0
- package/dist/shaders/sources/radialGradient/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/radialGradient/v1/module.js +60 -0
- package/dist/shaders/sources/radialGradient/v1/module.js.map +1 -0
- package/dist/shaders/sources/solid/v1/module.d.ts +17 -0
- package/dist/shaders/sources/solid/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/solid/v1/module.js +49 -0
- package/dist/shaders/sources/solid/v1/module.js.map +1 -0
- package/dist/shaders/transform/affine/v1/module.d.ts +36 -0
- package/dist/shaders/transform/affine/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/affine/v1/module.js +94 -0
- package/dist/shaders/transform/affine/v1/module.js.map +1 -0
- package/dist/shaders/transform/cornerPin/v1/module.d.ts +40 -0
- package/dist/shaders/transform/cornerPin/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/cornerPin/v1/module.js +109 -0
- package/dist/shaders/transform/cornerPin/v1/module.js.map +1 -0
- package/dist/shaders/transform/crop/v1/module.d.ts +26 -0
- package/dist/shaders/transform/crop/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/crop/v1/module.js +82 -0
- package/dist/shaders/transform/crop/v1/module.js.map +1 -0
- package/dist/shaders/transform/displace/v1/module.d.ts +23 -0
- package/dist/shaders/transform/displace/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/displace/v1/module.js +95 -0
- package/dist/shaders/transform/displace/v1/module.js.map +1 -0
- package/dist/shaders/transform/mirror/v1/module.d.ts +14 -0
- package/dist/shaders/transform/mirror/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/mirror/v1/module.js +73 -0
- package/dist/shaders/transform/mirror/v1/module.js.map +1 -0
- package/dist/shaders/transform/offset/v1/module.d.ts +21 -0
- package/dist/shaders/transform/offset/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/offset/v1/module.js +88 -0
- package/dist/shaders/transform/offset/v1/module.js.map +1 -0
- package/dist/shaders/transform/pad/v1/module.d.ts +26 -0
- package/dist/shaders/transform/pad/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/pad/v1/module.js +95 -0
- package/dist/shaders/transform/pad/v1/module.js.map +1 -0
- package/dist/shaders/transform/polarRemap/v1/module.d.ts +20 -0
- package/dist/shaders/transform/polarRemap/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/polarRemap/v1/module.js +95 -0
- package/dist/shaders/transform/polarRemap/v1/module.js.map +1 -0
- package/dist/shaders/transform/resize/v1/module.d.ts +20 -0
- package/dist/shaders/transform/resize/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/resize/v1/module.js +116 -0
- package/dist/shaders/transform/resize/v1/module.js.map +1 -0
- package/dist/shaders/transform/rotate90/v1/module.d.ts +25 -0
- package/dist/shaders/transform/rotate90/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/rotate90/v1/module.js +90 -0
- package/dist/shaders/transform/rotate90/v1/module.js.map +1 -0
- package/dist/shaders/transform/spherize/v1/module.d.ts +21 -0
- package/dist/shaders/transform/spherize/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/spherize/v1/module.js +94 -0
- package/dist/shaders/transform/spherize/v1/module.js.map +1 -0
- package/dist/shaders/transform/tile/v1/module.d.ts +22 -0
- package/dist/shaders/transform/tile/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/tile/v1/module.js +89 -0
- package/dist/shaders/transform/tile/v1/module.js.map +1 -0
- package/dist/shared/lumaWgsl.d.ts +14 -0
- package/dist/shared/lumaWgsl.d.ts.map +1 -0
- package/dist/shared/lumaWgsl.js +18 -0
- package/dist/shared/lumaWgsl.js.map +1 -0
- package/dist/shared/premulWgsl.d.ts +46 -0
- package/dist/shared/premulWgsl.d.ts.map +1 -0
- package/dist/shared/premulWgsl.js +90 -0
- package/dist/shared/premulWgsl.js.map +1 -0
- package/dist/texture.d.ts +54 -0
- package/dist/texture.d.ts.map +1 -0
- package/dist/texture.js +70 -0
- package/dist/texture.js.map +1 -0
- package/dist/types.d.ts +103 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/validate/wgslLinearity.d.ts +86 -0
- package/dist/validate/wgslLinearity.d.ts.map +1 -0
- package/dist/validate/wgslLinearity.js +298 -0
- package/dist/validate/wgslLinearity.js.map +1 -0
- package/dist/webgpu/index.d.ts +11 -0
- package/dist/webgpu/index.d.ts.map +1 -0
- package/dist/webgpu/index.js +11 -0
- package/dist/webgpu/index.js.map +1 -0
- package/package.json +85 -0
package/dist/executor.js
ADDED
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Executor` — the tiny shared runtime that turns a {@link ShaderModule} plus
|
|
3
|
+
* bound textures and params into encoded GPU work.
|
|
4
|
+
*
|
|
5
|
+
* Steps per call: validate input labels against the module's I/O contract,
|
|
6
|
+
* get-or-compile the pipeline via `ctx.pipelineCache`, pack `params` through
|
|
7
|
+
* the module's TypeGPU schema, build the bind group from the module's typed
|
|
8
|
+
* layout (`root.unwrap(layout)`), and encode the pass. The host owns *when*
|
|
9
|
+
* to submit and *where* the output texture lives.
|
|
10
|
+
*
|
|
11
|
+
* **No executor-inserted readback.** `encode` records GPU commands only — it
|
|
12
|
+
* never calls `copyTextureToBuffer`, `mapAsync`, or any path that pulls
|
|
13
|
+
* pixels to the CPU. Materialization is a deliberate host-side step at
|
|
14
|
+
* boundaries (Phase 4).
|
|
15
|
+
*
|
|
16
|
+
* The `fragment` arm (full-screen pass) drives image-in/image-out modules;
|
|
17
|
+
* the `compute` arm (a workgroup dispatch writing a storage-texture output)
|
|
18
|
+
* drives the migrated timeline effects. Both share input validation, the
|
|
19
|
+
* params packer, and bind-group construction — only the pipeline kind and the
|
|
20
|
+
* encoded pass differ.
|
|
21
|
+
*/
|
|
22
|
+
import { writeToArrayBuffer } from "typegpu";
|
|
23
|
+
import * as d from "typegpu/data";
|
|
24
|
+
import { encodePremulValidationPass, isPremulDebugEnabled } from "./debug/premulValidator.js";
|
|
25
|
+
import { FULLSCREEN_TRIANGLE_VERTEX, FULLSCREEN_VERTEX_ENTRY } from "./fullscreenQuad.js";
|
|
26
|
+
import { moduleKey } from "./module.js";
|
|
27
|
+
import { alphaPremulToStraightV1 } from "./shaders/alpha/premulToStraight/v1/module.js";
|
|
28
|
+
import { alphaStraightToPremulV1 } from "./shaders/alpha/straightToPremul/v1/module.js";
|
|
29
|
+
function variantMatchesInputs(variant, inputs) {
|
|
30
|
+
const required = variant.bindingKinds;
|
|
31
|
+
if (!required) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
for (const [name, kind] of Object.entries(required)) {
|
|
35
|
+
const bound = inputs[name];
|
|
36
|
+
if (!bound) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (bound.meta.bindingKind !== kind) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
function variantMeetsCapabilities(variant, capabilities) {
|
|
46
|
+
const req = variant.requires;
|
|
47
|
+
if (!req) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
if (req.textureExternal && !capabilities.textureExternal) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
if (req.f16Storage && !capabilities.f16Storage) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Resolve which `(layout, wgsl, ...)` to use for this dispatch.
|
|
60
|
+
*
|
|
61
|
+
* Phase 3 policy: try variants in declaration order; the first one whose
|
|
62
|
+
* `bindingKinds` match the bound inputs AND whose `requires` are satisfied by
|
|
63
|
+
* `ctx.capabilities` wins. If no variant matches, the module's primary is
|
|
64
|
+
* used; if it can't match either (e.g. a `texture_external` input on a host
|
|
65
|
+
* without that capability), the Executor lets the original validation /
|
|
66
|
+
* pipeline-creation fail loud rather than substituting silently.
|
|
67
|
+
*/
|
|
68
|
+
export function resolveVariant(module, inputs, capabilities) {
|
|
69
|
+
const primary = {
|
|
70
|
+
layout: module.layout,
|
|
71
|
+
wgsl: module.wgsl,
|
|
72
|
+
entryPoint: module.entryPoint,
|
|
73
|
+
samplers: module.samplers,
|
|
74
|
+
workgroupSize: module.workgroupSize,
|
|
75
|
+
variant: undefined
|
|
76
|
+
};
|
|
77
|
+
if (!module.variants || module.variants.length === 0) {
|
|
78
|
+
return primary;
|
|
79
|
+
}
|
|
80
|
+
for (const variant of module.variants) {
|
|
81
|
+
if (variantMatchesInputs(variant, inputs) &&
|
|
82
|
+
variantMeetsCapabilities(variant, capabilities)) {
|
|
83
|
+
return {
|
|
84
|
+
layout: variant.layout,
|
|
85
|
+
wgsl: variant.wgsl,
|
|
86
|
+
entryPoint: variant.entryPoint,
|
|
87
|
+
samplers: variant.samplers ?? {},
|
|
88
|
+
workgroupSize: variant.workgroupSize ?? module.workgroupSize,
|
|
89
|
+
variant: variant.name
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return primary;
|
|
94
|
+
}
|
|
95
|
+
export function createExecutor() {
|
|
96
|
+
const samplerCache = new WeakMap();
|
|
97
|
+
function getSampler(device, descriptor) {
|
|
98
|
+
let perDevice = samplerCache.get(device);
|
|
99
|
+
if (!perDevice) {
|
|
100
|
+
perDevice = new Map();
|
|
101
|
+
samplerCache.set(device, perDevice);
|
|
102
|
+
}
|
|
103
|
+
const key = JSON.stringify(descriptor);
|
|
104
|
+
let sampler = perDevice.get(key);
|
|
105
|
+
if (!sampler) {
|
|
106
|
+
sampler = device.createSampler(descriptor);
|
|
107
|
+
perDevice.set(key, sampler);
|
|
108
|
+
}
|
|
109
|
+
return sampler;
|
|
110
|
+
}
|
|
111
|
+
function validateInputs(module, inputs) {
|
|
112
|
+
for (const [name, contract] of Object.entries(module.io.inputs)) {
|
|
113
|
+
const bound = inputs[name];
|
|
114
|
+
if (!bound) {
|
|
115
|
+
if (contract.optional) {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
throw new Error(`${moduleKey(module.id, module.version)}: missing required input "${name}"`);
|
|
119
|
+
}
|
|
120
|
+
if (!contract.bindingKinds.includes(bound.meta.bindingKind)) {
|
|
121
|
+
throw new Error(`${moduleKey(module.id, module.version)}: input "${name}" has binding kind ` +
|
|
122
|
+
`"${bound.meta.bindingKind}", expected one of [${contract.bindingKinds.join(", ")}]`);
|
|
123
|
+
}
|
|
124
|
+
// colorSpace strict-check is deferred until `color/convert/*` modules
|
|
125
|
+
// land (Phase 3b); without them there is no safe way to auto-bridge a
|
|
126
|
+
// gamma↔linear mismatch, so failing loud here would just trip recipes
|
|
127
|
+
// whose internal modules already disagree about color space.
|
|
128
|
+
// alpha is checked-and-auto-bridged in `convertAlphaIfNeeded`.
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Phase 3a alpha auto-insert: when a bound input's `meta.alpha` doesn't
|
|
133
|
+
* match the module's contract, encode an `alpha/convert/*` pass into the
|
|
134
|
+
* same encoder and substitute the converted texture. Scratch textures used
|
|
135
|
+
* for the conversion are released after the main dispatch is encoded — the
|
|
136
|
+
* GPU queue serializes the recorded passes, so the scratch is safe to reuse.
|
|
137
|
+
*/
|
|
138
|
+
function convertAlphaIfNeeded(args) {
|
|
139
|
+
const { ctx, module, encoder, inputs } = args;
|
|
140
|
+
const converted = { ...inputs };
|
|
141
|
+
const scratchToRelease = [];
|
|
142
|
+
for (const [name, contract] of Object.entries(module.io.inputs)) {
|
|
143
|
+
const bound = converted[name];
|
|
144
|
+
if (!bound) {
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
if (bound.meta.alpha === contract.alpha) {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
const convertModule = pickAlphaConvertModule(bound.meta.alpha, contract.alpha);
|
|
151
|
+
const scratch = ctx.scratch.acquire({
|
|
152
|
+
width: bound.width,
|
|
153
|
+
height: bound.height,
|
|
154
|
+
// Exact size, not bucketed: the convert pass only writes the logical
|
|
155
|
+
// dimensions (it bounds-checks against the source), and the converted
|
|
156
|
+
// texture is then sampled in normalized space by the main dispatch. A
|
|
157
|
+
// bucketed allocation would leave the margin unwritten, which the
|
|
158
|
+
// normalized sample reads as garbage.
|
|
159
|
+
exact: true,
|
|
160
|
+
format: "rgba8unorm",
|
|
161
|
+
usage: GPUTextureUsage.TEXTURE_BINDING |
|
|
162
|
+
GPUTextureUsage.STORAGE_BINDING |
|
|
163
|
+
GPUTextureUsage.COPY_SRC |
|
|
164
|
+
GPUTextureUsage.COPY_DST,
|
|
165
|
+
label: `alpha-convert-${module.id}-${name}`,
|
|
166
|
+
meta: {
|
|
167
|
+
colorSpace: bound.meta.colorSpace,
|
|
168
|
+
alpha: contract.alpha,
|
|
169
|
+
bindingKind: "texture_2d"
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
const [wgX, wgY] = convertModule.workgroupSize;
|
|
173
|
+
// Recursive encode for the convert pass — strict alpha matches by
|
|
174
|
+
// construction (bound.meta.alpha matches the convertModule's input), so
|
|
175
|
+
// this won't recurse a second time.
|
|
176
|
+
encodeInternal({
|
|
177
|
+
ctx,
|
|
178
|
+
module: convertModule,
|
|
179
|
+
encoder,
|
|
180
|
+
inputs: { source: bound },
|
|
181
|
+
output: scratch,
|
|
182
|
+
params: convertModule.paramDefaults,
|
|
183
|
+
dispatch: {
|
|
184
|
+
kind: "compute",
|
|
185
|
+
x: Math.ceil(bound.width / wgX),
|
|
186
|
+
y: Math.ceil(bound.height / wgY),
|
|
187
|
+
z: 1
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
converted[name] = scratch;
|
|
191
|
+
scratchToRelease.push(scratch);
|
|
192
|
+
}
|
|
193
|
+
return { inputs: converted, scratchToRelease };
|
|
194
|
+
}
|
|
195
|
+
function pickAlphaConvertModule(from, to) {
|
|
196
|
+
if (from === "straight" && to === "premultiplied") {
|
|
197
|
+
return alphaStraightToPremulV1;
|
|
198
|
+
}
|
|
199
|
+
if (from === "premultiplied" && to === "straight") {
|
|
200
|
+
return alphaPremulToStraightV1;
|
|
201
|
+
}
|
|
202
|
+
// Both branches of the (from, to) pair are exhausted by the early-return
|
|
203
|
+
// in convertAlphaIfNeeded when `from === to`; defensive only.
|
|
204
|
+
throw new Error(`no alpha convert module for ${from} → ${to}`);
|
|
205
|
+
}
|
|
206
|
+
function buildBindGroup(ctx, module, resolved, inputs, output, uniformBuffer) {
|
|
207
|
+
const entries = [];
|
|
208
|
+
let binding = 0;
|
|
209
|
+
for (const [name, entry] of Object.entries(resolved.layout.entries)) {
|
|
210
|
+
const current = binding++;
|
|
211
|
+
if (!entry) {
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
if ("uniform" in entry) {
|
|
215
|
+
if (!uniformBuffer) {
|
|
216
|
+
throw new Error(`${moduleKey(module.id, module.version)}: layout declares uniform "${name}" but module has no params`);
|
|
217
|
+
}
|
|
218
|
+
entries.push({ binding: current, resource: { buffer: uniformBuffer } });
|
|
219
|
+
}
|
|
220
|
+
else if ("storageTexture" in entry) {
|
|
221
|
+
// Storage textures are always the module's output — compute modules
|
|
222
|
+
// write their result here (read-write storage is not used in the pool).
|
|
223
|
+
entries.push({ binding: current, resource: output.createView() });
|
|
224
|
+
}
|
|
225
|
+
else if ("texture" in entry || "externalTexture" in entry) {
|
|
226
|
+
const bound = inputs[name];
|
|
227
|
+
if (bound) {
|
|
228
|
+
entries.push({ binding: current, resource: bound.createView() });
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
// Unbound: only allowed if the io contract marks this input optional;
|
|
232
|
+
// the executor then supplies a 1×1 white texture so the WGSL samples
|
|
233
|
+
// coverage = 1 everywhere (canonical mask-slot fallback). The
|
|
234
|
+
// validateInputs pass has already enforced contract.optional for any
|
|
235
|
+
// input named in `module.io.inputs`; if a layout has texture bindings
|
|
236
|
+
// not declared in `io.inputs`, that's a programming error and we
|
|
237
|
+
// surface it here as a missing-binding error rather than a silent
|
|
238
|
+
// white-texture substitution.
|
|
239
|
+
const contract = module.io.inputs[name];
|
|
240
|
+
if (!contract) {
|
|
241
|
+
throw new Error(`${moduleKey(module.id, module.version)}: layout binds texture "${name}" but it is not declared in io.inputs`);
|
|
242
|
+
}
|
|
243
|
+
if (!contract.optional) {
|
|
244
|
+
throw new Error(`${moduleKey(module.id, module.version)}: no texture bound for required input "${name}"`);
|
|
245
|
+
}
|
|
246
|
+
entries.push({
|
|
247
|
+
binding: current,
|
|
248
|
+
resource: ctx.getDefaultWhiteTexture().createView()
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
else if ("sampler" in entry) {
|
|
252
|
+
const descriptor = resolved.samplers[name];
|
|
253
|
+
if (!descriptor) {
|
|
254
|
+
throw new Error(`${moduleKey(module.id, module.version)}: no sampler descriptor for "${name}"`);
|
|
255
|
+
}
|
|
256
|
+
entries.push({
|
|
257
|
+
binding: current,
|
|
258
|
+
resource: getSampler(ctx.device, descriptor)
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
throw new Error(`${moduleKey(module.id, module.version)}: unsupported layout entry "${name}"`);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return ctx.device.createBindGroup({
|
|
266
|
+
label: `${module.id}-bindgroup`,
|
|
267
|
+
layout: ctx.root.unwrap(resolved.layout),
|
|
268
|
+
entries
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
function getFragmentPipeline(ctx, module, resolved, targetFormat) {
|
|
272
|
+
const variantTag = resolved.variant ? `:${resolved.variant}` : "";
|
|
273
|
+
const cacheKey = `${moduleKey(module.id, module.version)}${variantTag}:fragment:${targetFormat}`;
|
|
274
|
+
const cached = ctx.pipelineCache.get(cacheKey);
|
|
275
|
+
if (cached) {
|
|
276
|
+
// SAFETY: the key carries the `:fragment:` segment, and the only write
|
|
277
|
+
// under a `:fragment:` key is the `createRenderPipeline` result below,
|
|
278
|
+
// so a hit here is a GPURenderPipeline.
|
|
279
|
+
return cached;
|
|
280
|
+
}
|
|
281
|
+
const shaderModule = ctx.device.createShaderModule({
|
|
282
|
+
label: `${module.id}-shader`,
|
|
283
|
+
code: `${FULLSCREEN_TRIANGLE_VERTEX}\n${resolved.wgsl}`
|
|
284
|
+
});
|
|
285
|
+
const pipeline = ctx.device.createRenderPipeline({
|
|
286
|
+
label: `${module.id}-pipeline`,
|
|
287
|
+
layout: ctx.device.createPipelineLayout({
|
|
288
|
+
bindGroupLayouts: [ctx.root.unwrap(resolved.layout)]
|
|
289
|
+
}),
|
|
290
|
+
vertex: { module: shaderModule, entryPoint: FULLSCREEN_VERTEX_ENTRY },
|
|
291
|
+
fragment: {
|
|
292
|
+
module: shaderModule,
|
|
293
|
+
entryPoint: resolved.entryPoint,
|
|
294
|
+
targets: [{ format: targetFormat }]
|
|
295
|
+
},
|
|
296
|
+
primitive: { topology: "triangle-list" }
|
|
297
|
+
});
|
|
298
|
+
ctx.pipelineCache.set(cacheKey, pipeline);
|
|
299
|
+
return pipeline;
|
|
300
|
+
}
|
|
301
|
+
function getComputePipeline(ctx, module, resolved) {
|
|
302
|
+
const variantTag = resolved.variant ? `:${resolved.variant}` : "";
|
|
303
|
+
const cacheKey = `${moduleKey(module.id, module.version)}${variantTag}:compute`;
|
|
304
|
+
const cached = ctx.pipelineCache.get(cacheKey);
|
|
305
|
+
if (cached) {
|
|
306
|
+
// SAFETY: the key ends in `:compute`, and the only write under a
|
|
307
|
+
// `:compute` key is the `createComputePipeline` result below, so a hit
|
|
308
|
+
// here is a GPUComputePipeline.
|
|
309
|
+
return cached;
|
|
310
|
+
}
|
|
311
|
+
const shaderModule = ctx.device.createShaderModule({
|
|
312
|
+
label: `${module.id}-shader`,
|
|
313
|
+
code: resolved.wgsl
|
|
314
|
+
});
|
|
315
|
+
const pipeline = ctx.device.createComputePipeline({
|
|
316
|
+
label: `${module.id}-pipeline`,
|
|
317
|
+
layout: ctx.device.createPipelineLayout({
|
|
318
|
+
bindGroupLayouts: [ctx.root.unwrap(resolved.layout)]
|
|
319
|
+
}),
|
|
320
|
+
compute: { module: shaderModule, entryPoint: resolved.entryPoint }
|
|
321
|
+
});
|
|
322
|
+
ctx.pipelineCache.set(cacheKey, pipeline);
|
|
323
|
+
return pipeline;
|
|
324
|
+
}
|
|
325
|
+
function packUniform(ctx, module, resolved, params) {
|
|
326
|
+
const hasUniform = Object.values(resolved.layout.entries).some((entry) => entry !== null && "uniform" in entry);
|
|
327
|
+
if (!hasUniform) {
|
|
328
|
+
return null;
|
|
329
|
+
}
|
|
330
|
+
// The module's TypeGPU schema is the single source of truth for the byte
|
|
331
|
+
// layout — `writeToArrayBuffer` packs `params` exactly as the WGSL struct
|
|
332
|
+
// expects. The packed bytes go into a buffer from the context's reused
|
|
333
|
+
// ring (see `UniformRing`) rather than a fresh per-encode allocation.
|
|
334
|
+
const size = d.sizeOf(module.params);
|
|
335
|
+
const data = new ArrayBuffer(size);
|
|
336
|
+
writeToArrayBuffer(data, module.params, params);
|
|
337
|
+
const buffer = ctx.uniformRing.acquire(size);
|
|
338
|
+
ctx.device.queue.writeBuffer(buffer, 0, data);
|
|
339
|
+
return buffer;
|
|
340
|
+
}
|
|
341
|
+
function encodeFragment(args, resolved) {
|
|
342
|
+
const { ctx, module, encoder, inputs, output, params } = args;
|
|
343
|
+
const uniformBuffer = packUniform(ctx, module, resolved, params);
|
|
344
|
+
const bindGroup = buildBindGroup(ctx, module, resolved, inputs, output, uniformBuffer);
|
|
345
|
+
const pipeline = getFragmentPipeline(ctx, module, resolved, output.format);
|
|
346
|
+
const pass = encoder.beginRenderPass({
|
|
347
|
+
label: `${module.id}-pass`,
|
|
348
|
+
colorAttachments: [
|
|
349
|
+
{ view: output.createView(), loadOp: "clear", storeOp: "store" }
|
|
350
|
+
]
|
|
351
|
+
});
|
|
352
|
+
pass.setPipeline(pipeline);
|
|
353
|
+
pass.setBindGroup(0, bindGroup);
|
|
354
|
+
pass.draw(3);
|
|
355
|
+
pass.end();
|
|
356
|
+
output.markWritten();
|
|
357
|
+
}
|
|
358
|
+
function encodeCompute(args, resolved, dispatch) {
|
|
359
|
+
const { ctx, module, encoder, inputs, output, params } = args;
|
|
360
|
+
const uniformBuffer = packUniform(ctx, module, resolved, params);
|
|
361
|
+
const bindGroup = buildBindGroup(ctx, module, resolved, inputs, output, uniformBuffer);
|
|
362
|
+
const pipeline = getComputePipeline(ctx, module, resolved);
|
|
363
|
+
const pass = encoder.beginComputePass({ label: `${module.id}-pass` });
|
|
364
|
+
pass.setPipeline(pipeline);
|
|
365
|
+
pass.setBindGroup(0, bindGroup);
|
|
366
|
+
pass.dispatchWorkgroups(dispatch.x, dispatch.y, dispatch.z ?? 1);
|
|
367
|
+
pass.end();
|
|
368
|
+
output.markWritten();
|
|
369
|
+
}
|
|
370
|
+
function encodeInternal(args) {
|
|
371
|
+
validateInputs(args.module, args.inputs);
|
|
372
|
+
const { inputs: maybeConverted, scratchToRelease } = convertAlphaIfNeeded(args);
|
|
373
|
+
const effectiveArgs = { ...args, inputs: maybeConverted };
|
|
374
|
+
const resolved = resolveVariant(effectiveArgs.module, effectiveArgs.inputs, effectiveArgs.ctx.capabilities);
|
|
375
|
+
try {
|
|
376
|
+
if (effectiveArgs.dispatch.kind === "fragment") {
|
|
377
|
+
encodeFragment(effectiveArgs, resolved);
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
encodeCompute(effectiveArgs, resolved, effectiveArgs.dispatch);
|
|
381
|
+
}
|
|
382
|
+
// Item 5 of the shader-pool invariant enforcement plan: when
|
|
383
|
+
// NODETOOL_GPU_DEBUG contains "premul", encode a scan of the output
|
|
384
|
+
// texture that flags texels violating rgb ≤ a, rgb ≥ 0, no NaN. Only
|
|
385
|
+
// makes sense for premul outputs (straight outputs are by definition
|
|
386
|
+
// unrelated to the premul invariant). The gate short-circuits to a
|
|
387
|
+
// single boolean check when the flag is off — zero overhead in
|
|
388
|
+
// production.
|
|
389
|
+
if (isPremulDebugEnabled() &&
|
|
390
|
+
effectiveArgs.module.io.output.alpha === "premultiplied") {
|
|
391
|
+
encodePremulValidationPass({
|
|
392
|
+
ctx: effectiveArgs.ctx,
|
|
393
|
+
module: effectiveArgs.module,
|
|
394
|
+
encoder: effectiveArgs.encoder,
|
|
395
|
+
output: effectiveArgs.output
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
finally {
|
|
400
|
+
// Release after recording — queue ordering keeps the scratch reads
|
|
401
|
+
// ahead of any future writes from a re-acquire.
|
|
402
|
+
for (const scratch of scratchToRelease) {
|
|
403
|
+
effectiveArgs.ctx.scratch.release(scratch);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return {
|
|
408
|
+
encode(args) {
|
|
409
|
+
encodeInternal(args);
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAIlC,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAyC,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AAwBxF,SAAS,oBAAoB,CAC3B,OAAsB,EACtB,MAAsC;IAEtC,MAAM,QAAQ,GAAG,OAAO,C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,CAAC,OAAO;oBAC9B,MAAM,EAAE,aAAa,CAAC,MAAM;iBAC7B,CAAC,CAAC;YACL,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,mEAAmE;YACnE,gDAAgD;YAChD,KAAK,MAAM,OAAO,IAAI,gBAAgB,EAAE,CAAC;gBACvC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,CAA+B,IAAwB;YAC3D,cAAc,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared full-screen pass vertex shader for fragment modules.
|
|
3
|
+
*
|
|
4
|
+
* A single oversized triangle (3 vertices) covering the viewport. Emits
|
|
5
|
+
* normalized UVs in `[0,1]` with a top-left origin — the pool's canonical
|
|
6
|
+
* coordinate convention. Fragment modules consume `@location(0) uv: vec2f`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const FULLSCREEN_TRIANGLE_VERTEX = "\nstruct FullscreenVertexOutput {\n @builtin(position) position: vec4f,\n @location(0) uv: vec2f,\n};\n\n@vertex\nfn vs_main(@builtin(vertex_index) vertexIndex: u32) -> FullscreenVertexOutput {\n var positions = array<vec2f, 3>(\n vec2f(-1.0, -1.0),\n vec2f( 3.0, -1.0),\n vec2f(-1.0, 3.0),\n );\n let pos = positions[vertexIndex];\n var out: FullscreenVertexOutput;\n out.position = vec4f(pos, 0.0, 1.0);\n // Map clip-space [-1,1] to UV [0,1] with top-left origin (flip Y).\n out.uv = vec2f((pos.x + 1.0) * 0.5, (1.0 - pos.y) * 0.5);\n return out;\n}\n";
|
|
9
|
+
/** Vertex entry point name in {@link FULLSCREEN_TRIANGLE_VERTEX}. */
|
|
10
|
+
export declare const FULLSCREEN_VERTEX_ENTRY = "vs_main";
|
|
11
|
+
//# sourceMappingURL=fullscreenQuad.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fullscreenQuad.d.ts","sourceRoot":"","sources":["../src/fullscreenQuad.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,mkBAoBtC,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,uBAAuB,YAAY,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared full-screen pass vertex shader for fragment modules.
|
|
3
|
+
*
|
|
4
|
+
* A single oversized triangle (3 vertices) covering the viewport. Emits
|
|
5
|
+
* normalized UVs in `[0,1]` with a top-left origin — the pool's canonical
|
|
6
|
+
* coordinate convention. Fragment modules consume `@location(0) uv: vec2f`.
|
|
7
|
+
*/
|
|
8
|
+
export const FULLSCREEN_TRIANGLE_VERTEX = /* wgsl */ `
|
|
9
|
+
struct FullscreenVertexOutput {
|
|
10
|
+
@builtin(position) position: vec4f,
|
|
11
|
+
@location(0) uv: vec2f,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
@vertex
|
|
15
|
+
fn vs_main(@builtin(vertex_index) vertexIndex: u32) -> FullscreenVertexOutput {
|
|
16
|
+
var positions = array<vec2f, 3>(
|
|
17
|
+
vec2f(-1.0, -1.0),
|
|
18
|
+
vec2f( 3.0, -1.0),
|
|
19
|
+
vec2f(-1.0, 3.0),
|
|
20
|
+
);
|
|
21
|
+
let pos = positions[vertexIndex];
|
|
22
|
+
var out: FullscreenVertexOutput;
|
|
23
|
+
out.position = vec4f(pos, 0.0, 1.0);
|
|
24
|
+
// Map clip-space [-1,1] to UV [0,1] with top-left origin (flip Y).
|
|
25
|
+
out.uv = vec2f((pos.x + 1.0) * 0.5, (1.0 - pos.y) * 0.5);
|
|
26
|
+
return out;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
/** Vertex entry point name in {@link FULLSCREEN_TRIANGLE_VERTEX}. */
|
|
30
|
+
export const FULLSCREEN_VERTEX_ENTRY = "vs_main";
|
|
31
|
+
//# sourceMappingURL=fullscreenQuad.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fullscreenQuad.js","sourceRoot":"","sources":["../src/fullscreenQuad.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;CAoBpD,CAAC;AAEF,qEAAqE;AACrE,MAAM,CAAC,MAAM,uBAAuB,GAAG,SAAS,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nodetool-ai/gpu — Public API (pure root).
|
|
3
|
+
*
|
|
4
|
+
* The blend-mode catalog + shared WGSL blend functions (Phase 0), consumed by
|
|
5
|
+
* the sketch editor, the timeline preview, and the Compositor node. The mode
|
|
6
|
+
* names come from `@nodetool-ai/protocol/blend-modes` and are re-exported
|
|
7
|
+
* here; this package owns the WGSL/Canvas2D/libvips mappings on top of them.
|
|
8
|
+
* This entry is pure — no WebGPU runtime, no TypeGPU import — so Node-side
|
|
9
|
+
* consumers (base-nodes) can pull in the catalog without dragging in the GPU
|
|
10
|
+
* stack.
|
|
11
|
+
*
|
|
12
|
+
* The TypeGPU-backed shader pool (Phase 1) lives behind `./pool`; the
|
|
13
|
+
* browser-only layer-compositing engine behind `./webgpu`.
|
|
14
|
+
*/
|
|
15
|
+
export * from "./blend/index.js";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nodetool-ai/gpu — Public API (pure root).
|
|
3
|
+
*
|
|
4
|
+
* The blend-mode catalog + shared WGSL blend functions (Phase 0), consumed by
|
|
5
|
+
* the sketch editor, the timeline preview, and the Compositor node. The mode
|
|
6
|
+
* names come from `@nodetool-ai/protocol/blend-modes` and are re-exported
|
|
7
|
+
* here; this package owns the WGSL/Canvas2D/libvips mappings on top of them.
|
|
8
|
+
* This entry is pure — no WebGPU runtime, no TypeGPU import — so Node-side
|
|
9
|
+
* consumers (base-nodes) can pull in the catalog without dragging in the GPU
|
|
10
|
+
* stack.
|
|
11
|
+
*
|
|
12
|
+
* The TypeGPU-backed shader pool (Phase 1) lives behind `./pool`; the
|
|
13
|
+
* browser-only layer-compositing engine behind `./webgpu`.
|
|
14
|
+
*/
|
|
15
|
+
export * from "./blend/index.js";
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,cAAc,kBAAkB,CAAC"}
|