@luma.gl/engine 9.0.0-alpha.16 → 9.0.0-alpha.17

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 (183) hide show
  1. package/dist/animation/key-frames.d.ts +1 -1
  2. package/dist/animation/key-frames.d.ts.map +1 -1
  3. package/dist/animation/key-frames.js +55 -54
  4. package/dist/animation/key-frames.js.map +1 -0
  5. package/dist/animation/timeline.d.ts +4 -4
  6. package/dist/animation/timeline.d.ts.map +1 -1
  7. package/dist/animation/timeline.js +101 -94
  8. package/dist/animation/timeline.js.map +1 -0
  9. package/dist/animation-loop/animation-loop.d.ts +4 -2
  10. package/dist/animation-loop/animation-loop.d.ts.map +1 -1
  11. package/dist/animation-loop/animation-loop.js +358 -414
  12. package/dist/animation-loop/animation-loop.js.map +1 -0
  13. package/dist/animation-loop/animation-props.d.ts +3 -1
  14. package/dist/animation-loop/animation-props.d.ts.map +1 -1
  15. package/dist/animation-loop/animation-props.js +1 -0
  16. package/dist/animation-loop/animation-props.js.map +1 -0
  17. package/dist/animation-loop/make-animation-loop.d.ts +1 -1
  18. package/dist/animation-loop/make-animation-loop.d.ts.map +1 -1
  19. package/dist/animation-loop/make-animation-loop.js +25 -26
  20. package/dist/animation-loop/make-animation-loop.js.map +1 -0
  21. package/dist/animation-loop/render-loop.js +5 -17
  22. package/dist/animation-loop/render-loop.js.map +1 -0
  23. package/dist/dist.dev.js +5240 -0
  24. package/dist/geometries/cone-geometry.d.ts +1 -1
  25. package/dist/geometries/cone-geometry.d.ts.map +1 -1
  26. package/dist/geometries/cone-geometry.js +18 -12
  27. package/dist/geometries/cone-geometry.js.map +1 -0
  28. package/dist/geometries/cube-geometry.d.ts +1 -1
  29. package/dist/geometries/cube-geometry.d.ts.map +1 -1
  30. package/dist/geometries/cube-geometry.js +60 -187
  31. package/dist/geometries/cube-geometry.js.map +1 -0
  32. package/dist/geometries/cylinder-geometry.d.ts +1 -1
  33. package/dist/geometries/cylinder-geometry.d.ts.map +1 -1
  34. package/dist/geometries/cylinder-geometry.js +15 -10
  35. package/dist/geometries/cylinder-geometry.js.map +1 -0
  36. package/dist/geometries/ico-sphere-geometry.d.ts +1 -1
  37. package/dist/geometries/ico-sphere-geometry.d.ts.map +1 -1
  38. package/dist/geometries/ico-sphere-geometry.js +160 -141
  39. package/dist/geometries/ico-sphere-geometry.js.map +1 -0
  40. package/dist/geometries/plane-geometry.d.ts +1 -1
  41. package/dist/geometries/plane-geometry.d.ts.map +1 -1
  42. package/dist/geometries/plane-geometry.js +111 -93
  43. package/dist/geometries/plane-geometry.js.map +1 -0
  44. package/dist/geometries/sphere-geometry.d.ts +1 -1
  45. package/dist/geometries/sphere-geometry.d.ts.map +1 -1
  46. package/dist/geometries/sphere-geometry.js +95 -76
  47. package/dist/geometries/sphere-geometry.js.map +1 -0
  48. package/dist/geometries/truncated-cone-geometry.d.ts +1 -1
  49. package/dist/geometries/truncated-cone-geometry.d.ts.map +1 -1
  50. package/dist/geometries/truncated-cone-geometry.js +126 -105
  51. package/dist/geometries/truncated-cone-geometry.js.map +1 -0
  52. package/dist/geometry/geometry-table.d.ts +1 -1
  53. package/dist/geometry/geometry-table.d.ts.map +1 -1
  54. package/dist/geometry/geometry-table.js +1 -0
  55. package/dist/geometry/geometry-table.js.map +1 -0
  56. package/dist/geometry/geometry-utils.js +32 -22
  57. package/dist/geometry/geometry-utils.js.map +1 -0
  58. package/dist/geometry/geometry.d.ts +4 -4
  59. package/dist/geometry/geometry.d.ts.map +1 -1
  60. package/dist/geometry/geometry.js +109 -96
  61. package/dist/geometry/geometry.js.map +1 -0
  62. package/dist/geometry/primitive-utils.js +1 -30
  63. package/dist/geometry/primitive-utils.js.map +1 -0
  64. package/dist/index.cjs +2222 -0
  65. package/dist/index.js +16 -20
  66. package/dist/index.js.map +1 -0
  67. package/dist/lib/clip-space.js +1 -50
  68. package/dist/lib/clip-space.js.map +1 -0
  69. package/dist/lib/model-utils.js +28 -101
  70. package/dist/lib/model-utils.js.map +1 -0
  71. package/dist/lib/model.d.ts +1 -1
  72. package/dist/lib/model.d.ts.map +1 -1
  73. package/dist/lib/model.js +129 -121
  74. package/dist/lib/model.js.map +1 -0
  75. package/dist/lib/pipeline-factory.d.ts +3 -3
  76. package/dist/lib/pipeline-factory.d.ts.map +1 -1
  77. package/dist/lib/pipeline-factory.js +165 -136
  78. package/dist/lib/pipeline-factory.js.map +1 -0
  79. package/dist.min.js +245 -0
  80. package/package.json +22 -13
  81. package/src/.DS_Store +0 -0
  82. package/src/animation/timeline.ts +1 -1
  83. package/src/animation-loop/animation-loop.ts +5 -5
  84. package/src/animation-loop/make-animation-loop.ts +2 -1
  85. package/src/geometry/geometry.ts +2 -2
  86. package/src/lib/pipeline-factory.ts +1 -1
  87. package/dist/bundle.d.ts +0 -2
  88. package/dist/bundle.d.ts.map +0 -1
  89. package/dist/bundle.js +0 -5
  90. package/dist/dist.min.js +0 -31
  91. package/dist/es5/animation/key-frames.js +0 -84
  92. package/dist/es5/animation/key-frames.js.map +0 -1
  93. package/dist/es5/animation/timeline.js +0 -183
  94. package/dist/es5/animation/timeline.js.map +0 -1
  95. package/dist/es5/animation-loop/animation-loop.js +0 -534
  96. package/dist/es5/animation-loop/animation-loop.js.map +0 -1
  97. package/dist/es5/animation-loop/animation-props.js +0 -2
  98. package/dist/es5/animation-loop/animation-props.js.map +0 -1
  99. package/dist/es5/animation-loop/make-animation-loop.js +0 -53
  100. package/dist/es5/animation-loop/make-animation-loop.js.map +0 -1
  101. package/dist/es5/animation-loop/render-loop.js +0 -39
  102. package/dist/es5/animation-loop/render-loop.js.map +0 -1
  103. package/dist/es5/bundle.js +0 -6
  104. package/dist/es5/bundle.js.map +0 -1
  105. package/dist/es5/geometries/cone-geometry.js +0 -43
  106. package/dist/es5/geometries/cone-geometry.js.map +0 -1
  107. package/dist/es5/geometries/cube-geometry.js +0 -84
  108. package/dist/es5/geometries/cube-geometry.js.map +0 -1
  109. package/dist/es5/geometries/cylinder-geometry.js +0 -39
  110. package/dist/es5/geometries/cylinder-geometry.js.map +0 -1
  111. package/dist/es5/geometries/ico-sphere-geometry.js +0 -185
  112. package/dist/es5/geometries/ico-sphere-geometry.js.map +0 -1
  113. package/dist/es5/geometries/plane-geometry.js +0 -137
  114. package/dist/es5/geometries/plane-geometry.js.map +0 -1
  115. package/dist/es5/geometries/sphere-geometry.js +0 -120
  116. package/dist/es5/geometries/sphere-geometry.js.map +0 -1
  117. package/dist/es5/geometries/truncated-cone-geometry.js +0 -160
  118. package/dist/es5/geometries/truncated-cone-geometry.js.map +0 -1
  119. package/dist/es5/geometry/geometry-table.js +0 -2
  120. package/dist/es5/geometry/geometry-table.js.map +0 -1
  121. package/dist/es5/geometry/geometry-utils.js +0 -39
  122. package/dist/es5/geometry/geometry-utils.js.map +0 -1
  123. package/dist/es5/geometry/geometry.js +0 -150
  124. package/dist/es5/geometry/geometry.js.map +0 -1
  125. package/dist/es5/geometry/primitive-utils.js +0 -2
  126. package/dist/es5/geometry/primitive-utils.js.map +0 -1
  127. package/dist/es5/index.js +0 -112
  128. package/dist/es5/index.js.map +0 -1
  129. package/dist/es5/lib/clip-space.js +0 -2
  130. package/dist/es5/lib/clip-space.js.map +0 -1
  131. package/dist/es5/lib/model-utils.js +0 -52
  132. package/dist/es5/lib/model-utils.js.map +0 -1
  133. package/dist/es5/lib/model.js +0 -173
  134. package/dist/es5/lib/model.js.map +0 -1
  135. package/dist/es5/lib/pipeline-factory.js +0 -244
  136. package/dist/es5/lib/pipeline-factory.js.map +0 -1
  137. package/dist/esm/animation/key-frames.js +0 -57
  138. package/dist/esm/animation/key-frames.js.map +0 -1
  139. package/dist/esm/animation/timeline.js +0 -113
  140. package/dist/esm/animation/timeline.js.map +0 -1
  141. package/dist/esm/animation-loop/animation-loop.js +0 -367
  142. package/dist/esm/animation-loop/animation-loop.js.map +0 -1
  143. package/dist/esm/animation-loop/animation-props.js +0 -2
  144. package/dist/esm/animation-loop/animation-props.js.map +0 -1
  145. package/dist/esm/animation-loop/make-animation-loop.js +0 -28
  146. package/dist/esm/animation-loop/make-animation-loop.js.map +0 -1
  147. package/dist/esm/animation-loop/render-loop.js +0 -7
  148. package/dist/esm/animation-loop/render-loop.js.map +0 -1
  149. package/dist/esm/bundle.js +0 -4
  150. package/dist/esm/bundle.js.map +0 -1
  151. package/dist/esm/geometries/cone-geometry.js +0 -21
  152. package/dist/esm/geometries/cone-geometry.js.map +0 -1
  153. package/dist/esm/geometries/cube-geometry.js +0 -67
  154. package/dist/esm/geometries/cube-geometry.js.map +0 -1
  155. package/dist/esm/geometries/cylinder-geometry.js +0 -18
  156. package/dist/esm/geometries/cylinder-geometry.js.map +0 -1
  157. package/dist/esm/geometries/ico-sphere-geometry.js +0 -170
  158. package/dist/esm/geometries/ico-sphere-geometry.js.map +0 -1
  159. package/dist/esm/geometries/plane-geometry.js +0 -119
  160. package/dist/esm/geometries/plane-geometry.js.map +0 -1
  161. package/dist/esm/geometries/sphere-geometry.js +0 -102
  162. package/dist/esm/geometries/sphere-geometry.js.map +0 -1
  163. package/dist/esm/geometries/truncated-cone-geometry.js +0 -136
  164. package/dist/esm/geometries/truncated-cone-geometry.js.map +0 -1
  165. package/dist/esm/geometry/geometry-table.js +0 -2
  166. package/dist/esm/geometry/geometry-table.js.map +0 -1
  167. package/dist/esm/geometry/geometry-utils.js +0 -37
  168. package/dist/esm/geometry/geometry-utils.js.map +0 -1
  169. package/dist/esm/geometry/geometry.js +0 -119
  170. package/dist/esm/geometry/geometry.js.map +0 -1
  171. package/dist/esm/geometry/primitive-utils.js +0 -2
  172. package/dist/esm/geometry/primitive-utils.js.map +0 -1
  173. package/dist/esm/index.js +0 -16
  174. package/dist/esm/index.js.map +0 -1
  175. package/dist/esm/lib/clip-space.js +0 -2
  176. package/dist/esm/lib/clip-space.js.map +0 -1
  177. package/dist/esm/lib/model-utils.js +0 -40
  178. package/dist/esm/lib/model-utils.js.map +0 -1
  179. package/dist/esm/lib/model.js +0 -146
  180. package/dist/esm/lib/model.js.map +0 -1
  181. package/dist/esm/lib/pipeline-factory.js +0 -180
  182. package/dist/esm/lib/pipeline-factory.js.map +0 -1
  183. package/src/bundle.ts +0 -4
