@luma.gl/core 9.1.1 → 9.1.2
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/device.d.ts +6 -0
- package/dist/adapter/device.d.ts.map +1 -1
- package/dist/adapter/device.js +9 -0
- package/dist/adapter/device.js.map +1 -1
- package/dist/adapter/luma.js +1 -1
- package/dist/dist.dev.js +9 -0
- package/dist/dist.min.js +2 -2
- package/dist/index.cjs +10 -1
- package/dist/index.cjs.map +2 -2
- package/package.json +2 -2
- package/src/adapter/device.ts +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/core",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.2",
|
|
4
4
|
"description": "The luma.gl core Device API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"@probe.gl/stats": "^4.0.8",
|
|
47
47
|
"@types/offscreencanvas": "^2019.6.4"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "d6198ca8e2adf62d6bdd08ac2556ccc39069a973"
|
|
50
50
|
}
|
package/src/adapter/device.ts
CHANGED
|
@@ -242,6 +242,8 @@ export type DeviceProps = {
|
|
|
242
242
|
|
|
243
243
|
// EXPERIMENTAL SETTINGS - subject to change
|
|
244
244
|
|
|
245
|
+
/** adapter.create() returns the existing Device if the provided canvas' WebGL context is already associated with a Device. */
|
|
246
|
+
_reuseDevices?: boolean;
|
|
245
247
|
/** WebGPU specific - Request a Device with the highest limits supported by platform. On WebGPU devices can be created with minimal limits. */
|
|
246
248
|
_requestMaxLimits?: boolean;
|
|
247
249
|
/** Disable specific features */
|
|
@@ -297,6 +299,8 @@ export abstract class Device {
|
|
|
297
299
|
// Callbacks
|
|
298
300
|
onError: (error: Error) => log.error(error.message)(),
|
|
299
301
|
|
|
302
|
+
// Experimental
|
|
303
|
+
_reuseDevices: false,
|
|
300
304
|
_requestMaxLimits: true,
|
|
301
305
|
_factoryDestroyPolicy: 'unused',
|
|
302
306
|
// TODO - Change these after confirming things work as expected
|
|
@@ -342,6 +346,8 @@ export abstract class Device {
|
|
|
342
346
|
/** An abstract timestamp used for change tracking */
|
|
343
347
|
timestamp: number = 0;
|
|
344
348
|
|
|
349
|
+
/** True if this device has been reused during device creation (app has multiple references) */
|
|
350
|
+
_reused: boolean = false;
|
|
345
351
|
/** Used by other luma.gl modules to store data on the device */
|
|
346
352
|
_lumaData: {[key: string]: unknown} = {};
|
|
347
353
|
|
|
@@ -573,6 +579,11 @@ export abstract class Device {
|
|
|
573
579
|
|
|
574
580
|
// IMPLEMENTATION
|
|
575
581
|
|
|
582
|
+
/** Helper to get the canvas context props */
|
|
583
|
+
static _getCanvasContextProps(props: DeviceProps): CanvasContextProps | undefined {
|
|
584
|
+
return props.createCanvasContext === true ? {} : props.createCanvasContext;
|
|
585
|
+
}
|
|
586
|
+
|
|
576
587
|
/**
|
|
577
588
|
* Determines what operations are supported on a texture format, checking against supported device features
|
|
578
589
|
* Subclasses override to apply additional checks
|