@luma.gl/shadertools 9.3.5 → 9.4.0-alpha.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.
Files changed (113) hide show
  1. package/dist/dist.dev.js +6555 -2373
  2. package/dist/dist.min.js +2984 -237
  3. package/dist/index.cjs +4356 -268
  4. package/dist/index.cjs.map +4 -4
  5. package/dist/index.d.ts +13 -3
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +6 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/lib/preprocessor/preprocessor.d.ts +11 -1
  10. package/dist/lib/preprocessor/preprocessor.d.ts.map +1 -1
  11. package/dist/lib/preprocessor/preprocessor.js +47 -2
  12. package/dist/lib/preprocessor/preprocessor.js.map +1 -1
  13. package/dist/lib/shader-assembler.d.ts +10 -10
  14. package/dist/lib/shader-assembler.d.ts.map +1 -1
  15. package/dist/lib/shader-assembler.js +36 -20
  16. package/dist/lib/shader-assembler.js.map +1 -1
  17. package/dist/lib/shader-assembly/assemble-shaders.d.ts +28 -7
  18. package/dist/lib/shader-assembly/assemble-shaders.d.ts.map +1 -1
  19. package/dist/lib/shader-assembly/assemble-shaders.js +133 -15
  20. package/dist/lib/shader-assembly/assemble-shaders.js.map +1 -1
  21. package/dist/lib/shader-assembly/platform-info.d.ts +2 -0
  22. package/dist/lib/shader-assembly/platform-info.d.ts.map +1 -1
  23. package/dist/lib/shader-assembly/shader-hooks.d.ts +1 -1
  24. package/dist/lib/shader-assembly/shader-hooks.d.ts.map +1 -1
  25. package/dist/lib/shader-assembly/shader-hooks.js +6 -3
  26. package/dist/lib/shader-assembly/shader-hooks.js.map +1 -1
  27. package/dist/lib/shader-assembly/shader-injections.d.ts +4 -1
  28. package/dist/lib/shader-assembly/shader-injections.d.ts.map +1 -1
  29. package/dist/lib/shader-assembly/shader-injections.js +68 -11
  30. package/dist/lib/shader-assembly/shader-injections.js.map +1 -1
  31. package/dist/lib/shader-assembly/shader-plugin-varyings.d.ts +15 -0
  32. package/dist/lib/shader-assembly/shader-plugin-varyings.d.ts.map +1 -0
  33. package/dist/lib/shader-assembly/shader-plugin-varyings.js +412 -0
  34. package/dist/lib/shader-assembly/shader-plugin-varyings.js.map +1 -0
  35. package/dist/lib/shader-assembly/shader-plugin-vertex-inputs.d.ts +12 -0
  36. package/dist/lib/shader-assembly/shader-plugin-vertex-inputs.d.ts.map +1 -0
  37. package/dist/lib/shader-assembly/shader-plugin-vertex-inputs.js +237 -0
  38. package/dist/lib/shader-assembly/shader-plugin-vertex-inputs.js.map +1 -0
  39. package/dist/lib/shader-module/shader-module.d.ts +3 -0
  40. package/dist/lib/shader-module/shader-module.d.ts.map +1 -1
  41. package/dist/lib/shader-module/shader-module.js.map +1 -1
  42. package/dist/lib/shader-module/shader-pass-pipeline.d.ts +14 -0
  43. package/dist/lib/shader-module/shader-pass-pipeline.d.ts.map +1 -0
  44. package/dist/lib/shader-module/shader-pass-pipeline.js +5 -0
  45. package/dist/lib/shader-module/shader-pass-pipeline.js.map +1 -0
  46. package/dist/lib/shader-module/shader-pass.d.ts +21 -4
  47. package/dist/lib/shader-module/shader-pass.d.ts.map +1 -1
  48. package/dist/lib/shader-plugin.d.ts +68 -0
  49. package/dist/lib/shader-plugin.d.ts.map +1 -0
  50. package/dist/lib/shader-plugin.js +98 -0
  51. package/dist/lib/shader-plugin.js.map +1 -0
  52. package/dist/lib/utils/assert.js +1 -1
  53. package/dist/lib/utils/assert.js.map +1 -1
  54. package/dist/modules/color/float-colors.d.ts +111 -5
  55. package/dist/modules/color/float-colors.d.ts.map +1 -1
  56. package/dist/modules/color/float-colors.js +200 -34
  57. package/dist/modules/color/float-colors.js.map +1 -1
  58. package/dist/modules/engine/clip/clip.d.ts +12 -0
  59. package/dist/modules/engine/clip/clip.d.ts.map +1 -0
  60. package/dist/modules/engine/clip/clip.js +129 -0
  61. package/dist/modules/engine/clip/clip.js.map +1 -0
  62. package/dist/modules/engine/filter/filter.d.ts +12 -0
  63. package/dist/modules/engine/filter/filter.d.ts.map +1 -0
  64. package/dist/modules/engine/filter/filter.js +88 -0
  65. package/dist/modules/engine/filter/filter.js.map +1 -0
  66. package/dist/modules/geospatial/dggs/dggs-wgsl.d.ts +3 -0
  67. package/dist/modules/geospatial/dggs/dggs-wgsl.d.ts.map +1 -0
  68. package/dist/modules/geospatial/dggs/dggs-wgsl.js +1892 -0
  69. package/dist/modules/geospatial/dggs/dggs-wgsl.js.map +1 -0
  70. package/dist/modules/geospatial/dggs/dggs.d.ts +6 -0
  71. package/dist/modules/geospatial/dggs/dggs.d.ts.map +1 -0
  72. package/dist/modules/geospatial/dggs/dggs.js +10 -0
  73. package/dist/modules/geospatial/dggs/dggs.js.map +1 -0
  74. package/dist/modules/lighting/water-material/water-material.d.ts +28 -0
  75. package/dist/modules/lighting/water-material/water-material.d.ts.map +1 -0
  76. package/dist/modules/lighting/water-material/water-material.js +179 -0
  77. package/dist/modules/lighting/water-material/water-material.js.map +1 -0
  78. package/dist/modules/lighting/water-material/water-shaders-glsl.d.ts +3 -0
  79. package/dist/modules/lighting/water-material/water-shaders-glsl.d.ts.map +1 -0
  80. package/dist/modules/lighting/water-material/water-shaders-glsl.js +232 -0
  81. package/dist/modules/lighting/water-material/water-shaders-glsl.js.map +1 -0
  82. package/dist/modules/lighting/water-material/water-shaders-wgsl.d.ts +2 -0
  83. package/dist/modules/lighting/water-material/water-shaders-wgsl.d.ts.map +1 -0
  84. package/dist/modules/lighting/water-material/water-shaders-wgsl.js +230 -0
  85. package/dist/modules/lighting/water-material/water-shaders-wgsl.js.map +1 -0
  86. package/dist/modules/math/fp64/fp64-arithmetic-wgsl.d.ts +2 -1
  87. package/dist/modules/math/fp64/fp64-arithmetic-wgsl.d.ts.map +1 -1
  88. package/dist/modules/math/fp64/fp64-arithmetic-wgsl.js +268 -0
  89. package/dist/modules/math/fp64/fp64-arithmetic-wgsl.js.map +1 -1
  90. package/package.json +2 -2
  91. package/src/index.ts +50 -3
  92. package/src/lib/preprocessor/preprocessor.ts +68 -3
  93. package/src/lib/shader-assembler.ts +49 -20
  94. package/src/lib/shader-assembly/assemble-shaders.ts +242 -30
  95. package/src/lib/shader-assembly/platform-info.ts +2 -0
  96. package/src/lib/shader-assembly/shader-hooks.ts +7 -3
  97. package/src/lib/shader-assembly/shader-injections.ts +96 -11
  98. package/src/lib/shader-assembly/shader-plugin-varyings.ts +524 -0
  99. package/src/lib/shader-assembly/shader-plugin-vertex-inputs.ts +279 -0
  100. package/src/lib/shader-module/shader-module.ts +3 -0
  101. package/src/lib/shader-module/shader-pass-pipeline.ts +19 -0
  102. package/src/lib/shader-module/shader-pass.ts +29 -4
  103. package/src/lib/shader-plugin.ts +214 -0
  104. package/src/lib/utils/assert.ts +1 -1
  105. package/src/modules/color/float-colors.ts +272 -37
  106. package/src/modules/engine/clip/clip.ts +149 -0
  107. package/src/modules/engine/filter/filter.ts +107 -0
  108. package/src/modules/geospatial/dggs/dggs-wgsl.ts +1892 -0
  109. package/src/modules/geospatial/dggs/dggs.ts +12 -0
  110. package/src/modules/lighting/water-material/water-material.ts +234 -0
  111. package/src/modules/lighting/water-material/water-shaders-glsl.ts +233 -0
  112. package/src/modules/lighting/water-material/water-shaders-wgsl.ts +230 -0
  113. package/src/modules/math/fp64/fp64-arithmetic-wgsl.ts +268 -0