@@ -1,151 +1,180 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
1
2
  import { assembleShaders } from '@luma.gl/shadertools';
2
3
  const DEFAULT_RENDER_PIPELINE_OPTIONS = {
3
- vs: '',
4
- fs: '',
5
- modules: [],
6
- defines: {},
7
- inject: {},
8
- transpileToGLSL100: false,
9
- layout: null,
10
- varyings: [],
11
- bufferMode: 0x8c8d,
12
- topology: 'triangle-list',
13
- parameters: {}
4
+ vs: '',
5
+ fs: '',
6
+ modules: [],
7
+ defines: {},
8
+ inject: {},
9
+ transpileToGLSL100: false,
10
+ layout: null,
11
+ varyings: [],
12
+ bufferMode: 0x8c8d,
13
+ topology: 'triangle-list',
14
+ parameters: {}
14
15
  };
15
- /** Efficiently create shared pipelines with varying parameters */
16
16
  export class PipelineFactory {
17
- // private readonly _registeredModules = {}; // TODO: Remove? This isn't used anywhere in luma.gl
18
- static getDefaultPipelineFactory(device) {
19
- // @ts-expect-error Add to device
20
- device.defaultPipelineFactory = device.defaultPipelineFactory || new PipelineFactory(device);
21
- // @ts-expect-error Add to device
22
- return device.defaultPipelineFactory;
17
+ static getDefaultPipelineFactory(device) {
18
+ device.defaultPipelineFactory = device.defaultPipelineFactory || new PipelineFactory(device);
19
+ return device.defaultPipelineFactory;
20
+ }
21
+ constructor(device) {
22
+ _defineProperty(this, "device", void 0);
23
+ _defineProperty(this, "stateHash", 0);
24
+ _defineProperty(this, "_hashCounter", 0);
25
+ _defineProperty(this, "_hashes", {});
26
+ _defineProperty(this, "_useCounts", {});
27
+ _defineProperty(this, "_pipelineCache", {});
28
+ _defineProperty(this, "_getUniforms", {});
29
+ _defineProperty(this, "_hookFunctions", []);
30
+ _defineProperty(this, "_defaultModules", []);
31
+ this.device = device;
32
+ }
33
+ addDefaultModule(module) {
34
+ if (!this._defaultModules.find(m => m.name === (typeof module === 'string' ? module : module.name))) {
35
+ this._defaultModules.push(module);
23
36
  }
24
- constructor(device) {
25
- this.stateHash = 0; // Used to change hashing if hooks are modified
26
- this._hashCounter = 0;
27
- this._hashes = {};
28
- this._useCounts = {};
29
- this._pipelineCache = {};
30
- this._getUniforms = {};
31
- this._hookFunctions = [];
32
- this._defaultModules = [];
33
- this.device = device;
37
+ this.stateHash++;
38
+ }
39
+ removeDefaultModule(module) {
40
+ const moduleName = typeof module === 'string' ? module : module.name;
41
+ this._defaultModules = this._defaultModules.filter(m => m.name !== moduleName);
42
+ this.stateHash++;
43
+ }
44
+ addShaderHook(hook, opts) {
45
+ if (opts) {
46
+ hook = Object.assign(opts, {
47
+ hook
48
+ });
34
49
  }
35
- addDefaultModule(module) {
36
- if (!this._defaultModules.find((m) => m.name === (typeof module === 'string' ? module : module.name))) {
37
- this._defaultModules.push(module);
38
- }
39
- this.stateHash++;
50
+ this._hookFunctions.push(hook);
51
+ this.stateHash++;
52
+ }
53
+ createRenderPipeline(options) {
54
+ const props = {
55
+ ...DEFAULT_RENDER_PIPELINE_OPTIONS,
56
+ ...options
57
+ };
58
+ const modules = this._getModuleList(props.modules);
59
+ const hash = this._hashRenderPipeline({
60
+ ...props,
61
+ modules
62
+ });
63
+ if (!this._pipelineCache[hash]) {
64
+ const {
65
+ pipeline,
66
+ getUniforms
67
+ } = this._createRenderPipeline({
68
+ ...props,
69
+ modules
70
+ });
71
+ pipeline.hash = hash;
72
+ this._pipelineCache[hash] = pipeline;
73
+ this._getUniforms[hash] = getUniforms || (x => ({}));
74
+ this._useCounts[hash] = 0;
40
75
  }
41
- removeDefaultModule(module) {
42
- const moduleName = typeof module === 'string' ? module : module.name;
43
- this._defaultModules = this._defaultModules.filter((m) => m.name !== moduleName);
44
- this.stateHash++;
76
+ this._useCounts[hash]++;
77
+ return {
78
+ pipeline: this._pipelineCache[hash],
79
+ getUniforms: this._getUniforms[hash]
80
+ };
81
+ }
82
+ release(pipeline) {
83
+ const hash = pipeline.hash;
84
+ this._useCounts[hash]--;
85
+ if (this._useCounts[hash] === 0) {
86
+ this._pipelineCache[hash].destroy();
87
+ delete this._pipelineCache[hash];
88
+ delete this._getUniforms[hash];
89
+ delete this._useCounts[hash];
45
90
  }
46
- addShaderHook(hook, opts) {
47
- if (opts) {
48
- hook = Object.assign(opts, { hook });
49
- }
50
- this._hookFunctions.push(hook);
51
- this.stateHash++;
91
+ }
92
+ getUniforms(pipeline) {
93
+ return this._getUniforms[pipeline.hash] || null;
94
+ }
95
+ _createRenderPipeline(props) {
96
+ const platformInfo = {
97
+ gpu: this.device.info.gpu,
98
+ features: this.device.features
99
+ };
100
+ if (!props.fs) {
101
+ throw new Error('fs');
52
102
  }
53
- createRenderPipeline(options) {
54
- const props = { ...DEFAULT_RENDER_PIPELINE_OPTIONS, ...options };
55
- const modules = this._getModuleList(props.modules); // Combine with default modules
56
- const hash = this._hashRenderPipeline({ ...props, modules });
57
- if (!this._pipelineCache[hash]) {
58
- const { pipeline, getUniforms } = this._createRenderPipeline({ ...props, modules });
59
- pipeline.hash = hash;
60
- this._pipelineCache[hash] = pipeline;
61
- this._getUniforms[hash] = getUniforms || ((x) => ({}));
62
- this._useCounts[hash] = 0;
63
- }
64
- this._useCounts[hash]++;
65
- return {
66
- pipeline: this._pipelineCache[hash],
67
- getUniforms: this._getUniforms[hash]
68
- };
103
+ const assembled = assembleShaders(platformInfo, {
104
+ ...props,
105
+ fs: props.fs,
106
+ hookFunctions: this._hookFunctions
107
+ });
108
+ const pipeline = this.device.createRenderPipeline({
109
+ ...props,
110
+ vs: this.device.createShader({
111
+ stage: 'vertex',
112
+ source: assembled.vs
113
+ }),
114
+ fs: assembled.fs ? this.device.createShader({
115
+ stage: 'fragment',
116
+ source: assembled.fs
117
+ }) : null
118
+ });
119
+ return {
120
+ pipeline,
121
+ getUniforms: assembled.getUniforms
122
+ };
123
+ }
124
+ _hashRenderPipeline(props) {
125
+ const {
126
+ modules = [],
127
+ varyings = [],
128
+ defines = {},
129
+ inject = {},
130
+ parameters = {}
131
+ } = props;
132
+ const vsHash = this._getHash(props.vs);
133
+ const fsHash = props.fs ? this._getHash(props.fs) : 0;
134
+ const moduleHashes = modules.map(m => this._getHash(typeof m === 'string' ? m : m.name)).sort();
135
+ const varyingHashes = varyings.map(v => this._getHash(v));
136
+ const defineKeys = Object.keys(defines).sort();
137
+ const injectKeys = Object.keys(inject).sort();
138
+ const defineHashes = [];
139
+ const injectHashes = [];
140
+ for (const key of defineKeys) {
141
+ defineHashes.push(this._getHash(key));
142
+ defineHashes.push(this._getHash(String(defines[key])));
69
143
  }
70
- release(pipeline) {
71
- const hash = pipeline.hash;
72
- this._useCounts[hash]--;
73
- if (this._useCounts[hash] === 0) {
74
- this._pipelineCache[hash].destroy();
75
- delete this._pipelineCache[hash];
76
- delete this._getUniforms[hash];
77
- delete this._useCounts[hash];
78
- }
144
+ for (const key of injectKeys) {
145
+ injectHashes.push(this._getHash(key));
146
+ injectHashes.push(this._getHash(inject[key]));
79
147
  }
80
- getUniforms(pipeline) {
81
- return this._getUniforms[pipeline.hash] || null;
148
+ const parameterHash = JSON.stringify(parameters);
149
+ return "".concat(vsHash, "/").concat(fsHash, "D").concat(defineHashes.join('/'), "M").concat(moduleHashes.join('/'), "I").concat(injectHashes.join('/'), "V").concat(varyingHashes.join('/'), "H").concat(this.stateHash, "B").concat(props.bufferMode).concat(props.transpileToGLSL100 ? 'T' : '', "P").concat(parameterHash);
150
+ }
151
+ _getHash(key) {
152
+ if (this._hashes[key] === undefined) {
153
+ this._hashes[key] = this._hashCounter++;
82
154
  }
83
- // PRIVATE
84
- _createRenderPipeline(props) {
85
- const platformInfo = {
86
- gpu: this.device.info.gpu,
87
- features: this.device.features
88
- };
89
- if (!props.fs) {
90
- throw new Error('fs');
91
- }
92
- const assembled = assembleShaders(platformInfo, { ...props, fs: props.fs, hookFunctions: this._hookFunctions });
93
- const pipeline = this.device.createRenderPipeline({
94
- ...props,
95
- vs: this.device.createShader({ stage: 'vertex', source: assembled.vs }),
96
- fs: assembled.fs ? this.device.createShader({ stage: 'fragment', source: assembled.fs }) : null,
97
- });
98
- return { pipeline, getUniforms: assembled.getUniforms };
155
+ return this._hashes[key];
156
+ }
157
+ _getModuleList() {
158
+ let appModules = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
159
+ const modules = new Array(this._defaultModules.length + appModules.length);
160
+ const seen = {};
161
+ let count = 0;
162
+ for (let i = 0, len = this._defaultModules.length; i < len; ++i) {
163
+ const module = this._defaultModules[i];
164
+ const name = module.name;
165
+ modules[count++] = module;
166
+ seen[name] = true;
99
167
  }
100
- /** Calculate a hash based on all the inputs for a render pipeline */
101
- _hashRenderPipeline(props) {
102
- const { modules = [], varyings = [], defines = {}, inject = {}, parameters = {} } = props;
103
- const vsHash = this._getHash(props.vs);
104
- const fsHash = props.fs ? this._getHash(props.fs) : 0;
105
- const moduleHashes = modules.map((m) => this._getHash(typeof m === 'string' ? m : m.name)).sort();
106
- const varyingHashes = varyings.map((v) => this._getHash(v));
107
- const defineKeys = Object.keys(defines).sort();
108
- const injectKeys = Object.keys(inject).sort();
109
- const defineHashes = [];
110
- const injectHashes = [];
111
- for (const key of defineKeys) {
112
- defineHashes.push(this._getHash(key));
113
- defineHashes.push(this._getHash(String(defines[key])));
114
- }
115
- for (const key of injectKeys) {
116
- injectHashes.push(this._getHash(key));
117
- injectHashes.push(this._getHash(inject[key]));
118
- }
119
- // TODO - hash parameters!
120
- const parameterHash = JSON.stringify(parameters);
121
- return `${vsHash}/${fsHash}D${defineHashes.join('/')}M${moduleHashes.join('/')}I${injectHashes.join('/')}V${varyingHashes.join('/')}H${this.stateHash}B${props.bufferMode}${props.transpileToGLSL100 ? 'T' : ''}P${parameterHash}`;
122
- }
123
- _getHash(key) {
124
- if (this._hashes[key] === undefined) {
125
- this._hashes[key] = this._hashCounter++;
126
- }
127
- return this._hashes[key];
128
- }
129
- // Dedupe and combine with default modules
130
- _getModuleList(appModules = []) {
131
- const modules = new Array(this._defaultModules.length + appModules.length);
132
- const seen = {};
133
- let count = 0;
134
- for (let i = 0, len = this._defaultModules.length; i < len; ++i) {
135
- const module = this._defaultModules[i];
136
- const name = module.name;
137
- modules[count++] = module;
138
- seen[name] = true;
139
- }
140
- for (let i = 0, len = appModules.length; i < len; ++i) {
141
- const module = appModules[i];
142
- const name = module.name;
143
- if (!seen[name]) {
144
- modules[count++] = module;
145
- seen[name] = true;
146
- }
147
- }
148
- modules.length = count;
149
- return modules;
168
+ for (let i = 0, len = appModules.length; i < len; ++i) {
169
+ const module = appModules[i];
170
+ const name = module.name;
171
+ if (!seen[name]) {
172
+ modules[count++] = module;
173
+ seen[name] = true;
174
+ }
150
175
  }
176
+ modules.length = count;
177
+ return modules;
178
+ }
151
179
  }
180
+ //# sourceMappingURL=pipeline-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-factory.js","names":["assembleShaders","DEFAULT_RENDER_PIPELINE_OPTIONS","vs","fs","modules","defines","inject","transpileToGLSL100","layout","varyings","bufferMode","topology","parameters","PipelineFactory","getDefaultPipelineFactory","device","defaultPipelineFactory","constructor","_defineProperty","addDefaultModule","module","_defaultModules","find","m","name","push","stateHash","removeDefaultModule","moduleName","filter","addShaderHook","hook","opts","Object","assign","_hookFunctions","createRenderPipeline","options","props","_getModuleList","hash","_hashRenderPipeline","_pipelineCache","pipeline","getUniforms","_createRenderPipeline","_getUniforms","x","_useCounts","release","destroy","platformInfo","gpu","info","features","Error","assembled","hookFunctions","createShader","stage","source","vsHash","_getHash","fsHash","moduleHashes","map","sort","varyingHashes","v","defineKeys","keys","injectKeys","defineHashes","injectHashes","key","String","parameterHash","JSON","stringify","concat","join","_hashes","undefined","_hashCounter","appModules","arguments","length","Array","seen","count","i","len"],"sources":["../../src/lib/pipeline-factory.ts"],"sourcesContent":["import type {RenderPipelineParameters, PrimitiveTopology, ShaderLayout} from '@luma.gl/api';\nimport {Device, RenderPipeline} from '@luma.gl/api/';\nimport type { ShaderModule } from '@luma.gl/shadertools';\nimport {assembleShaders} from '@luma.gl/shadertools';\n\nexport type GetRenderPipelineOptions = {\n vs: string;\n fs: string | null;\n topology: PrimitiveTopology;\n layout?: ShaderLayout | null;\n parameters?: RenderPipelineParameters;\n\n modules?: ShaderModule[];\n defines?: Record<string, string | number | boolean>;\n inject?: Record<string, string>;\n transpileToGLSL100?: boolean;\n\n varyings?: string[];\n bufferMode?: number, \n};\n\nexport type GetComputePipelineOptions = {\n cs: string;\n parameters?: RenderPipelineParameters;\n\n modules?: ShaderModule[];\n defines?: Record<string, string>;\n inject?: Record<string, string>;\n transpileToGLSL100?: boolean;\n\n varyings?: string[];\n bufferMode?: number;\n};\n\nconst DEFAULT_RENDER_PIPELINE_OPTIONS: Required<GetRenderPipelineOptions> = {\n vs: '',\n fs: '',\n modules: [],\n defines: {},\n inject: {},\n transpileToGLSL100: false,\n layout: null,\n\n varyings: [],\n bufferMode: 0x8c8d, // // varyings/bufferMode for xform feedback, 0x8c8d: SEPARATE_ATTRIBS\n topology: 'triangle-list',\n parameters: {} \n};\n\ntype GetUniformsFunc = (props?: Record<string, any>) => Record<string, any>;\n\n/** Efficiently create shared pipelines with varying parameters */\nexport class PipelineFactory {\n readonly device: Device;\n\n stateHash: number = 0; // Used to change hashing if hooks are modified\n private _hashCounter: number = 0;\n private readonly _hashes: Record<string, number> = {};\n private readonly _useCounts: Record<string, number> = {};\n\n private readonly _pipelineCache: Record<string, RenderPipeline> = {};\n\n private readonly _getUniforms: Record<string, GetUniformsFunc> = {};\n private readonly _hookFunctions: any[] = [];\n private _defaultModules: any[] = [];\n // private readonly _registeredModules = {}; // TODO: Remove? This isn't used anywhere in luma.gl\n\n static getDefaultPipelineFactory(device: Device): PipelineFactory {\n // @ts-expect-error Add to device\n device.defaultPipelineFactory = device.defaultPipelineFactory || new PipelineFactory(device);\n // @ts-expect-error Add to device\n return device.defaultPipelineFactory;\n }\n\n constructor(device: Device) {\n this.device = device;\n }\n\n addDefaultModule(module: ShaderModule): void {\n if (!this._defaultModules.find((m) => m.name === (typeof module === 'string' ? module : module.name))) {\n this._defaultModules.push(module);\n }\n this.stateHash++;\n }\n\n removeDefaultModule(module: ShaderModule): void {\n const moduleName = typeof module === 'string' ? module : module.name;\n this._defaultModules = this._defaultModules.filter((m) => m.name !== moduleName);\n this.stateHash++;\n }\n\n addShaderHook(hook: string, opts?: any): void {\n if (opts) {\n hook = Object.assign(opts, {hook});\n }\n this._hookFunctions.push(hook);\n this.stateHash++;\n }\n\n createRenderPipeline(options: GetRenderPipelineOptions): {\n pipeline: RenderPipeline;\n getUniforms: GetUniformsFunc;\n } {\n const props: Required<GetRenderPipelineOptions> = {...DEFAULT_RENDER_PIPELINE_OPTIONS, ...options};\n\n const modules = this._getModuleList(props.modules); // Combine with default modules\n\n const hash = this._hashRenderPipeline({...props, modules});\n\n if (!this._pipelineCache[hash]) {\n const {pipeline, getUniforms} = this._createRenderPipeline({...props, modules});\n pipeline.hash = hash;\n this._pipelineCache[hash] = pipeline;\n this._getUniforms[hash] = getUniforms || ((x?: unknown) => ({}));\n this._useCounts[hash] = 0;\n }\n\n this._useCounts[hash]++;\n\n return {\n pipeline: this._pipelineCache[hash],\n getUniforms: this._getUniforms[hash]\n };\n }\n\n release(pipeline: RenderPipeline): void {\n const hash = pipeline.hash;\n this._useCounts[hash]--;\n if (this._useCounts[hash] === 0) {\n this._pipelineCache[hash].destroy();\n delete this._pipelineCache[hash];\n delete this._getUniforms[hash];\n delete this._useCounts[hash];\n }\n }\n\n getUniforms(pipeline: RenderPipeline) {\n return this._getUniforms[pipeline.hash] || null;\n }\n\n // PRIVATE\n\n _createRenderPipeline(props: GetRenderPipelineOptions): {\n pipeline: RenderPipeline,\n getUniforms: GetUniformsFunc\n } {\n const platformInfo = {\n gpu: this.device.info.gpu,\n features: this.device.features\n };\n\n if (!props.fs) {\n throw new Error('fs');\n }\n\n const assembled = assembleShaders(platformInfo, {...props, fs: props.fs, hookFunctions: this._hookFunctions});\n\n const pipeline = this.device.createRenderPipeline({\n ...props,\n vs: this.device.createShader({stage: 'vertex', source: assembled.vs}),\n fs: assembled.fs ? this.device.createShader({stage: 'fragment', source: assembled.fs}) : null,\n });\n\n return {pipeline, getUniforms: assembled.getUniforms};\n }\n\n /** Calculate a hash based on all the inputs for a render pipeline */\n _hashRenderPipeline(props: GetRenderPipelineOptions): string {\n const {modules = [], varyings = [], defines = {}, inject = {}, parameters = {}} = props;\n const vsHash = this._getHash(props.vs);\n const fsHash = props.fs ? this._getHash(props.fs) : 0;\n\n const moduleHashes = modules.map((m) => this._getHash(typeof m === 'string' ? m : m.name)).sort();\n const varyingHashes = varyings.map((v) => this._getHash(v));\n\n const defineKeys = Object.keys(defines).sort();\n const injectKeys = Object.keys(inject).sort();\n const defineHashes: number[] = [];\n const injectHashes: number[] = [];\n\n for (const key of defineKeys) {\n defineHashes.push(this._getHash(key));\n defineHashes.push(this._getHash(String(defines[key])));\n }\n\n for (const key of injectKeys) {\n injectHashes.push(this._getHash(key));\n injectHashes.push(this._getHash(inject[key]));\n }\n\n // TODO - hash parameters!\n const parameterHash = JSON.stringify(parameters);\n\n return `${vsHash}/${fsHash}D${defineHashes.join('/')}M${moduleHashes.join(\n '/'\n )}I${injectHashes.join('/')}V${varyingHashes.join('/')}H${this.stateHash}B${props.bufferMode}${\n props.transpileToGLSL100 ? 'T' : ''\n }P${parameterHash}`;\n }\n\n _getHash(key: string): number {\n if (this._hashes[key] === undefined) {\n this._hashes[key] = this._hashCounter++;\n }\n return this._hashes[key];\n }\n\n // Dedupe and combine with default modules\n _getModuleList(appModules: ShaderModule[] = []): ShaderModule[] {\n const modules = new Array(this._defaultModules.length + appModules.length);\n const seen: Record<string, boolean> = {};\n let count = 0;\n\n for (let i = 0, len = this._defaultModules.length; i < len; ++i) {\n const module = this._defaultModules[i];\n const name = module.name;\n modules[count++] = module;\n seen[name] = true;\n }\n\n for (let i = 0, len = appModules.length; i < len; ++i) {\n const module = appModules[i];\n const name = module.name;\n if (!seen[name]) {\n modules[count++] = module;\n seen[name] = true;\n }\n }\n\n modules.length = count;\n\n return modules;\n }\n}\n"],"mappings":";AAGA,SAAQA,eAAe,QAAO,sBAAsB;AA+BpD,MAAMC,+BAAmE,GAAG;EAC1EC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,OAAO,EAAE,EAAE;EACXC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC,CAAC;EACVC,kBAAkB,EAAE,KAAK;EACzBC,MAAM,EAAE,IAAI;EAEZC,QAAQ,EAAE,EAAE;EACZC,UAAU,EAAE,MAAM;EAClBC,QAAQ,EAAE,eAAe;EACzBC,UAAU,EAAE,CAAC;AACf,CAAC;AAKD,OAAO,MAAMC,eAAe,CAAC;EAe3B,OAAOC,yBAAyBA,CAACC,MAAc,EAAmB;IAEhEA,MAAM,CAACC,sBAAsB,GAAGD,MAAM,CAACC,sBAAsB,IAAI,IAAIH,eAAe,CAACE,MAAM,CAAC;IAE5F,OAAOA,MAAM,CAACC,sBAAsB;EACtC;EAEAC,WAAWA,CAACF,MAAc,EAAE;IAAAG,eAAA;IAAAA,eAAA,oBAnBR,CAAC;IAAAA,eAAA,uBACU,CAAC;IAAAA,eAAA,kBACmB,CAAC,CAAC;IAAAA,eAAA,qBACC,CAAC,CAAC;IAAAA,eAAA,yBAEU,CAAC,CAAC;IAAAA,eAAA,uBAEH,CAAC,CAAC;IAAAA,eAAA,yBAC1B,EAAE;IAAAA,eAAA,0BACV,EAAE;IAWjC,IAAI,CAACH,MAAM,GAAGA,MAAM;EACtB;EAEAI,gBAAgBA,CAACC,MAAoB,EAAQ;IAC3C,IAAI,CAAC,IAAI,CAACC,eAAe,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,IAAI,MAAM,OAAOJ,MAAM,KAAK,QAAQ,GAAGA,MAAM,GAAGA,MAAM,CAACI,IAAI,CAAC,CAAC,EAAE;MACrG,IAAI,CAACH,eAAe,CAAC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