@deck.gl/google-maps 9.3.0-alpha.2 → 9.3.0-alpha.5
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 +245 -171
- package/dist/google-maps-overlay.js +1 -1
- package/dist/google-maps-overlay.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist.min.js +2 -2
- package/package.json +6 -8
- package/src/google-maps-overlay.ts +1 -1
package/dist/dist.dev.js
CHANGED
|
@@ -48,10 +48,10 @@ var __exports__ = (() => {
|
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
// ../../node_modules/@luma.gl/
|
|
51
|
+
// ../../node_modules/@luma.gl/webgl/dist/constants/webgl-constants.js
|
|
52
52
|
var GLEnum;
|
|
53
53
|
var init_webgl_constants = __esm({
|
|
54
|
-
"../../node_modules/@luma.gl/
|
|
54
|
+
"../../node_modules/@luma.gl/webgl/dist/constants/webgl-constants.js"() {
|
|
55
55
|
(function(GLEnum2) {
|
|
56
56
|
GLEnum2[GLEnum2["DEPTH_BUFFER_BIT"] = 256] = "DEPTH_BUFFER_BIT";
|
|
57
57
|
GLEnum2[GLEnum2["STENCIL_BUFFER_BIT"] = 1024] = "STENCIL_BUFFER_BIT";
|
|
@@ -703,9 +703,9 @@ var __exports__ = (() => {
|
|
|
703
703
|
}
|
|
704
704
|
});
|
|
705
705
|
|
|
706
|
-
// ../../node_modules/@luma.gl/
|
|
707
|
-
var
|
|
708
|
-
"../../node_modules/@luma.gl/
|
|
706
|
+
// ../../node_modules/@luma.gl/webgl/dist/constants/index.js
|
|
707
|
+
var init_constants = __esm({
|
|
708
|
+
"../../node_modules/@luma.gl/webgl/dist/constants/index.js"() {
|
|
709
709
|
init_webgl_constants();
|
|
710
710
|
}
|
|
711
711
|
});
|
|
@@ -868,7 +868,7 @@ var __exports__ = (() => {
|
|
|
868
868
|
});
|
|
869
869
|
|
|
870
870
|
// ../../node_modules/@probe.gl/env/dist/index.js
|
|
871
|
-
var
|
|
871
|
+
var init_dist = __esm({
|
|
872
872
|
"../../node_modules/@probe.gl/env/dist/index.js"() {
|
|
873
873
|
init_get_browser();
|
|
874
874
|
}
|
|
@@ -945,7 +945,7 @@ var __exports__ = (() => {
|
|
|
945
945
|
var init_webgl_developer_tools = __esm({
|
|
946
946
|
"../../node_modules/@luma.gl/webgl/dist/context/debug/webgl-developer-tools.js"() {
|
|
947
947
|
import_core3 = __toESM(require_core2(), 1);
|
|
948
|
-
|
|
948
|
+
init_constants();
|
|
949
949
|
}
|
|
950
950
|
});
|
|
951
951
|
|
|
@@ -2470,6 +2470,15 @@ var __exports__ = (() => {
|
|
|
2470
2470
|
}
|
|
2471
2471
|
gl.bindTexture(texture.glTarget, null);
|
|
2472
2472
|
}
|
|
2473
|
+
/** Default framebuffer resize is managed by canvas size and should be a no-op. */
|
|
2474
|
+
resizeAttachments(width, height) {
|
|
2475
|
+
if (this.handle === null) {
|
|
2476
|
+
this.width = width;
|
|
2477
|
+
this.height = height;
|
|
2478
|
+
return;
|
|
2479
|
+
}
|
|
2480
|
+
super.resizeAttachments(width, height);
|
|
2481
|
+
}
|
|
2473
2482
|
};
|
|
2474
2483
|
}
|
|
2475
2484
|
});
|
|
@@ -2822,7 +2831,12 @@ var __exports__ = (() => {
|
|
|
2822
2831
|
throw new Error(this.props.stage);
|
|
2823
2832
|
}
|
|
2824
2833
|
device._setWebGLDebugMetadata(this.handle, this, { spector: this.props });
|
|
2825
|
-
this._compile(this.source);
|
|
2834
|
+
const compilationStatus = this._compile(this.source);
|
|
2835
|
+
if (compilationStatus && typeof compilationStatus.catch === "function") {
|
|
2836
|
+
compilationStatus.catch(() => {
|
|
2837
|
+
this.compilationStatus = "error";
|
|
2838
|
+
});
|
|
2839
|
+
}
|
|
2826
2840
|
}
|
|
2827
2841
|
destroy() {
|
|
2828
2842
|
if (this.handle) {
|
|
@@ -2853,7 +2867,7 @@ var __exports__ = (() => {
|
|
|
2853
2867
|
}
|
|
2854
2868
|
// PRIVATE METHODS
|
|
2855
2869
|
/** Compile a shader and get compilation status */
|
|
2856
|
-
|
|
2870
|
+
_compile(source) {
|
|
2857
2871
|
source = source.startsWith("#version ") ? source : `#version 300 es
|
|
2858
2872
|
${source}`;
|
|
2859
2873
|
const { gl } = this.device;
|
|
@@ -2872,10 +2886,11 @@ ${source}`;
|
|
|
2872
2886
|
return;
|
|
2873
2887
|
}
|
|
2874
2888
|
import_core11.log.once(1, "Shader compilation is asynchronous")();
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2889
|
+
return this._waitForCompilationComplete().then(() => {
|
|
2890
|
+
import_core11.log.info(2, `Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)();
|
|
2891
|
+
this._getCompilationStatus();
|
|
2892
|
+
this.debugShader();
|
|
2893
|
+
});
|
|
2879
2894
|
}
|
|
2880
2895
|
/** Use KHR_parallel_shader_compile extension if available */
|
|
2881
2896
|
async _waitForCompilationComplete() {
|
|
@@ -3015,6 +3030,9 @@ ${source}`;
|
|
|
3015
3030
|
parameters.depthCompare !== "always" ? gl.enable(2929) : gl.disable(2929);
|
|
3016
3031
|
gl.depthFunc(convertCompareFunction("depthCompare", parameters.depthCompare));
|
|
3017
3032
|
}
|
|
3033
|
+
if (parameters.clearDepth !== void 0) {
|
|
3034
|
+
gl.clearDepth(parameters.clearDepth);
|
|
3035
|
+
}
|
|
3018
3036
|
if (parameters.stencilWriteMask) {
|
|
3019
3037
|
const mask = parameters.stencilWriteMask;
|
|
3020
3038
|
gl.stencilMaskSeparate(1028, mask);
|
|
@@ -3388,7 +3406,7 @@ ${source}`;
|
|
|
3388
3406
|
function getWebGLCubeFaceTarget(glTarget, dimension, level) {
|
|
3389
3407
|
return dimension === "cube" ? 34069 + level : glTarget;
|
|
3390
3408
|
}
|
|
3391
|
-
var import_core15,
|
|
3409
|
+
var import_core15, WEBGLTexture;
|
|
3392
3410
|
var init_webgl_texture = __esm({
|
|
3393
3411
|
"../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-texture.js"() {
|
|
3394
3412
|
import_core15 = __toESM(require_core2(), 1);
|
|
@@ -3397,7 +3415,6 @@ ${source}`;
|
|
|
3397
3415
|
init_with_parameters();
|
|
3398
3416
|
init_webgl_texture_view();
|
|
3399
3417
|
init_shader_formats();
|
|
3400
|
-
import_core16 = __toESM(require_core2(), 1);
|
|
3401
3418
|
WEBGLTexture = class extends import_core15.Texture {
|
|
3402
3419
|
// readonly MAX_ATTRIBUTES: number;
|
|
3403
3420
|
device;
|
|
@@ -3529,31 +3546,28 @@ ${source}`;
|
|
|
3529
3546
|
* before any WebGL calls are issued.
|
|
3530
3547
|
*/
|
|
3531
3548
|
readBuffer(options = {}, buffer) {
|
|
3549
|
+
if (!buffer) {
|
|
3550
|
+
throw new Error(`${this} readBuffer requires a destination buffer`);
|
|
3551
|
+
}
|
|
3532
3552
|
const normalizedOptions = this._getSupportedColorReadOptions(options);
|
|
3553
|
+
const byteOffset = options.byteOffset ?? 0;
|
|
3533
3554
|
const memoryLayout = this.computeMemoryLayout(normalizedOptions);
|
|
3534
|
-
|
|
3535
|
-
byteLength
|
|
3536
|
-
usage: import_core15.Buffer.COPY_DST | import_core15.Buffer.MAP_READ
|
|
3537
|
-
});
|
|
3538
|
-
if (readBuffer.byteLength < memoryLayout.byteLength) {
|
|
3539
|
-
throw new Error(`${this} readBuffer target is too small (${readBuffer.byteLength} < ${memoryLayout.byteLength})`);
|
|
3555
|
+
if (buffer.byteLength < byteOffset + memoryLayout.byteLength) {
|
|
3556
|
+
throw new Error(`${this} readBuffer target is too small (${buffer.byteLength} < ${byteOffset + memoryLayout.byteLength})`);
|
|
3540
3557
|
}
|
|
3541
|
-
const webglBuffer =
|
|
3558
|
+
const webglBuffer = buffer;
|
|
3542
3559
|
this.gl.bindBuffer(35051, webglBuffer.handle);
|
|
3543
3560
|
try {
|
|
3544
3561
|
this._readColorTextureLayers(normalizedOptions, memoryLayout, (destinationByteOffset) => {
|
|
3545
|
-
this.gl.readPixels(normalizedOptions.x, normalizedOptions.y, normalizedOptions.width, normalizedOptions.height, this.glFormat, this.glType, destinationByteOffset);
|
|
3562
|
+
this.gl.readPixels(normalizedOptions.x, normalizedOptions.y, normalizedOptions.width, normalizedOptions.height, this.glFormat, this.glType, byteOffset + destinationByteOffset);
|
|
3546
3563
|
});
|
|
3547
3564
|
} finally {
|
|
3548
3565
|
this.gl.bindBuffer(35051, null);
|
|
3549
3566
|
}
|
|
3550
|
-
return
|
|
3567
|
+
return buffer;
|
|
3551
3568
|
}
|
|
3552
3569
|
async readDataAsync(options = {}) {
|
|
3553
|
-
|
|
3554
|
-
const data = await buffer.readAsync();
|
|
3555
|
-
buffer.destroy();
|
|
3556
|
-
return data.buffer;
|
|
3570
|
+
throw new Error(`${this} readDataAsync is deprecated; use readBuffer() with an explicit destination buffer or DynamicTexture.readAsync()`);
|
|
3557
3571
|
}
|
|
3558
3572
|
writeBuffer(buffer, options_ = {}) {
|
|
3559
3573
|
const options = this._normalizeTextureWriteOptions(options_);
|
|
@@ -3666,7 +3680,7 @@ ${source}`;
|
|
|
3666
3680
|
const options = this._getSupportedColorReadOptions(options_);
|
|
3667
3681
|
const memoryLayout = this.computeMemoryLayout(options);
|
|
3668
3682
|
const shaderType = convertGLDataTypeToDataType(this.glType);
|
|
3669
|
-
const ArrayType = (0,
|
|
3683
|
+
const ArrayType = (0, import_core15.getTypedArrayConstructor)(shaderType);
|
|
3670
3684
|
const targetArray = new ArrayType(memoryLayout.byteLength / ArrayType.BYTES_PER_ELEMENT);
|
|
3671
3685
|
this._readColorTextureLayers(options, memoryLayout, (destinationByteOffset) => {
|
|
3672
3686
|
const layerView = new ArrayType(targetArray.buffer, targetArray.byteOffset + destinationByteOffset, memoryLayout.bytesPerImage / ArrayType.BYTES_PER_ELEMENT);
|
|
@@ -3945,23 +3959,38 @@ ${source}`;
|
|
|
3945
3959
|
function mergeShaderLayout(baseLayout, overrideLayout) {
|
|
3946
3960
|
const mergedLayout = {
|
|
3947
3961
|
...baseLayout,
|
|
3948
|
-
attributes: baseLayout.attributes.map((attribute) => ({ ...attribute }))
|
|
3962
|
+
attributes: baseLayout.attributes.map((attribute) => ({ ...attribute })),
|
|
3963
|
+
bindings: baseLayout.bindings.map((binding) => ({ ...binding }))
|
|
3949
3964
|
};
|
|
3950
3965
|
for (const attribute of overrideLayout?.attributes || []) {
|
|
3951
3966
|
const baseAttribute = mergedLayout.attributes.find((attr) => attr.name === attribute.name);
|
|
3952
3967
|
if (!baseAttribute) {
|
|
3953
|
-
|
|
3968
|
+
import_core16.log.warn(`shader layout attribute ${attribute.name} not present in shader`);
|
|
3954
3969
|
} else {
|
|
3955
3970
|
baseAttribute.type = attribute.type || baseAttribute.type;
|
|
3956
3971
|
baseAttribute.stepMode = attribute.stepMode || baseAttribute.stepMode;
|
|
3957
3972
|
}
|
|
3958
3973
|
}
|
|
3974
|
+
for (const binding of overrideLayout?.bindings || []) {
|
|
3975
|
+
const baseBinding = getShaderLayoutBindingByName(mergedLayout, binding.name);
|
|
3976
|
+
if (!baseBinding) {
|
|
3977
|
+
import_core16.log.warn(`shader layout binding ${binding.name} not present in shader`);
|
|
3978
|
+
continue;
|
|
3979
|
+
}
|
|
3980
|
+
Object.assign(baseBinding, binding);
|
|
3981
|
+
}
|
|
3959
3982
|
return mergedLayout;
|
|
3960
3983
|
}
|
|
3961
|
-
|
|
3984
|
+
function getShaderLayoutBindingByName(shaderLayout, bindingName) {
|
|
3985
|
+
return shaderLayout.bindings.find((binding) => binding.name === bindingName || binding.name === `${bindingName}Uniforms` || `${binding.name}Uniforms` === bindingName);
|
|
3986
|
+
}
|
|
3987
|
+
function getBindingValueForLayoutBinding(bindings, bindingName) {
|
|
3988
|
+
return bindings[bindingName] || bindings[`${bindingName}Uniforms`] || bindings[bindingName.replace(/Uniforms$/, "")];
|
|
3989
|
+
}
|
|
3990
|
+
var import_core16, WEBGLRenderPipeline;
|
|
3962
3991
|
var init_webgl_render_pipeline = __esm({
|
|
3963
3992
|
"../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-render-pipeline.js"() {
|
|
3964
|
-
|
|
3993
|
+
import_core16 = __toESM(require_core2(), 1);
|
|
3965
3994
|
init_device_parameters();
|
|
3966
3995
|
init_set_uniform();
|
|
3967
3996
|
init_webgl_buffer();
|
|
@@ -3969,7 +3998,7 @@ ${source}`;
|
|
|
3969
3998
|
init_webgl_texture();
|
|
3970
3999
|
init_webgl_texture_view();
|
|
3971
4000
|
init_webgl_topology_utils();
|
|
3972
|
-
WEBGLRenderPipeline = class extends
|
|
4001
|
+
WEBGLRenderPipeline = class extends import_core16.RenderPipeline {
|
|
3973
4002
|
/** The WebGL device that created this render pipeline */
|
|
3974
4003
|
device;
|
|
3975
4004
|
/** Handle to underlying WebGL program */
|
|
@@ -4019,17 +4048,18 @@ ${source}`;
|
|
|
4019
4048
|
* Shared-model draws pass bindings per draw and do not rely on this state.
|
|
4020
4049
|
*/
|
|
4021
4050
|
setBindings(bindings, options) {
|
|
4022
|
-
|
|
4023
|
-
|
|
4051
|
+
const flatBindings = (0, import_core16.flattenBindingsByGroup)((0, import_core16.normalizeBindingsByGroup)(this.shaderLayout, bindings));
|
|
4052
|
+
for (const [name, value] of Object.entries(flatBindings)) {
|
|
4053
|
+
const binding = getShaderLayoutBindingByName(this.shaderLayout, name);
|
|
4024
4054
|
if (!binding) {
|
|
4025
4055
|
const validBindings = this.shaderLayout.bindings.map((binding_) => `"${binding_.name}"`).join(", ");
|
|
4026
4056
|
if (!options?.disableWarnings) {
|
|
4027
|
-
|
|
4057
|
+
import_core16.log.warn(`No binding "${name}" in render pipeline "${this.id}", expected one of ${validBindings}`, value)();
|
|
4028
4058
|
}
|
|
4029
4059
|
continue;
|
|
4030
4060
|
}
|
|
4031
4061
|
if (!value) {
|
|
4032
|
-
|
|
4062
|
+
import_core16.log.warn(`Unsetting binding "${name}" in render pipeline "${this.id}"`)();
|
|
4033
4063
|
}
|
|
4034
4064
|
switch (binding.type) {
|
|
4035
4065
|
case "uniform":
|
|
@@ -4043,7 +4073,7 @@ ${source}`;
|
|
|
4043
4073
|
}
|
|
4044
4074
|
break;
|
|
4045
4075
|
case "sampler":
|
|
4046
|
-
|
|
4076
|
+
import_core16.log.warn(`Ignoring sampler ${name}`)();
|
|
4047
4077
|
break;
|
|
4048
4078
|
default:
|
|
4049
4079
|
throw new Error(binding.type);
|
|
@@ -4057,6 +4087,7 @@ ${source}`;
|
|
|
4057
4087
|
*/
|
|
4058
4088
|
draw(options) {
|
|
4059
4089
|
this._syncLinkStatus();
|
|
4090
|
+
const drawBindings = options.bindGroups ? (0, import_core16.flattenBindingsByGroup)(options.bindGroups) : options.bindings || this.bindings;
|
|
4060
4091
|
const {
|
|
4061
4092
|
renderPass,
|
|
4062
4093
|
parameters = this.props.parameters,
|
|
@@ -4071,18 +4102,17 @@ ${source}`;
|
|
|
4071
4102
|
// firstInstance,
|
|
4072
4103
|
// baseVertex,
|
|
4073
4104
|
transformFeedback,
|
|
4074
|
-
bindings = this.bindings,
|
|
4075
4105
|
uniforms = this.uniforms
|
|
4076
4106
|
} = options;
|
|
4077
4107
|
const glDrawMode = getGLDrawMode(topology);
|
|
4078
4108
|
const isIndexed = Boolean(vertexArray.indexBuffer);
|
|
4079
4109
|
const glIndexType = vertexArray.indexBuffer?.glIndexType;
|
|
4080
4110
|
if (this.linkStatus !== "success") {
|
|
4081
|
-
|
|
4111
|
+
import_core16.log.info(2, `RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)();
|
|
4082
4112
|
return false;
|
|
4083
4113
|
}
|
|
4084
|
-
if (!this._areTexturesRenderable(
|
|
4085
|
-
|
|
4114
|
+
if (!this._areTexturesRenderable(drawBindings)) {
|
|
4115
|
+
import_core16.log.info(2, `RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)();
|
|
4086
4116
|
return false;
|
|
4087
4117
|
}
|
|
4088
4118
|
this.device.gl.useProgram(this.handle);
|
|
@@ -4090,7 +4120,7 @@ ${source}`;
|
|
|
4090
4120
|
if (transformFeedback) {
|
|
4091
4121
|
transformFeedback.begin(this.props.topology);
|
|
4092
4122
|
}
|
|
4093
|
-
this._applyBindings(
|
|
4123
|
+
this._applyBindings(drawBindings, { disableWarnings: this.props.disableWarnings });
|
|
4094
4124
|
this._applyUniforms(uniforms);
|
|
4095
4125
|
const webglRenderPass = renderPass;
|
|
4096
4126
|
withDeviceAndGLParameters(this.device, parameters, webglRenderPass.glParameters, () => {
|
|
@@ -4125,8 +4155,8 @@ ${source}`;
|
|
|
4125
4155
|
_areTexturesRenderable(bindings) {
|
|
4126
4156
|
let texturesRenderable = true;
|
|
4127
4157
|
for (const bindingInfo of this.shaderLayout.bindings) {
|
|
4128
|
-
if (!bindings
|
|
4129
|
-
|
|
4158
|
+
if (!getBindingValueForLayoutBinding(bindings, bindingInfo.name)) {
|
|
4159
|
+
import_core16.log.warn(`Binding ${bindingInfo.name} not found in ${this.id}`)();
|
|
4130
4160
|
texturesRenderable = false;
|
|
4131
4161
|
}
|
|
4132
4162
|
}
|
|
@@ -4143,7 +4173,7 @@ ${source}`;
|
|
|
4143
4173
|
let textureUnit = 0;
|
|
4144
4174
|
let uniformBufferIndex = 0;
|
|
4145
4175
|
for (const binding of this.shaderLayout.bindings) {
|
|
4146
|
-
const value = bindings
|
|
4176
|
+
const value = getBindingValueForLayoutBinding(bindings, binding.name);
|
|
4147
4177
|
if (!value) {
|
|
4148
4178
|
throw new Error(`No value for binding ${binding.name} in ${this.id}`);
|
|
4149
4179
|
}
|
|
@@ -4158,16 +4188,8 @@ ${source}`;
|
|
|
4158
4188
|
if (value instanceof WEBGLBuffer) {
|
|
4159
4189
|
gl.bindBufferBase(35345, uniformBufferIndex, value.handle);
|
|
4160
4190
|
} else {
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
uniformBufferIndex,
|
|
4164
|
-
// @ts-expect-error
|
|
4165
|
-
value.buffer.handle,
|
|
4166
|
-
// @ts-expect-error
|
|
4167
|
-
value.offset || 0,
|
|
4168
|
-
// @ts-expect-error
|
|
4169
|
-
value.size || value.buffer.byteLength - value.offset
|
|
4170
|
-
);
|
|
4191
|
+
const bufferBinding = value;
|
|
4192
|
+
gl.bindBufferRange(35345, uniformBufferIndex, bufferBinding.buffer.handle, bufferBinding.offset || 0, bufferBinding.size || bufferBinding.buffer.byteLength - (bufferBinding.offset || 0));
|
|
4171
4193
|
}
|
|
4172
4194
|
uniformBufferIndex += 1;
|
|
4173
4195
|
break;
|
|
@@ -4181,7 +4203,7 @@ ${source}`;
|
|
|
4181
4203
|
} else if (value instanceof WEBGLTexture) {
|
|
4182
4204
|
texture = value;
|
|
4183
4205
|
} else if (value instanceof WEBGLFramebuffer && value.colorAttachments[0] instanceof WEBGLTextureView) {
|
|
4184
|
-
|
|
4206
|
+
import_core16.log.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")();
|
|
4185
4207
|
texture = value.colorAttachments[0].texture;
|
|
4186
4208
|
} else {
|
|
4187
4209
|
throw new Error("No texture");
|
|
@@ -4390,7 +4412,7 @@ ${source}`;
|
|
|
4390
4412
|
}
|
|
4391
4413
|
const { name, type: glUniformType, size } = activeInfo;
|
|
4392
4414
|
const uniformType = convertGLUniformTypeToShaderVariableType(glUniformType);
|
|
4393
|
-
const { type, components } = (0,
|
|
4415
|
+
const { type, components } = (0, import_core17.getVariableShaderTypeInfo)(uniformType);
|
|
4394
4416
|
varyings.push({ location, name, type, size: size * components });
|
|
4395
4417
|
}
|
|
4396
4418
|
varyings.sort((a, b) => a.location - b.location);
|
|
@@ -4470,6 +4492,12 @@ ${source}`;
|
|
|
4470
4492
|
});
|
|
4471
4493
|
}
|
|
4472
4494
|
}
|
|
4495
|
+
const uniformInstancePrefixes = new Set(blockInfo.uniforms.map((uniform) => uniform.name.split(".")[0]).filter((instanceName) => Boolean(instanceName)));
|
|
4496
|
+
const blockAlias = blockInfo.name.replace(/Uniforms$/, "");
|
|
4497
|
+
if (uniformInstancePrefixes.size === 1 && !uniformInstancePrefixes.has(blockInfo.name) && !uniformInstancePrefixes.has(blockAlias)) {
|
|
4498
|
+
const [instanceName] = uniformInstancePrefixes;
|
|
4499
|
+
import_core17.log.warn(`Uniform block "${blockInfo.name}" uses GLSL instance "${instanceName}". luma.gl binds uniform buffers by block name ("${blockInfo.name}") and alias ("${blockAlias}"). Prefer matching the instance name to one of those to avoid confusing silent mismatches.`)();
|
|
4500
|
+
}
|
|
4473
4501
|
uniformBlocks.push(blockInfo);
|
|
4474
4502
|
}
|
|
4475
4503
|
uniformBlocks.sort((a, b) => a.location - b.location);
|
|
@@ -4485,7 +4513,7 @@ ${source}`;
|
|
|
4485
4513
|
}
|
|
4486
4514
|
const UNIFORM_NAME_REGEXP = /([^[]*)(\[[0-9]+\])?/;
|
|
4487
4515
|
const matches = UNIFORM_NAME_REGEXP.exec(name);
|
|
4488
|
-
const uniformName = (0,
|
|
4516
|
+
const uniformName = (0, import_core17.assertDefined)(matches?.[1], `Failed to parse GLSL uniform name ${name}`);
|
|
4489
4517
|
return {
|
|
4490
4518
|
name: uniformName,
|
|
4491
4519
|
// TODO - is this a bug, shouldn't we return the value?
|
|
@@ -4493,23 +4521,23 @@ ${source}`;
|
|
|
4493
4521
|
isArray: Boolean(matches?.[2])
|
|
4494
4522
|
};
|
|
4495
4523
|
}
|
|
4496
|
-
var
|
|
4524
|
+
var import_core17;
|
|
4497
4525
|
var init_get_shader_layout_from_glsl = __esm({
|
|
4498
4526
|
"../../node_modules/@luma.gl/webgl/dist/adapter/helpers/get-shader-layout-from-glsl.js"() {
|
|
4499
|
-
|
|
4527
|
+
import_core17 = __toESM(require_core2(), 1);
|
|
4500
4528
|
init_webgl_shadertypes();
|
|
4501
4529
|
}
|
|
4502
4530
|
});
|
|
4503
4531
|
|
|
4504
4532
|
// ../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-shared-render-pipeline.js
|
|
4505
|
-
var
|
|
4533
|
+
var import_core18, LOG_PROGRAM_PERF_PRIORITY, WEBGLSharedRenderPipeline;
|
|
4506
4534
|
var init_webgl_shared_render_pipeline = __esm({
|
|
4507
4535
|
"../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-shared-render-pipeline.js"() {
|
|
4508
|
-
|
|
4536
|
+
import_core18 = __toESM(require_core2(), 1);
|
|
4509
4537
|
init_get_shader_layout_from_glsl();
|
|
4510
4538
|
init_webgl_shadertypes();
|
|
4511
4539
|
LOG_PROGRAM_PERF_PRIORITY = 4;
|
|
4512
|
-
WEBGLSharedRenderPipeline = class extends
|
|
4540
|
+
WEBGLSharedRenderPipeline = class extends import_core18.SharedRenderPipeline {
|
|
4513
4541
|
device;
|
|
4514
4542
|
handle;
|
|
4515
4543
|
vs;
|
|
@@ -4526,9 +4554,9 @@ ${source}`;
|
|
|
4526
4554
|
this.device.gl.transformFeedbackVaryings(this.handle, props.varyings, props.bufferMode || 35981);
|
|
4527
4555
|
}
|
|
4528
4556
|
this._linkShaders();
|
|
4529
|
-
|
|
4557
|
+
import_core18.log.time(3, `RenderPipeline ${this.id} - shaderLayout introspection`)();
|
|
4530
4558
|
this.introspectedLayout = getShaderLayoutFromGLSL(this.device.gl, this.handle);
|
|
4531
|
-
|
|
4559
|
+
import_core18.log.timeEnd(3, `RenderPipeline ${this.id} - shaderLayout introspection`)();
|
|
4532
4560
|
}
|
|
4533
4561
|
destroy() {
|
|
4534
4562
|
if (this.destroyed) {
|
|
@@ -4543,17 +4571,17 @@ ${source}`;
|
|
|
4543
4571
|
const { gl } = this.device;
|
|
4544
4572
|
gl.attachShader(this.handle, this.vs.handle);
|
|
4545
4573
|
gl.attachShader(this.handle, this.fs.handle);
|
|
4546
|
-
|
|
4574
|
+
import_core18.log.time(LOG_PROGRAM_PERF_PRIORITY, `linkProgram for ${this.id}`)();
|
|
4547
4575
|
gl.linkProgram(this.handle);
|
|
4548
|
-
|
|
4576
|
+
import_core18.log.timeEnd(LOG_PROGRAM_PERF_PRIORITY, `linkProgram for ${this.id}`)();
|
|
4549
4577
|
if (!this.device.features.has("compilation-status-async-webgl")) {
|
|
4550
4578
|
const status2 = this._getLinkStatus();
|
|
4551
4579
|
this._reportLinkStatus(status2);
|
|
4552
4580
|
return;
|
|
4553
4581
|
}
|
|
4554
|
-
|
|
4582
|
+
import_core18.log.once(1, "RenderPipeline linking is asynchronous")();
|
|
4555
4583
|
await this._waitForLinkComplete();
|
|
4556
|
-
|
|
4584
|
+
import_core18.log.info(2, `RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();
|
|
4557
4585
|
const status = this._getLinkStatus();
|
|
4558
4586
|
this._reportLinkStatus(status);
|
|
4559
4587
|
}
|
|
@@ -4664,44 +4692,29 @@ ${source}`;
|
|
|
4664
4692
|
device.gl.bindBuffer(36662, null);
|
|
4665
4693
|
device.gl.bindBuffer(36663, null);
|
|
4666
4694
|
}
|
|
4667
|
-
function _copyBufferToTexture(
|
|
4668
|
-
throw new Error("
|
|
4695
|
+
function _copyBufferToTexture(_device, _options) {
|
|
4696
|
+
throw new Error("copyBufferToTexture is not supported in WebGL");
|
|
4669
4697
|
}
|
|
4670
4698
|
function _copyTextureToBuffer(device, options) {
|
|
4671
|
-
const {
|
|
4672
|
-
|
|
4673
|
-
sourceTexture
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
destinationBuffer,
|
|
4687
|
-
/** Offset, in bytes, from the beginning of the buffer to the start of the image data (default 0) */
|
|
4688
|
-
byteOffset = 0,
|
|
4689
|
-
/**
|
|
4690
|
-
* The stride, in bytes, between the beginning of each block row and the subsequent block row.
|
|
4691
|
-
* Required if there are multiple block rows (i.e. the copy height or depth is more than one block).
|
|
4692
|
-
*/
|
|
4693
|
-
bytesPerRow,
|
|
4694
|
-
/**
|
|
4695
|
-
* Number of block rows per single image of the texture.
|
|
4696
|
-
* rowsPerImage × bytesPerRow is the stride, in bytes, between the beginning of each image of data and the subsequent image.
|
|
4697
|
-
* Required if there are multiple images (i.e. the copy depth is more than one).
|
|
4698
|
-
*/
|
|
4699
|
-
rowsPerImage
|
|
4700
|
-
} = options;
|
|
4699
|
+
const { sourceTexture, mipLevel = 0, aspect = "all", width = options.sourceTexture.width, height = options.sourceTexture.height, depthOrArrayLayers, origin = [0, 0, 0], destinationBuffer, byteOffset = 0, bytesPerRow, rowsPerImage } = options;
|
|
4700
|
+
if (sourceTexture instanceof import_core19.Texture) {
|
|
4701
|
+
sourceTexture.readBuffer({
|
|
4702
|
+
x: origin[0] ?? 0,
|
|
4703
|
+
y: origin[1] ?? 0,
|
|
4704
|
+
z: origin[2] ?? 0,
|
|
4705
|
+
width,
|
|
4706
|
+
height,
|
|
4707
|
+
depthOrArrayLayers,
|
|
4708
|
+
mipLevel,
|
|
4709
|
+
aspect,
|
|
4710
|
+
byteOffset
|
|
4711
|
+
}, destinationBuffer);
|
|
4712
|
+
return;
|
|
4713
|
+
}
|
|
4701
4714
|
if (aspect !== "all") {
|
|
4702
4715
|
throw new Error("aspect not supported in WebGL");
|
|
4703
4716
|
}
|
|
4704
|
-
if (mipLevel !== 0 || depthOrArrayLayers !== 0 || bytesPerRow || rowsPerImage) {
|
|
4717
|
+
if (mipLevel !== 0 || depthOrArrayLayers !== void 0 || bytesPerRow || rowsPerImage) {
|
|
4705
4718
|
throw new Error("not implemented");
|
|
4706
4719
|
}
|
|
4707
4720
|
const { framebuffer, destroyFramebuffer } = getFramebuffer(sourceTexture);
|
|
@@ -4710,7 +4723,7 @@ ${source}`;
|
|
|
4710
4723
|
const webglBuffer = destinationBuffer;
|
|
4711
4724
|
const sourceWidth = width || framebuffer.width;
|
|
4712
4725
|
const sourceHeight = height || framebuffer.height;
|
|
4713
|
-
const colorAttachment0 = (0,
|
|
4726
|
+
const colorAttachment0 = (0, import_core19.assertDefined)(framebuffer.colorAttachments[0]);
|
|
4714
4727
|
const sourceParams = getTextureFormatWebGL(colorAttachment0.texture.props.format);
|
|
4715
4728
|
const sourceFormat = sourceParams.format;
|
|
4716
4729
|
const sourceType = sourceParams.type;
|
|
@@ -4788,7 +4801,7 @@ ${source}`;
|
|
|
4788
4801
|
}
|
|
4789
4802
|
}
|
|
4790
4803
|
function getFramebuffer(source) {
|
|
4791
|
-
if (source instanceof
|
|
4804
|
+
if (source instanceof import_core19.Texture) {
|
|
4792
4805
|
const { width, height, id } = source;
|
|
4793
4806
|
const framebuffer = source.device.createFramebuffer({
|
|
4794
4807
|
id: `framebuffer-for-${id}`,
|
|
@@ -4800,13 +4813,13 @@ ${source}`;
|
|
|
4800
4813
|
}
|
|
4801
4814
|
return { framebuffer: source, destroyFramebuffer: false };
|
|
4802
4815
|
}
|
|
4803
|
-
var
|
|
4816
|
+
var import_core19, WEBGLCommandBuffer;
|
|
4804
4817
|
var init_webgl_command_buffer = __esm({
|
|
4805
4818
|
"../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-command-buffer.js"() {
|
|
4806
|
-
|
|
4807
|
-
init_webgl_texture();
|
|
4819
|
+
import_core19 = __toESM(require_core2(), 1);
|
|
4808
4820
|
init_webgl_texture_table();
|
|
4809
|
-
|
|
4821
|
+
init_webgl_texture();
|
|
4822
|
+
WEBGLCommandBuffer = class extends import_core19.CommandBuffer {
|
|
4810
4823
|
device;
|
|
4811
4824
|
handle = null;
|
|
4812
4825
|
commands = [];
|
|
@@ -4839,14 +4852,14 @@ ${source}`;
|
|
|
4839
4852
|
});
|
|
4840
4853
|
|
|
4841
4854
|
// ../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-render-pass.js
|
|
4842
|
-
var
|
|
4855
|
+
var import_core20, COLOR_CHANNELS, WEBGLRenderPass;
|
|
4843
4856
|
var init_webgl_render_pass = __esm({
|
|
4844
4857
|
"../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-render-pass.js"() {
|
|
4845
|
-
|
|
4858
|
+
import_core20 = __toESM(require_core2(), 1);
|
|
4846
4859
|
init_with_parameters();
|
|
4847
4860
|
init_unified_parameter_api();
|
|
4848
4861
|
COLOR_CHANNELS = [1, 2, 4, 8];
|
|
4849
|
-
WEBGLRenderPass = class extends
|
|
4862
|
+
WEBGLRenderPass = class extends import_core20.RenderPass {
|
|
4850
4863
|
device;
|
|
4851
4864
|
handle = null;
|
|
4852
4865
|
/** Parameters that should be applied before each draw call */
|
|
@@ -4854,13 +4867,15 @@ ${source}`;
|
|
|
4854
4867
|
constructor(device, props) {
|
|
4855
4868
|
super(device, props);
|
|
4856
4869
|
this.device = device;
|
|
4857
|
-
|
|
4870
|
+
const webglFramebuffer = this.props.framebuffer;
|
|
4871
|
+
const isDefaultFramebuffer = !webglFramebuffer || webglFramebuffer.handle === null;
|
|
4872
|
+
if (isDefaultFramebuffer) {
|
|
4858
4873
|
device.getDefaultCanvasContext()._resizeDrawingBufferIfNeeded();
|
|
4859
4874
|
}
|
|
4860
4875
|
let viewport;
|
|
4861
4876
|
if (!props?.parameters?.viewport) {
|
|
4862
|
-
if (
|
|
4863
|
-
const { width, height } =
|
|
4877
|
+
if (!isDefaultFramebuffer) {
|
|
4878
|
+
const { width, height } = webglFramebuffer;
|
|
4864
4879
|
viewport = [0, 0, width, height];
|
|
4865
4880
|
} else {
|
|
4866
4881
|
const [width, height] = device.getDefaultCanvasContext().getDrawingBufferSize();
|
|
@@ -4869,11 +4884,10 @@ ${source}`;
|
|
|
4869
4884
|
}
|
|
4870
4885
|
this.device.pushState();
|
|
4871
4886
|
this.setParameters({ viewport, ...this.props.parameters });
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
const drawBuffers = this.props.framebuffer.colorAttachments.map((_, i) => 36064 + i);
|
|
4887
|
+
if (!isDefaultFramebuffer) {
|
|
4888
|
+
const drawBuffers = webglFramebuffer.colorAttachments.map((_, i) => 36064 + i);
|
|
4875
4889
|
this.device.gl.drawBuffers(drawBuffers);
|
|
4876
|
-
} else
|
|
4890
|
+
} else {
|
|
4877
4891
|
this.device.gl.drawBuffers([1029]);
|
|
4878
4892
|
}
|
|
4879
4893
|
this.clear();
|
|
@@ -5011,13 +5025,13 @@ ${source}`;
|
|
|
5011
5025
|
});
|
|
5012
5026
|
|
|
5013
5027
|
// ../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-command-encoder.js
|
|
5014
|
-
var
|
|
5028
|
+
var import_core21, WEBGLCommandEncoder;
|
|
5015
5029
|
var init_webgl_command_encoder = __esm({
|
|
5016
5030
|
"../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-command-encoder.js"() {
|
|
5017
|
-
|
|
5031
|
+
import_core21 = __toESM(require_core2(), 1);
|
|
5018
5032
|
init_webgl_command_buffer();
|
|
5019
5033
|
init_webgl_render_pass();
|
|
5020
|
-
WEBGLCommandEncoder = class extends
|
|
5034
|
+
WEBGLCommandEncoder = class extends import_core21.CommandEncoder {
|
|
5021
5035
|
device;
|
|
5022
5036
|
handle = null;
|
|
5023
5037
|
commandBuffer;
|
|
@@ -5066,7 +5080,8 @@ ${source}`;
|
|
|
5066
5080
|
}
|
|
5067
5081
|
insertDebugMarker(markerLabel) {
|
|
5068
5082
|
}
|
|
5069
|
-
resolveQuerySet(
|
|
5083
|
+
resolveQuerySet(_querySet, _destination, _options) {
|
|
5084
|
+
throw new Error("resolveQuerySet is not supported in WebGL");
|
|
5070
5085
|
}
|
|
5071
5086
|
writeTimestamp(querySet, queryIndex) {
|
|
5072
5087
|
const webglQuerySet = querySet;
|
|
@@ -5119,14 +5134,14 @@ ${source}`;
|
|
|
5119
5134
|
}
|
|
5120
5135
|
return true;
|
|
5121
5136
|
}
|
|
5122
|
-
var
|
|
5137
|
+
var import_core22, WEBGLVertexArray;
|
|
5123
5138
|
var init_webgl_vertex_array = __esm({
|
|
5124
5139
|
"../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-vertex-array.js"() {
|
|
5125
|
-
|
|
5126
|
-
|
|
5140
|
+
import_core22 = __toESM(require_core2(), 1);
|
|
5141
|
+
init_dist();
|
|
5127
5142
|
init_webgl_vertex_formats();
|
|
5128
5143
|
init_fill_array();
|
|
5129
|
-
WEBGLVertexArray = class extends
|
|
5144
|
+
WEBGLVertexArray = class extends import_core22.VertexArray {
|
|
5130
5145
|
get [Symbol.toStringTag]() {
|
|
5131
5146
|
return "VertexArray";
|
|
5132
5147
|
}
|
|
@@ -5292,7 +5307,7 @@ ${source}`;
|
|
|
5292
5307
|
this.buffer = this.buffer || this.device.createBuffer({ byteLength });
|
|
5293
5308
|
updateNeeded ||= !compareConstantArrayValues(constantValue, this.bufferValue);
|
|
5294
5309
|
if (updateNeeded) {
|
|
5295
|
-
const typedArray = (0,
|
|
5310
|
+
const typedArray = (0, import_core22.getScratchArray)(value.constructor, length);
|
|
5296
5311
|
fillArray({ target: typedArray, source: constantValue, start: 0, count: length });
|
|
5297
5312
|
this.buffer.write(typedArray);
|
|
5298
5313
|
this.bufferValue = value;
|
|
@@ -5310,13 +5325,13 @@ ${source}`;
|
|
|
5310
5325
|
}
|
|
5311
5326
|
return /^\d+$/.test(value);
|
|
5312
5327
|
}
|
|
5313
|
-
var
|
|
5328
|
+
var import_core23, WEBGLTransformFeedback;
|
|
5314
5329
|
var init_webgl_transform_feedback = __esm({
|
|
5315
5330
|
"../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-transform-feedback.js"() {
|
|
5316
|
-
|
|
5317
|
-
|
|
5331
|
+
import_core23 = __toESM(require_core2(), 1);
|
|
5332
|
+
init_dist2();
|
|
5318
5333
|
init_webgl_topology_utils();
|
|
5319
|
-
WEBGLTransformFeedback = class extends
|
|
5334
|
+
WEBGLTransformFeedback = class extends import_core23.TransformFeedback {
|
|
5320
5335
|
device;
|
|
5321
5336
|
gl;
|
|
5322
5337
|
handle;
|
|
@@ -5379,7 +5394,7 @@ ${source}`;
|
|
|
5379
5394
|
const { buffer, byteLength, byteOffset } = this._getBufferRange(bufferOrRange);
|
|
5380
5395
|
if (location < 0) {
|
|
5381
5396
|
this.unusedBuffers[locationOrName] = buffer;
|
|
5382
|
-
|
|
5397
|
+
import_core23.log.warn(`${this.id} unusedBuffers varying buffer ${locationOrName}`)();
|
|
5383
5398
|
return;
|
|
5384
5399
|
}
|
|
5385
5400
|
this.buffers[location] = { buffer, byteLength, byteOffset };
|
|
@@ -5462,14 +5477,15 @@ ${source}`;
|
|
|
5462
5477
|
});
|
|
5463
5478
|
|
|
5464
5479
|
// ../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-query-set.js
|
|
5465
|
-
var
|
|
5480
|
+
var import_core24, WEBGLQuerySet;
|
|
5466
5481
|
var init_webgl_query_set = __esm({
|
|
5467
5482
|
"../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-query-set.js"() {
|
|
5468
|
-
|
|
5469
|
-
WEBGLQuerySet = class extends
|
|
5483
|
+
import_core24 = __toESM(require_core2(), 1);
|
|
5484
|
+
WEBGLQuerySet = class extends import_core24.QuerySet {
|
|
5470
5485
|
device;
|
|
5471
5486
|
handle;
|
|
5472
5487
|
_timestampPairs = [];
|
|
5488
|
+
_pendingReads = /* @__PURE__ */ new Set();
|
|
5473
5489
|
_occlusionQuery = null;
|
|
5474
5490
|
_occlusionActive = false;
|
|
5475
5491
|
get [Symbol.toStringTag]() {
|
|
@@ -5505,15 +5521,21 @@ ${source}`;
|
|
|
5505
5521
|
}
|
|
5506
5522
|
for (const pair of this._timestampPairs) {
|
|
5507
5523
|
if (pair.activeQuery) {
|
|
5524
|
+
this._cancelPendingQuery(pair.activeQuery);
|
|
5508
5525
|
this.device.gl.deleteQuery(pair.activeQuery.handle);
|
|
5509
5526
|
}
|
|
5510
5527
|
for (const query of pair.completedQueries) {
|
|
5528
|
+
this._cancelPendingQuery(query);
|
|
5511
5529
|
this.device.gl.deleteQuery(query.handle);
|
|
5512
5530
|
}
|
|
5513
5531
|
}
|
|
5514
5532
|
if (this._occlusionQuery) {
|
|
5533
|
+
this._cancelPendingQuery(this._occlusionQuery);
|
|
5515
5534
|
this.device.gl.deleteQuery(this._occlusionQuery.handle);
|
|
5516
5535
|
}
|
|
5536
|
+
for (const query of Array.from(this._pendingReads)) {
|
|
5537
|
+
this._cancelPendingQuery(query);
|
|
5538
|
+
}
|
|
5517
5539
|
this.destroyResource();
|
|
5518
5540
|
}
|
|
5519
5541
|
isResultAvailable(queryIndex) {
|
|
@@ -5582,7 +5604,11 @@ ${source}`;
|
|
|
5582
5604
|
handle: this.handle,
|
|
5583
5605
|
promise: null,
|
|
5584
5606
|
result: null,
|
|
5585
|
-
disjoint: false
|
|
5607
|
+
disjoint: false,
|
|
5608
|
+
cancelled: false,
|
|
5609
|
+
pollRequestId: null,
|
|
5610
|
+
resolve: null,
|
|
5611
|
+
reject: null
|
|
5586
5612
|
};
|
|
5587
5613
|
this._occlusionActive = true;
|
|
5588
5614
|
}
|
|
@@ -5611,7 +5637,11 @@ ${source}`;
|
|
|
5611
5637
|
handle,
|
|
5612
5638
|
promise: null,
|
|
5613
5639
|
result: null,
|
|
5614
|
-
disjoint: false
|
|
5640
|
+
disjoint: false,
|
|
5641
|
+
cancelled: false,
|
|
5642
|
+
pollRequestId: null,
|
|
5643
|
+
resolve: null,
|
|
5644
|
+
reject: null
|
|
5615
5645
|
};
|
|
5616
5646
|
this.device.gl.beginQuery(35007, handle);
|
|
5617
5647
|
pair.activeQuery = query;
|
|
@@ -5643,6 +5673,10 @@ ${source}`;
|
|
|
5643
5673
|
return this._pollQueryAvailability(pair.completedQueries[0]);
|
|
5644
5674
|
}
|
|
5645
5675
|
_pollQueryAvailability(query) {
|
|
5676
|
+
if (query.cancelled || this.destroyed) {
|
|
5677
|
+
query.result = 0n;
|
|
5678
|
+
return true;
|
|
5679
|
+
}
|
|
5646
5680
|
if (query.result !== null || query.disjoint) {
|
|
5647
5681
|
return true;
|
|
5648
5682
|
}
|
|
@@ -5671,13 +5705,28 @@ ${source}`;
|
|
|
5671
5705
|
if (query.promise) {
|
|
5672
5706
|
return query.promise;
|
|
5673
5707
|
}
|
|
5708
|
+
this._pendingReads.add(query);
|
|
5674
5709
|
query.promise = new Promise((resolve, reject) => {
|
|
5710
|
+
query.resolve = resolve;
|
|
5711
|
+
query.reject = reject;
|
|
5675
5712
|
const poll = () => {
|
|
5713
|
+
query.pollRequestId = null;
|
|
5714
|
+
if (query.cancelled || this.destroyed) {
|
|
5715
|
+
this._pendingReads.delete(query);
|
|
5716
|
+
query.promise = null;
|
|
5717
|
+
query.resolve = null;
|
|
5718
|
+
query.reject = null;
|
|
5719
|
+
resolve(0n);
|
|
5720
|
+
return;
|
|
5721
|
+
}
|
|
5676
5722
|
if (!this._pollQueryAvailability(query)) {
|
|
5677
|
-
|
|
5723
|
+
query.pollRequestId = this._requestAnimationFrame(poll);
|
|
5678
5724
|
return;
|
|
5679
5725
|
}
|
|
5726
|
+
this._pendingReads.delete(query);
|
|
5680
5727
|
query.promise = null;
|
|
5728
|
+
query.resolve = null;
|
|
5729
|
+
query.reject = null;
|
|
5681
5730
|
if (query.disjoint) {
|
|
5682
5731
|
reject(new Error("GPU timestamp query was invalidated by a disjoint event"));
|
|
5683
5732
|
} else {
|
|
@@ -5688,16 +5737,37 @@ ${source}`;
|
|
|
5688
5737
|
});
|
|
5689
5738
|
return query.promise;
|
|
5690
5739
|
}
|
|
5740
|
+
_cancelPendingQuery(query) {
|
|
5741
|
+
this._pendingReads.delete(query);
|
|
5742
|
+
query.cancelled = true;
|
|
5743
|
+
if (query.pollRequestId !== null) {
|
|
5744
|
+
this._cancelAnimationFrame(query.pollRequestId);
|
|
5745
|
+
query.pollRequestId = null;
|
|
5746
|
+
}
|
|
5747
|
+
if (query.resolve) {
|
|
5748
|
+
const resolve = query.resolve;
|
|
5749
|
+
query.promise = null;
|
|
5750
|
+
query.resolve = null;
|
|
5751
|
+
query.reject = null;
|
|
5752
|
+
resolve(0n);
|
|
5753
|
+
}
|
|
5754
|
+
}
|
|
5755
|
+
_requestAnimationFrame(callback) {
|
|
5756
|
+
return requestAnimationFrame(callback);
|
|
5757
|
+
}
|
|
5758
|
+
_cancelAnimationFrame(requestId) {
|
|
5759
|
+
cancelAnimationFrame(requestId);
|
|
5760
|
+
}
|
|
5691
5761
|
};
|
|
5692
5762
|
}
|
|
5693
5763
|
});
|
|
5694
5764
|
|
|
5695
5765
|
// ../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-fence.js
|
|
5696
|
-
var
|
|
5766
|
+
var import_core25, WEBGLFence;
|
|
5697
5767
|
var init_webgl_fence = __esm({
|
|
5698
5768
|
"../../node_modules/@luma.gl/webgl/dist/adapter/resources/webgl-fence.js"() {
|
|
5699
|
-
|
|
5700
|
-
WEBGLFence = class extends
|
|
5769
|
+
import_core25 = __toESM(require_core2(), 1);
|
|
5770
|
+
WEBGLFence = class extends import_core25.Fence {
|
|
5701
5771
|
device;
|
|
5702
5772
|
gl;
|
|
5703
5773
|
handle;
|
|
@@ -5816,7 +5886,7 @@ ${source}`;
|
|
|
5816
5886
|
sourceFormat ||= texture?.glFormat || 6408;
|
|
5817
5887
|
sourceType ||= texture?.glType || 5121;
|
|
5818
5888
|
target2 = getPixelArray(target2, sourceType, sourceFormat, sourceWidth, sourceHeight, sourceDepth);
|
|
5819
|
-
const signedType =
|
|
5889
|
+
const signedType = import_core26.dataTypeDecoder.getDataType(target2);
|
|
5820
5890
|
sourceType = sourceType || convertDataTypeToGLDataType(signedType);
|
|
5821
5891
|
const prevHandle = gl.bindFramebuffer(36160, handle);
|
|
5822
5892
|
gl.readBuffer(36064 + sourceAttachment);
|
|
@@ -5859,7 +5929,7 @@ ${source}`;
|
|
|
5859
5929
|
return webglBufferTarget;
|
|
5860
5930
|
}
|
|
5861
5931
|
function getFramebuffer2(source) {
|
|
5862
|
-
if (!(source instanceof
|
|
5932
|
+
if (!(source instanceof import_core26.Framebuffer)) {
|
|
5863
5933
|
return { framebuffer: toFramebuffer(source), deleteFramebuffer: true };
|
|
5864
5934
|
}
|
|
5865
5935
|
return { framebuffer: source, deleteFramebuffer: false };
|
|
@@ -5881,14 +5951,14 @@ ${source}`;
|
|
|
5881
5951
|
}
|
|
5882
5952
|
glType ||= 5121;
|
|
5883
5953
|
const shaderType = convertGLDataTypeToDataType(glType);
|
|
5884
|
-
const ArrayType =
|
|
5954
|
+
const ArrayType = import_core26.dataTypeDecoder.getTypedArrayConstructor(shaderType);
|
|
5885
5955
|
const components = glFormatToComponents(glFormat);
|
|
5886
5956
|
return new ArrayType(width * height * components);
|
|
5887
5957
|
}
|
|
5888
|
-
var
|
|
5958
|
+
var import_core26;
|
|
5889
5959
|
var init_webgl_texture_utils = __esm({
|
|
5890
5960
|
"../../node_modules/@luma.gl/webgl/dist/adapter/helpers/webgl-texture-utils.js"() {
|
|
5891
|
-
|
|
5961
|
+
import_core26 = __toESM(require_core2(), 1);
|
|
5892
5962
|
init_webgl_shadertypes();
|
|
5893
5963
|
init_format_utils();
|
|
5894
5964
|
init_shader_formats();
|
|
@@ -5930,10 +6000,10 @@ ${source}`;
|
|
|
5930
6000
|
}
|
|
5931
6001
|
return true;
|
|
5932
6002
|
}
|
|
5933
|
-
var
|
|
6003
|
+
var import_core27, WebGLDevice;
|
|
5934
6004
|
var init_webgl_device = __esm({
|
|
5935
6005
|
"../../node_modules/@luma.gl/webgl/dist/adapter/webgl-device.js"() {
|
|
5936
|
-
|
|
6006
|
+
import_core27 = __toESM(require_core2(), 1);
|
|
5937
6007
|
init_webgl_state_tracker();
|
|
5938
6008
|
init_create_browser_context();
|
|
5939
6009
|
init_webgl_context_data();
|
|
@@ -5962,7 +6032,7 @@ ${source}`;
|
|
|
5962
6032
|
init_unified_parameter_api();
|
|
5963
6033
|
init_with_parameters();
|
|
5964
6034
|
init_webgl_extensions();
|
|
5965
|
-
WebGLDevice = class extends
|
|
6035
|
+
WebGLDevice = class extends import_core27.Device {
|
|
5966
6036
|
static getDeviceFromContext(gl) {
|
|
5967
6037
|
if (!gl) {
|
|
5968
6038
|
return null;
|
|
@@ -6013,7 +6083,7 @@ ${source}`;
|
|
|
6013
6083
|
}
|
|
6014
6084
|
constructor(props) {
|
|
6015
6085
|
super({ ...props, id: props.id || uid("webgl-device") });
|
|
6016
|
-
const canvasContextProps =
|
|
6086
|
+
const canvasContextProps = import_core27.Device._getCanvasContextProps(props);
|
|
6017
6087
|
if (!canvasContextProps) {
|
|
6018
6088
|
throw new Error("WebGLDevice requires props.createCanvasContext to be set");
|
|
6019
6089
|
}
|
|
@@ -6051,7 +6121,7 @@ ${source}`;
|
|
|
6051
6121
|
device = WebGLDevice.getDeviceFromContext(gl);
|
|
6052
6122
|
if (device) {
|
|
6053
6123
|
if (props._reuseDevices) {
|
|
6054
|
-
|
|
6124
|
+
import_core27.log.log(1, `Not creating a new Device, instead returning a reference to Device ${device.id} already attached to WebGL context`, device)();
|
|
6055
6125
|
this.canvasContext.destroy();
|
|
6056
6126
|
device._reused = true;
|
|
6057
6127
|
return device;
|
|
@@ -6071,15 +6141,15 @@ ${source}`;
|
|
|
6071
6141
|
this.features.initializeFeatures();
|
|
6072
6142
|
}
|
|
6073
6143
|
const glState = new WebGLStateTracker(this.gl, {
|
|
6074
|
-
log: (...args) =>
|
|
6144
|
+
log: (...args) => import_core27.log.log(1, ...args)()
|
|
6075
6145
|
});
|
|
6076
6146
|
glState.trackState(this.gl, { copyState: false });
|
|
6077
6147
|
if (props.debug || props.debugWebGL) {
|
|
6078
6148
|
this.gl = makeDebugContext(this.gl, { debugWebGL: true, traceWebGL: props.debugWebGL });
|
|
6079
|
-
|
|
6149
|
+
import_core27.log.warn("WebGL debug mode activated. Performance reduced.")();
|
|
6080
6150
|
}
|
|
6081
6151
|
if (props.debugWebGL) {
|
|
6082
|
-
|
|
6152
|
+
import_core27.log.level = Math.max(import_core27.log.level, 1);
|
|
6083
6153
|
}
|
|
6084
6154
|
this.commandEncoder = new WEBGLCommandEncoder(this, { id: `${this}-command-encoder` });
|
|
6085
6155
|
this.canvasContext._startObservers();
|
|
@@ -6162,13 +6232,7 @@ ${source}`;
|
|
|
6162
6232
|
submit(commandBuffer) {
|
|
6163
6233
|
let submittedCommandEncoder = null;
|
|
6164
6234
|
if (!commandBuffer) {
|
|
6165
|
-
submittedCommandEncoder = this.
|
|
6166
|
-
commandBuffer = submittedCommandEncoder.finish();
|
|
6167
|
-
this.commandEncoder.destroy();
|
|
6168
|
-
this.commandEncoder = this.createCommandEncoder({
|
|
6169
|
-
id: submittedCommandEncoder.props.id,
|
|
6170
|
-
timeProfilingQuerySet: submittedCommandEncoder.getTimeProfilingQuerySet()
|
|
6171
|
-
});
|
|
6235
|
+
({ submittedCommandEncoder, commandBuffer } = this._finalizeDefaultCommandEncoderForSubmit());
|
|
6172
6236
|
}
|
|
6173
6237
|
try {
|
|
6174
6238
|
commandBuffer._executeCommands();
|
|
@@ -6182,6 +6246,16 @@ ${source}`;
|
|
|
6182
6246
|
commandBuffer.destroy();
|
|
6183
6247
|
}
|
|
6184
6248
|
}
|
|
6249
|
+
_finalizeDefaultCommandEncoderForSubmit() {
|
|
6250
|
+
const submittedCommandEncoder = this.commandEncoder;
|
|
6251
|
+
const commandBuffer = submittedCommandEncoder.finish();
|
|
6252
|
+
this.commandEncoder.destroy();
|
|
6253
|
+
this.commandEncoder = this.createCommandEncoder({
|
|
6254
|
+
id: submittedCommandEncoder.props.id,
|
|
6255
|
+
timeProfilingQuerySet: submittedCommandEncoder.getTimeProfilingQuerySet()
|
|
6256
|
+
});
|
|
6257
|
+
return { submittedCommandEncoder, commandBuffer };
|
|
6258
|
+
}
|
|
6185
6259
|
//
|
|
6186
6260
|
// TEMPORARY HACKS - will be removed in v9.1
|
|
6187
6261
|
//
|
|
@@ -6203,7 +6277,7 @@ ${source}`;
|
|
|
6203
6277
|
return withGLParameters(this.gl, parameters, func);
|
|
6204
6278
|
}
|
|
6205
6279
|
resetWebGL() {
|
|
6206
|
-
|
|
6280
|
+
import_core27.log.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")();
|
|
6207
6281
|
resetGLParameters(this.gl);
|
|
6208
6282
|
}
|
|
6209
6283
|
_getDeviceSpecificTextureFormatCapabilities(capabilities) {
|
|
@@ -6275,7 +6349,7 @@ ${source}`;
|
|
|
6275
6349
|
this._constants = this._constants || new Array(maxVertexAttributes).fill(null);
|
|
6276
6350
|
const currentConstant = this._constants[location];
|
|
6277
6351
|
if (currentConstant && compareConstantArrayValues2(currentConstant, constant)) {
|
|
6278
|
-
|
|
6352
|
+
import_core27.log.info(1, `setConstantAttributeWebGL(${location}) could have been skipped, value unchanged`)();
|
|
6279
6353
|
}
|
|
6280
6354
|
this._constants[location] = constant;
|
|
6281
6355
|
switch (constant.constructor) {
|
|
@@ -6312,7 +6386,7 @@ ${source}`;
|
|
|
6312
6386
|
});
|
|
6313
6387
|
|
|
6314
6388
|
// ../../node_modules/@luma.gl/webgl/dist/index.js
|
|
6315
|
-
var
|
|
6389
|
+
var init_dist2 = __esm({
|
|
6316
6390
|
"../../node_modules/@luma.gl/webgl/dist/index.js"() {
|
|
6317
6391
|
init_webgl_device();
|
|
6318
6392
|
init_webgl_buffer();
|
|
@@ -6337,11 +6411,11 @@ ${source}`;
|
|
|
6337
6411
|
__reExport(bundle_exports, peer_dependency_exports);
|
|
6338
6412
|
|
|
6339
6413
|
// src/google-maps-overlay.ts
|
|
6340
|
-
|
|
6341
|
-
|
|
6414
|
+
init_constants();
|
|
6415
|
+
init_dist2();
|
|
6342
6416
|
|
|
6343
6417
|
// src/utils.ts
|
|
6344
|
-
var
|
|
6418
|
+
var import_core28 = __toESM(require_core(), 1);
|
|
6345
6419
|
|
|
6346
6420
|
// ../../node_modules/@math.gl/core/dist/lib/common.js
|
|
6347
6421
|
var RADIANS_TO_DEGREES = 1 / Math.PI * 180;
|
|
@@ -8283,13 +8357,13 @@ ${source}`;
|
|
|
8283
8357
|
mousemove: null,
|
|
8284
8358
|
mouseout: null
|
|
8285
8359
|
};
|
|
8286
|
-
const newDeck = new
|
|
8360
|
+
const newDeck = new import_core28.Deck({
|
|
8287
8361
|
...props,
|
|
8288
8362
|
// Default to true for high-DPI displays, but allow user override
|
|
8289
8363
|
useDevicePixels: props.useDevicePixels ?? true,
|
|
8290
8364
|
style: props.interleaved ? null : { pointerEvents: "none" },
|
|
8291
8365
|
parent: getContainer(overlay, props.style),
|
|
8292
|
-
views: new
|
|
8366
|
+
views: new import_core28.MapView({ repeat: true }),
|
|
8293
8367
|
initialViewState: {
|
|
8294
8368
|
longitude: 0,
|
|
8295
8369
|
latitude: 0,
|