package/dist/index.d.ts CHANGED
@@ -5,12 +5,15 @@
5
5
  export type { PlatformInfo } from "./lib/shader-assembly/platform-info.js";
6
6
  export type { ShaderBindingDebugRow } from "./lib/shader-assembly/wgsl-binding-debug.js";
7
7
  export type { ShaderModule } from "./lib/shader-module/shader-module.js";
8
- export type { ShaderPass } from "./lib/shader-module/shader-pass.js";
8
+ export type { ResolvedShaderPlugins, ResolvedShaderPluginVarying, ShaderPlugin, ShaderPluginInjection, ShaderPluginInjectionTarget, ShaderPluginVarying, ShaderPluginVaryingInterpolation, ShaderPluginVariant } from "./lib/shader-plugin.js";
9
+ export type { ShaderPass, ShaderPassInputSource, ShaderPassRenderTarget, ShaderSubPass } from "./lib/shader-module/shader-pass.js";
10
+ export type { ShaderPassPipeline, ShaderPassPipelineStep } from "./lib/shader-module/shader-pass-pipeline.js";
9
11
  export type { ShaderModuleUniformValue, UniformTypes } from "./lib/utils/uniform-types.js";
10
12
  export { initializeShaderModule, initializeShaderModules } from "./lib/shader-module/shader-module.js";
11
13
  export { getShaderModuleUniforms } from "./lib/shader-module/shader-module.js";
12
14
  export { getShaderModuleDependencies } from "./lib/shader-module/shader-module-dependencies.js";
13
15
  export { checkShaderModuleDeprecations } from "./lib/shader-module/shader-module.js";
16
+ export { mergeShaderPluginModules, resolveShaderPlugins } from "./lib/shader-plugin.js";
14
17
  export type { GLSLUniformBlockInfo, ShaderModuleUniformLayoutStage, ShaderModuleUniformLayoutValidationResult } from "./lib/shader-module/shader-module-uniform-layout.js";
