@deck.gl/core 9.2.0-beta.3 → 9.2.0
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/dist.dev.js +11 -8
- package/dist/index.cjs +7 -6
- package/dist/index.cjs.map +2 -2
- package/dist/lib/attribute/attribute-manager.js +2 -2
- package/dist/lib/attribute/attribute-manager.js.map +1 -1
- package/dist/lib/attribute/attribute.d.ts +1 -1
- package/dist/lib/attribute/attribute.d.ts.map +1 -1
- package/dist/lib/attribute/attribute.js +3 -2
- package/dist/lib/attribute/attribute.js.map +1 -1
- package/dist/lib/deck.js +1 -1
- package/dist/lib/deck.js.map +1 -1
- package/dist/lib/init.js +2 -2
- package/dist/lib/init.js.map +1 -1
- package/dist.min.js +5 -5
- package/package.json +7 -7
- package/src/lib/attribute/attribute-manager.ts +2 -2
- package/src/lib/attribute/attribute.ts +4 -2
- package/src/lib/deck.ts +1 -1
package/dist/dist.dev.js
CHANGED
|
@@ -1887,7 +1887,7 @@ or create a device with the 'debug: true' prop.`;
|
|
|
1887
1887
|
VERSION = (
|
|
1888
1888
|
// Version detection using build plugin
|
|
1889
1889
|
// @ts-expect-error no-undef
|
|
1890
|
-
true ? "9.2.
|
|
1890
|
+
true ? "9.2.2" : "running from source"
|
|
1891
1891
|
);
|
|
1892
1892
|
spector;
|
|
1893
1893
|
preregisteredAdapters = /* @__PURE__ */ new Map();
|
|
@@ -9583,7 +9583,7 @@ ${source3}`;
|
|
|
9583
9583
|
* @param gl
|
|
9584
9584
|
* @returns
|
|
9585
9585
|
*/
|
|
9586
|
-
async attach(gl) {
|
|
9586
|
+
async attach(gl, props = {}) {
|
|
9587
9587
|
const { WebGLDevice: WebGLDevice2 } = await Promise.resolve().then(() => (init_webgl_device(), webgl_device_exports));
|
|
9588
9588
|
if (gl instanceof WebGLDevice2) {
|
|
9589
9589
|
return gl;
|
|
@@ -9594,9 +9594,11 @@ ${source3}`;
|
|
|
9594
9594
|
if (!isWebGL(gl)) {
|
|
9595
9595
|
throw new Error("Invalid WebGL2RenderingContext");
|
|
9596
9596
|
}
|
|
9597
|
+
const createCanvasContext = props.createCanvasContext === true ? {} : props.createCanvasContext;
|
|
9597
9598
|
return new WebGLDevice2({
|
|
9599
|
+
...props,
|
|
9598
9600
|
_handle: gl,
|
|
9599
|
-
createCanvasContext: { canvas: gl.canvas, autoResize: false }
|
|
9601
|
+
createCanvasContext: { canvas: gl.canvas, autoResize: false, ...createCanvasContext }
|
|
9600
9602
|
});
|
|
9601
9603
|
}
|
|
9602
9604
|
async create(props = {}) {
|
|
@@ -36492,7 +36494,7 @@ void main() {
|
|
|
36492
36494
|
if (props.gl instanceof WebGLRenderingContext) {
|
|
36493
36495
|
log_default.error("WebGL1 context not supported.")();
|
|
36494
36496
|
}
|
|
36495
|
-
deviceOrPromise = webgl2Adapter.attach(props.gl);
|
|
36497
|
+
deviceOrPromise = webgl2Adapter.attach(props.gl, this.props.deviceProps);
|
|
36496
36498
|
}
|
|
36497
36499
|
if (!deviceOrPromise) {
|
|
36498
36500
|
deviceOrPromise = this._createDevice(props);
|
|
@@ -37758,7 +37760,7 @@ void main() {
|
|
|
37758
37760
|
}
|
|
37759
37761
|
// Use generic value
|
|
37760
37762
|
// Returns true if successful
|
|
37761
|
-
setConstantValue(value) {
|
|
37763
|
+
setConstantValue(context, value) {
|
|
37762
37764
|
const isWebGPU = this.device.type === "webgpu";
|
|
37763
37765
|
if (isWebGPU || value === void 0 || typeof value === "function") {
|
|
37764
37766
|
if (isWebGPU && typeof value !== "function") {
|
|
@@ -37769,7 +37771,8 @@ void main() {
|
|
|
37769
37771
|
}
|
|
37770
37772
|
return false;
|
|
37771
37773
|
}
|
|
37772
|
-
const
|
|
37774
|
+
const transformedValue = this.settings.transform && context ? this.settings.transform.call(context, value) : value;
|
|
37775
|
+
const hasChanged = this.setData({ constant: true, value: transformedValue });
|
|
37773
37776
|
if (hasChanged) {
|
|
37774
37777
|
this.setNeedsRedraw();
|
|
37775
37778
|
}
|
|
@@ -38798,7 +38801,7 @@ void main(void) {
|
|
|
38798
38801
|
typeof accessorName === "string" ? buffers[accessorName] : void 0,
|
|
38799
38802
|
data.startIndices
|
|
38800
38803
|
)) {
|
|
38801
|
-
} else if (typeof accessorName === "string" && !buffers[accessorName] && attribute.setConstantValue(props[accessorName])) {
|
|
38804
|
+
} else if (typeof accessorName === "string" && !buffers[accessorName] && attribute.setConstantValue(context, props[accessorName])) {
|
|
38802
38805
|
} else if (attribute.needsUpdate()) {
|
|
38803
38806
|
updated = true;
|
|
38804
38807
|
this._updateAttribute({
|
|
@@ -38914,7 +38917,7 @@ void main(void) {
|
|
|
38914
38917
|
const { attribute, numInstances } = opts;
|
|
38915
38918
|
debug(TRACE_ATTRIBUTE_UPDATE_START, attribute);
|
|
38916
38919
|
if (attribute.constant) {
|
|
38917
|
-
attribute.setConstantValue(attribute.value);
|
|
38920
|
+
attribute.setConstantValue(opts.context, attribute.value);
|
|
38918
38921
|
return;
|
|
38919
38922
|
}
|
|
38920
38923
|
if (attribute.allocate(numInstances)) {
|
package/dist/index.cjs
CHANGED
|
@@ -232,7 +232,7 @@ var json_loader_default = {
|
|
|
232
232
|
|
|
233
233
|
// dist/lib/init.js
|
|
234
234
|
function checkVersion() {
|
|
235
|
-
const version = true ? "9.2.0
|
|
235
|
+
const version = true ? "9.2.0" : globalThis.DECK_VERSION || "untranspiled source";
|
|
236
236
|
const existingVersion = globalThis.deck && globalThis.deck.VERSION;
|
|
237
237
|
if (existingVersion && existingVersion !== version) {
|
|
238
238
|
throw new Error(`deck.gl - multiple versions detected: ${existingVersion} vs ${version}`);
|
|
@@ -6906,7 +6906,7 @@ var Deck = class {
|
|
|
6906
6906
|
if (props.gl instanceof WebGLRenderingContext) {
|
|
6907
6907
|
log_default.error("WebGL1 context not supported.")();
|
|
6908
6908
|
}
|
|
6909
|
-
deviceOrPromise = import_webgl.webgl2Adapter.attach(props.gl);
|
|
6909
|
+
deviceOrPromise = import_webgl.webgl2Adapter.attach(props.gl, this.props.deviceProps);
|
|
6910
6910
|
}
|
|
6911
6911
|
if (!deviceOrPromise) {
|
|
6912
6912
|
deviceOrPromise = this._createDevice(props);
|
|
@@ -8146,7 +8146,7 @@ var Attribute = class extends DataColumn {
|
|
|
8146
8146
|
}
|
|
8147
8147
|
// Use generic value
|
|
8148
8148
|
// Returns true if successful
|
|
8149
|
-
setConstantValue(value) {
|
|
8149
|
+
setConstantValue(context, value) {
|
|
8150
8150
|
const isWebGPU = this.device.type === "webgpu";
|
|
8151
8151
|
if (isWebGPU || value === void 0 || typeof value === "function") {
|
|
8152
8152
|
if (isWebGPU && typeof value !== "function") {
|
|
@@ -8157,7 +8157,8 @@ var Attribute = class extends DataColumn {
|
|
|
8157
8157
|
}
|
|
8158
8158
|
return false;
|
|
8159
8159
|
}
|
|
8160
|
-
const
|
|
8160
|
+
const transformedValue = this.settings.transform && context ? this.settings.transform.call(context, value) : value;
|
|
8161
|
+
const hasChanged = this.setData({ constant: true, value: transformedValue });
|
|
8161
8162
|
if (hasChanged) {
|
|
8162
8163
|
this.setNeedsRedraw();
|
|
8163
8164
|
}
|
|
@@ -9117,7 +9118,7 @@ var AttributeManager = class {
|
|
|
9117
9118
|
}
|
|
9118
9119
|
if (attribute.setExternalBuffer(buffers[attributeName])) {
|
|
9119
9120
|
} else if (attribute.setBinaryValue(typeof accessorName === "string" ? buffers[accessorName] : void 0, data.startIndices)) {
|
|
9120
|
-
} else if (typeof accessorName === "string" && !buffers[accessorName] && attribute.setConstantValue(props[accessorName])) {
|
|
9121
|
+
} else if (typeof accessorName === "string" && !buffers[accessorName] && attribute.setConstantValue(context, props[accessorName])) {
|
|
9121
9122
|
} else if (attribute.needsUpdate()) {
|
|
9122
9123
|
updated = true;
|
|
9123
9124
|
this._updateAttribute({
|
|
@@ -9234,7 +9235,7 @@ var AttributeManager = class {
|
|
|
9234
9235
|
const { attribute, numInstances } = opts;
|
|
9235
9236
|
debug(TRACE_ATTRIBUTE_UPDATE_START, attribute);
|
|
9236
9237
|
if (attribute.constant) {
|
|
9237
|
-
attribute.setConstantValue(attribute.value);
|
|
9238
|
+
attribute.setConstantValue(opts.context, attribute.value);
|
|
9238
9239
|
return;
|
|
9239
9240
|
}
|
|
9240
9241
|
if (attribute.allocate(numInstances)) {
|