@luma.gl/shaders 0.0.0-stage → 10.0.0-alpha.11
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/LICENSE +38 -0
- package/README.md +25 -2
- package/dist/dist.dev.js +21598 -0
- package/dist/dist.min.js +13439 -0
- package/dist/glsl.cjs +33 -0
- package/dist/glsl.cjs.map +6 -0
- package/dist/glsl.d.ts +6 -0
- package/dist/glsl.d.ts.map +1 -0
- package/dist/glsl.js +7 -0
- package/dist/glsl.js.map +1 -0
- package/dist/index.cjs +278 -0
- package/dist/index.cjs.map +6 -0
- package/dist/index.d.ts +108 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +74 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/color/normalize-byte-colors.cjs +50 -0
- package/dist/lib/color/normalize-byte-colors.d.ts +23 -0
- package/dist/lib/color/normalize-byte-colors.d.ts.map +1 -0
- package/dist/lib/color/normalize-byte-colors.js +42 -0
- package/dist/lib/color/normalize-byte-colors.js.map +1 -0
- package/dist/lib/filters/prop-types.cjs +90 -0
- package/dist/lib/filters/prop-types.d.ts +44 -0
- package/dist/lib/filters/prop-types.d.ts.map +1 -0
- package/dist/lib/filters/prop-types.js +96 -0
- package/dist/lib/filters/prop-types.js.map +1 -0
- package/dist/lib/glsl-shader-assembler.cjs +50 -0
- package/dist/lib/glsl-shader-assembler.d.ts +19 -0
- package/dist/lib/glsl-shader-assembler.d.ts.map +1 -0
- package/dist/lib/glsl-shader-assembler.js +29 -0
- package/dist/lib/glsl-shader-assembler.js.map +1 -0
- package/dist/lib/glsl-utils/get-shader-info.cjs +52 -0
- package/dist/lib/glsl-utils/get-shader-info.d.ts +9 -0
- package/dist/lib/glsl-utils/get-shader-info.d.ts.map +1 -0
- package/dist/lib/glsl-utils/get-shader-info.js +33 -0
- package/dist/lib/glsl-utils/get-shader-info.js.map +1 -0
- package/dist/lib/glsl-utils/shader-utils.cjs +126 -0
- package/dist/lib/glsl-utils/shader-utils.d.ts +23 -0
- package/dist/lib/glsl-utils/shader-utils.d.ts.map +1 -0
- package/dist/lib/glsl-utils/shader-utils.js +92 -0
- package/dist/lib/glsl-utils/shader-utils.js.map +1 -0
- package/dist/lib/preprocessor/preprocessor.cjs +128 -0
- package/dist/lib/preprocessor/preprocessor.d.ts +15 -0
- package/dist/lib/preprocessor/preprocessor.d.ts.map +1 -0
- package/dist/lib/preprocessor/preprocessor.js +120 -0
- package/dist/lib/preprocessor/preprocessor.js.map +1 -0
- package/dist/lib/shader-assembler-base.cjs +132 -0
- package/dist/lib/shader-assembler-base.d.ts +51 -0
- package/dist/lib/shader-assembler-base.d.ts.map +1 -0
- package/dist/lib/shader-assembler-base.js +127 -0
- package/dist/lib/shader-assembler-base.js.map +1 -0
- package/dist/lib/shader-assembler.cjs +33 -0
- package/dist/lib/shader-assembler.d.ts +4 -0
- package/dist/lib/shader-assembler.d.ts.map +1 -0
- package/dist/lib/shader-assembler.js +7 -0
- package/dist/lib/shader-assembler.js.map +1 -0
- package/dist/lib/shader-assembly/assemble-glsl-shaders.cjs +181 -0
- package/dist/lib/shader-assembly/assemble-glsl-shaders.d.ts +70 -0
- package/dist/lib/shader-assembly/assemble-glsl-shaders.d.ts.map +1 -0
- package/dist/lib/shader-assembly/assemble-glsl-shaders.js +208 -0
- package/dist/lib/shader-assembly/assemble-glsl-shaders.js.map +1 -0
- package/dist/lib/shader-assembly/assemble-shaders.cjs +42 -0
- package/dist/lib/shader-assembly/assemble-shaders.d.ts +10 -0
- package/dist/lib/shader-assembly/assemble-shaders.d.ts.map +1 -0
- package/dist/lib/shader-assembly/assemble-shaders.js +10 -0
- package/dist/lib/shader-assembly/assemble-shaders.js.map +1 -0
- package/dist/lib/shader-assembly/assemble-wgsl-shaders.cjs +498 -0
- package/dist/lib/shader-assembly/assemble-wgsl-shaders.d.ts +70 -0
- package/dist/lib/shader-assembly/assemble-wgsl-shaders.d.ts.map +1 -0
- package/dist/lib/shader-assembly/assemble-wgsl-shaders.js +480 -0
- package/dist/lib/shader-assembly/assemble-wgsl-shaders.js.map +1 -0
- package/dist/lib/shader-assembly/platform-defines.cjs +79 -0
- package/dist/lib/shader-assembly/platform-defines.d.ts +4 -0
- package/dist/lib/shader-assembly/platform-defines.d.ts.map +1 -0
- package/dist/lib/shader-assembly/platform-defines.js +52 -0
- package/dist/lib/shader-assembly/platform-defines.js.map +1 -0
- package/dist/lib/shader-assembly/platform-info.cjs +15 -0
- package/dist/lib/shader-assembly/platform-info.d.ts +20 -0
- package/dist/lib/shader-assembly/platform-info.d.ts.map +1 -0
- package/dist/lib/shader-assembly/platform-info.js +5 -0
- package/dist/lib/shader-assembly/platform-info.js.map +1 -0
- package/dist/lib/shader-assembly/shader-assembly-shared.cjs +96 -0
- package/dist/lib/shader-assembly/shader-assembly-shared.d.ts +16 -0
- package/dist/lib/shader-assembly/shader-assembly-shared.d.ts.map +1 -0
- package/dist/lib/shader-assembly/shader-assembly-shared.js +79 -0
- package/dist/lib/shader-assembly/shader-assembly-shared.js.map +1 -0
- package/dist/lib/shader-assembly/shader-assembly-types.cjs +15 -0
- package/dist/lib/shader-assembly/shader-assembly-types.d.ts +132 -0
- package/dist/lib/shader-assembly/shader-assembly-types.d.ts.map +1 -0
- package/dist/lib/shader-assembly/shader-assembly-types.js +5 -0
- package/dist/lib/shader-assembly/shader-assembly-types.js.map +1 -0
- package/dist/lib/shader-assembly/shader-injection-targets.cjs +103 -0
- package/dist/lib/shader-assembly/shader-injection-targets.d.ts +46 -0
- package/dist/lib/shader-assembly/shader-injection-targets.d.ts.map +1 -0
- package/dist/lib/shader-assembly/shader-injection-targets.js +83 -0
- package/dist/lib/shader-assembly/shader-injection-targets.js.map +1 -0
- package/dist/lib/shader-assembly/shader-injections.cjs +204 -0
- package/dist/lib/shader-assembly/shader-injections.d.ts +49 -0
- package/dist/lib/shader-assembly/shader-injections.d.ts.map +1 -0
- package/dist/lib/shader-assembly/shader-injections.js +207 -0
- package/dist/lib/shader-assembly/shader-injections.js.map +1 -0
- package/dist/lib/shader-assembly/shader-plugin-varyings.cjs +434 -0
- package/dist/lib/shader-assembly/shader-plugin-varyings.d.ts +15 -0
- package/dist/lib/shader-assembly/shader-plugin-varyings.d.ts.map +1 -0
- package/dist/lib/shader-assembly/shader-plugin-varyings.js +438 -0
- package/dist/lib/shader-assembly/shader-plugin-varyings.js.map +1 -0
- package/dist/lib/shader-assembly/shader-plugin-vertex-inputs.cjs +254 -0
- package/dist/lib/shader-assembly/shader-plugin-vertex-inputs.d.ts +12 -0
- package/dist/lib/shader-assembly/shader-plugin-vertex-inputs.d.ts.map +1 -0
- package/dist/lib/shader-assembly/shader-plugin-vertex-inputs.js +237 -0
- package/dist/lib/shader-assembly/shader-plugin-vertex-inputs.js.map +1 -0
- package/dist/lib/shader-assembly/wgsl-binding-debug.cjs +166 -0
- package/dist/lib/shader-assembly/wgsl-binding-debug.d.ts +37 -0
- package/dist/lib/shader-assembly/wgsl-binding-debug.d.ts.map +1 -0
- package/dist/lib/shader-assembly/wgsl-binding-debug.js +144 -0
- package/dist/lib/shader-assembly/wgsl-binding-debug.js.map +1 -0
- package/dist/lib/shader-assembly/wgsl-binding-scan.cjs +184 -0
- package/dist/lib/shader-assembly/wgsl-binding-scan.d.ts +19 -0
- package/dist/lib/shader-assembly/wgsl-binding-scan.d.ts.map +1 -0
- package/dist/lib/shader-assembly/wgsl-binding-scan.js +151 -0
- package/dist/lib/shader-assembly/wgsl-binding-scan.js.map +1 -0
- package/dist/lib/shader-assembly/wgsl-injection-target-names.cjs +163 -0
- package/dist/lib/shader-assembly/wgsl-injection-target-names.d.ts +8 -0
- package/dist/lib/shader-assembly/wgsl-injection-target-names.d.ts.map +1 -0
- package/dist/lib/shader-assembly/wgsl-injection-target-names.js +145 -0
- package/dist/lib/shader-assembly/wgsl-injection-target-names.js.map +1 -0
- package/dist/lib/shader-assembly/wgsl-interface-scan.cjs +502 -0
- package/dist/lib/shader-assembly/wgsl-interface-scan.d.ts +14 -0
- package/dist/lib/shader-assembly/wgsl-interface-scan.d.ts.map +1 -0
- package/dist/lib/shader-assembly/wgsl-interface-scan.js +498 -0
- package/dist/lib/shader-assembly/wgsl-interface-scan.js.map +1 -0
- package/dist/lib/shader-generator/generate-shader.cjs +36 -0
- package/dist/lib/shader-generator/generate-shader.d.ts +8 -0
- package/dist/lib/shader-generator/generate-shader.d.ts.map +1 -0
- package/dist/lib/shader-generator/generate-shader.js +15 -0
- package/dist/lib/shader-generator/generate-shader.js.map +1 -0
- package/dist/lib/shader-generator/glsl/generate-glsl.cjs +94 -0
- package/dist/lib/shader-generator/glsl/generate-glsl.d.ts +7 -0
- package/dist/lib/shader-generator/glsl/generate-glsl.d.ts.map +1 -0
- package/dist/lib/shader-generator/glsl/generate-glsl.js +79 -0
- package/dist/lib/shader-generator/glsl/generate-glsl.js.map +1 -0
- package/dist/lib/shader-generator/utils/capitalize.cjs +29 -0
- package/dist/lib/shader-generator/utils/capitalize.d.ts +7 -0
- package/dist/lib/shader-generator/utils/capitalize.d.ts.map +1 -0
- package/dist/lib/shader-generator/utils/capitalize.js +12 -0
- package/dist/lib/shader-generator/utils/capitalize.js.map +1 -0
- package/dist/lib/shader-generator/wgsl/generate-wgsl.cjs +46 -0
- package/dist/lib/shader-generator/wgsl/generate-wgsl.d.ts +7 -0
- package/dist/lib/shader-generator/wgsl/generate-wgsl.d.ts.map +1 -0
- package/dist/lib/shader-generator/wgsl/generate-wgsl.js +23 -0
- package/dist/lib/shader-generator/wgsl/generate-wgsl.js.map +1 -0
- package/dist/lib/shader-module/composite-shader-pass.cjs +15 -0
- package/dist/lib/shader-module/composite-shader-pass.d.ts +41 -0
- package/dist/lib/shader-module/composite-shader-pass.d.ts.map +1 -0
- package/dist/lib/shader-module/composite-shader-pass.js +5 -0
- package/dist/lib/shader-module/composite-shader-pass.js.map +1 -0
- package/dist/lib/shader-module/shader-module-dependencies.cjs +83 -0
- package/dist/lib/shader-module/shader-module-dependencies.d.ts +39 -0
- package/dist/lib/shader-module/shader-module-dependencies.d.ts.map +1 -0
- package/dist/lib/shader-module/shader-module-dependencies.js +103 -0
- package/dist/lib/shader-module/shader-module-dependencies.js.map +1 -0
- package/dist/lib/shader-module/shader-module-uniform-layout.cjs +224 -0
- package/dist/lib/shader-module/shader-module-uniform-layout.d.ts +91 -0
- package/dist/lib/shader-module/shader-module-uniform-layout.d.ts.map +1 -0
- package/dist/lib/shader-module/shader-module-uniform-layout.js +253 -0
- package/dist/lib/shader-module/shader-module-uniform-layout.js.map +1 -0
- package/dist/lib/shader-module/shader-module.cjs +99 -0
- package/dist/lib/shader-module/shader-module.d.ts +94 -0
- package/dist/lib/shader-module/shader-module.d.ts.map +1 -0
- package/dist/lib/shader-module/shader-module.js +101 -0
- package/dist/lib/shader-module/shader-module.js.map +1 -0
- package/dist/lib/shader-module/shader-pass.cjs +15 -0
- package/dist/lib/shader-module/shader-pass.d.ts +48 -0
- package/dist/lib/shader-module/shader-pass.d.ts.map +1 -0
- package/dist/lib/shader-module/shader-pass.js +5 -0
- package/dist/lib/shader-module/shader-pass.js.map +1 -0
- package/dist/lib/shader-plugin.cjs +156 -0
- package/dist/lib/shader-plugin.d.ts +61 -0
- package/dist/lib/shader-plugin.d.ts.map +1 -0
- package/dist/lib/shader-plugin.js +147 -0
- package/dist/lib/shader-plugin.js.map +1 -0
- package/dist/lib/shader-transpiler/shader-transpiler.cjs +15 -0
- package/dist/lib/shader-transpiler/shader-transpiler.d.ts +27 -0
- package/dist/lib/shader-transpiler/shader-transpiler.d.ts.map +1 -0
- package/dist/lib/shader-transpiler/shader-transpiler.js +5 -0
- package/dist/lib/shader-transpiler/shader-transpiler.js.map +1 -0
- package/dist/lib/shader-transpiler/transpile-glsl-shader.cjs +71 -0
- package/dist/lib/shader-transpiler/transpile-glsl-shader.d.ts +9 -0
- package/dist/lib/shader-transpiler/transpile-glsl-shader.d.ts.map +1 -0
- package/dist/lib/shader-transpiler/transpile-glsl-shader.js +69 -0
- package/dist/lib/shader-transpiler/transpile-glsl-shader.js.map +1 -0
- package/dist/lib/utils/assert.cjs +34 -0
- package/dist/lib/utils/assert.d.ts +2 -0
- package/dist/lib/utils/assert.d.ts.map +1 -0
- package/dist/lib/utils/assert.js +13 -0
- package/dist/lib/utils/assert.js.map +1 -0
- package/dist/lib/utils/uniform-types.cjs +15 -0
- package/dist/lib/utils/uniform-types.d.ts +18 -0
- package/dist/lib/utils/uniform-types.d.ts.map +1 -0
- package/dist/lib/utils/uniform-types.js +5 -0
- package/dist/lib/utils/uniform-types.js.map +1 -0
- package/dist/lib/wgsl-shader-assembler.cjs +99 -0
- package/dist/lib/wgsl-shader-assembler.d.ts +34 -0
- package/dist/lib/wgsl-shader-assembler.d.ts.map +1 -0
- package/dist/lib/wgsl-shader-assembler.js +84 -0
- package/dist/lib/wgsl-shader-assembler.js.map +1 -0
- package/dist/module-injectors.cjs +59 -0
- package/dist/module-injectors.d.ts +3 -0
- package/dist/module-injectors.d.ts.map +1 -0
- package/dist/module-injectors.js +31 -0
- package/dist/module-injectors.js.map +1 -0
- package/dist/modules/color/float-colors.cjs +275 -0
- package/dist/modules/color/float-colors.d.ts +132 -0
- package/dist/modules/color/float-colors.d.ts.map +1 -0
- package/dist/modules/color/float-colors.js +248 -0
- package/dist/modules/color/float-colors.js.map +1 -0
- package/dist/modules/engine/clip/clip.cjs +142 -0
- package/dist/modules/engine/clip/clip.d.ts +12 -0
- package/dist/modules/engine/clip/clip.d.ts.map +1 -0
- package/dist/modules/engine/clip/clip.js +119 -0
- package/dist/modules/engine/clip/clip.js.map +1 -0
- package/dist/modules/engine/filter/filter.cjs +103 -0
- package/dist/modules/engine/filter/filter.d.ts +12 -0
- package/dist/modules/engine/filter/filter.d.ts.map +1 -0
- package/dist/modules/engine/filter/filter.js +80 -0
- package/dist/modules/engine/filter/filter.js.map +1 -0
- package/dist/modules/engine/geometry/geometry.cjs +63 -0
- package/dist/modules/engine/geometry/geometry.d.ts +9 -0
- package/dist/modules/engine/geometry/geometry.d.ts.map +1 -0
- package/dist/modules/engine/geometry/geometry.js +42 -0
- package/dist/modules/engine/geometry/geometry.js.map +1 -0
- package/dist/modules/engine/gpu-animation/gpu-animation.cjs +255 -0
- package/dist/modules/engine/gpu-animation/gpu-animation.d.ts +34 -0
- package/dist/modules/engine/gpu-animation/gpu-animation.d.ts.map +1 -0
- package/dist/modules/engine/gpu-animation/gpu-animation.js +228 -0
- package/dist/modules/engine/gpu-animation/gpu-animation.js.map +1 -0
- package/dist/modules/engine/picking/picking.cjs +210 -0
- package/dist/modules/engine/picking/picking.d.ts +77 -0
- package/dist/modules/engine/picking/picking.d.ts.map +1 -0
- package/dist/modules/engine/picking/picking.js +198 -0
- package/dist/modules/engine/picking/picking.js.map +1 -0
- package/dist/modules/engine/project/project.cjs +138 -0
- package/dist/modules/engine/project/project.d.ts +39 -0
- package/dist/modules/engine/project/project.d.ts.map +1 -0
- package/dist/modules/engine/project/project.js +129 -0
- package/dist/modules/engine/project/project.js.map +1 -0
- package/dist/modules/engine/skin/skin.cjs +212 -0
- package/dist/modules/engine/skin/skin.d.ts +52 -0
- package/dist/modules/engine/skin/skin.d.ts.map +1 -0
- package/dist/modules/engine/skin/skin.js +179 -0
- package/dist/modules/engine/skin/skin.js.map +1 -0
- package/dist/modules/engine/transform/transform.cjs +72 -0
- package/dist/modules/engine/transform/transform.d.ts +6 -0
- package/dist/modules/engine/transform/transform.d.ts.map +1 -0
- package/dist/modules/engine/transform/transform.js +49 -0
- package/dist/modules/engine/transform/transform.js.map +1 -0
- package/dist/modules/geometry/path-dash/path-dash.cjs +93 -0
- package/dist/modules/geometry/path-dash/path-dash.d.ts +10 -0
- package/dist/modules/geometry/path-dash/path-dash.d.ts.map +1 -0
- package/dist/modules/geometry/path-dash/path-dash.js +66 -0
- package/dist/modules/geometry/path-dash/path-dash.js.map +1 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill-shaders.cjs +117 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill-shaders.d.ts +3 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill-shaders.d.ts.map +1 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill-shaders.js +87 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill-shaders.js.map +1 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill.cjs +64 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill.d.ts +14 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill.d.ts.map +1 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill.js +43 -0
- package/dist/modules/geometry/pattern-fill/pattern-fill.js.map +1 -0
- package/dist/modules/geometry/point-glow/point-glow.cjs +104 -0
- package/dist/modules/geometry/point-glow/point-glow.d.ts +11 -0
- package/dist/modules/geometry/point-glow/point-glow.d.ts.map +1 -0
- package/dist/modules/geometry/point-glow/point-glow.js +77 -0
- package/dist/modules/geometry/point-glow/point-glow.js.map +1 -0
- package/dist/modules/geometry/precipitation/precipitation.cjs +122 -0
- package/dist/modules/geometry/precipitation/precipitation.d.ts +40 -0
- package/dist/modules/geometry/precipitation/precipitation.d.ts.map +1 -0
- package/dist/modules/geometry/precipitation/precipitation.js +95 -0
- package/dist/modules/geometry/precipitation/precipitation.js.map +1 -0
- package/dist/modules/geometry/sketch-stroke/sketch-stroke.cjs +158 -0
- package/dist/modules/geometry/sketch-stroke/sketch-stroke.d.ts +60 -0
- package/dist/modules/geometry/sketch-stroke/sketch-stroke.d.ts.map +1 -0
- package/dist/modules/geometry/sketch-stroke/sketch-stroke.js +137 -0
- package/dist/modules/geometry/sketch-stroke/sketch-stroke.js.map +1 -0
- package/dist/modules/geospatial/dggs/dggs-wgsl.cjs +2304 -0
- package/dist/modules/geospatial/dggs/dggs-wgsl.d.ts +3 -0
- package/dist/modules/geospatial/dggs/dggs-wgsl.d.ts.map +1 -0
- package/dist/modules/geospatial/dggs/dggs-wgsl.js +2283 -0
- package/dist/modules/geospatial/dggs/dggs-wgsl.js.map +1 -0
- package/dist/modules/geospatial/dggs/dggs.cjs +31 -0
- package/dist/modules/geospatial/dggs/dggs.d.ts +6 -0
- package/dist/modules/geospatial/dggs/dggs.d.ts.map +1 -0
- package/dist/modules/geospatial/dggs/dggs.js +10 -0
- package/dist/modules/geospatial/dggs/dggs.js.map +1 -0
- package/dist/modules/lighting/area-lighting/area-light-types.cjs +68 -0
- package/dist/modules/lighting/area-lighting/area-light-types.d.ts +34 -0
- package/dist/modules/lighting/area-lighting/area-light-types.d.ts.map +1 -0
- package/dist/modules/lighting/area-lighting/area-light-types.js +40 -0
- package/dist/modules/lighting/area-lighting/area-light-types.js.map +1 -0
- package/dist/modules/lighting/area-lighting/area-lighting-shaders.cjs +101 -0
- package/dist/modules/lighting/area-lighting/area-lighting-shaders.d.ts +3 -0
- package/dist/modules/lighting/area-lighting/area-lighting-shaders.d.ts.map +1 -0
- package/dist/modules/lighting/area-lighting/area-lighting-shaders.js +71 -0
- package/dist/modules/lighting/area-lighting/area-lighting-shaders.js.map +1 -0
- package/dist/modules/lighting/area-lighting/area-lighting.cjs +62 -0
- package/dist/modules/lighting/area-lighting/area-lighting.d.ts +89 -0
- package/dist/modules/lighting/area-lighting/area-lighting.d.ts.map +1 -0
- package/dist/modules/lighting/area-lighting/area-lighting.js +41 -0
- package/dist/modules/lighting/area-lighting/area-lighting.js.map +1 -0
- package/dist/modules/lighting/area-lighting/ltc-shaders.cjs +192 -0
- package/dist/modules/lighting/area-lighting/ltc-shaders.d.ts +3 -0
- package/dist/modules/lighting/area-lighting/ltc-shaders.d.ts.map +1 -0
- package/dist/modules/lighting/area-lighting/ltc-shaders.js +162 -0
- package/dist/modules/lighting/area-lighting/ltc-shaders.js.map +1 -0
- package/dist/modules/lighting/atmosphere/atmosphere.cjs +253 -0
- package/dist/modules/lighting/atmosphere/atmosphere.d.ts +45 -0
- package/dist/modules/lighting/atmosphere/atmosphere.d.ts.map +1 -0
- package/dist/modules/lighting/atmosphere/atmosphere.js +228 -0
- package/dist/modules/lighting/atmosphere/atmosphere.js.map +1 -0
- package/dist/modules/lighting/clouds/clouds.cjs +216 -0
- package/dist/modules/lighting/clouds/clouds.d.ts +58 -0
- package/dist/modules/lighting/clouds/clouds.d.ts.map +1 -0
- package/dist/modules/lighting/clouds/clouds.js +192 -0
- package/dist/modules/lighting/clouds/clouds.js.map +1 -0
- package/dist/modules/lighting/clustered-light-grid/clustered-light-grid.cjs +40 -0
- package/dist/modules/lighting/clustered-light-grid/clustered-light-grid.d.ts +6 -0
- package/dist/modules/lighting/clustered-light-grid/clustered-light-grid.d.ts.map +1 -0
- package/dist/modules/lighting/clustered-light-grid/clustered-light-grid.js +15 -0
- package/dist/modules/lighting/clustered-light-grid/clustered-light-grid.js.map +1 -0
- package/dist/modules/lighting/contact-shadow/contact-shadow.cjs +348 -0
- package/dist/modules/lighting/contact-shadow/contact-shadow.d.ts +188 -0
- package/dist/modules/lighting/contact-shadow/contact-shadow.d.ts.map +1 -0
- package/dist/modules/lighting/contact-shadow/contact-shadow.js +307 -0
- package/dist/modules/lighting/contact-shadow/contact-shadow.js.map +1 -0
- package/dist/modules/lighting/firefly/firefly.cjs +74 -0
- package/dist/modules/lighting/firefly/firefly.d.ts +36 -0
- package/dist/modules/lighting/firefly/firefly.d.ts.map +1 -0
- package/dist/modules/lighting/firefly/firefly.js +53 -0
- package/dist/modules/lighting/firefly/firefly.js.map +1 -0
- package/dist/modules/lighting/globe-clouds/globe-clouds.cjs +143 -0
- package/dist/modules/lighting/globe-clouds/globe-clouds.d.ts +53 -0
- package/dist/modules/lighting/globe-clouds/globe-clouds.d.ts.map +1 -0
- package/dist/modules/lighting/globe-clouds/globe-clouds.js +119 -0
- package/dist/modules/lighting/globe-clouds/globe-clouds.js.map +1 -0
- package/dist/modules/lighting/gouraud-material/gouraud-material.cjs +61 -0
- package/dist/modules/lighting/gouraud-material/gouraud-material.d.ts +12 -0
- package/dist/modules/lighting/gouraud-material/gouraud-material.d.ts.map +1 -0
- package/dist/modules/lighting/gouraud-material/gouraud-material.js +40 -0
- package/dist/modules/lighting/gouraud-material/gouraud-material.js.map +1 -0
- package/dist/modules/lighting/height-fog/height-fog-functions.cjs +139 -0
- package/dist/modules/lighting/height-fog/height-fog-functions.d.ts +14 -0
- package/dist/modules/lighting/height-fog/height-fog-functions.d.ts.map +1 -0
- package/dist/modules/lighting/height-fog/height-fog-functions.js +114 -0
- package/dist/modules/lighting/height-fog/height-fog-functions.js.map +1 -0
- package/dist/modules/lighting/height-fog/height-fog.cjs +104 -0
- package/dist/modules/lighting/height-fog/height-fog.d.ts +60 -0
- package/dist/modules/lighting/height-fog/height-fog.d.ts.map +1 -0
- package/dist/modules/lighting/height-fog/height-fog.js +77 -0
- package/dist/modules/lighting/height-fog/height-fog.js.map +1 -0
- package/dist/modules/lighting/ibl/ibl.cjs +63 -0
- package/dist/modules/lighting/ibl/ibl.d.ts +25 -0
- package/dist/modules/lighting/ibl/ibl.d.ts.map +1 -0
- package/dist/modules/lighting/ibl/ibl.js +33 -0
- package/dist/modules/lighting/ibl/ibl.js.map +1 -0
- package/dist/modules/lighting/lambert-material/lambert-material.cjs +54 -0
- package/dist/modules/lighting/lambert-material/lambert-material.d.ts +10 -0
- package/dist/modules/lighting/lambert-material/lambert-material.d.ts.map +1 -0
- package/dist/modules/lighting/lambert-material/lambert-material.js +33 -0
- package/dist/modules/lighting/lambert-material/lambert-material.js.map +1 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-glsl.cjs +88 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-glsl.d.ts +3 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-glsl.d.ts.map +1 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-glsl.js +60 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-glsl.js.map +1 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-wgsl.cjs +97 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-wgsl.d.ts +2 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-wgsl.d.ts.map +1 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-wgsl.js +73 -0
- package/dist/modules/lighting/lambert-material/lambert-shaders-wgsl.js.map +1 -0
- package/dist/modules/lighting/lights/lighting-glsl.cjs +116 -0
- package/dist/modules/lighting/lights/lighting-glsl.d.ts +2 -0
- package/dist/modules/lighting/lights/lighting-glsl.d.ts.map +1 -0
- package/dist/modules/lighting/lights/lighting-glsl.js +92 -0
- package/dist/modules/lighting/lights/lighting-glsl.js.map +1 -0
- package/dist/modules/lighting/lights/lighting-wgsl.cjs +115 -0
- package/dist/modules/lighting/lights/lighting-wgsl.d.ts +2 -0
- package/dist/modules/lighting/lights/lighting-wgsl.d.ts.map +1 -0
- package/dist/modules/lighting/lights/lighting-wgsl.js +91 -0
- package/dist/modules/lighting/lights/lighting-wgsl.js.map +1 -0
- package/dist/modules/lighting/lights/lighting.cjs +210 -0
- package/dist/modules/lighting/lights/lighting.d.ts +163 -0
- package/dist/modules/lighting/lights/lighting.d.ts.map +1 -0
- package/dist/modules/lighting/lights/lighting.js +208 -0
- package/dist/modules/lighting/lights/lighting.js.map +1 -0
- package/dist/modules/lighting/no-material/dirlight.cjs +112 -0
- package/dist/modules/lighting/no-material/dirlight.d.ts +33 -0
- package/dist/modules/lighting/no-material/dirlight.d.ts.map +1 -0
- package/dist/modules/lighting/no-material/dirlight.js +86 -0
- package/dist/modules/lighting/no-material/dirlight.js.map +1 -0
- package/dist/modules/lighting/pbr-ambient-occlusion/pbr-ambient-occlusion.cjs +87 -0
- package/dist/modules/lighting/pbr-ambient-occlusion/pbr-ambient-occlusion.d.ts +21 -0
- package/dist/modules/lighting/pbr-ambient-occlusion/pbr-ambient-occlusion.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-ambient-occlusion/pbr-ambient-occlusion.js +61 -0
- package/dist/modules/lighting/pbr-ambient-occlusion/pbr-ambient-occlusion.js.map +1 -0
- package/dist/modules/lighting/pbr-contact-shadow/pbr-contact-shadow.cjs +87 -0
- package/dist/modules/lighting/pbr-contact-shadow/pbr-contact-shadow.d.ts +21 -0
- package/dist/modules/lighting/pbr-contact-shadow/pbr-contact-shadow.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-contact-shadow/pbr-contact-shadow.js +61 -0
- package/dist/modules/lighting/pbr-contact-shadow/pbr-contact-shadow.js.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-material-glsl.cjs +1789 -0
- package/dist/modules/lighting/pbr-material/pbr-material-glsl.d.ts +3 -0
- package/dist/modules/lighting/pbr-material/pbr-material-glsl.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-material-glsl.js +1767 -0
- package/dist/modules/lighting/pbr-material/pbr-material-glsl.js.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-material-wgsl.cjs +2084 -0
- package/dist/modules/lighting/pbr-material/pbr-material-wgsl.d.ts +3 -0
- package/dist/modules/lighting/pbr-material/pbr-material-wgsl.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-material-wgsl.js +2062 -0
- package/dist/modules/lighting/pbr-material/pbr-material-wgsl.js.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-material.cjs +315 -0
- package/dist/modules/lighting/pbr-material/pbr-material.d.ts +516 -0
- package/dist/modules/lighting/pbr-material/pbr-material.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-material.js +292 -0
- package/dist/modules/lighting/pbr-material/pbr-material.js.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-projection.cjs +63 -0
- package/dist/modules/lighting/pbr-material/pbr-projection.d.ts +10 -0
- package/dist/modules/lighting/pbr-material/pbr-projection.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-projection.js +37 -0
- package/dist/modules/lighting/pbr-material/pbr-projection.js.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-scene.cjs +109 -0
- package/dist/modules/lighting/pbr-material/pbr-scene.d.ts +52 -0
- package/dist/modules/lighting/pbr-material/pbr-scene.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-scene.js +83 -0
- package/dist/modules/lighting/pbr-material/pbr-scene.js.map +1 -0
- package/dist/modules/lighting/pbr-shadow/pbr-shadow.cjs +97 -0
- package/dist/modules/lighting/pbr-shadow/pbr-shadow.d.ts +15 -0
- package/dist/modules/lighting/pbr-shadow/pbr-shadow.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-shadow/pbr-shadow.js +69 -0
- package/dist/modules/lighting/pbr-shadow/pbr-shadow.js.map +1 -0
- package/dist/modules/lighting/pbr-surface/pbr-surface.cjs +114 -0
- package/dist/modules/lighting/pbr-surface/pbr-surface.d.ts +15 -0
- package/dist/modules/lighting/pbr-surface/pbr-surface.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-surface/pbr-surface.js +88 -0
- package/dist/modules/lighting/pbr-surface/pbr-surface.js.map +1 -0
- package/dist/modules/lighting/phong-material/phong-material.cjs +61 -0
- package/dist/modules/lighting/phong-material/phong-material.d.ts +13 -0
- package/dist/modules/lighting/phong-material/phong-material.d.ts.map +1 -0
- package/dist/modules/lighting/phong-material/phong-material.js +40 -0
- package/dist/modules/lighting/phong-material/phong-material.js.map +1 -0
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.cjs +100 -0
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.d.ts +3 -0
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.d.ts.map +1 -0
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.js +72 -0
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.js.map +1 -0
- package/dist/modules/lighting/phong-material/phong-shaders-wgsl.cjs +153 -0
- package/dist/modules/lighting/phong-material/phong-shaders-wgsl.d.ts +2 -0
- package/dist/modules/lighting/phong-material/phong-shaders-wgsl.d.ts.map +1 -0
- package/dist/modules/lighting/phong-material/phong-shaders-wgsl.js +129 -0
- package/dist/modules/lighting/phong-material/phong-shaders-wgsl.js.map +1 -0
- package/dist/modules/lighting/prefiltered-environment/prefiltered-environment.cjs +379 -0
- package/dist/modules/lighting/prefiltered-environment/prefiltered-environment.d.ts +41 -0
- package/dist/modules/lighting/prefiltered-environment/prefiltered-environment.d.ts.map +1 -0
- package/dist/modules/lighting/prefiltered-environment/prefiltered-environment.js +345 -0
- package/dist/modules/lighting/prefiltered-environment/prefiltered-environment.js.map +1 -0
- package/dist/modules/lighting/shadow/shadow-glsl.cjs +228 -0
- package/dist/modules/lighting/shadow/shadow-glsl.d.ts +3 -0
- package/dist/modules/lighting/shadow/shadow-glsl.d.ts.map +1 -0
- package/dist/modules/lighting/shadow/shadow-glsl.js +204 -0
- package/dist/modules/lighting/shadow/shadow-glsl.js.map +1 -0
- package/dist/modules/lighting/shadow/shadow-types.cjs +15 -0
- package/dist/modules/lighting/shadow/shadow-types.d.ts +63 -0
- package/dist/modules/lighting/shadow/shadow-types.d.ts.map +1 -0
- package/dist/modules/lighting/shadow/shadow-types.js +5 -0
- package/dist/modules/lighting/shadow/shadow-types.js.map +1 -0
- package/dist/modules/lighting/shadow/shadow.cjs +458 -0
- package/dist/modules/lighting/shadow/shadow.d.ts +117 -0
- package/dist/modules/lighting/shadow/shadow.d.ts.map +1 -0
- package/dist/modules/lighting/shadow/shadow.js +450 -0
- package/dist/modules/lighting/shadow/shadow.js.map +1 -0
- package/dist/modules/lighting/surface-weather/surface-weather.cjs +199 -0
- package/dist/modules/lighting/surface-weather/surface-weather.d.ts +54 -0
- package/dist/modules/lighting/surface-weather/surface-weather.d.ts.map +1 -0
- package/dist/modules/lighting/surface-weather/surface-weather.js +175 -0
- package/dist/modules/lighting/surface-weather/surface-weather.js.map +1 -0
- package/dist/modules/lighting/unlit-material/unlit-material.cjs +60 -0
- package/dist/modules/lighting/unlit-material/unlit-material.d.ts +9 -0
- package/dist/modules/lighting/unlit-material/unlit-material.d.ts.map +1 -0
- package/dist/modules/lighting/unlit-material/unlit-material.js +40 -0
- package/dist/modules/lighting/unlit-material/unlit-material.js.map +1 -0
- package/dist/modules/lighting/water-material/river-water-material.cjs +56 -0
- package/dist/modules/lighting/water-material/river-water-material.d.ts +21 -0
- package/dist/modules/lighting/water-material/river-water-material.d.ts.map +1 -0
- package/dist/modules/lighting/water-material/river-water-material.js +36 -0
- package/dist/modules/lighting/water-material/river-water-material.js.map +1 -0
- package/dist/modules/lighting/water-material/river-water-shaders.cjs +261 -0
- package/dist/modules/lighting/water-material/river-water-shaders.d.ts +3 -0
- package/dist/modules/lighting/water-material/river-water-shaders.d.ts.map +1 -0
- package/dist/modules/lighting/water-material/river-water-shaders.js +233 -0
- package/dist/modules/lighting/water-material/river-water-shaders.js.map +1 -0
- package/dist/modules/lighting/water-material/water-material.cjs +188 -0
- package/dist/modules/lighting/water-material/water-material.d.ts +28 -0
- package/dist/modules/lighting/water-material/water-material.d.ts.map +1 -0
- package/dist/modules/lighting/water-material/water-material.js +179 -0
- package/dist/modules/lighting/water-material/water-material.js.map +1 -0
- package/dist/modules/lighting/water-material/water-shaders-glsl.cjs +260 -0
- package/dist/modules/lighting/water-material/water-shaders-glsl.d.ts +3 -0
- package/dist/modules/lighting/water-material/water-shaders-glsl.d.ts.map +1 -0
- package/dist/modules/lighting/water-material/water-shaders-glsl.js +232 -0
- package/dist/modules/lighting/water-material/water-shaders-glsl.js.map +1 -0
- package/dist/modules/lighting/water-material/water-shaders-wgsl.cjs +254 -0
- package/dist/modules/lighting/water-material/water-shaders-wgsl.d.ts +2 -0
- package/dist/modules/lighting/water-material/water-shaders-wgsl.d.ts.map +1 -0
- package/dist/modules/lighting/water-material/water-shaders-wgsl.js +230 -0
- package/dist/modules/lighting/water-material/water-shaders-wgsl.js.map +1 -0
- package/dist/modules/math/fp16/fp16-utils.cjs +112 -0
- package/dist/modules/math/fp16/fp16-utils.d.ts +13 -0
- package/dist/modules/math/fp16/fp16-utils.d.ts.map +1 -0
- package/dist/modules/math/fp16/fp16-utils.js +118 -0
- package/dist/modules/math/fp16/fp16-utils.js.map +1 -0
- package/dist/modules/math/fp32/fp32.cjs +310 -0
- package/dist/modules/math/fp32/fp32.d.ts +9 -0
- package/dist/modules/math/fp32/fp32.d.ts.map +1 -0
- package/dist/modules/math/fp32/fp32.js +288 -0
- package/dist/modules/math/fp32/fp32.js.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-glsl.cjs +229 -0
- package/dist/modules/math/fp64/fp64-arithmetic-glsl.d.ts +2 -0
- package/dist/modules/math/fp64/fp64-arithmetic-glsl.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-glsl.js +205 -0
- package/dist/modules/math/fp64/fp64-arithmetic-glsl.js.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-hybrid.cjs +144 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-hybrid.d.ts +10 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-hybrid.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-hybrid.js +128 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-hybrid.js.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-integer.cjs +583 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-integer.d.ts +11 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-integer.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-integer.js +563 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl-integer.js.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl.cjs +946 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl.d.ts +3 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl.js +923 -0
- package/dist/modules/math/fp64/fp64-arithmetic-wgsl.js.map +1 -0
- package/dist/modules/math/fp64/fp64-functions-glsl.cjs +699 -0
- package/dist/modules/math/fp64/fp64-functions-glsl.d.ts +2 -0
- package/dist/modules/math/fp64/fp64-functions-glsl.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64-functions-glsl.js +675 -0
- package/dist/modules/math/fp64/fp64-functions-glsl.js.map +1 -0
- package/dist/modules/math/fp64/fp64-functions-wgsl.cjs +180 -0
- package/dist/modules/math/fp64/fp64-functions-wgsl.d.ts +3 -0
- package/dist/modules/math/fp64/fp64-functions-wgsl.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64-functions-wgsl.js +157 -0
- package/dist/modules/math/fp64/fp64-functions-wgsl.js.map +1 -0
- package/dist/modules/math/fp64/fp64-utils.cjs +50 -0
- package/dist/modules/math/fp64/fp64-utils.d.ts +22 -0
- package/dist/modules/math/fp64/fp64-utils.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64-utils.js +42 -0
- package/dist/modules/math/fp64/fp64-utils.js.map +1 -0
- package/dist/modules/math/fp64/fp64.cjs +68 -0
- package/dist/modules/math/fp64/fp64.d.ts +24 -0
- package/dist/modules/math/fp64/fp64.d.ts.map +1 -0
- package/dist/modules/math/fp64/fp64.js +46 -0
- package/dist/modules/math/fp64/fp64.js.map +1 -0
- package/dist/modules/math/random/random.cjs +46 -0
- package/dist/modules/math/random/random.d.ts +7 -0
- package/dist/modules/math/random/random.d.ts.map +1 -0
- package/dist/modules/math/random/random.js +21 -0
- package/dist/modules/math/random/random.js.map +1 -0
- package/dist/modules/math/value-noise/value-noise.cjs +95 -0
- package/dist/modules/math/value-noise/value-noise.d.ts +7 -0
- package/dist/modules/math/value-noise/value-noise.d.ts.map +1 -0
- package/dist/modules/math/value-noise/value-noise.js +68 -0
- package/dist/modules/math/value-noise/value-noise.js.map +1 -0
- package/dist/modules/volume/volume-raymarch.cjs +107 -0
- package/dist/modules/volume/volume-raymarch.d.ts +6 -0
- package/dist/modules/volume/volume-raymarch.d.ts.map +1 -0
- package/dist/modules/volume/volume-raymarch.js +84 -0
- package/dist/modules/volume/volume-raymarch.js.map +1 -0
- package/dist/types/align-to.cjs +38 -0
- package/dist/types/align-to.d.ts +3 -0
- package/dist/types/align-to.d.ts.map +1 -0
- package/dist/types/align-to.js +13 -0
- package/dist/types/align-to.js.map +1 -0
- package/dist/types/primitive-data-types.cjs +15 -0
- package/dist/types/primitive-data-types.d.ts +7 -0
- package/dist/types/primitive-data-types.d.ts.map +1 -0
- package/dist/types/primitive-data-types.js +5 -0
- package/dist/types/primitive-data-types.js.map +1 -0
- package/dist/types/sampler-props.cjs +15 -0
- package/dist/types/sampler-props.d.ts +26 -0
- package/dist/types/sampler-props.d.ts.map +1 -0
- package/dist/types/sampler-props.js +5 -0
- package/dist/types/sampler-props.js.map +1 -0
- package/dist/types/shader-block-layout.cjs +184 -0
- package/dist/types/shader-block-layout.d.ts +72 -0
- package/dist/types/shader-block-layout.d.ts.map +1 -0
- package/dist/types/shader-block-layout.js +209 -0
- package/dist/types/shader-block-layout.js.map +1 -0
- package/dist/types/shader-layout.cjs +15 -0
- package/dist/types/shader-layout.d.ts +178 -0
- package/dist/types/shader-layout.d.ts.map +1 -0
- package/dist/types/shader-layout.js +5 -0
- package/dist/types/shader-layout.js.map +1 -0
- package/dist/types/shader-type-decoder.cjs +240 -0
- package/dist/types/shader-type-decoder.d.ts +41 -0
- package/dist/types/shader-type-decoder.d.ts.map +1 -0
- package/dist/types/shader-type-decoder.js +210 -0
- package/dist/types/shader-type-decoder.js.map +1 -0
- package/dist/types/shader-types.cjs +15 -0
- package/dist/types/shader-types.d.ts +101 -0
- package/dist/types/shader-types.d.ts.map +1 -0
- package/dist/types/shader-types.js +30 -0
- package/dist/types/shader-types.js.map +1 -0
- package/dist/types/texture-formats.cjs +15 -0
- package/dist/types/texture-formats.d.ts +24 -0
- package/dist/types/texture-formats.d.ts.map +1 -0
- package/dist/types/texture-formats.js +5 -0
- package/dist/types/texture-formats.js.map +1 -0
- package/dist/types.cjs +53 -0
- package/dist/types.cjs.map +6 -0
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/wgsl.cjs +55 -0
- package/dist/wgsl.cjs.map +6 -0
- package/dist/wgsl.d.ts +8 -0
- package/dist/wgsl.d.ts.map +1 -0
- package/dist/wgsl.js +9 -0
- package/dist/wgsl.js.map +1 -0
- package/package.json +65 -4
- package/src/glsl.ts +13 -0
- package/src/index.ts +307 -0
- package/src/lib/color/normalize-byte-colors.ts +57 -0
- package/src/lib/filters/prop-types.ts +150 -0
- package/src/lib/glsl-shader-assembler.ts +39 -0
- package/src/lib/glsl-utils/get-shader-info.ts +42 -0
- package/src/lib/glsl-utils/shader-utils.ts +110 -0
- package/src/lib/preprocessor/preprocessor.ts +157 -0
- package/src/lib/shader-assembler-base.ts +169 -0
- package/src/lib/shader-assembler.ts +7 -0
- package/src/lib/shader-assembly/assemble-glsl-shaders.ts +305 -0
- package/src/lib/shader-assembly/assemble-shaders.ts +13 -0
- package/src/lib/shader-assembly/assemble-wgsl-shaders.ts +830 -0
- package/src/lib/shader-assembly/platform-defines.ts +58 -0
- package/src/lib/shader-assembly/platform-info.ts +23 -0
- package/src/lib/shader-assembly/shader-assembly-shared.ts +95 -0
- package/src/lib/shader-assembly/shader-assembly-types.ts +146 -0
- package/src/lib/shader-assembly/shader-injection-targets.ts +148 -0
- package/src/lib/shader-assembly/shader-injections.ts +298 -0
- package/src/lib/shader-assembly/shader-plugin-varyings.ts +555 -0
- package/src/lib/shader-assembly/shader-plugin-vertex-inputs.ts +279 -0
- package/src/lib/shader-assembly/wgsl-binding-debug.ts +227 -0
- package/src/lib/shader-assembly/wgsl-binding-scan.ts +228 -0
- package/src/lib/shader-assembly/wgsl-injection-target-names.ts +180 -0
- package/src/lib/shader-assembly/wgsl-interface-scan.ts +676 -0
- package/src/lib/shader-generator/generate-shader.ts +27 -0
- package/src/lib/shader-generator/glsl/generate-glsl.ts +101 -0
- package/src/lib/shader-generator/utils/capitalize.ts +12 -0
- package/src/lib/shader-generator/wgsl/generate-wgsl.ts +40 -0
- package/src/lib/shader-module/composite-shader-pass.ts +47 -0
- package/src/lib/shader-module/shader-module-dependencies.ts +128 -0
- package/src/lib/shader-module/shader-module-uniform-layout.ts +420 -0
- package/src/lib/shader-module/shader-module.ts +237 -0
- package/src/lib/shader-module/shader-pass.ts +69 -0
- package/src/lib/shader-plugin.ts +236 -0
- package/src/lib/shader-transpiler/shader-transpiler.ts +34 -0
- package/src/lib/shader-transpiler/transpile-glsl-shader.ts +78 -0
- package/src/lib/utils/assert.ts +13 -0
- package/src/lib/utils/uniform-types.ts +89 -0
- package/src/lib/wgsl-shader-assembler.ts +122 -0
- package/src/module-injectors.ts +32 -0
- package/src/modules/color/float-colors.ts +334 -0
- package/src/modules/engine/clip/clip.ts +139 -0
- package/src/modules/engine/filter/filter.ts +99 -0
- package/src/modules/engine/geometry/geometry.ts +45 -0
- package/src/modules/engine/gpu-animation/gpu-animation.ts +244 -0
- package/src/modules/engine/picking/README.md +88 -0
- package/src/modules/engine/picking/picking.ts +252 -0
- package/src/modules/engine/project/project.ts +166 -0
- package/src/modules/engine/skin/skin.ts +233 -0
- package/src/modules/engine/transform/transform.ts +50 -0
- package/src/modules/geometry/path-dash/path-dash.ts +68 -0
- package/src/modules/geometry/pattern-fill/pattern-fill-shaders.ts +88 -0
- package/src/modules/geometry/pattern-fill/pattern-fill.ts +54 -0
- package/src/modules/geometry/point-glow/point-glow.ts +87 -0
- package/src/modules/geometry/precipitation/README.md +19 -0
- package/src/modules/geometry/precipitation/precipitation.ts +108 -0
- package/src/modules/geometry/sketch-stroke/sketch-stroke.ts +160 -0
- package/src/modules/geospatial/dggs/dggs-wgsl.ts +2284 -0
- package/src/modules/geospatial/dggs/dggs.ts +12 -0
- package/src/modules/lighting/area-lighting/area-light-types.ts +71 -0
- package/src/modules/lighting/area-lighting/area-lighting-shaders.ts +72 -0
- package/src/modules/lighting/area-lighting/area-lighting.ts +63 -0
- package/src/modules/lighting/area-lighting/ltc-shaders.ts +163 -0
- package/src/modules/lighting/atmosphere/README.md +25 -0
- package/src/modules/lighting/atmosphere/atmosphere.ts +246 -0
- package/src/modules/lighting/clouds/README.md +24 -0
- package/src/modules/lighting/clouds/clouds.ts +216 -0
- package/src/modules/lighting/clustered-light-grid/clustered-light-grid.ts +17 -0
- package/src/modules/lighting/contact-shadow/contact-shadow.ts +365 -0
- package/src/modules/lighting/firefly/firefly.ts +64 -0
- package/src/modules/lighting/globe-clouds/globe-clouds.ts +124 -0
- package/src/modules/lighting/gouraud-material/gouraud-material.ts +55 -0
- package/src/modules/lighting/height-fog/README.md +36 -0
- package/src/modules/lighting/height-fog/height-fog-functions.ts +116 -0
- package/src/modules/lighting/height-fog/height-fog.ts +96 -0
- package/src/modules/lighting/ibl/ibl.ts +43 -0
- package/src/modules/lighting/lambert-material/lambert-material.ts +42 -0
- package/src/modules/lighting/lambert-material/lambert-shaders-glsl.ts +61 -0
- package/src/modules/lighting/lambert-material/lambert-shaders-wgsl.ts +73 -0
- package/src/modules/lighting/lights/lighting-glsl.ts +92 -0
- package/src/modules/lighting/lights/lighting-wgsl.ts +91 -0
- package/src/modules/lighting/lights/lighting.ts +385 -0
- package/src/modules/lighting/no-material/dirlight.ts +101 -0
- package/src/modules/lighting/pbr-ambient-occlusion/pbr-ambient-occlusion.ts +78 -0
- package/src/modules/lighting/pbr-contact-shadow/pbr-contact-shadow.ts +78 -0
- package/src/modules/lighting/pbr-material/pbr-material-glsl.ts +1770 -0
- package/src/modules/lighting/pbr-material/pbr-material-wgsl.ts +2065 -0
- package/src/modules/lighting/pbr-material/pbr-material.ts +517 -0
- package/src/modules/lighting/pbr-material/pbr-projection.ts +50 -0
- package/src/modules/lighting/pbr-material/pbr-scene.ts +112 -0
- package/src/modules/lighting/pbr-shadow/pbr-shadow.ts +85 -0
- package/src/modules/lighting/pbr-surface/pbr-surface.ts +103 -0
- package/src/modules/lighting/phong-material/phong-material.ts +53 -0
- package/src/modules/lighting/phong-material/phong-shaders-glsl.ts +73 -0
- package/src/modules/lighting/phong-material/phong-shaders-wgsl.ts +129 -0
- package/src/modules/lighting/prefiltered-environment/prefiltered-environment.ts +370 -0
- package/src/modules/lighting/shadow/shadow-glsl.ts +204 -0
- package/src/modules/lighting/shadow/shadow-types.ts +68 -0
- package/src/modules/lighting/shadow/shadow.ts +536 -0
- package/src/modules/lighting/surface-weather/README.md +28 -0
- package/src/modules/lighting/surface-weather/surface-weather.ts +198 -0
- package/src/modules/lighting/unlit-material/unlit-material.ts +44 -0
- package/src/modules/lighting/water-material/river-water-material.ts +58 -0
- package/src/modules/lighting/water-material/river-water-shaders.ts +234 -0
- package/src/modules/lighting/water-material/water-material.ts +234 -0
- package/src/modules/lighting/water-material/water-shaders-glsl.ts +233 -0
- package/src/modules/lighting/water-material/water-shaders-wgsl.ts +230 -0
- package/src/modules/math/fp16/fp16-utils.ts +156 -0
- package/src/modules/math/fp32/fp32.ts +291 -0
- package/src/modules/math/fp64/fp64-arithmetic-glsl.ts +205 -0
- package/src/modules/math/fp64/fp64-arithmetic-wgsl-hybrid.ts +129 -0
- package/src/modules/math/fp64/fp64-arithmetic-wgsl-integer.ts +564 -0
- package/src/modules/math/fp64/fp64-arithmetic-wgsl.ts +924 -0
- package/src/modules/math/fp64/fp64-functions-glsl.ts +675 -0
- package/src/modules/math/fp64/fp64-functions-wgsl.ts +157 -0
- package/src/modules/math/fp64/fp64-utils.ts +46 -0
- package/src/modules/math/fp64/fp64.ts +64 -0
- package/src/modules/math/random/random.ts +25 -0
- package/src/modules/math/value-noise/value-noise.ts +70 -0
- package/src/modules/volume/volume-raymarch.ts +87 -0
- package/src/types/align-to.ts +13 -0
- package/src/types/primitive-data-types.ts +10 -0
- package/src/types/sampler-props.ts +39 -0
- package/src/types/shader-block-layout.ts +340 -0
- package/src/types/shader-layout.ts +208 -0
- package/src/types/shader-type-decoder.ts +285 -0
- package/src/types/shader-types.ts +207 -0
- package/src/types/texture-formats.ts +157 -0
- package/src/types.ts +116 -0
- package/src/wgsl.ts +34 -0
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var assemble_wgsl_shaders_exports = {};
|
|
19
|
+
__export(assemble_wgsl_shaders_exports, {
|
|
20
|
+
RESERVED_APPLICATION_GROUP_0_BINDING_LIMIT: () => RESERVED_APPLICATION_GROUP_0_BINDING_LIMIT,
|
|
21
|
+
allocateApplicationAutoBindingLocation: () => allocateApplicationAutoBindingLocation,
|
|
22
|
+
allocateAutoBindingLocation: () => allocateAutoBindingLocation,
|
|
23
|
+
appendGeneratedVaryingInjections: () => appendGeneratedVaryingInjections,
|
|
24
|
+
appendGeneratedVertexInputInjections: () => appendGeneratedVertexInputInjections,
|
|
25
|
+
assembleShaderWGSL: () => assembleShaderWGSL,
|
|
26
|
+
assembleWGSLShader: () => assembleWGSLShader,
|
|
27
|
+
assembleWGSLSource: () => assembleWGSLSource,
|
|
28
|
+
assertNoUnresolvedAutoBindings: () => assertNoUnresolvedAutoBindings,
|
|
29
|
+
claimReservedBindingLocation: () => claimReservedBindingLocation,
|
|
30
|
+
formatWGSLBindingAssignmentComments: () => formatWGSLBindingAssignmentComments,
|
|
31
|
+
formatWGSLSourceSnippet: () => formatWGSLSourceSnippet,
|
|
32
|
+
getBindingRegistryKey: () => getBindingRegistryKey,
|
|
33
|
+
getUsedBindingsByGroupFromApplicationWGSL: () => getUsedBindingsByGroupFromApplicationWGSL,
|
|
34
|
+
getWGSLDeclarationInjections: () => getWGSLDeclarationInjections,
|
|
35
|
+
getWGSLModuleNameAtIndex: () => getWGSLModuleNameAtIndex,
|
|
36
|
+
getWGSLShaderInjectionTargets: () => getWGSLShaderInjectionTargets,
|
|
37
|
+
isInApplicationWGSLSection: () => isInApplicationWGSLSection,
|
|
38
|
+
registerUsedBindingLocation: () => registerUsedBindingLocation,
|
|
39
|
+
relocateWGSLApplicationBindingMatch: () => relocateWGSLApplicationBindingMatch,
|
|
40
|
+
relocateWGSLApplicationBindings: () => relocateWGSLApplicationBindings,
|
|
41
|
+
relocateWGSLModuleBindingMatch: () => relocateWGSLModuleBindingMatch,
|
|
42
|
+
relocateWGSLModuleBindings: () => relocateWGSLModuleBindings,
|
|
43
|
+
reserveModuleBindings: () => reserveModuleBindings,
|
|
44
|
+
validateApplicationWGSLBinding: () => validateApplicationWGSLBinding,
|
|
45
|
+
validateModuleWGSLBinding: () => validateModuleWGSLBinding
|
|
46
|
+
});
|
|
47
|
+
module.exports = __toCommonJS(assemble_wgsl_shaders_exports);
|
|
48
|
+
var import_wgsl_binding_debug = require("./wgsl-binding-debug.cjs");
|
|
49
|
+
var import_wgsl_interface_scan = require("./wgsl-interface-scan.cjs");
|
|
50
|
+
var import_wgsl_injection_target_names = require("./wgsl-injection-target-names.cjs");
|
|
51
|
+
var import_shader_module_dependencies = require("../shader-module/shader-module-dependencies.cjs");
|
|
52
|
+
var import_shader_assembly_shared = require("./shader-assembly-shared.cjs");
|
|
53
|
+
var import_assert = require("../utils/assert.cjs");
|
|
54
|
+
var import_preprocessor = require("../preprocessor/preprocessor.cjs");
|
|
55
|
+
var import_shader_plugin_vertex_inputs = require("./shader-plugin-vertex-inputs.cjs");
|
|
56
|
+
var import_shader_plugin_varyings = require("./shader-plugin-varyings.cjs");
|
|
57
|
+
var import_shader_injection_targets = require("./shader-injection-targets.cjs");
|
|
58
|
+
var import_shader_injections = require("./shader-injections.cjs");
|
|
59
|
+
var import_shader_module = require("../shader-module/shader-module.cjs");
|
|
60
|
+
var import_wgsl_binding_scan = require("./wgsl-binding-scan.cjs");
|
|
61
|
+
const RESERVED_APPLICATION_GROUP_0_BINDING_LIMIT = 100;
|
|
62
|
+
function assembleWGSLShader(options) {
|
|
63
|
+
const assembledShader = assembleWGSLSource(options);
|
|
64
|
+
return {
|
|
65
|
+
...assembledShader,
|
|
66
|
+
bindingTable: (0, import_wgsl_binding_debug.getShaderBindingDebugRowsFromWGSL)(assembledShader.source, assembledShader.bindingAssignments),
|
|
67
|
+
shaderLayout: (0, import_wgsl_interface_scan.scanWGSLInterface)(assembledShader.source, {
|
|
68
|
+
vertexEntryPoint: options.vertexEntryPoint,
|
|
69
|
+
scanVertexAttributes: options.scanVertexAttributes
|
|
70
|
+
})
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function assembleWGSLSource(options) {
|
|
74
|
+
const modules = (0, import_shader_module_dependencies.getShaderModuleDependencies)(options.modules || []);
|
|
75
|
+
const { source, bindingAssignments } = assembleShaderWGSL(options.platformInfo, {
|
|
76
|
+
...options,
|
|
77
|
+
source: options.source,
|
|
78
|
+
stage: "vertex",
|
|
79
|
+
modules
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
source,
|
|
83
|
+
getUniforms: (0, import_shader_assembly_shared.assembleGetUniforms)(modules),
|
|
84
|
+
bindingAssignments
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function assembleShaderWGSL(platformInfo, options) {
|
|
88
|
+
const {
|
|
89
|
+
// id,
|
|
90
|
+
source,
|
|
91
|
+
stage,
|
|
92
|
+
modules,
|
|
93
|
+
// defines = {},
|
|
94
|
+
defines = {},
|
|
95
|
+
injectionTargets = [],
|
|
96
|
+
inject = {},
|
|
97
|
+
pluginInjections = {},
|
|
98
|
+
pluginVertexInputs = {},
|
|
99
|
+
pluginInterStageVariables = {},
|
|
100
|
+
vertexEntryPoint = "vertexMain",
|
|
101
|
+
fragmentEntryPoint = "fragmentMain",
|
|
102
|
+
log
|
|
103
|
+
} = options;
|
|
104
|
+
(0, import_assert.assert)(typeof source === "string", "shader source must be a string");
|
|
105
|
+
const preprocessedSource = (0, import_preprocessor.preprocess)(source, { defines });
|
|
106
|
+
const pluginVertexInputAssembly = (0, import_shader_plugin_vertex_inputs.assembleShaderPluginVertexInputsWGSL)(preprocessedSource, vertexEntryPoint, pluginVertexInputs);
|
|
107
|
+
const pluginVaryingAssembly = (0, import_shader_plugin_varyings.assembleShaderPluginInterStageVariablesWGSL)(pluginVertexInputAssembly.source, vertexEntryPoint, fragmentEntryPoint, pluginInterStageVariables);
|
|
108
|
+
const coreSource = pluginVaryingAssembly.source;
|
|
109
|
+
let assembledSource = "";
|
|
110
|
+
const injectionTargetMap = (0, import_shader_injection_targets.normalizeShaderInjectionTargets)(injectionTargets, options.pluginInjectionTargets, "wgsl");
|
|
111
|
+
const targetInjections = {};
|
|
112
|
+
const declInjections = {};
|
|
113
|
+
const mainInjections = {};
|
|
114
|
+
(0, import_shader_assembly_shared.appendInjections)(pluginInjections, targetInjections, declInjections, mainInjections);
|
|
115
|
+
const applicationInjections = Array.isArray(inject) ? (0, import_shader_injections.resolveShaderInjections)(inject, "wgsl") : {};
|
|
116
|
+
(0, import_shader_assembly_shared.appendInjections)(applicationInjections, targetInjections, declInjections, mainInjections);
|
|
117
|
+
const injectionMap = Array.isArray(inject) ? {} : inject;
|
|
118
|
+
for (const key in injectionMap) {
|
|
119
|
+
const injection = typeof injectionMap[key] === "string" ? { injection: injectionMap[key], order: 0 } : injectionMap[key];
|
|
120
|
+
const match = /^(v|f)s:(#)?([\w-]+)$/.exec(key);
|
|
121
|
+
if (match) {
|
|
122
|
+
const hash = match[2];
|
|
123
|
+
const name = match[3];
|
|
124
|
+
if (hash) {
|
|
125
|
+
if (name === "decl") {
|
|
126
|
+
declInjections[key] = [...declInjections[key] || [], injection];
|
|
127
|
+
} else {
|
|
128
|
+
mainInjections[key] = [...mainInjections[key] || [], injection];
|
|
129
|
+
}
|
|
130
|
+
} else {
|
|
131
|
+
targetInjections[key] = [...targetInjections[key] || [], injection];
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
mainInjections[key] = [...mainInjections[key] || [], injection];
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
appendGeneratedVertexInputInjections(pluginVertexInputAssembly.declarations, pluginVertexInputAssembly.initialization, declInjections, mainInjections);
|
|
138
|
+
appendGeneratedVaryingInjections(pluginVaryingAssembly, declInjections, mainInjections);
|
|
139
|
+
(0, import_shader_injection_targets.validateShaderInjectionTargetInjections)(injectionTargetMap, targetInjections);
|
|
140
|
+
const modulesToInject = modules.map((module2) => ({
|
|
141
|
+
module: module2,
|
|
142
|
+
source: (0, import_preprocessor.preprocess)((0, import_shader_assembly_shared.getShaderModuleSource)(module2, "wgsl", log), { defines })
|
|
143
|
+
}));
|
|
144
|
+
const applicationRelocation = relocateWGSLApplicationBindings(coreSource);
|
|
145
|
+
const usedBindingsByGroup = getUsedBindingsByGroupFromApplicationWGSL(applicationRelocation.source);
|
|
146
|
+
const reservedBindingKeysByGroup = reserveModuleBindings(modulesToInject, options._bindingRegistry, usedBindingsByGroup);
|
|
147
|
+
const bindingAssignments = [];
|
|
148
|
+
const relocatedModules = modulesToInject.map(({ module: module2, source: moduleSource }) => {
|
|
149
|
+
const relocation = relocateWGSLModuleBindings(moduleSource, module2, {
|
|
150
|
+
usedBindingsByGroup,
|
|
151
|
+
bindingRegistry: options._bindingRegistry,
|
|
152
|
+
reservedBindingKeysByGroup
|
|
153
|
+
});
|
|
154
|
+
bindingAssignments.push(...relocation.bindingAssignments);
|
|
155
|
+
return { module: module2, source: relocation.source };
|
|
156
|
+
});
|
|
157
|
+
for (const { module: module2, source: moduleSource } of relocatedModules) {
|
|
158
|
+
if (log) {
|
|
159
|
+
(0, import_shader_module.checkShaderModuleDeprecations)(module2, coreSource, log);
|
|
160
|
+
}
|
|
161
|
+
assembledSource += moduleSource;
|
|
162
|
+
}
|
|
163
|
+
assembledSource += import_shader_assembly_shared.INJECT_SHADER_DECLARATIONS;
|
|
164
|
+
assembledSource = (0, import_shader_injections.injectShader)(assembledSource, stage, getWGSLDeclarationInjections(declInjections), false, "wgsl", { vertex: vertexEntryPoint, fragment: fragmentEntryPoint });
|
|
165
|
+
const targetNames = (0, import_wgsl_injection_target_names.getWGSLInjectionTargetNames)(injectionTargetMap, [
|
|
166
|
+
assembledSource,
|
|
167
|
+
applicationRelocation.source,
|
|
168
|
+
...Object.values(targetInjections).flat().map((injection) => injection.injection),
|
|
169
|
+
...Object.values(mainInjections).flat().map((injection) => injection.injection)
|
|
170
|
+
].join("\n"));
|
|
171
|
+
assembledSource += getWGSLShaderInjectionTargets(injectionTargetMap, targetInjections, targetNames);
|
|
172
|
+
assembledSource += formatWGSLBindingAssignmentComments(bindingAssignments);
|
|
173
|
+
assembledSource += applicationRelocation.source;
|
|
174
|
+
assembledSource = (0, import_shader_injections.injectShader)(assembledSource, stage, mainInjections, false, "wgsl", {
|
|
175
|
+
vertex: vertexEntryPoint,
|
|
176
|
+
fragment: fragmentEntryPoint
|
|
177
|
+
});
|
|
178
|
+
assembledSource = (0, import_wgsl_injection_target_names.resolveWGSLInjectionTargetNames)(assembledSource, injectionTargetMap, targetNames);
|
|
179
|
+
assertNoUnresolvedAutoBindings(assembledSource);
|
|
180
|
+
return { source: assembledSource, bindingAssignments };
|
|
181
|
+
}
|
|
182
|
+
function appendGeneratedVertexInputInjections(declarations, initialization, declarationInjections, mainInjections) {
|
|
183
|
+
if (declarations) {
|
|
184
|
+
declarationInjections["vs:#decl"] = declarationInjections["vs:#decl"] || [];
|
|
185
|
+
declarationInjections["vs:#decl"].push({
|
|
186
|
+
injection: declarations,
|
|
187
|
+
order: Number.MIN_SAFE_INTEGER
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
if (initialization) {
|
|
191
|
+
mainInjections["vs:#main-start"] = mainInjections["vs:#main-start"] || [];
|
|
192
|
+
mainInjections["vs:#main-start"].push({
|
|
193
|
+
injection: initialization,
|
|
194
|
+
order: Number.MIN_SAFE_INTEGER
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function appendGeneratedVaryingInjections(assembly, declarationInjections, mainInjections) {
|
|
199
|
+
if (assembly.declarations) {
|
|
200
|
+
declarationInjections["vs:#decl"] = declarationInjections["vs:#decl"] || [];
|
|
201
|
+
declarationInjections["vs:#decl"].push({
|
|
202
|
+
injection: assembly.declarations,
|
|
203
|
+
order: Number.MIN_SAFE_INTEGER
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
if (assembly.vertexInitialization) {
|
|
207
|
+
mainInjections["vs:#main-start"] = mainInjections["vs:#main-start"] || [];
|
|
208
|
+
mainInjections["vs:#main-start"].push({
|
|
209
|
+
injection: assembly.vertexInitialization,
|
|
210
|
+
order: Number.MIN_SAFE_INTEGER
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
if (assembly.fragmentInitialization) {
|
|
214
|
+
mainInjections["fs:#main-start"] = mainInjections["fs:#main-start"] || [];
|
|
215
|
+
mainInjections["fs:#main-start"].push({
|
|
216
|
+
injection: assembly.fragmentInitialization,
|
|
217
|
+
order: Number.MIN_SAFE_INTEGER
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function getWGSLDeclarationInjections(declarationInjections) {
|
|
222
|
+
const unifiedDeclarations = [
|
|
223
|
+
...declarationInjections["vs:#decl"] || [],
|
|
224
|
+
...declarationInjections["fs:#decl"] || []
|
|
225
|
+
];
|
|
226
|
+
return unifiedDeclarations.length ? { "vs:#decl": unifiedDeclarations } : {};
|
|
227
|
+
}
|
|
228
|
+
function getWGSLShaderInjectionTargets(injectionTargetMap, targetInjections, names = (0, import_wgsl_injection_target_names.getWGSLInjectionTargetNames)(injectionTargetMap)) {
|
|
229
|
+
return ["vertex", "fragment"].map((stage) => {
|
|
230
|
+
const targets = Object.fromEntries(Object.entries(injectionTargetMap[stage]).map(([key, target]) => {
|
|
231
|
+
var _a;
|
|
232
|
+
const name = key.slice(3);
|
|
233
|
+
const emittedName = ((_a = names.get(name)) == null ? void 0 : _a[stage]) || name;
|
|
234
|
+
return [key, { ...target, signature: emittedName + target.signature.slice(name.length) }];
|
|
235
|
+
}));
|
|
236
|
+
return (0, import_shader_injection_targets.getShaderInjectionTargets)(targets, targetInjections, "wgsl");
|
|
237
|
+
}).join("");
|
|
238
|
+
}
|
|
239
|
+
function getUsedBindingsByGroupFromApplicationWGSL(source) {
|
|
240
|
+
const usedBindingsByGroup = /* @__PURE__ */ new Map();
|
|
241
|
+
for (const match of (0, import_wgsl_binding_scan.getWGSLBindingDeclarationMatches)(source, import_wgsl_binding_scan.WGSL_EXPLICIT_BINDING_DECLARATION_REGEXES)) {
|
|
242
|
+
const location = Number(match.bindingToken);
|
|
243
|
+
const group = Number(match.groupToken);
|
|
244
|
+
validateApplicationWGSLBinding(group, location, match.name);
|
|
245
|
+
registerUsedBindingLocation(usedBindingsByGroup, group, location, `application binding "${match.name}"`);
|
|
246
|
+
}
|
|
247
|
+
return usedBindingsByGroup;
|
|
248
|
+
}
|
|
249
|
+
function relocateWGSLApplicationBindings(source) {
|
|
250
|
+
const declarationMatches = (0, import_wgsl_binding_scan.getWGSLBindingDeclarationMatches)(source, import_wgsl_binding_scan.WGSL_BINDING_DECLARATION_REGEXES);
|
|
251
|
+
const usedBindingsByGroup = /* @__PURE__ */ new Map();
|
|
252
|
+
for (const declarationMatch of declarationMatches) {
|
|
253
|
+
if (declarationMatch.bindingToken === "auto") {
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
const location = Number(declarationMatch.bindingToken);
|
|
257
|
+
const group = Number(declarationMatch.groupToken);
|
|
258
|
+
validateApplicationWGSLBinding(group, location, declarationMatch.name);
|
|
259
|
+
registerUsedBindingLocation(usedBindingsByGroup, group, location, `application binding "${declarationMatch.name}"`);
|
|
260
|
+
}
|
|
261
|
+
const relocationState = {
|
|
262
|
+
sawSupportedBindingDeclaration: declarationMatches.length > 0
|
|
263
|
+
};
|
|
264
|
+
const relocatedSource = (0, import_wgsl_binding_scan.replaceWGSLBindingDeclarationMatches)(source, import_wgsl_binding_scan.WGSL_BINDING_DECLARATION_REGEXES, (declarationMatch) => relocateWGSLApplicationBindingMatch(declarationMatch, usedBindingsByGroup, relocationState));
|
|
265
|
+
if ((0, import_wgsl_binding_scan.hasWGSLAutoBinding)(source) && !relocationState.sawSupportedBindingDeclaration) {
|
|
266
|
+
throw new Error('Unsupported @binding(auto) declaration form in application WGSL. Use adjacent "@group(N)" and "@binding(auto)" decorators followed by a bindable "var" declaration.');
|
|
267
|
+
}
|
|
268
|
+
return { source: relocatedSource };
|
|
269
|
+
}
|
|
270
|
+
function relocateWGSLModuleBindings(moduleSource, module2, context) {
|
|
271
|
+
const bindingAssignments = [];
|
|
272
|
+
const declarationMatches = (0, import_wgsl_binding_scan.getWGSLBindingDeclarationMatches)(moduleSource, import_wgsl_binding_scan.MODULE_WGSL_BINDING_DECLARATION_REGEXES);
|
|
273
|
+
const relocationState = {
|
|
274
|
+
sawSupportedBindingDeclaration: declarationMatches.length > 0,
|
|
275
|
+
nextHintedBindingLocation: typeof module2.firstBindingSlot === "number" ? module2.firstBindingSlot : null
|
|
276
|
+
};
|
|
277
|
+
const relocatedSource = (0, import_wgsl_binding_scan.replaceWGSLBindingDeclarationMatches)(moduleSource, import_wgsl_binding_scan.MODULE_WGSL_BINDING_DECLARATION_REGEXES, (declarationMatch) => relocateWGSLModuleBindingMatch(declarationMatch, {
|
|
278
|
+
module: module2,
|
|
279
|
+
context,
|
|
280
|
+
bindingAssignments,
|
|
281
|
+
relocationState
|
|
282
|
+
}));
|
|
283
|
+
if ((0, import_wgsl_binding_scan.hasWGSLAutoBinding)(moduleSource) && !relocationState.sawSupportedBindingDeclaration) {
|
|
284
|
+
throw new Error(`Unsupported @binding(auto) declaration form in module "${module2.name}". Use adjacent "@group(N)" and "@binding(auto)" decorators followed by a bindable "var" declaration.`);
|
|
285
|
+
}
|
|
286
|
+
return { source: relocatedSource, bindingAssignments };
|
|
287
|
+
}
|
|
288
|
+
function relocateWGSLModuleBindingMatch(declarationMatch, params) {
|
|
289
|
+
var _a, _b;
|
|
290
|
+
const { module: module2, context, bindingAssignments, relocationState } = params;
|
|
291
|
+
const { match, bindingToken, groupToken, name } = declarationMatch;
|
|
292
|
+
const group = Number(groupToken);
|
|
293
|
+
if (bindingToken === "auto") {
|
|
294
|
+
const registryKey2 = getBindingRegistryKey(group, module2.name, name);
|
|
295
|
+
const registryLocation = (_a = context.bindingRegistry) == null ? void 0 : _a.get(registryKey2);
|
|
296
|
+
const location2 = registryLocation !== void 0 ? registryLocation : allocateAutoBindingLocation(group, context.usedBindingsByGroup, module2.name, relocationState.nextHintedBindingLocation ?? void 0, context.bindingRegistry);
|
|
297
|
+
validateModuleWGSLBinding(module2.name, group, location2, name);
|
|
298
|
+
if (registryLocation !== void 0 && claimReservedBindingLocation(context.reservedBindingKeysByGroup, group, location2, registryKey2)) {
|
|
299
|
+
bindingAssignments.push({ moduleName: module2.name, name, group, location: location2 });
|
|
300
|
+
return match.replace(/@binding\(\s*auto\s*\)/, `@binding(${location2})`);
|
|
301
|
+
}
|
|
302
|
+
registerUsedBindingLocation(context.usedBindingsByGroup, group, location2, `module "${module2.name}" binding "${name}"`);
|
|
303
|
+
(_b = context.bindingRegistry) == null ? void 0 : _b.set(registryKey2, location2);
|
|
304
|
+
bindingAssignments.push({ moduleName: module2.name, name, group, location: location2 });
|
|
305
|
+
if (relocationState.nextHintedBindingLocation !== null && registryLocation === void 0) {
|
|
306
|
+
relocationState.nextHintedBindingLocation = location2 + 1;
|
|
307
|
+
}
|
|
308
|
+
return match.replace(/@binding\(\s*auto\s*\)/, `@binding(${location2})`);
|
|
309
|
+
}
|
|
310
|
+
const location = Number(bindingToken);
|
|
311
|
+
validateModuleWGSLBinding(module2.name, group, location, name);
|
|
312
|
+
const registryKey = getBindingRegistryKey(group, module2.name, name);
|
|
313
|
+
if (!claimReservedBindingLocation(context.reservedBindingKeysByGroup, group, location, registryKey)) {
|
|
314
|
+
registerUsedBindingLocation(context.usedBindingsByGroup, group, location, `module "${module2.name}" binding "${name}"`);
|
|
315
|
+
}
|
|
316
|
+
bindingAssignments.push({ moduleName: module2.name, name, group, location });
|
|
317
|
+
return match;
|
|
318
|
+
}
|
|
319
|
+
function relocateWGSLApplicationBindingMatch(declarationMatch, usedBindingsByGroup, relocationState) {
|
|
320
|
+
const { match, bindingToken, groupToken, name } = declarationMatch;
|
|
321
|
+
const group = Number(groupToken);
|
|
322
|
+
if (bindingToken === "auto") {
|
|
323
|
+
const location = allocateApplicationAutoBindingLocation(group, usedBindingsByGroup);
|
|
324
|
+
validateApplicationWGSLBinding(group, location, name);
|
|
325
|
+
registerUsedBindingLocation(usedBindingsByGroup, group, location, `application binding "${name}"`);
|
|
326
|
+
return match.replace(/@binding\(\s*auto\s*\)/, `@binding(${location})`);
|
|
327
|
+
}
|
|
328
|
+
relocationState.sawSupportedBindingDeclaration = true;
|
|
329
|
+
return match;
|
|
330
|
+
}
|
|
331
|
+
function reserveModuleBindings(modules, bindingRegistry, usedBindingsByGroup) {
|
|
332
|
+
const reservedBindingKeysByGroup = /* @__PURE__ */ new Map();
|
|
333
|
+
const autoBindings = [];
|
|
334
|
+
function reserveBinding(group, location, registryKey, label) {
|
|
335
|
+
registerUsedBindingLocation(usedBindingsByGroup, group, location, label);
|
|
336
|
+
const reservedBindingKeys = reservedBindingKeysByGroup.get(group) || /* @__PURE__ */ new Map();
|
|
337
|
+
reservedBindingKeys.set(location, registryKey);
|
|
338
|
+
reservedBindingKeysByGroup.set(group, reservedBindingKeys);
|
|
339
|
+
}
|
|
340
|
+
for (const { module: module2, source } of modules) {
|
|
341
|
+
for (const binding of (0, import_wgsl_binding_scan.getWGSLBindingDeclarationMatches)(source, import_wgsl_binding_scan.MODULE_WGSL_BINDING_DECLARATION_REGEXES)) {
|
|
342
|
+
const group = Number(binding.groupToken);
|
|
343
|
+
if (binding.bindingToken === "auto") {
|
|
344
|
+
autoBindings.push({ module: module2, name: binding.name, group });
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
const location = Number(binding.bindingToken);
|
|
348
|
+
validateModuleWGSLBinding(module2.name, group, location, binding.name);
|
|
349
|
+
reserveBinding(group, location, getBindingRegistryKey(group, module2.name, binding.name), `module "${module2.name}" binding "${binding.name}"`);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
for (const { module: module2, name, group } of autoBindings) {
|
|
353
|
+
const registryKey = getBindingRegistryKey(group, module2.name, name);
|
|
354
|
+
const location = bindingRegistry == null ? void 0 : bindingRegistry.get(registryKey);
|
|
355
|
+
if (location !== void 0) {
|
|
356
|
+
reserveBinding(group, location, registryKey, `registered module binding "${registryKey}"`);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return reservedBindingKeysByGroup;
|
|
360
|
+
}
|
|
361
|
+
function claimReservedBindingLocation(reservedBindingKeysByGroup, group, location, registryKey) {
|
|
362
|
+
const reservedBindingKeys = reservedBindingKeysByGroup.get(group);
|
|
363
|
+
if (!reservedBindingKeys) {
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
const reservedKey = reservedBindingKeys.get(location);
|
|
367
|
+
if (!reservedKey) {
|
|
368
|
+
return false;
|
|
369
|
+
}
|
|
370
|
+
if (reservedKey !== registryKey) {
|
|
371
|
+
throw new Error(`Registered module binding "${registryKey}" collided with "${reservedKey}": group ${group}, binding ${location}.`);
|
|
372
|
+
}
|
|
373
|
+
reservedBindingKeys.delete(location);
|
|
374
|
+
return true;
|
|
375
|
+
}
|
|
376
|
+
function validateApplicationWGSLBinding(group, location, name) {
|
|
377
|
+
if (group === 0 && location >= RESERVED_APPLICATION_GROUP_0_BINDING_LIMIT) {
|
|
378
|
+
throw new Error(`Application binding "${name}" in group 0 uses reserved binding ${location}. Application-owned explicit group-0 bindings must stay below ${RESERVED_APPLICATION_GROUP_0_BINDING_LIMIT}.`);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
function validateModuleWGSLBinding(moduleName, group, location, name) {
|
|
382
|
+
if (group === 0 && location < RESERVED_APPLICATION_GROUP_0_BINDING_LIMIT) {
|
|
383
|
+
throw new Error(`Module "${moduleName}" binding "${name}" in group 0 uses reserved application binding ${location}. Module-owned explicit group-0 bindings must be ${RESERVED_APPLICATION_GROUP_0_BINDING_LIMIT} or higher.`);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
function registerUsedBindingLocation(usedBindingsByGroup, group, location, label) {
|
|
387
|
+
const usedBindings = usedBindingsByGroup.get(group) || /* @__PURE__ */ new Set();
|
|
388
|
+
if (usedBindings.has(location)) {
|
|
389
|
+
throw new Error(`Duplicate WGSL binding assignment for ${label}: group ${group}, binding ${location}.`);
|
|
390
|
+
}
|
|
391
|
+
usedBindings.add(location);
|
|
392
|
+
usedBindingsByGroup.set(group, usedBindings);
|
|
393
|
+
}
|
|
394
|
+
function allocateAutoBindingLocation(group, usedBindingsByGroup, moduleName, preferredBindingLocation, bindingRegistry) {
|
|
395
|
+
const usedBindings = usedBindingsByGroup.get(group) || /* @__PURE__ */ new Set();
|
|
396
|
+
const registeredBindingLocations = /* @__PURE__ */ new Set();
|
|
397
|
+
const registryGroupPrefix = `${group}:`;
|
|
398
|
+
const registryModulePrefix = `${registryGroupPrefix}${moduleName}:`;
|
|
399
|
+
for (const [registryKey, location] of bindingRegistry || []) {
|
|
400
|
+
if (registryKey.startsWith(registryModulePrefix)) {
|
|
401
|
+
registeredBindingLocations.add(location);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
let nextBinding = preferredBindingLocation ?? (group === 0 ? RESERVED_APPLICATION_GROUP_0_BINDING_LIMIT : usedBindings.size > 0 ? Math.max(...usedBindings) + 1 : 0);
|
|
405
|
+
while (usedBindings.has(nextBinding) || registeredBindingLocations.has(nextBinding)) {
|
|
406
|
+
nextBinding++;
|
|
407
|
+
}
|
|
408
|
+
for (const [registryKey, location] of bindingRegistry || []) {
|
|
409
|
+
if (location === nextBinding && registryKey.startsWith(registryGroupPrefix)) {
|
|
410
|
+
bindingRegistry == null ? void 0 : bindingRegistry.delete(registryKey);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return nextBinding;
|
|
414
|
+
}
|
|
415
|
+
function allocateApplicationAutoBindingLocation(group, usedBindingsByGroup) {
|
|
416
|
+
const usedBindings = usedBindingsByGroup.get(group) || /* @__PURE__ */ new Set();
|
|
417
|
+
let nextBinding = 0;
|
|
418
|
+
while (usedBindings.has(nextBinding)) {
|
|
419
|
+
nextBinding++;
|
|
420
|
+
}
|
|
421
|
+
return nextBinding;
|
|
422
|
+
}
|
|
423
|
+
function assertNoUnresolvedAutoBindings(source) {
|
|
424
|
+
const unresolvedBinding = (0, import_wgsl_binding_scan.getFirstWGSLAutoBindingDeclarationMatch)(source, import_wgsl_binding_scan.MODULE_WGSL_BINDING_DECLARATION_REGEXES);
|
|
425
|
+
if (!unresolvedBinding) {
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
const moduleName = getWGSLModuleNameAtIndex(source, unresolvedBinding.index);
|
|
429
|
+
if (moduleName) {
|
|
430
|
+
throw new Error(`Unresolved @binding(auto) for module "${moduleName}" binding "${unresolvedBinding.name}" remained in assembled WGSL source.`);
|
|
431
|
+
}
|
|
432
|
+
if (isInApplicationWGSLSection(source, unresolvedBinding.index)) {
|
|
433
|
+
throw new Error(`Unresolved @binding(auto) for application binding "${unresolvedBinding.name}" remained in assembled WGSL source.`);
|
|
434
|
+
}
|
|
435
|
+
throw new Error(`Unresolved @binding(auto) remained in assembled WGSL source near "${formatWGSLSourceSnippet(unresolvedBinding.match)}".`);
|
|
436
|
+
}
|
|
437
|
+
function formatWGSLBindingAssignmentComments(bindingAssignments) {
|
|
438
|
+
if (bindingAssignments.length === 0) {
|
|
439
|
+
return "";
|
|
440
|
+
}
|
|
441
|
+
let source = "// ----- MODULE WGSL BINDING ASSIGNMENTS ---------------\n";
|
|
442
|
+
for (const bindingAssignment of bindingAssignments) {
|
|
443
|
+
source += `// ${bindingAssignment.moduleName}.${bindingAssignment.name} -> @group(${bindingAssignment.group}) @binding(${bindingAssignment.location})
|
|
444
|
+
`;
|
|
445
|
+
}
|
|
446
|
+
source += "\n";
|
|
447
|
+
return source;
|
|
448
|
+
}
|
|
449
|
+
function getBindingRegistryKey(group, moduleName, bindingName) {
|
|
450
|
+
return `${group}:${moduleName}:${bindingName}`;
|
|
451
|
+
}
|
|
452
|
+
function getWGSLModuleNameAtIndex(source, index) {
|
|
453
|
+
const moduleHeaderRegex = /^\/\/ ----- MODULE ([^\n]+) ---------------$/gm;
|
|
454
|
+
let moduleName;
|
|
455
|
+
let match;
|
|
456
|
+
match = moduleHeaderRegex.exec(source);
|
|
457
|
+
while (match && match.index <= index) {
|
|
458
|
+
moduleName = match[1];
|
|
459
|
+
match = moduleHeaderRegex.exec(source);
|
|
460
|
+
}
|
|
461
|
+
return moduleName;
|
|
462
|
+
}
|
|
463
|
+
function isInApplicationWGSLSection(source, index) {
|
|
464
|
+
const injectionMarkerIndex = source.indexOf(import_shader_assembly_shared.INJECT_SHADER_DECLARATIONS);
|
|
465
|
+
return injectionMarkerIndex >= 0 ? index > injectionMarkerIndex : true;
|
|
466
|
+
}
|
|
467
|
+
function formatWGSLSourceSnippet(source) {
|
|
468
|
+
return source.replace(/\s+/g, " ").trim();
|
|
469
|
+
}
|
|
470
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
471
|
+
0 && (module.exports = {
|
|
472
|
+
RESERVED_APPLICATION_GROUP_0_BINDING_LIMIT,
|
|
473
|
+
allocateApplicationAutoBindingLocation,
|
|
474
|
+
allocateAutoBindingLocation,
|
|
475
|
+
appendGeneratedVaryingInjections,
|
|
476
|
+
appendGeneratedVertexInputInjections,
|
|
477
|
+
assembleShaderWGSL,
|
|
478
|
+
assembleWGSLShader,
|
|
479
|
+
assembleWGSLSource,
|
|
480
|
+
assertNoUnresolvedAutoBindings,
|
|
481
|
+
claimReservedBindingLocation,
|
|
482
|
+
formatWGSLBindingAssignmentComments,
|
|
483
|
+
formatWGSLSourceSnippet,
|
|
484
|
+
getBindingRegistryKey,
|
|
485
|
+
getUsedBindingsByGroupFromApplicationWGSL,
|
|
486
|
+
getWGSLDeclarationInjections,
|
|
487
|
+
getWGSLModuleNameAtIndex,
|
|
488
|
+
getWGSLShaderInjectionTargets,
|
|
489
|
+
isInApplicationWGSLSection,
|
|
490
|
+
registerUsedBindingLocation,
|
|
491
|
+
relocateWGSLApplicationBindingMatch,
|
|
492
|
+
relocateWGSLApplicationBindings,
|
|
493
|
+
relocateWGSLModuleBindingMatch,
|
|
494
|
+
relocateWGSLModuleBindings,
|
|
495
|
+
reserveModuleBindings,
|
|
496
|
+
validateApplicationWGSLBinding,
|
|
497
|
+
validateModuleWGSLBinding
|
|
498
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type ShaderBindingDebugRow } from "./wgsl-binding-debug.js";
|
|
2
|
+
import { type ShaderLayout } from "../../types.js";
|
|
3
|
+
import { type AssembleWGSLShaderOptions, type GetUniformsFunc, type WGSLBindingAssignment, type AssembleStageOptions, type WGSLApplicationRelocationState, type BindingRelocationContext, type WGSLRelocationParams } from "./shader-assembly-types.js";
|
|
4
|
+
import { PlatformInfo } from "./platform-info.js";
|
|
5
|
+
import { normalizeShaderInjectionTargets } from "./shader-injection-targets.js";
|
|
6
|
+
import { type ResolvedShaderInjection } from "./shader-injections.js";
|
|
7
|
+
import { type ShaderModule } from "../shader-module/shader-module.js";
|
|
8
|
+
import { type WGSLBindingDeclarationMatch } from "./wgsl-binding-scan.js";
|
|
9
|
+
export declare const RESERVED_APPLICATION_GROUP_0_BINDING_LIMIT = 100;
|
|
10
|
+
/** Inject shader modules and compute metadata for the resulting WGSL source. */
|
|
11
|
+
export declare function assembleWGSLShader(options: AssembleWGSLShaderOptions): {
|
|
12
|
+
source: string;
|
|
13
|
+
getUniforms: GetUniformsFunc;
|
|
14
|
+
bindingAssignments: WGSLBindingAssignment[];
|
|
15
|
+
bindingTable: ShaderBindingDebugRow[];
|
|
16
|
+
shaderLayout: ShaderLayout | null;
|
|
17
|
+
};
|
|
18
|
+
/** @internal Assemble source without scanning metadata that subsequent preprocessing invalidates. */
|
|
19
|
+
export declare function assembleWGSLSource(options: AssembleWGSLShaderOptions): {
|
|
20
|
+
source: string;
|
|
21
|
+
getUniforms: GetUniformsFunc;
|
|
22
|
+
bindingAssignments: WGSLBindingAssignment[];
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Pulls together complete source code for either a vertex or a fragment shader
|
|
26
|
+
* adding prologues, requested module chunks, and any final injections.
|
|
27
|
+
* @param gl
|
|
28
|
+
* @param options
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
export declare function assembleShaderWGSL(platformInfo: PlatformInfo, options: AssembleStageOptions): {
|
|
32
|
+
source: string;
|
|
33
|
+
bindingAssignments: WGSLBindingAssignment[];
|
|
34
|
+
};
|
|
35
|
+
export declare function appendGeneratedVertexInputInjections(declarations: string, initialization: string, declarationInjections: Record<string, ResolvedShaderInjection[]>, mainInjections: Record<string, ResolvedShaderInjection[]>): void;
|
|
36
|
+
export declare function appendGeneratedVaryingInjections(assembly: {
|
|
37
|
+
declarations: string;
|
|
38
|
+
vertexInitialization: string;
|
|
39
|
+
fragmentInitialization: string;
|
|
40
|
+
}, declarationInjections: Record<string, ResolvedShaderInjection[]>, mainInjections: Record<string, ResolvedShaderInjection[]>): void;
|
|
41
|
+
export declare function getWGSLDeclarationInjections(declarationInjections: Record<string, ResolvedShaderInjection[]>): Record<string, ResolvedShaderInjection[]>;
|
|
42
|
+
export declare function getWGSLShaderInjectionTargets(injectionTargetMap: ReturnType<typeof normalizeShaderInjectionTargets>, targetInjections: Record<string, ResolvedShaderInjection[]>, names?: Map<string, Record<"vertex" | "fragment", string>>): string;
|
|
43
|
+
export declare function getUsedBindingsByGroupFromApplicationWGSL(source: string): Map<number, Set<number>>;
|
|
44
|
+
export declare function relocateWGSLApplicationBindings(source: string): {
|
|
45
|
+
source: string;
|
|
46
|
+
};
|
|
47
|
+
export declare function relocateWGSLModuleBindings(moduleSource: string, module: ShaderModule, context: BindingRelocationContext): {
|
|
48
|
+
source: string;
|
|
49
|
+
bindingAssignments: WGSLBindingAssignment[];
|
|
50
|
+
};
|
|
51
|
+
export declare function relocateWGSLModuleBindingMatch(declarationMatch: WGSLBindingDeclarationMatch, params: WGSLRelocationParams): string;
|
|
52
|
+
export declare function relocateWGSLApplicationBindingMatch(declarationMatch: WGSLBindingDeclarationMatch, usedBindingsByGroup: Map<number, Set<number>>, relocationState: WGSLApplicationRelocationState): string;
|
|
53
|
+
/** Reserve declared locations before reusing registry assignments or allocating new bindings. */
|
|
54
|
+
export declare function reserveModuleBindings(modules: {
|
|
55
|
+
module: ShaderModule;
|
|
56
|
+
source: string;
|
|
57
|
+
}[], bindingRegistry: Map<string, number> | undefined, usedBindingsByGroup: Map<number, Set<number>>): Map<number, Map<number, string>>;
|
|
58
|
+
export declare function claimReservedBindingLocation(reservedBindingKeysByGroup: Map<number, Map<number, string>>, group: number, location: number, registryKey: string): boolean;
|
|
59
|
+
export declare function validateApplicationWGSLBinding(group: number, location: number, name: string): void;
|
|
60
|
+
export declare function validateModuleWGSLBinding(moduleName: string, group: number, location: number, name: string): void;
|
|
61
|
+
export declare function registerUsedBindingLocation(usedBindingsByGroup: Map<number, Set<number>>, group: number, location: number, label: string): void;
|
|
62
|
+
export declare function allocateAutoBindingLocation(group: number, usedBindingsByGroup: Map<number, Set<number>>, moduleName: string, preferredBindingLocation?: number, bindingRegistry?: Map<string, number>): number;
|
|
63
|
+
export declare function allocateApplicationAutoBindingLocation(group: number, usedBindingsByGroup: Map<number, Set<number>>): number;
|
|
64
|
+
export declare function assertNoUnresolvedAutoBindings(source: string): void;
|
|
65
|
+
export declare function formatWGSLBindingAssignmentComments(bindingAssignments: WGSLBindingAssignment[]): string;
|
|
66
|
+
export declare function getBindingRegistryKey(group: number, moduleName: string, bindingName: string): string;
|
|
67
|
+
export declare function getWGSLModuleNameAtIndex(source: string, index: number): string | undefined;
|
|
68
|
+
export declare function isInApplicationWGSLSection(source: string, index: number): boolean;
|
|
69
|
+
export declare function formatWGSLSourceSnippet(source: string): string;
|
|
70
|
+
//# sourceMappingURL=assemble-wgsl-shaders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assemble-wgsl-shaders.d.ts","sourceRoot":"","sources":["../../../src/lib/shader-assembly/assemble-wgsl-shaders.ts"],"names":[],"mappings":"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"}
|