15
18
  export { getGLSLUniformBlocks, getShaderModuleUniformBlockFields, getShaderModuleUniformBlockName, getShaderModuleUniformLayoutValidationResult, validateShaderModuleUniformLayout, warnIfGLSLUniformBlocksAreNotStd140 } from "./lib/shader-module/shader-module-uniform-layout.js";
16
19
  export { getShaderModuleSource } from "./lib/shader-assembly/assemble-shaders.js";
@@ -33,10 +36,15 @@ export { normalizeByteColor3, normalizeByteColor4, resolveUseByteColors } from "
33
36
  export { random } from "./modules/math/random/random.js";
34
37
  export { fp32 } from "./modules/math/fp32/fp32.js";
35
38
  export { fp64, fp64arithmetic } from "./modules/math/fp64/fp64.js";
36
- export type { FloatColorsProps, FloatColorsUniforms } from "./modules/color/float-colors.js";
37
- export { floatColors } from "./modules/color/float-colors.js";
39
+ export { dggs } from "./modules/geospatial/dggs/dggs.js";
40
+ export type { ColorsProps, ColorsUniforms, FloatColorsProps, FloatColorsUniforms, StorageColorFormat, StorageColorFormatValue, StorageColorsBindings, StorageColorsProps, StorageColorsUniforms } from "./modules/color/float-colors.js";
41
+ export { colors, floatColors, STORAGE_COLOR_DEFAULT_BYTE_STRIDES, STORAGE_COLOR_FORMAT, STORAGE_COLOR_FORMAT_BYTE_LENGTHS, storageColors } from "./modules/color/float-colors.js";
38
42
  export type { PickingProps, PickingUniforms } from "./modules/engine/picking/picking.js";
39
43
  export { picking } from "./modules/engine/picking/picking.js";
44
+ export type { FilterShaderPluginProps } from "./modules/engine/filter/filter.js";
45
+ export { filterShaderPlugin } from "./modules/engine/filter/filter.js";
46
+ export type { ClipShaderPluginProps } from "./modules/engine/clip/clip.js";
47
+ export { clipShaderPlugin } from "./modules/engine/clip/clip.js";
40
48
  export { skin } from "./modules/engine/skin/skin.js";
41
49
  export { type Light, type AmbientLight, type PointLight, type SpotLight, type DirectionalLight, type LightingLightUniform } from "./modules/lighting/lights/lighting.js";
42
50
  export type { LightingProps, LightingUniforms } from "./modules/lighting/lights/lighting.js";
@@ -50,6 +58,8 @@ export type { GouraudMaterialProps } from "./modules/lighting/gouraud-material/g
50
58
  export { gouraudMaterial } from "./modules/lighting/gouraud-material/gouraud-material.js";
51
59
  export type { PhongMaterialProps } from "./modules/lighting/phong-material/phong-material.js";
52
60
  export { phongMaterial } from "./modules/lighting/phong-material/phong-material.js";
61
+ export type { WaterMaterialProps, WaterMaterialUniforms } from "./modules/lighting/water-material/water-material.js";
62
+ export { waterMaterial } from "./modules/lighting/water-material/water-material.js";
53
63
  export type { PBRMaterialBindings, PBRMaterialProps, PBRMaterialUniforms } from "./modules/lighting/pbr-material/pbr-material.js";
54
64
  export type { PBRSceneBindings, PBRSceneProps, PBRSceneUniforms } from "./modules/lighting/pbr-material/pbr-scene.js";
55
65
  export type { PBRProjectionProps } from "./modules/lighting/pbr-material/pbr-projection.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,YAAY,EAAC,YAAY,EAAC,+CAA4C;AACtE,YAAY,EAAC,qBAAqB,EAAC,oDAAiD;AAIpF,YAAY,EAAC,YAAY,EAAC,6CAA0C;AACpE,YAAY,EAAC,UAAU,EAAC,2CA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IAAI,EAAC,sCAAmC;AAGhD,OAAO,EACL,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAC1B,8CAA2C;AAE5C,YAAY,EAAC,aAAa,EAAE,gBAAgB,EAAC,8CAA2C;AACxF,OAAO,EAAC,QAAQ,EAAC,8CAA2C;AAC5D,YAAY,EAAC,WAAW,EAAC,sCAAmC;AAC5D,OAAO,EAAC,GAAG,EAAC,sCAAmC;AAC/C,OAAO,EAAC,QAAQ,EAAC,mDAAgD;AACjE,YAAY,EAAC,oBAAoB,EAAC,gEAA6D;AAC/F,OAAO,EAAC,eAAe,EAAC,gEAA6D;AACrF,YAAY,EAAC,oBAAoB,EAAC,gEAA6D;AAC/F,OAAO,EAAC,eAAe,EAAC,gEAA6D;AACrF,YAAY,EAAC,kBAAkB,EAAC,4DAAyD;AACzF,OAAO,EAAC,aAAa,EAAC,4DAAyD;AAC/E,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACtB,4DAAyD;AAC1D,OAAO,EAAC,aAAa,EAAC,4DAAyD;AAC/E,YAAY,EACV,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACpB,wDAAqD;AACtD,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EACjB,qDAAkD;AACnD,YAAY,EAAC,kBAAkB,EAAC,0DAAuD;AAEvF,OAAO,EAAC,WAAW,EAAC,wDAAqD;AACzE,OAAO,EAAC,QAAQ,EAAC,qDAAkD"}
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ export { initializeShaderModule, initializeShaderModules } from "./lib/shader-mo
5
5
  export { getShaderModuleUniforms } from "./lib/shader-module/shader-module.js";
