@luma.gl/core 9.0.9 → 9.0.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/dist/adapter/resources/render-pipeline.d.ts +6 -8
- package/dist/adapter/resources/render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/render-pipeline.js +3 -2
- package/dist/dist.dev.js +190 -79
- package/dist/dist.min.js +7 -7
- package/dist/index.cjs +19 -3
- package/dist/index.cjs.map +2 -2
- package/dist/init.js +1 -1
- package/dist/lib/luma.d.ts +1 -0
- package/dist/lib/luma.d.ts.map +1 -1
- package/dist/lib/luma.js +20 -0
- package/package.json +2 -2
- package/src/adapter/resources/render-pipeline.ts +15 -13
- package/src/lib/luma.ts +23 -0
- package/LICENSE +0 -34
|
@@ -32,10 +32,6 @@ export type RenderPipelineProps = ResourceProps & {
|
|
|
32
32
|
topology?: PrimitiveTopology;
|
|
33
33
|
/** Parameters that are controlled by pipeline */
|
|
34
34
|
parameters?: RenderPipelineParameters;
|
|
35
|
-
/** Number of vertices */
|
|
36
|
-
vertexCount?: number;
|
|
37
|
-
/** Number of instances */
|
|
38
|
-
instanceCount?: number;
|
|
39
35
|
/** Buffers, Textures, Samplers for the shader bindings */
|
|
40
36
|
bindings?: Record<string, Binding>;
|
|
41
37
|
/** @deprecated uniforms (WebGL only) */
|
|
@@ -72,12 +68,14 @@ export declare abstract class RenderPipeline extends Resource<RenderPipelineProp
|
|
|
72
68
|
topology?: PrimitiveTopology;
|
|
73
69
|
/** vertex attributes */
|
|
74
70
|
vertexArray: VertexArray;
|
|
75
|
-
/**
|
|
76
|
-
|
|
77
|
-
/** Number of "rows" in 'vertex' buffers */
|
|
78
|
-
vertexCount?: number;
|
|
71
|
+
/** Use instanced rendering? */
|
|
72
|
+
isInstanced?: boolean;
|
|
79
73
|
/** Number of "rows" in 'instance' buffers */
|
|
80
74
|
instanceCount?: number;
|
|
75
|
+
/** Number of "rows" in 'vertex' buffers */
|
|
76
|
+
vertexCount?: number;
|
|
77
|
+
/** Number of "rows" in index buffer */
|
|
78
|
+
indexCount?: number;
|
|
81
79
|
/** First vertex to draw from */
|
|
82
80
|
firstVertex?: number;
|
|
83
81
|
/** First index to draw from */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-pipeline.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/render-pipeline.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,KAAK,EAAC,YAAY,EAAC,0BAAuB;AACjD,OAAO,KAAK,EAAC,iBAAiB,EAAE,wBAAwB,EAAC,+BAA4B;AACrF,OAAO,KAAK,EAAC,YAAY,EAAE,OAAO,EAAC,kCAA+B;AAClE,OAAO,KAAK,EAAC,YAAY,EAAC,kCAA+B;AAEzD,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AACnD,OAAO,KAAK,EAAC,MAAM,EAAC,oBAAiB;AACrC,OAAO,KAAK,EAAC,UAAU,EAAC,yBAAsB;AAC9C,OAAO,EAAC,WAAW,EAAC,0BAAuB;AAC3C,OAAO,EAAC,iBAAiB,EAAC,gCAA6B;AAEvD,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAGhD,6BAA6B;IAC7B,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,gFAAgF;IAChF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qGAAqG;IACrG,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,+BAA+B;IAC/B,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,kFAAkF;IAClF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,uGAAuG;IACvG,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAErC,+EAA+E;IAC/E,YAAY,CAAC,EAAE,YAAY,GAAG,I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,CAAC;QACxB,wGAAwG;QACxG,UAAU,CAAC,EAAE,wBAAwB,CAAC;QACtC,sDAAsD;QACtD,QAAQ,CAAC,EAAE,iBAAiB,CAAC;QAC7B,wBAAwB;QACxB,WAAW,EAAE,WAAW,CAAC;QACzB,+BAA+B;QAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,6CAA6C;QAC7C,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,2CAA2C;QAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,uCAAuC;QACvC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,gCAAgC;QAChC,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,+BAA+B;QAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,kCAAkC;QAClC,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,sCAAsC;QACtC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;KACvC,GAAG,OAAO;IAIX;;;;;OAKG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,IAAI;CAG/D"}
|
|
@@ -19,8 +19,9 @@ export class RenderPipeline extends Resource {
|
|
|
19
19
|
bufferLayout: [],
|
|
20
20
|
topology: 'triangle-list',
|
|
21
21
|
parameters: {},
|
|
22
|
-
|
|
23
|
-
instanceCount: 0,
|
|
22
|
+
// isInstanced: false,
|
|
23
|
+
// instanceCount: 0,
|
|
24
|
+
// vertexCount: 0,
|
|
24
25
|
bindings: {},
|
|
25
26
|
uniforms: {}
|
|
26
27
|
};
|
package/dist/dist.dev.js
CHANGED
|
@@ -97,37 +97,39 @@ var __exports__ = (() => {
|
|
|
97
97
|
uid: () => uid
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
-
// ../../node_modules/@probe.gl/env/dist/lib/globals.js
|
|
101
|
-
var window_ = globalThis;
|
|
102
|
-
var document_ = globalThis.document || {};
|
|
103
|
-
var process_ = globalThis.process || {};
|
|
104
|
-
var console_ = globalThis.console;
|
|
105
|
-
var navigator_ = globalThis.navigator || {};
|
|
106
|
-
|
|
107
100
|
// ../../node_modules/@probe.gl/env/dist/lib/is-electron.js
|
|
108
101
|
function isElectron(mockUserAgent) {
|
|
109
|
-
if (typeof window !== "undefined" && window.process
|
|
102
|
+
if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
|
|
110
103
|
return true;
|
|
111
104
|
}
|
|
112
|
-
if (typeof process !== "undefined" && Boolean(process.versions
|
|
105
|
+
if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions["electron"])) {
|
|
113
106
|
return true;
|
|
114
107
|
}
|
|
115
|
-
const realUserAgent = typeof navigator
|
|
108
|
+
const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
|
|
116
109
|
const userAgent = mockUserAgent || realUserAgent;
|
|
117
|
-
|
|
110
|
+
if (userAgent && userAgent.indexOf("Electron") >= 0) {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
return false;
|
|
118
114
|
}
|
|
119
115
|
|
|
120
116
|
// ../../node_modules/@probe.gl/env/dist/lib/is-browser.js
|
|
121
117
|
function isBrowser() {
|
|
122
|
-
const isNode = (
|
|
123
|
-
// @ts-expect-error
|
|
124
|
-
typeof process === "object" && String(process) === "[object process]" && !process?.browser
|
|
125
|
-
);
|
|
118
|
+
const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
|
|
126
119
|
return !isNode || isElectron();
|
|
127
120
|
}
|
|
128
121
|
|
|
129
|
-
// ../../node_modules/@probe.gl/env/dist/
|
|
130
|
-
var
|
|
122
|
+
// ../../node_modules/@probe.gl/env/dist/lib/globals.js
|
|
123
|
+
var self_ = globalThis.self || globalThis.window || globalThis.global;
|
|
124
|
+
var window_ = globalThis.window || globalThis.self || globalThis.global;
|
|
125
|
+
var document_ = globalThis.document || {};
|
|
126
|
+
var process_ = globalThis.process || {};
|
|
127
|
+
var console_ = globalThis.console;
|
|
128
|
+
var navigator_ = globalThis.navigator || {};
|
|
129
|
+
|
|
130
|
+
// ../../node_modules/@probe.gl/env/dist/utils/globals.js
|
|
131
|
+
var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
132
|
+
var isBrowser2 = isBrowser();
|
|
131
133
|
|
|
132
134
|
// ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
|
|
133
135
|
function getStorage(type) {
|
|
@@ -142,7 +144,11 @@ var __exports__ = (() => {
|
|
|
142
144
|
}
|
|
143
145
|
}
|
|
144
146
|
var LocalStorage = class {
|
|
145
|
-
constructor(id, defaultConfig
|
|
147
|
+
constructor(id, defaultConfig) {
|
|
148
|
+
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
149
|
+
this.storage = void 0;
|
|
150
|
+
this.id = void 0;
|
|
151
|
+
this.config = void 0;
|
|
146
152
|
this.storage = getStorage(type);
|
|
147
153
|
this.id = id;
|
|
148
154
|
this.config = defaultConfig;
|
|
@@ -158,7 +164,6 @@ var __exports__ = (() => {
|
|
|
158
164
|
this.storage.setItem(this.id, serialized);
|
|
159
165
|
}
|
|
160
166
|
}
|
|
161
|
-
// Get config from persistent store, if available
|
|
162
167
|
_loadConfiguration() {
|
|
163
168
|
let configuration = {};
|
|
164
169
|
if (this.storage) {
|
|
@@ -184,10 +189,22 @@ var __exports__ = (() => {
|
|
|
184
189
|
}
|
|
185
190
|
return formatted;
|
|
186
191
|
}
|
|
187
|
-
function leftPad(string
|
|
192
|
+
function leftPad(string) {
|
|
193
|
+
let length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
188
194
|
const padLength = Math.max(length - string.length, 0);
|
|
189
195
|
return `${" ".repeat(padLength)}${string}`;
|
|
190
196
|
}
|
|
197
|
+
function formatImage(image, message, scale) {
|
|
198
|
+
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
199
|
+
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
200
|
+
if (image.width > maxWidth) {
|
|
201
|
+
scale = Math.min(scale, maxWidth / image.width);
|
|
202
|
+
}
|
|
203
|
+
const width = image.width * scale;
|
|
204
|
+
const height = image.height * scale;
|
|
205
|
+
const style = ["font-size:1px;", `padding:${Math.floor(height / 2)}px ${Math.floor(width / 2)}px;`, `line-height:${height}px;`, `background:url(${imageUrl});`, `background-size:${width}px ${height}px;`, "color:transparent;"].join("");
|
|
206
|
+
return [`${message} %c+`, style];
|
|
207
|
+
}
|
|
191
208
|
|
|
192
209
|
// ../../node_modules/@probe.gl/log/dist/utils/color.js
|
|
193
210
|
var COLOR;
|
|
@@ -232,7 +249,8 @@ var __exports__ = (() => {
|
|
|
232
249
|
}
|
|
233
250
|
|
|
234
251
|
// ../../node_modules/@probe.gl/log/dist/utils/autobind.js
|
|
235
|
-
function autobind(obj
|
|
252
|
+
function autobind(obj) {
|
|
253
|
+
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
236
254
|
const proto = Object.getPrototypeOf(obj);
|
|
237
255
|
const propNames = Object.getOwnPropertyNames(proto);
|
|
238
256
|
const object = obj;
|
|
@@ -257,9 +275,11 @@ var __exports__ = (() => {
|
|
|
257
275
|
function getHiResTimestamp() {
|
|
258
276
|
let timestamp;
|
|
259
277
|
if (isBrowser() && window_.performance) {
|
|
260
|
-
|
|
278
|
+
var _window$performance, _window$performance$n;
|
|
279
|
+
timestamp = window_ === null || window_ === void 0 ? void 0 : (_window$performance = window_.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
|
|
261
280
|
} else if ("hrtime" in process_) {
|
|
262
|
-
|
|
281
|
+
var _process$hrtime;
|
|
282
|
+
const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
|
|
263
283
|
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
264
284
|
} else {
|
|
265
285
|
timestamp = Date.now();
|
|
@@ -282,12 +302,21 @@ var __exports__ = (() => {
|
|
|
282
302
|
function noop() {
|
|
283
303
|
}
|
|
284
304
|
var cache = {};
|
|
285
|
-
var ONCE = {
|
|
305
|
+
var ONCE = {
|
|
306
|
+
once: true
|
|
307
|
+
};
|
|
286
308
|
var Log = class {
|
|
287
|
-
constructor(
|
|
309
|
+
constructor() {
|
|
310
|
+
let {
|
|
311
|
+
id
|
|
312
|
+
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
313
|
+
id: ""
|
|
314
|
+
};
|
|
315
|
+
this.id = void 0;
|
|
288
316
|
this.VERSION = VERSION;
|
|
289
317
|
this._startTs = getHiResTimestamp();
|
|
290
318
|
this._deltaTs = getHiResTimestamp();
|
|
319
|
+
this._storage = void 0;
|
|
291
320
|
this.userData = {};
|
|
292
321
|
this.LOG_THROTTLE_TIMEOUT = 0;
|
|
293
322
|
this.id = id;
|
|
@@ -309,44 +338,42 @@ var __exports__ = (() => {
|
|
|
309
338
|
getLevel() {
|
|
310
339
|
return this._storage.config.level;
|
|
311
340
|
}
|
|
312
|
-
/** @return milliseconds, with fractions */
|
|
313
341
|
getTotal() {
|
|
314
342
|
return Number((getHiResTimestamp() - this._startTs).toPrecision(10));
|
|
315
343
|
}
|
|
316
|
-
/** @return milliseconds, with fractions */
|
|
317
344
|
getDelta() {
|
|
318
345
|
return Number((getHiResTimestamp() - this._deltaTs).toPrecision(10));
|
|
319
346
|
}
|
|
320
|
-
/** @deprecated use logLevel */
|
|
321
347
|
set priority(newPriority) {
|
|
322
348
|
this.level = newPriority;
|
|
323
349
|
}
|
|
324
|
-
/** @deprecated use logLevel */
|
|
325
350
|
get priority() {
|
|
326
351
|
return this.level;
|
|
327
352
|
}
|
|
328
|
-
/** @deprecated use logLevel */
|
|
329
353
|
getPriority() {
|
|
330
354
|
return this.level;
|
|
331
355
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
this._storage.setConfiguration({
|
|
356
|
+
enable() {
|
|
357
|
+
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
358
|
+
this._storage.setConfiguration({
|
|
359
|
+
enabled
|
|
360
|
+
});
|
|
335
361
|
return this;
|
|
336
362
|
}
|
|
337
363
|
setLevel(level) {
|
|
338
|
-
this._storage.setConfiguration({
|
|
364
|
+
this._storage.setConfiguration({
|
|
365
|
+
level
|
|
366
|
+
});
|
|
339
367
|
return this;
|
|
340
368
|
}
|
|
341
|
-
/** return the current status of the setting */
|
|
342
369
|
get(setting) {
|
|
343
370
|
return this._storage.config[setting];
|
|
344
371
|
}
|
|
345
|
-
// update the status of the setting
|
|
346
372
|
set(setting, value) {
|
|
347
|
-
this._storage.setConfiguration({
|
|
373
|
+
this._storage.setConfiguration({
|
|
374
|
+
[setting]: value
|
|
375
|
+
});
|
|
348
376
|
}
|
|
349
|
-
/** Logs the current settings as a table */
|
|
350
377
|
settings() {
|
|
351
378
|
if (console.table) {
|
|
352
379
|
console.table(this._storage.config);
|
|
@@ -354,11 +381,8 @@ var __exports__ = (() => {
|
|
|
354
381
|
console.log(this._storage.config);
|
|
355
382
|
}
|
|
356
383
|
}
|
|
357
|
-
// Unconditional logging
|
|
358
384
|
assert(condition, message) {
|
|
359
|
-
|
|
360
|
-
throw new Error(message || "Assertion failed");
|
|
361
|
-
}
|
|
385
|
+
assert(condition, message);
|
|
362
386
|
}
|
|
363
387
|
warn(message) {
|
|
364
388
|
return this._getLogFunction(0, message, originalConsole.warn, arguments, ONCE);
|
|
@@ -366,11 +390,9 @@ var __exports__ = (() => {
|
|
|
366
390
|
error(message) {
|
|
367
391
|
return this._getLogFunction(0, message, originalConsole.error, arguments);
|
|
368
392
|
}
|
|
369
|
-
/** Print a deprecation warning */
|
|
370
393
|
deprecated(oldUsage, newUsage) {
|
|
371
394
|
return this.warn(`\`${oldUsage}\` is deprecated and will be removed in a later version. Use \`${newUsage}\` instead`);
|
|
372
395
|
}
|
|
373
|
-
/** Print a removal warning */
|
|
374
396
|
removed(oldUsage, newUsage) {
|
|
375
397
|
return this.error(`\`${oldUsage}\` has been removed. Use \`${newUsage}\` instead`);
|
|
376
398
|
}
|
|
@@ -389,7 +411,6 @@ var __exports__ = (() => {
|
|
|
389
411
|
once(logLevel, message) {
|
|
390
412
|
return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
|
|
391
413
|
}
|
|
392
|
-
/** Logs an object as a table */
|
|
393
414
|
table(logLevel, table, columns) {
|
|
394
415
|
if (table) {
|
|
395
416
|
return this._getLogFunction(logLevel, table, console.table || noop, columns && [columns], {
|
|
@@ -398,6 +419,27 @@ var __exports__ = (() => {
|
|
|
398
419
|
}
|
|
399
420
|
return noop;
|
|
400
421
|
}
|
|
422
|
+
image(_ref) {
|
|
423
|
+
let {
|
|
424
|
+
logLevel,
|
|
425
|
+
priority,
|
|
426
|
+
image,
|
|
427
|
+
message = "",
|
|
428
|
+
scale = 1
|
|
429
|
+
} = _ref;
|
|
430
|
+
if (!this._shouldLog(logLevel || priority)) {
|
|
431
|
+
return noop;
|
|
432
|
+
}
|
|
433
|
+
return isBrowser() ? logImageInBrowser({
|
|
434
|
+
image,
|
|
435
|
+
message,
|
|
436
|
+
scale
|
|
437
|
+
}) : logImageInNode({
|
|
438
|
+
image,
|
|
439
|
+
message,
|
|
440
|
+
scale
|
|
441
|
+
});
|
|
442
|
+
}
|
|
401
443
|
time(logLevel, message) {
|
|
402
444
|
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
403
445
|
}
|
|
@@ -407,19 +449,30 @@ var __exports__ = (() => {
|
|
|
407
449
|
timeStamp(logLevel, message) {
|
|
408
450
|
return this._getLogFunction(logLevel, message, console.timeStamp || noop);
|
|
409
451
|
}
|
|
410
|
-
group(logLevel, message
|
|
411
|
-
|
|
412
|
-
|
|
452
|
+
group(logLevel, message) {
|
|
453
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
454
|
+
collapsed: false
|
|
455
|
+
};
|
|
456
|
+
const options = normalizeArguments({
|
|
457
|
+
logLevel,
|
|
458
|
+
message,
|
|
459
|
+
opts
|
|
460
|
+
});
|
|
461
|
+
const {
|
|
462
|
+
collapsed
|
|
463
|
+
} = opts;
|
|
413
464
|
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
414
465
|
return this._getLogFunction(options);
|
|
415
466
|
}
|
|
416
|
-
groupCollapsed(logLevel, message
|
|
417
|
-
|
|
467
|
+
groupCollapsed(logLevel, message) {
|
|
468
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
469
|
+
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
470
|
+
collapsed: true
|
|
471
|
+
}));
|
|
418
472
|
}
|
|
419
473
|
groupEnd(logLevel) {
|
|
420
474
|
return this._getLogFunction(logLevel, "", console.groupEnd || noop);
|
|
421
475
|
}
|
|
422
|
-
// EXPERIMENTAL
|
|
423
476
|
withGroup(logLevel, message, func) {
|
|
424
477
|
this.group(logLevel, message)();
|
|
425
478
|
try {
|
|
@@ -433,14 +486,17 @@ var __exports__ = (() => {
|
|
|
433
486
|
console.trace();
|
|
434
487
|
}
|
|
435
488
|
}
|
|
436
|
-
// PRIVATE METHODS
|
|
437
|
-
/** Deduces log level from a variety of arguments */
|
|
438
489
|
_shouldLog(logLevel) {
|
|
439
490
|
return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
|
|
440
491
|
}
|
|
441
492
|
_getLogFunction(logLevel, message, method, args, opts) {
|
|
442
493
|
if (this._shouldLog(logLevel)) {
|
|
443
|
-
opts = normalizeArguments({
|
|
494
|
+
opts = normalizeArguments({
|
|
495
|
+
logLevel,
|
|
496
|
+
message,
|
|
497
|
+
args,
|
|
498
|
+
opts
|
|
499
|
+
});
|
|
444
500
|
method = method || opts.method;
|
|
445
501
|
assert(method);
|
|
446
502
|
opts.total = this.getTotal();
|
|
@@ -480,7 +536,10 @@ var __exports__ = (() => {
|
|
|
480
536
|
return resolvedLevel;
|
|
481
537
|
}
|
|
482
538
|
function normalizeArguments(opts) {
|
|
483
|
-
const {
|
|
539
|
+
const {
|
|
540
|
+
logLevel,
|
|
541
|
+
message
|
|
542
|
+
} = opts;
|
|
484
543
|
opts.logLevel = normalizeLogLevel(logLevel);
|
|
485
544
|
const args = opts.args ? Array.from(opts.args) : [];
|
|
486
545
|
while (args.length && args.shift() !== message) {
|
|
@@ -503,7 +562,9 @@ var __exports__ = (() => {
|
|
|
503
562
|
}
|
|
504
563
|
const messageType = typeof opts.message;
|
|
505
564
|
assert(messageType === "string" || messageType === "object");
|
|
506
|
-
return Object.assign(opts, {
|
|
565
|
+
return Object.assign(opts, {
|
|
566
|
+
args
|
|
567
|
+
}, opts.opts);
|
|
507
568
|
}
|
|
508
569
|
function decorateMessage(id, message, opts) {
|
|
509
570
|
if (typeof message === "string") {
|
|
@@ -513,6 +574,43 @@ var __exports__ = (() => {
|
|
|
513
574
|
}
|
|
514
575
|
return message;
|
|
515
576
|
}
|
|
577
|
+
function logImageInNode(_ref2) {
|
|
578
|
+
let {
|
|
579
|
+
image,
|
|
580
|
+
message = "",
|
|
581
|
+
scale = 1
|
|
582
|
+
} = _ref2;
|
|
583
|
+
console.warn("removed");
|
|
584
|
+
return noop;
|
|
585
|
+
}
|
|
586
|
+
function logImageInBrowser(_ref3) {
|
|
587
|
+
let {
|
|
588
|
+
image,
|
|
589
|
+
message = "",
|
|
590
|
+
scale = 1
|
|
591
|
+
} = _ref3;
|
|
592
|
+
if (typeof image === "string") {
|
|
593
|
+
const img = new Image();
|
|
594
|
+
img.onload = () => {
|
|
595
|
+
const args = formatImage(img, message, scale);
|
|
596
|
+
console.log(...args);
|
|
597
|
+
};
|
|
598
|
+
img.src = image;
|
|
599
|
+
return noop;
|
|
600
|
+
}
|
|
601
|
+
const element = image.nodeName || "";
|
|
602
|
+
if (element.toLowerCase() === "img") {
|
|
603
|
+
console.log(...formatImage(image, message, scale));
|
|
604
|
+
return noop;
|
|
605
|
+
}
|
|
606
|
+
if (element.toLowerCase() === "canvas") {
|
|
607
|
+
const img = new Image();
|
|
608
|
+
img.onload = () => console.log(...formatImage(img, message, scale));
|
|
609
|
+
img.src = image.toDataURL();
|
|
610
|
+
return noop;
|
|
611
|
+
}
|
|
612
|
+
return noop;
|
|
613
|
+
}
|
|
516
614
|
function getTableHeader(table) {
|
|
517
615
|
for (const key in table) {
|
|
518
616
|
for (const title in table[key]) {
|
|
@@ -522,11 +620,10 @@ var __exports__ = (() => {
|
|
|
522
620
|
return "empty";
|
|
523
621
|
}
|
|
524
622
|
|
|
525
|
-
// ../../node_modules/@probe.gl/log/dist/init.js
|
|
526
|
-
globalThis.probe = {};
|
|
527
|
-
|
|
528
623
|
// ../../node_modules/@probe.gl/log/dist/index.js
|
|
529
|
-
var dist_default = new Log({
|
|
624
|
+
var dist_default = new Log({
|
|
625
|
+
id: "@probe.gl/log"
|
|
626
|
+
});
|
|
530
627
|
|
|
531
628
|
// src/utils/log.ts
|
|
532
629
|
var log = new Log({ id: "luma.gl" });
|
|
@@ -548,6 +645,8 @@ var __exports__ = (() => {
|
|
|
548
645
|
// ../../node_modules/@probe.gl/stats/dist/lib/stat.js
|
|
549
646
|
var Stat = class {
|
|
550
647
|
constructor(name2, type) {
|
|
648
|
+
this.name = void 0;
|
|
649
|
+
this.type = void 0;
|
|
551
650
|
this.sampleSize = 1;
|
|
552
651
|
this.time = 0;
|
|
553
652
|
this.count = 0;
|
|
@@ -582,31 +681,26 @@ var __exports__ = (() => {
|
|
|
582
681
|
this.sampleSize = samples;
|
|
583
682
|
return this;
|
|
584
683
|
}
|
|
585
|
-
/** Call to increment count (+1) */
|
|
586
684
|
incrementCount() {
|
|
587
685
|
this.addCount(1);
|
|
588
686
|
return this;
|
|
589
687
|
}
|
|
590
|
-
/** Call to decrement count (-1) */
|
|
591
688
|
decrementCount() {
|
|
592
689
|
this.subtractCount(1);
|
|
593
690
|
return this;
|
|
594
691
|
}
|
|
595
|
-
/** Increase count */
|
|
596
692
|
addCount(value) {
|
|
597
693
|
this._count += value;
|
|
598
694
|
this._samples++;
|
|
599
695
|
this._checkSampling();
|
|
600
696
|
return this;
|
|
601
697
|
}
|
|
602
|
-
/** Decrease count */
|
|
603
698
|
subtractCount(value) {
|
|
604
699
|
this._count -= value;
|
|
605
700
|
this._samples++;
|
|
606
701
|
this._checkSampling();
|
|
607
702
|
return this;
|
|
608
703
|
}
|
|
609
|
-
/** Add an arbitrary timing and bump the count */
|
|
610
704
|
addTime(time) {
|
|
611
705
|
this._time += time;
|
|
612
706
|
this.lastTiming = time;
|
|
@@ -614,13 +708,11 @@ var __exports__ = (() => {
|
|
|
614
708
|
this._checkSampling();
|
|
615
709
|
return this;
|
|
616
710
|
}
|
|
617
|
-
/** Start a timer */
|
|
618
711
|
timeStart() {
|
|
619
712
|
this._startTime = getHiResTimestamp2();
|
|
620
713
|
this._timerPending = true;
|
|
621
714
|
return this;
|
|
622
715
|
}
|
|
623
|
-
/** End a timer. Adds to time and bumps the timing count. */
|
|
624
716
|
timeEnd() {
|
|
625
717
|
if (!this._timerPending) {
|
|
626
718
|
return this;
|
|
@@ -633,22 +725,18 @@ var __exports__ = (() => {
|
|
|
633
725
|
getSampleAverageCount() {
|
|
634
726
|
return this.sampleSize > 0 ? this.lastSampleCount / this.sampleSize : 0;
|
|
635
727
|
}
|
|
636
|
-
/** Calculate average time / count for the previous window */
|
|
637
728
|
getSampleAverageTime() {
|
|
638
729
|
return this.sampleSize > 0 ? this.lastSampleTime / this.sampleSize : 0;
|
|
639
730
|
}
|
|
640
|
-
/** Calculate counts per second for the previous window */
|
|
641
731
|
getSampleHz() {
|
|
642
732
|
return this.lastSampleTime > 0 ? this.sampleSize / (this.lastSampleTime / 1e3) : 0;
|
|
643
733
|
}
|
|
644
734
|
getAverageCount() {
|
|
645
735
|
return this.samples > 0 ? this.count / this.samples : 0;
|
|
646
736
|
}
|
|
647
|
-
/** Calculate average time / count */
|
|
648
737
|
getAverageTime() {
|
|
649
738
|
return this.samples > 0 ? this.time / this.samples : 0;
|
|
650
739
|
}
|
|
651
|
-
/** Calculate counts per second */
|
|
652
740
|
getHz() {
|
|
653
741
|
return this.time > 0 ? this.samples / (this.time / 1e3) : 0;
|
|
654
742
|
}
|
|
@@ -669,20 +757,23 @@ var __exports__ = (() => {
|
|
|
669
757
|
// ../../node_modules/@probe.gl/stats/dist/lib/stats.js
|
|
670
758
|
var Stats = class {
|
|
671
759
|
constructor(options) {
|
|
760
|
+
this.id = void 0;
|
|
672
761
|
this.stats = {};
|
|
673
762
|
this.id = options.id;
|
|
674
763
|
this.stats = {};
|
|
675
764
|
this._initializeStats(options.stats);
|
|
676
765
|
Object.seal(this);
|
|
677
766
|
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
return this._getOrCreate({
|
|
767
|
+
get(name2) {
|
|
768
|
+
let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "count";
|
|
769
|
+
return this._getOrCreate({
|
|
770
|
+
name: name2,
|
|
771
|
+
type
|
|
772
|
+
});
|
|
681
773
|
}
|
|
682
774
|
get size() {
|
|
683
775
|
return Object.keys(this.stats).length;
|
|
684
776
|
}
|
|
685
|
-
/** Reset all stats */
|
|
686
777
|
reset() {
|
|
687
778
|
for (const stat of Object.values(this.stats)) {
|
|
688
779
|
stat.reset();
|
|
@@ -706,11 +797,15 @@ var __exports__ = (() => {
|
|
|
706
797
|
});
|
|
707
798
|
return table;
|
|
708
799
|
}
|
|
709
|
-
_initializeStats(
|
|
800
|
+
_initializeStats() {
|
|
801
|
+
let stats = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
710
802
|
stats.forEach((stat) => this._getOrCreate(stat));
|
|
711
803
|
}
|
|
712
804
|
_getOrCreate(stat) {
|
|
713
|
-
const {
|
|
805
|
+
const {
|
|
806
|
+
name: name2,
|
|
807
|
+
type
|
|
808
|
+
} = stat;
|
|
714
809
|
let result = this.stats[name2];
|
|
715
810
|
if (!result) {
|
|
716
811
|
if (stat instanceof Stat) {
|
|
@@ -1357,6 +1452,21 @@ var __exports__ = (() => {
|
|
|
1357
1452
|
"No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported."
|
|
1358
1453
|
);
|
|
1359
1454
|
}
|
|
1455
|
+
static enforceWebGL2(enforce = true) {
|
|
1456
|
+
const prototype = HTMLCanvasElement.prototype;
|
|
1457
|
+
if (!enforce && prototype.originalGetContext) {
|
|
1458
|
+
prototype.getContext = prototype.originalGetContext;
|
|
1459
|
+
prototype.originalGetContext = void 0;
|
|
1460
|
+
return;
|
|
1461
|
+
}
|
|
1462
|
+
prototype.originalGetContext = prototype.getContext;
|
|
1463
|
+
prototype.getContext = function(contextId, options) {
|
|
1464
|
+
if (contextId === "webgl" || contextId === "experimental-webgl") {
|
|
1465
|
+
return this.originalGetContext("webgl2", options);
|
|
1466
|
+
}
|
|
1467
|
+
return this.originalGetContext(contextId, options);
|
|
1468
|
+
};
|
|
1469
|
+
}
|
|
1360
1470
|
};
|
|
1361
1471
|
__publicField(luma, "defaultProps", {
|
|
1362
1472
|
...Device.defaultProps,
|
|
@@ -2122,8 +2232,9 @@ ${htmlLog}
|
|
|
2122
2232
|
bufferLayout: [],
|
|
2123
2233
|
topology: "triangle-list",
|
|
2124
2234
|
parameters: {},
|
|
2125
|
-
|
|
2126
|
-
instanceCount: 0,
|
|
2235
|
+
// isInstanced: false,
|
|
2236
|
+
// instanceCount: 0,
|
|
2237
|
+
// vertexCount: 0,
|
|
2127
2238
|
bindings: {},
|
|
2128
2239
|
uniforms: {}
|
|
2129
2240
|
});
|