6
6
  export { getShaderModuleDependencies } from "./lib/shader-module/shader-module-dependencies.js";
7
7
  export { checkShaderModuleDeprecations } from "./lib/shader-module/shader-module.js";
8
+ export { mergeShaderPluginModules, resolveShaderPlugins } from "./lib/shader-plugin.js";
8
9
  export { getGLSLUniformBlocks, getShaderModuleUniformBlockFields, getShaderModuleUniformBlockName, getShaderModuleUniformLayoutValidationResult, validateShaderModuleUniformLayout, warnIfGLSLUniformBlocksAreNotStd140 } from "./lib/shader-module/shader-module-uniform-layout.js";
9
10
  export { getShaderModuleSource } from "./lib/shader-assembly/assemble-shaders.js";
10
11
  export { resolveModules as _resolveModules } from "./lib/shader-module/shader-module-dependencies.js";
@@ -29,8 +30,11 @@ export { normalizeByteColor3, normalizeByteColor4, resolveUseByteColors } from "
29
30
  export { random } from "./modules/math/random/random.js";
30
31
  export { fp32 } from "./modules/math/fp32/fp32.js";
31
32
  export { fp64, fp64arithmetic } from "./modules/math/fp64/fp64.js";
32
- export { floatColors } from "./modules/color/float-colors.js";
33
+ export { dggs } from "./modules/geospatial/dggs/dggs.js";
34
+ export { colors, floatColors, STORAGE_COLOR_DEFAULT_BYTE_STRIDES, STORAGE_COLOR_FORMAT, STORAGE_COLOR_FORMAT_BYTE_LENGTHS, storageColors } from "./modules/color/float-colors.js";
33
35
  export { picking } from "./modules/engine/picking/picking.js";
36
+ export { filterShaderPlugin } from "./modules/engine/filter/filter.js";
37
+ export { clipShaderPlugin } from "./modules/engine/clip/clip.js";
34
38
  export { skin } from "./modules/engine/skin/skin.js";
35
39
  export { lighting } from "./modules/lighting/lights/lighting.js";
36
40
  export { ibl } from "./modules/lighting/ibl/ibl.js";
@@ -38,6 +42,7 @@ export { dirlight } from "./modules/lighting/no-material/dirlight.js";
38
42
  export { lambertMaterial } from "./modules/lighting/lambert-material/lambert-material.js";
39
43
  export { gouraudMaterial } from "./modules/lighting/gouraud-material/gouraud-material.js";
40
44
  export { phongMaterial } from "./modules/lighting/phong-material/phong-material.js";
45
+ export { waterMaterial } from "./modules/lighting/water-material/water-material.js";
41
46
  export { pbrMaterial } from "./modules/lighting/pbr-material/pbr-material.js";
42
47
  export { pbrScene } from "./modules/lighting/pbr-material/pbr-scene.js";
43
48
  //# sourceMappingURL=index.js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AO,EAAC,aAAa,EAAC,4DAAyD;AAK/E,OAAO,EAAC,aAAa,EAAC,4DAAyD;AAa/E,OAAO,EAAC,WAAW,EAAC,wDAAqD;AACzE,OAAO,EAAC,QAAQ,EAAC,qDAAkD"}
@@ -1,5 +1,15 @@
1
+ /** Options for the luma.gl shader source preprocessor. */
1
2
  export type PreprocessorOptions = {
2
- defines?: Record<string, boolean>;
3
+ /** Boolean or numeric values used by `#if`, `#ifdef`, and `#ifndef` conditionals. */
4
+ defines?: Record<string, boolean | number>;
3
5
  };
6
+ /**
7
+ * Removes inactive conditional branches from shader source.
8
+ * Supports `#ifdef`, `#ifndef`, and simple `#if` expressions using a define name,
9
+ * `!NAME`, `defined(NAME)`, `!defined(NAME)`, or a boolean or numeric literal.
10
+ * @param source Shader source containing luma.gl-supported conditional directives.
11
+ * @param options Defines used while evaluating conditional directives.
12
+ * @returns Shader source with inactive branches removed.
13
+ */
4
14
  export declare function preprocess(source: string, options?: PreprocessorOptions): string;
5
15
  //# sourceMappingURL=preprocessor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preprocessor.d.ts","sourceRoot":"","sources":["../../../src/lib/preprocessor/preprocessor.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAgDhF"}
1
+ {"version":3,"file":"preprocessor.d.ts","sourceRoot":"","sources":["../../../src/lib/preprocessor/preprocessor.ts"],"names":[],"mappings":"AAeA,0DAA0D;AAC1D,MAAM,MAAM,mBAAmB,GAAG;IAChC,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAyDhF"}
@@ -2,23 +2,39 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
  const DEFINE_NAME_PATTERN = '([a-zA-Z_][a-zA-Z0-9_]*)';
5
+ const IF_REGEXP = /^\s*\#\s*if\s+(.+?)\s*(?:\/\/.*)?$/;
5
6
  const IFDEF_REGEXP = new RegExp(`^\\s*\\#\\s*ifdef\\s*${DEFINE_NAME_PATTERN}\\s*$`);
6
7
  const IFNDEF_REGEXP = new RegExp(`^\\s*\\#\\s*ifndef\\s*${DEFINE_NAME_PATTERN}\\s*(?:\\/\\/.*)?$`);
7
8
  const ELSE_REGEXP = /^\s*\#\s*else\s*(?:\/\/.*)?$/;
8
9
  const ENDIF_REGEXP = /^\s*\#\s*endif\s*$/;
9
10
  const IFDEF_WITH_COMMENT_REGEXP = new RegExp(`^\\s*\\#\\s*ifdef\\s*${DEFINE_NAME_PATTERN}\\s*(?:\\/\\/.*)?$`);
10
11
  const ENDIF_WITH_COMMENT_REGEXP = /^\s*\#\s*endif\s*(?:\/\/.*)?$/;
12
+ /**
13
+ * Removes inactive conditional branches from shader source.
14
+ * Supports `#ifdef`, `#ifndef`, and simple `#if` expressions using a define name,
15
+ * `!NAME`, `defined(NAME)`, `!defined(NAME)`, or a boolean or numeric literal.
16
+ * @param source Shader source containing luma.gl-supported conditional directives.
17
+ * @param options Defines used while evaluating conditional directives.
18
+ * @returns Shader source with inactive branches removed.
19
+ */
11
20
  export function preprocess(source, options) {
12
21
  const lines = source.split('\n');
13
22
  const output = [];
14
23
  const conditionalStack = [];
15
24
  let conditional = true;
16
25
  for (const line of lines) {
26
+ const matchIfExpression = line.match(IF_REGEXP);
17
27
  const matchIf = line.match(IFDEF_WITH_COMMENT_REGEXP) || line.match(IFDEF_REGEXP);
18
28
  const matchIfNot = line.match(IFNDEF_REGEXP);
19
29
  const matchElse = line.match(ELSE_REGEXP);
20
30
  const matchEnd = line.match(ENDIF_WITH_COMMENT_REGEXP) || line.match(ENDIF_REGEXP);
21
- if (matchIf || matchIfNot) {
31
+ if (matchIfExpression) {
32
+ const branchTaken = evaluateIfExpression(matchIfExpression[1], options?.defines || {});
33
+ const active = conditional && branchTaken;
34
+ conditionalStack.push({ parentActive: conditional, branchTaken, active });
35
+ conditional = active;
36
+ }
37
+ else if (matchIf || matchIfNot) {
22
38
  const defineName = (matchIf || matchIfNot)?.[1];
23
39
  const defineValue = Boolean(options?.defines?.[defineName]);
24
40
  const branchTaken = matchIf ? defineValue : !defineValue;
@@ -29,7 +45,7 @@ export function preprocess(source, options) {
29
45
  else if (matchElse) {
30
46
  const currentConditional = conditionalStack[conditionalStack.length - 1];
31
47
  if (!currentConditional) {
32
- throw new Error('Encountered #else without matching #ifdef or #ifndef');
48
+ throw new Error('Encountered #else without matching #if, #ifdef or #ifndef');
33
49
  }
34
50
  currentConditional.active =
35
51
  currentConditional.parentActive && !currentConditional.branchTaken;
@@ -51,4 +67,33 @@ export function preprocess(source, options) {
51
67
  }
52
68
  return output.join('\n');
53
69
  }
70
+ function evaluateIfExpression(expression, defines) {
71
+ const trimmedExpression = expression.trim();
72
+ if (/^[+-]?\d+(?:\.\d+)?$/.test(trimmedExpression)) {
73
+ return Number(trimmedExpression) !== 0;
74
+ }
75
+ if (trimmedExpression === 'true') {
76
+ return true;
77
+ }
78
+ if (trimmedExpression === 'false') {
79
+ return false;
80
+ }
81
+ const negatedDefineMatch = trimmedExpression.match(new RegExp(`^!\\s*${DEFINE_NAME_PATTERN}$`));
82
+ if (negatedDefineMatch) {
83
+ return !Boolean(defines[negatedDefineMatch[1]]);
84
+ }
85
+ const defineMatch = trimmedExpression.match(new RegExp(`^${DEFINE_NAME_PATTERN}$`));
86
+ if (defineMatch) {
87
+ return Boolean(defines[defineMatch[1]]);
88
+ }
89
+ const definedMatch = trimmedExpression.match(new RegExp(`^defined\\s*\\(\\s*${DEFINE_NAME_PATTERN}\\s*\\)$`));
90
+ if (definedMatch) {
91
+ return defines[definedMatch[1]] !== undefined;
92
+ }
93
+ const negatedDefinedMatch = trimmedExpression.match(new RegExp(`^!\\s*defined\\s*\\(\\s*${DEFINE_NAME_PATTERN}\\s*\\)$`));
94
+ if (negatedDefinedMatch) {
95
+ return defines[negatedDefinedMatch[1]] === undefined;
96
+ }
97
+ throw new Error(`Unsupported #if expression "${expression}"`);
98
+ }
54
99
  //# sourceMappingURL=preprocessor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"preprocessor.js","sourceRoot":"","sources":["../../../src/lib/preprocessor/preprocessor.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AACvD,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,wBAAwB,mBAAmB,OAAO,CAAC,CAAC;AACpF,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,yBAAyB,mBAAmB,oBAAoB,CAAC,CAAC;AACnG,MAAM,WAAW,GAAG,8BAA8B,CAAC;AACnD,MAAM,YAAY,GAAG,oBAAoB,CAAC;AAC1C,MAAM,yBAAyB,GAAG,IAAI,MAAM,CAC1C,wBAAwB,mBAAmB,oBAAoB,CAChE,CAAC;AACF,MAAM,yBAAyB,GAAG,+BAA+B,CAAC;AAMlE,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,OAA6B;IACtE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,MAAM,gBAAgB,GAIjB,EAAE,CAAC;IACR,IAAI,WAAW,GAAG,IAAI,CAAC;IAEvB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,YAA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derAssembler {
16
16
  private readonly _wgslBindingRegistry;
17
17
  /**
18
18
  * A default shader assembler instance - the natural place to register default modules and hooks
19
- * @returns
19
+ * @returns Shared default shader assembler.
20
20
  */
21
21
  static getDefaultShaderAssembler(): ShaderAssembler;
22
22
  /**
23
- * Add a default module that does not have to be provided with every call to assembleShaders()
23
+ * Add a default module that does not have to be provided with every assembly call.
24
+ * @param module Shader module to include in later assembly calls.
24
25
  */
25
26
  addDefaultModule(module: ShaderModule): void;
26
27
  /**
27
28
  * Remove a default module
29
+ * @param module Shader module to remove from later assembly calls.
28
30
  */
29
31
  removeDefaultModule(module: ShaderModule): void;
30
32
  /**
31
33
  * Register a shader hook
32
- * @param hook
33
- * @param opts
34
+ * @param hook Stage-prefixed hook signature, such as `vs:OFFSET_POSITION(inout vec4 position)`.
35
+ * @param opts Optional hook metadata such as always-on header and footer source.
34
36
  */
35
37
  addShaderHook(hook: string, opts?: any): void;
36
38
  /**
37
39
  * Assemble a WGSL unified shader
38
- * @param platformInfo
39
- * @param props
40
- * @returns
40
+ * @param props WGSL source, platform information, shader modules, defines, and injections.
41
+ * @returns Assembled WGSL source, resolved modules, uniforms, and binding debug metadata.
41
42
  */
42
43
  assembleWGSLShader(props: AssembleShaderProps): {
43
44
  source: string;
@@ -53,9 +54,8 @@ export declare class ShaderAssembler {
53
54
  };
54
55
  /**
55
56
  * Assemble a pair of shaders into a single shader program
56
- * @param platformInfo
57
- * @param props
58
- * @returns
57
+ * @param props GLSL vertex and fragment source, platform information, shader modules, defines, and injections.
58
+ * @returns Assembled GLSL source, resolved modules, and combined uniform getter.
59
59
  */
60
60
  assembleGLSLShaderPair(props: AssembleShaderProps): {
61
61
  vs: string;
@@ -1 +1 @@
1
- {"version":3,"file":"shader-assembler.d.ts","sourceRoot":"","sources":["../../src/lib/shader-assembler.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAC,yCAAsC;AAEhE,OAAO,EACL,mBAAmB,EACnB,eAAe,EAGhB,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;QACX,EAAE,EAAE,MAAM,CAAC;QACX,WAAW,EAAE,eAAe,CAAC;QAC7B,OAAO,EAAE,YAAY,EAAE,CAAC;KACzB;IAgBD;;OAEG;IACH,cAAc,CAAC,UAAU,GAAE,YAAY,EAAO,GAAG,YAAY,EAAE;CA0BhE"}
@@ -20,7 +20,7 @@ export class ShaderAssembler {
20
20
  _wgslBindingRegistry = new Map();
21
21
  /**
22
22
  * A default shader assembler instance - the natural place to register default modules and hooks
23
- * @returns
23
+ * @returns Shared default shader assembler.
24
24
  */
25
25
  static getDefaultShaderAssembler() {
26
26
  ShaderAssembler.defaultShaderAssembler =
@@ -28,7 +28,8 @@ export class ShaderAssembler {
28
28
  return ShaderAssembler.defaultShaderAssembler;
29
29
  }
30
30
  /**
31
- * Add a default module that does not have to be provided with every call to assembleShaders()
31
+ * Add a default module that does not have to be provided with every assembly call.
32
+ * @param module Shader module to include in later assembly calls.
32
33
  */
33
34
  addDefaultModule(module) {
34
35
  if (!this._defaultModules.find(m => m.name === (typeof module === 'string' ? module : module.name))) {
@@ -37,6 +38,7 @@ export class ShaderAssembler {
37
38
  }
38
39
  /**
39
40
  * Remove a default module
41
+ * @param module Shader module to remove from later assembly calls.
40
42
  */
41
43
  removeDefaultModule(module) {
42
44
  const moduleName = typeof module === 'string' ? module : module.name;
@@ -44,8 +46,8 @@ export class ShaderAssembler {
44
46
  }
45
47
  /**
46
48
  * Register a shader hook
47
- * @param hook
48
- * @param opts
49
+ * @param hook Stage-prefixed hook signature, such as `vs:OFFSET_POSITION(inout vec4 position)`.
50
+ * @param opts Optional hook metadata such as always-on header and footer source.
49
51
  */
50
52
  addShaderHook(hook, opts) {
51
53
  if (opts) {
@@ -55,30 +57,29 @@ export class ShaderAssembler {
55
57
  }
56
58
  /**
57
59
  * Assemble a WGSL unified shader
58
- * @param platformInfo
59
- * @param props
60
- * @returns
60
+ * @param props WGSL source, platform information, shader modules, defines, and injections.
61
+ * @returns Assembled WGSL source, resolved modules, uniforms, and binding debug metadata.
61
62
  */
62
63
  assembleWGSLShader(props) {
63
64
  const modules = this._getModuleList(props.modules); // Combine with default modules
64
65
  const hookFunctions = this._hookFunctions; // TODO - combine with default hook functions
65
- const { source, getUniforms, bindingAssignments } = assembleWGSLShader({
66
+ const defines = getShaderPreprocessorDefines(props, modules);
67
+ const preprocessedApplicationSource = props.platformInfo.shaderLanguage === 'wgsl' && props.source
68
+ ? preprocess(props.source, { defines })
69
+ : props.source;
70
+ const { source: assembledSource, getUniforms, bindingAssignments } = assembleWGSLShader({
66
71
  ...props,
67
72
  // @ts-expect-error
68
- source: props.source,
73
+ source: preprocessedApplicationSource,
74
+ defines,
69
75
  _bindingRegistry: this._wgslBindingRegistry,
70
76
  modules,
71
77
  hookFunctions
72
78
  });
73
- const defines = {
74
- ...modules.reduce((accumulator, module) => {
75
- Object.assign(accumulator, module.defines);
76
- return accumulator;
77
- }, {}),
78
- ...props.defines
79
- };
80
79
  // WGSL does not have built-in preprocessing support (just compile time constants)
81
- const preprocessedSource = props.platformInfo.shaderLanguage === 'wgsl' ? preprocess(source, { defines }) : source;
80
+ const preprocessedSource = props.platformInfo.shaderLanguage === 'wgsl'
81
+ ? preprocess(assembledSource, { defines })
82
+ : assembledSource;
82
83
  return {
83
84
  source: preprocessedSource,
84
85
  getUniforms,
@@ -89,9 +90,8 @@ export class ShaderAssembler {
89
90
  }
90
91
  /**
91
92
  * Assemble a pair of shaders into a single shader program
92
- * @param platformInfo
93
- * @param props
94
- * @returns
93
+ * @param props GLSL vertex and fragment source, platform information, shader modules, defines, and injections.
94
+ * @returns Assembled GLSL source, resolved modules, and combined uniform getter.
95
95
  */
96
96
  assembleGLSLShaderPair(props) {
97
97
  const modules = this._getModuleList(props.modules); // Combine with default modules
@@ -133,4 +133,20 @@ export class ShaderAssembler {
133
133
  return modules;
134
134
  }
135
135
  }
136
+ function getShaderPreprocessorDefines(props, modules) {
137
+ return {
138
+ ...getPlatformPreprocessorDefines(props.platformInfo),
139
+ ...modules.reduce((accumulator, module) => {
140
+ Object.assign(accumulator, module.defines);
141
+ return accumulator;
142
+ }, {}),
143
+ ...props.defines
144
+ };
145
+ }
146
+ function getPlatformPreprocessorDefines(platformInfo) {
147
+ const limits = platformInfo.limits || {};
148
+ return {
149
+ LUMA_SUPPORTS_VERTEX_STORAGE_BUFFERS: platformInfo.type === 'webgpu' && (limits['maxStorageBuffersInVertexStage'] || 0) > 0
150
+ };
151
+ }
136
152
  //# sourceMappingURL=shader-assembler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shader-assembler.js","sourceRoot":"","sources":["../../src/lib/shader-assembler.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,uBAAuB,EAAC,yCAAsC;AACtE,OAAO,EAGL,kBAAkB,EAClB,sBAAsB,EACvB,8CAA2C;AAC5C,OAAO,EACL,iCAAiC,EAElC,gDAA6C;AAC9C,OAAO,EAAC,UAAU,EAAC,uCAAoC;AAEvD;;;GAGG;AACH,MAAM,OAAO,eAAe;IAC1B,uCAAuC;IACvC,MAAM,CAAC,sBAAsB,CAAkB;IAC/C,qBAAqB;IACJ,cAAc,GAAU,EAAE,CAAC;IAC5C,qBAAqB;IACb,eAAe,GAAmB,EAAE,CAAC;IAC7C,kFAAkF;IACjE,oBAAoB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAElE;;;OAGG;IACH,MAAM,CAAC,yBAAyB;QAC9B,eAAe,CAAC,sBAAsB;YACpC,eAAe,CAAC,sBAAsB,IAAI,IAAI,eAAe,EAAE,CAAC;QAClE,OAAO,eAAe,CAAC,sBAAsB,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,gBAAgB,CAAC,MAAoB;QACnC,IACE,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CACxB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,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AAC;QACH,CAAC;QAED,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC;QAEvB,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACjC,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAED,SAAS,4BAA4B,CACnC,KAA0B,EAC1B,OAAuB;IAEvB,OAAO;QACL,GAAG,8BAA8B,CAAC,KAAK,CAAC,YAAY,CAAC;QACrD,GAAG,OAAO,CAAC,MAAM,CAAmC,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE;YAC1E,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;YAC3C,OAAO,WAAW,CAAC;QACrB,CAAC,EAAE,EAAE,CAAC;QACN,GAAG,KAAK,CAAC,OAAO;KACjB,CAAC;AACJ,CAAC;AAED,SAAS,8BAA8B,CACrC,YAAiD;IAEjD,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,IAAI,EAAE,CAAC;IACzC,OAAO;QACL,oCAAoC,EAClC,YAAY,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,gCAAgC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC;KACxF,CAAC;AACJ,CAAC"}
@@ -3,9 +3,9 @@ import type { ShaderInjection } from "./shader-injections.js";
3
3
  import type { ShaderModule } from "../shader-module/shader-module.js";
4
4
  import { ShaderHook } from "./shader-hooks.js";
5
5
  import { type ShaderBindingDebugRow } from "./wgsl-binding-debug.js";
6
- /**
7
- * Options for `ShaderAssembler.assembleShaders()`
8
- */
6
+ import type { AttributeShaderType } from '@luma.gl/core';
7
+ import type { ResolvedShaderPluginVarying } from "../shader-plugin.js";
8
+ /** Props accepted by `ShaderAssembler` assembly methods. */
9
9
  export type AssembleShaderProps = AssembleShaderOptions & {
10
10
  platformInfo: PlatformInfo;
11
11
  /** WGSL: single shader source. */
@@ -15,6 +15,7 @@ export type AssembleShaderProps = AssembleShaderOptions & {
15
15
  /** GLSL fragment shader source. */
16
16
  fs?: string | null;
17
17
  };
18
+ /** Shared shader assembly options. */
18
19
  export type AssembleShaderOptions = {
19
20
  /** information about the platform (which shader language & version, extensions etc.) */
20
21
  platformInfo: PlatformInfo;
@@ -22,14 +23,24 @@ export type AssembleShaderOptions = {
22
23
  id?: string;
23
24
  /** Modules to be injected */
24
25
  modules?: ShaderModule[];
25
- /** Defines to be injected */
26
- defines?: Record<string, boolean>;
26
+ /** Boolean or numeric preprocessor defines evaluated before shader assembly. */
27
+ defines?: Record<string, boolean | number>;
27
28
  /** GLSL only: Overrides to be injected. In WGSL these are supplied during Pipeline creation time */
28
29
  constants?: Record<string, number>;
29
30
  /** Hook functions */
30
31
  hookFunctions?: (ShaderHook | string)[];
31
32
  /** Code injections */
32
33
  inject?: Record<string, string | ShaderInjection>;
34
+ /** Ordered code injections contributed by ShaderPlugin descriptors. */
35
+ pluginInjections?: Record<string, ShaderInjection[]>;
36
+ /** Vertex inputs contributed by ShaderPlugin descriptors. */
37
+ pluginVertexInputs?: Record<string, AttributeShaderType>;
38
+ /** Cross-stage varyings contributed by ShaderPlugin descriptors. */
39
+ pluginVaryings?: Record<string, ResolvedShaderPluginVarying>;
40
+ /** WGSL vertex entry point selected by the render pipeline. */
41
+ vertexEntryPoint?: string;
42
+ /** WGSL fragment entry point selected by the render pipeline. */
43
+ fragmentEntryPoint?: string;
33
44
  /** Whether to inject prologue */
34
45
  prologue?: boolean;
35
46
  /** logger object */
@@ -43,14 +54,24 @@ type AssembleStageOptions = {
43
54
  stage: 'vertex' | 'fragment';
44
55
  /** Modules to be injected */
45
56
  modules: any[];
46
- /** Defines to be injected */
47
- defines?: Record<string, boolean>;
57
+ /** Boolean or numeric preprocessor defines evaluated before shader assembly. */
58
+ defines?: Record<string, boolean | number>;
48
59
  /** GLSL only: Overrides to be injected. In WGSL these are supplied during Pipeline creation time */
49
60
  constants?: Record<string, number>;
50
61
  /** Hook functions */
51
62
  hookFunctions?: (ShaderHook | string)[];
52
63
  /** Code injections */
53
64
  inject?: Record<string, string | ShaderInjection>;
65
+ /** Ordered code injections contributed by ShaderPlugin descriptors. */
66
+ pluginInjections?: Record<string, ShaderInjection[]>;
67
+ /** Vertex inputs contributed by ShaderPlugin descriptors. */
68
+ pluginVertexInputs?: Record<string, AttributeShaderType>;
69
+ /** Cross-stage varyings contributed by ShaderPlugin descriptors. */
70
+ pluginVaryings?: Record<string, ResolvedShaderPluginVarying>;
71
+ /** WGSL vertex entry point selected by the render pipeline. */
72
+ vertexEntryPoint?: string;
73
+ /** WGSL fragment entry point selected by the render pipeline. */
74
+ fragmentEntryPoint?: string;
54
75
  /** Whether to inject prologue */
55
76
  prologue?: boolean;
56
77
  /** logger object */
@@ -1 +1 @@
1
- {"version":3,"file":"assemble-shaders.d.ts","sourceRoot":"","sources":["../../../src/lib/shader-assembly/assemble-shaders.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAS7C,OAAO,KAAK,EAAC,eAAe,EAAC,+BAA4B;AACzD,OAAO,KAAK,EAAC,YAAY,EAAC,0CAAuC;AACjE,OAAO,EAAC,UAAU,EAAuC,0BAAuB;AAGhF,OAAO,EAAoC,KAAK,qBAAqB,EAAC,gCAA6B;AAuBnG;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,qBAAqB,GAAG;IACxD,YAAY,EAAE,YAAY,CAAC;IAC3B,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,iCAAiC;IACjC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,mCAAmC;IACnC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,wFAAwF;IACxF,YAAY,EAAE,YAAY,CAAC;IAC3B,gCAAgC;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB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