@luma.gl/webgl 9.0.0-beta.4 → 9.0.0-beta.6
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/converters/device-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/device-parameters.js +297 -155
- package/dist/adapter/converters/sampler-parameters.d.ts +0 -4
- package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/sampler-parameters.js +73 -67
- package/dist/adapter/converters/shader-formats.d.ts.map +1 -1
- package/dist/adapter/converters/shader-formats.js +53 -46
- package/dist/adapter/converters/texture-formats.d.ts +13 -19
- package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
- package/dist/adapter/converters/texture-formats.js +474 -879
- package/dist/adapter/converters/vertex-formats.d.ts.map +1 -1
- package/dist/adapter/converters/vertex-formats.js +53 -61
- package/dist/adapter/device-helpers/device-features.d.ts +2 -5
- package/dist/adapter/device-helpers/device-features.d.ts.map +1 -1
- package/dist/adapter/device-helpers/device-features.js +56 -87
- package/dist/adapter/device-helpers/device-limits.d.ts +2 -4
- package/dist/adapter/device-helpers/device-limits.d.ts.map +1 -1
- package/dist/adapter/device-helpers/device-limits.js +88 -83
- package/dist/adapter/device-helpers/get-device-info.d.ts +1 -1
- package/dist/adapter/device-helpers/get-device-info.d.ts.map +1 -1
- package/dist/adapter/device-helpers/get-device-info.js +79 -63
- package/dist/adapter/device-helpers/webgl-device-features.d.ts +19 -0
- package/dist/adapter/device-helpers/webgl-device-features.d.ts.map +1 -0
- package/dist/adapter/device-helpers/webgl-device-features.js +86 -0
- package/dist/adapter/device-helpers/webgl-device-info.d.ts +5 -0
- package/dist/adapter/device-helpers/webgl-device-info.d.ts.map +1 -0
- package/dist/adapter/device-helpers/webgl-device-info.js +90 -0
- package/dist/adapter/device-helpers/webgl-device-limits.d.ts +35 -0
- package/dist/adapter/device-helpers/webgl-device-limits.d.ts.map +1 -0
- package/dist/adapter/device-helpers/webgl-device-limits.js +47 -0
- package/dist/adapter/helpers/decode-webgl-types.d.ts.map +1 -1
- package/dist/adapter/helpers/decode-webgl-types.js +88 -76
- package/dist/adapter/helpers/get-shader-layout.d.ts +1 -1
- package/dist/adapter/helpers/get-shader-layout.d.ts.map +1 -1
- package/dist/adapter/helpers/get-shader-layout.js +261 -225
- package/dist/adapter/helpers/parse-shader-compiler-log.d.ts.map +1 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.js +47 -37
- package/dist/adapter/helpers/set-uniform.d.ts +1 -1
- package/dist/adapter/helpers/set-uniform.d.ts.map +1 -1
- package/dist/adapter/helpers/set-uniform.js +68 -82
- package/dist/adapter/helpers/webgl-topology-utils.d.ts.map +1 -1
- package/dist/adapter/helpers/webgl-topology-utils.js +78 -93
- package/dist/adapter/objects/constants-to-keys.d.ts +1 -1
- package/dist/adapter/objects/constants-to-keys.d.ts.map +1 -1
- package/dist/adapter/objects/constants-to-keys.js +19 -12
- package/dist/adapter/objects/webgl-renderbuffer.d.ts +2 -2
- package/dist/adapter/objects/webgl-renderbuffer.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-renderbuffer.js +86 -77
- package/dist/adapter/objects/webgl-resource.d.ts +3 -25
- package/dist/adapter/objects/webgl-resource.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-resource.js +102 -146
- package/dist/adapter/resources/webgl-buffer.d.ts +3 -4
- package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-buffer.js +161 -119
- package/dist/adapter/resources/webgl-command-buffer.d.ts +1 -1
- package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.js +266 -168
- package/dist/adapter/resources/webgl-command-encoder.d.ts +8 -3
- package/dist/adapter/resources/webgl-command-encoder.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-encoder.js +33 -39
- package/dist/adapter/resources/webgl-external-texture.js +93 -1
- package/dist/adapter/resources/webgl-framebuffer.d.ts +8 -10
- package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +167 -137
- package/dist/adapter/resources/webgl-query-set.d.ts +44 -0
- package/dist/adapter/resources/webgl-query-set.d.ts.map +1 -0
- package/dist/adapter/resources/webgl-query-set.js +136 -0
- package/dist/adapter/resources/webgl-render-pass.d.ts +3 -1
- package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.js +124 -90
- package/dist/adapter/resources/webgl-render-pipeline.d.ts +15 -6
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +356 -221
- package/dist/adapter/resources/webgl-sampler.d.ts +1 -3
- package/dist/adapter/resources/webgl-sampler.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-sampler.js +43 -33
- package/dist/adapter/resources/webgl-shader.d.ts +12 -2
- package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-shader.js +114 -47
- package/dist/adapter/resources/webgl-texture-view.d.ts +14 -0
- package/dist/adapter/resources/webgl-texture-view.d.ts.map +1 -0
- package/dist/adapter/resources/webgl-texture-view.js +18 -0
- package/dist/adapter/resources/webgl-texture.d.ts +6 -9
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +615 -695
- package/dist/adapter/resources/webgl-transform-feedback.d.ts +2 -2
- package/dist/adapter/resources/webgl-transform-feedback.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-transform-feedback.js +141 -143
- package/dist/adapter/resources/webgl-vertex-array.d.ts +3 -3
- package/dist/adapter/resources/webgl-vertex-array.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-vertex-array.js +229 -157
- package/dist/adapter/webgl-canvas-context.d.ts +2 -2
- package/dist/adapter/webgl-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgl-canvas-context.js +58 -36
- package/dist/adapter/webgl-device.d.ts +34 -40
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +418 -363
- package/dist/classic/accessor.d.ts.map +1 -1
- package/dist/classic/accessor.js +132 -101
- package/dist/classic/clear.d.ts +2 -2
- package/dist/classic/clear.d.ts.map +1 -1
- package/dist/classic/clear.js +73 -72
- package/dist/classic/copy-and-blit.d.ts +1 -1
- package/dist/classic/copy-and-blit.d.ts.map +1 -1
- package/dist/classic/copy-and-blit.js +175 -175
- package/dist/classic/format-utils.d.ts +2 -2
- package/dist/classic/format-utils.d.ts.map +1 -1
- package/dist/classic/format-utils.js +39 -32
- package/dist/classic/typed-array-utils.d.ts.map +1 -1
- package/dist/classic/typed-array-utils.js +96 -81
- package/dist/context/context/context-data.d.ts +14 -0
- package/dist/context/context/context-data.d.ts.map +1 -0
- package/dist/context/context/context-data.js +33 -0
- package/dist/context/context/create-browser-context.d.ts +1 -6
- package/dist/context/context/create-browser-context.d.ts.map +1 -1
- package/dist/context/context/create-browser-context.js +62 -49
- package/dist/context/debug/spector.d.ts.map +1 -1
- package/dist/context/debug/spector.js +55 -50
- package/dist/context/debug/webgl-developer-tools.d.ts +1 -2
- package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -1
- package/dist/context/debug/webgl-developer-tools.js +104 -77
- package/dist/context/helpers/create-browser-context.d.ts +35 -0
- package/dist/context/helpers/create-browser-context.d.ts.map +1 -0
- package/dist/context/helpers/create-browser-context.js +67 -0
- package/dist/context/{polyfill/context-data.d.ts → helpers/webgl-context-data.d.ts} +2 -2
- package/dist/context/helpers/webgl-context-data.d.ts.map +1 -0
- package/dist/context/helpers/webgl-context-data.js +21 -0
- package/dist/context/helpers/webgl-extensions.d.ts +4 -0
- package/dist/context/helpers/webgl-extensions.d.ts.map +1 -0
- package/dist/context/helpers/webgl-extensions.js +10 -0
- package/dist/context/parameters/unified-parameter-api.d.ts +3 -3
- package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
- package/dist/context/parameters/unified-parameter-api.js +94 -44
- package/dist/context/parameters/webgl-parameter-tables.d.ts +120 -99
- package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.js +469 -404
- package/dist/context/state-tracker/deep-array-equal.d.ts.map +1 -1
- package/dist/context/state-tracker/deep-array-equal.js +19 -14
- package/dist/context/state-tracker/track-context-state.d.ts +4 -4
- package/dist/context/state-tracker/track-context-state.d.ts.map +1 -1
- package/dist/context/state-tracker/track-context-state.js +188 -123
- package/dist/context/state-tracker/with-parameters.d.ts +2 -2
- package/dist/context/state-tracker/with-parameters.d.ts.map +1 -1
- package/dist/context/state-tracker/with-parameters.js +43 -26
- package/dist/dist.dev.js +3135 -4142
- package/dist/index.cjs +1766 -2717
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +25 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -1
- package/dist.min.js +9 -42
- package/package.json +11 -15
- package/src/adapter/converters/device-parameters.ts +105 -17
- package/src/adapter/converters/sampler-parameters.ts +12 -20
- package/src/adapter/converters/shader-formats.ts +47 -22
- package/src/adapter/converters/texture-formats.ts +138 -185
- package/src/adapter/converters/vertex-formats.ts +3 -3
- package/src/adapter/device-helpers/webgl-device-features.ts +101 -0
- package/src/adapter/device-helpers/{get-device-info.ts → webgl-device-info.ts} +30 -22
- package/src/adapter/device-helpers/webgl-device-limits.ts +53 -0
- package/src/adapter/helpers/decode-webgl-types.ts +13 -7
- package/src/adapter/helpers/get-shader-layout.ts +21 -31
- package/src/adapter/helpers/parse-shader-compiler-log.ts +10 -6
- package/src/adapter/helpers/set-uniform.ts +3 -4
- package/src/adapter/helpers/webgl-topology-utils.ts +10 -3
- package/src/adapter/objects/constants-to-keys.ts +3 -2
- package/src/adapter/objects/webgl-renderbuffer.ts +38 -16
- package/src/adapter/objects/webgl-resource.ts +7 -140
- package/src/adapter/resources/webgl-buffer.ts +10 -14
- package/src/adapter/resources/webgl-command-buffer.ts +24 -34
- package/src/adapter/resources/webgl-command-encoder.ts +14 -11
- package/src/adapter/resources/webgl-external-texture.ts +5 -5
- package/src/adapter/resources/webgl-framebuffer.ts +38 -34
- package/src/adapter/resources/webgl-query-set.ts +171 -0
- package/src/adapter/resources/webgl-render-pass.ts +24 -15
- package/src/adapter/resources/webgl-render-pipeline.ts +138 -70
- package/src/adapter/resources/webgl-sampler.ts +7 -10
- package/src/adapter/resources/webgl-shader.ts +65 -11
- package/src/adapter/resources/webgl-texture-view.ts +28 -0
- package/src/adapter/resources/webgl-texture.ts +38 -105
- package/src/adapter/resources/webgl-transform-feedback.ts +16 -22
- package/src/adapter/resources/webgl-vertex-array.ts +20 -21
- package/src/adapter/webgl-canvas-context.ts +7 -11
- package/src/adapter/webgl-device.ts +106 -151
- package/src/classic/accessor.ts +5 -4
- package/src/classic/clear.ts +25 -20
- package/src/classic/copy-and-blit.ts +12 -6
- package/src/classic/format-utils.ts +2 -1
- package/src/classic/typed-array-utils.ts +3 -7
- package/src/context/debug/spector.ts +9 -6
- package/src/context/debug/webgl-developer-tools.ts +31 -20
- package/src/context/{context → helpers}/create-browser-context.ts +9 -33
- package/src/context/{polyfill/context-data.ts → helpers/webgl-context-data.ts} +3 -2
- package/src/context/helpers/webgl-extensions.ts +17 -0
- package/src/context/parameters/unified-parameter-api.ts +5 -4
- package/src/context/parameters/webgl-parameter-tables.ts +118 -90
- package/src/context/state-tracker/deep-array-equal.ts +2 -1
- package/src/context/state-tracker/track-context-state.ts +29 -23
- package/src/context/state-tracker/with-parameters.ts +7 -2
- package/src/index.ts +4 -18
- package/src/types.ts +2 -1
- package/dist/adapter/converters/device-parameters.js.map +0 -1
- package/dist/adapter/converters/sampler-parameters.js.map +0 -1
- package/dist/adapter/converters/shader-formats.js.map +0 -1
- package/dist/adapter/converters/texture-formats.js.map +0 -1
- package/dist/adapter/converters/vertex-formats.js.map +0 -1
- package/dist/adapter/device-helpers/device-features.js.map +0 -1
- package/dist/adapter/device-helpers/device-limits.js.map +0 -1
- package/dist/adapter/device-helpers/get-device-info.js.map +0 -1
- package/dist/adapter/device-helpers/is-old-ie.d.ts +0 -2
- package/dist/adapter/device-helpers/is-old-ie.d.ts.map +0 -1
- package/dist/adapter/device-helpers/is-old-ie.js +0 -9
- package/dist/adapter/device-helpers/is-old-ie.js.map +0 -1
- package/dist/adapter/helpers/decode-webgl-types.js.map +0 -1
- package/dist/adapter/helpers/get-shader-layout.js.map +0 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.js.map +0 -1
- package/dist/adapter/helpers/set-uniform.js.map +0 -1
- package/dist/adapter/helpers/webgl-topology-utils.js.map +0 -1
- package/dist/adapter/objects/constants-to-keys.js.map +0 -1
- package/dist/adapter/objects/webgl-renderbuffer.js.map +0 -1
- package/dist/adapter/objects/webgl-resource.js.map +0 -1
- package/dist/adapter/resources/webgl-buffer.js.map +0 -1
- package/dist/adapter/resources/webgl-command-buffer.js.map +0 -1
- package/dist/adapter/resources/webgl-command-encoder.js.map +0 -1
- package/dist/adapter/resources/webgl-external-texture.js.map +0 -1
- package/dist/adapter/resources/webgl-framebuffer.js.map +0 -1
- package/dist/adapter/resources/webgl-render-pass.js.map +0 -1
- package/dist/adapter/resources/webgl-render-pipeline.js.map +0 -1
- package/dist/adapter/resources/webgl-sampler.js.map +0 -1
- package/dist/adapter/resources/webgl-shader.js.map +0 -1
- package/dist/adapter/resources/webgl-texture.js.map +0 -1
- package/dist/adapter/resources/webgl-transform-feedback.js.map +0 -1
- package/dist/adapter/resources/webgl-vertex-array.js.map +0 -1
- package/dist/adapter/webgl-canvas-context.js.map +0 -1
- package/dist/adapter/webgl-device.js.map +0 -1
- package/dist/classic/accessor.js.map +0 -1
- package/dist/classic/clear.js.map +0 -1
- package/dist/classic/copy-and-blit.js.map +0 -1
- package/dist/classic/format-utils.js.map +0 -1
- package/dist/classic/typed-array-utils.js.map +0 -1
- package/dist/context/context/create-browser-context.js.map +0 -1
- package/dist/context/context/create-headless-context.d.ts +0 -9
- package/dist/context/context/create-headless-context.d.ts.map +0 -1
- package/dist/context/context/create-headless-context.js +0 -42
- package/dist/context/context/create-headless-context.js.map +0 -1
- package/dist/context/context/webgl-checks.d.ts +0 -13
- package/dist/context/context/webgl-checks.d.ts.map +0 -1
- package/dist/context/context/webgl-checks.js +0 -31
- package/dist/context/context/webgl-checks.js.map +0 -1
- package/dist/context/debug/spector.js.map +0 -1
- package/dist/context/debug/webgl-developer-tools.js.map +0 -1
- package/dist/context/parameters/unified-parameter-api.js.map +0 -1
- package/dist/context/parameters/webgl-parameter-tables.js.map +0 -1
- package/dist/context/polyfill/context-data.d.ts.map +0 -1
- package/dist/context/polyfill/context-data.js +0 -12
- package/dist/context/polyfill/context-data.js.map +0 -1
- package/dist/context/polyfill/get-parameter-polyfill.d.ts +0 -2
- package/dist/context/polyfill/get-parameter-polyfill.d.ts.map +0 -1
- package/dist/context/polyfill/get-parameter-polyfill.js +0 -85
- package/dist/context/polyfill/get-parameter-polyfill.js.map +0 -1
- package/dist/context/polyfill/polyfill-context.d.ts +0 -5
- package/dist/context/polyfill/polyfill-context.d.ts.map +0 -1
- package/dist/context/polyfill/polyfill-context.js +0 -87
- package/dist/context/polyfill/polyfill-context.js.map +0 -1
- package/dist/context/polyfill/polyfill-table.d.ts +0 -48
- package/dist/context/polyfill/polyfill-table.d.ts.map +0 -1
- package/dist/context/polyfill/polyfill-table.js +0 -137
- package/dist/context/polyfill/polyfill-table.js.map +0 -1
- package/dist/context/polyfill/polyfill-vertex-array-object.d.ts +0 -2
- package/dist/context/polyfill/polyfill-vertex-array-object.d.ts.map +0 -1
- package/dist/context/polyfill/polyfill-vertex-array-object.js +0 -265
- package/dist/context/polyfill/polyfill-vertex-array-object.js.map +0 -1
- package/dist/context/state-tracker/deep-array-equal.js.map +0 -1
- package/dist/context/state-tracker/track-context-state.js.map +0 -1
- package/dist/context/state-tracker/with-parameters.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/src/adapter/device-helpers/device-features.ts +0 -161
- package/src/adapter/device-helpers/device-limits.ts +0 -155
- package/src/adapter/device-helpers/is-old-ie.ts +0 -14
- package/src/context/context/create-headless-context.ts +0 -51
- package/src/context/context/webgl-checks.ts +0 -51
- package/src/context/polyfill/get-parameter-polyfill.ts +0 -122
- package/src/context/polyfill/polyfill-context.ts +0 -104
- package/src/context/polyfill/polyfill-table.ts +0 -167
- package/src/context/polyfill/polyfill-vertex-array-object.ts +0 -365
|
@@ -1,91 +1,106 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { GL } from '@luma.gl/constants';
|
|
1
5
|
const ERR_TYPE_DEDUCTION = 'Failed to deduce GL constant from typed array';
|
|
6
|
+
/**
|
|
7
|
+
* Converts TYPED ARRAYS to corresponding GL constant
|
|
8
|
+
* Used to auto deduce gl parameter types
|
|
9
|
+
* @deprecated Use getDataTypeFromTypedArray
|
|
10
|
+
* @param arrayOrType
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
2
13
|
export function getGLTypeFromTypedArray(arrayOrType) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
// If typed array, look up constructor
|
|
15
|
+
const type = ArrayBuffer.isView(arrayOrType) ? arrayOrType.constructor : arrayOrType;
|
|
16
|
+
switch (type) {
|
|
17
|
+
case Float32Array:
|
|
18
|
+
return GL.FLOAT;
|
|
19
|
+
case Uint16Array:
|
|
20
|
+
return GL.UNSIGNED_SHORT;
|
|
21
|
+
case Uint32Array:
|
|
22
|
+
return GL.UNSIGNED_INT;
|
|
23
|
+
case Uint8Array:
|
|
24
|
+
return GL.UNSIGNED_BYTE;
|
|
25
|
+
case Uint8ClampedArray:
|
|
26
|
+
return GL.UNSIGNED_BYTE;
|
|
27
|
+
case Int8Array:
|
|
28
|
+
return GL.BYTE;
|
|
29
|
+
case Int16Array:
|
|
30
|
+
return GL.SHORT;
|
|
31
|
+
case Int32Array:
|
|
32
|
+
return GL.INT;
|
|
33
|
+
default:
|
|
34
|
+
throw new Error(ERR_TYPE_DEDUCTION);
|
|
35
|
+
}
|
|
24
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Converts GL constant to corresponding TYPED ARRAY
|
|
39
|
+
* Used to auto deduce gl parameter types
|
|
40
|
+
* @deprecated Use getTypedArrayFromDataType
|
|
41
|
+
* @param glType
|
|
42
|
+
* @param param1
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
// eslint-disable-next-line complexity
|
|
25
46
|
export function getTypedArrayFromGLType(glType, options) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
47
|
+
const { clamped = true } = options || {};
|
|
48
|
+
// Sorted in some order of likelihood to reduce amount of comparisons
|
|
49
|
+
switch (glType) {
|
|
50
|
+
case GL.FLOAT:
|
|
51
|
+
return Float32Array;
|
|
52
|
+
case GL.UNSIGNED_SHORT:
|
|
53
|
+
case GL.UNSIGNED_SHORT_5_6_5:
|
|
54
|
+
case GL.UNSIGNED_SHORT_4_4_4_4:
|
|
55
|
+
case GL.UNSIGNED_SHORT_5_5_5_1:
|
|
56
|
+
return Uint16Array;
|
|
57
|
+
case GL.UNSIGNED_INT:
|
|
58
|
+
return Uint32Array;
|
|
59
|
+
case GL.UNSIGNED_BYTE:
|
|
60
|
+
return clamped ? Uint8ClampedArray : Uint8Array;
|
|
61
|
+
case GL.BYTE:
|
|
62
|
+
return Int8Array;
|
|
63
|
+
case GL.SHORT:
|
|
64
|
+
return Int16Array;
|
|
65
|
+
case GL.INT:
|
|
66
|
+
return Int32Array;
|
|
67
|
+
default:
|
|
68
|
+
throw new Error('Failed to deduce typed array type from GL constant');
|
|
69
|
+
}
|
|
50
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Flip rows (can be used on arrays returned from `Framebuffer.readPixels`)
|
|
73
|
+
* https: *stackoverflow.com/questions/41969562/
|
|
74
|
+
* how-can-i-flip-the-result-of-webglrenderingcontext-readpixels
|
|
75
|
+
* @param param0
|
|
76
|
+
*/
|
|
51
77
|
export function flipRows(options) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
data.set(tempBuffer, bottomOffset);
|
|
67
|
-
}
|
|
78
|
+
const { data, width, height, bytesPerPixel = 4, temp } = options;
|
|
79
|
+
const bytesPerRow = width * bytesPerPixel;
|
|
80
|
+
// make a temp buffer to hold one row
|
|
81
|
+
const tempBuffer = temp || new Uint8Array(bytesPerRow);
|
|
82
|
+
for (let y = 0; y < height / 2; ++y) {
|
|
83
|
+
const topOffset = y * bytesPerRow;
|
|
84
|
+
const bottomOffset = (height - y - 1) * bytesPerRow;
|
|
85
|
+
// make copy of a row on the top half
|
|
86
|
+
tempBuffer.set(data.subarray(topOffset, topOffset + bytesPerRow));
|
|
87
|
+
// copy a row from the bottom half to the top
|
|
88
|
+
data.copyWithin(topOffset, bottomOffset, bottomOffset + bytesPerRow);
|
|
89
|
+
// copy the copy of the top half row to the bottom half
|
|
90
|
+
data.set(tempBuffer, bottomOffset);
|
|
91
|
+
}
|
|
68
92
|
}
|
|
69
93
|
export function scalePixels(options) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
for (let c = 0; c < 4; c++) {
|
|
81
|
-
newData[(y * newWidth + x) * 4 + c] = data[(y * 2 * width + x * 2) * 4 + c];
|
|
82
|
-
}
|
|
94
|
+
const { data, width, height } = options;
|
|
95
|
+
const newWidth = Math.round(width / 2);
|
|
96
|
+
const newHeight = Math.round(height / 2);
|
|
97
|
+
const newData = new Uint8Array(newWidth * newHeight * 4);
|
|
98
|
+
for (let y = 0; y < newHeight; y++) {
|
|
99
|
+
for (let x = 0; x < newWidth; x++) {
|
|
100
|
+
for (let c = 0; c < 4; c++) {
|
|
101
|
+
newData[(y * newWidth + x) * 4 + c] = data[(y * 2 * width + x * 2) * 4 + c];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
83
104
|
}
|
|
84
|
-
|
|
85
|
-
return {
|
|
86
|
-
data: newData,
|
|
87
|
-
width: newWidth,
|
|
88
|
-
height: newHeight
|
|
89
|
-
};
|
|
105
|
+
return { data: newData, width: newWidth, height: newHeight };
|
|
90
106
|
}
|
|
91
|
-
//# sourceMappingURL=typed-array-utils.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stores luma.gl specific state associated with a context
|
|
3
|
+
*/
|
|
4
|
+
export interface WebGLContextData {
|
|
5
|
+
_polyfilled: boolean;
|
|
6
|
+
_extensions: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Gets luma.gl specific state from a context
|
|
10
|
+
* @returns context state
|
|
11
|
+
*/
|
|
12
|
+
export declare function getContextData(gl: WebGL2RenderingContext): WebGLContextData;
|
|
13
|
+
export declare function initializeExtensions(gl: WebGL2RenderingContext): void;
|
|
14
|
+
//# sourceMappingURL=context-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-data.d.ts","sourceRoot":"","sources":["../../../src/context/context/context-data.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,sBAAsB,GAAG,gBAAgB,CAc3E;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,sBAAsB,GAAG,IAAI,CAYrE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// luma.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
/**
|
|
4
|
+
* Gets luma.gl specific state from a context
|
|
5
|
+
* @returns context state
|
|
6
|
+
*/
|
|
7
|
+
export function getContextData(gl) {
|
|
8
|
+
// @ts-expect-error
|
|
9
|
+
const luma = gl.luma;
|
|
10
|
+
if (!luma) {
|
|
11
|
+
const contextState = {
|
|
12
|
+
_polyfilled: false,
|
|
13
|
+
_extensions: {}
|
|
14
|
+
};
|
|
15
|
+
// @ts-expect-error
|
|
16
|
+
gl.luma = contextState;
|
|
17
|
+
}
|
|
18
|
+
// @ts-expect-error
|
|
19
|
+
return gl.luma;
|
|
20
|
+
}
|
|
21
|
+
export function initializeExtensions(gl) {
|
|
22
|
+
const contextState = getContextData(gl);
|
|
23
|
+
// `getSupportedExtensions` can return null when context is lost.
|
|
24
|
+
const EXTENSIONS = gl.getSupportedExtensions() || [];
|
|
25
|
+
// Generates warnings in Chrome
|
|
26
|
+
const IGNORE_EXTENSIONS = ['WEBGL_polygon_mode'];
|
|
27
|
+
for (const extensionName of EXTENSIONS) {
|
|
28
|
+
if (!IGNORE_EXTENSIONS.includes(extensionName)) {
|
|
29
|
+
const extension = gl.getExtension(extensionName);
|
|
30
|
+
contextState._extensions[extensionName] = extension;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ContextProps
|
|
3
|
-
* @param webgl2 Set to false to not create a WebGL2 context (force webgl1)
|
|
4
|
-
* @param webgl1 set to false to not create a WebGL1 context (fail if webgl2 not available)
|
|
5
3
|
* @param onContextLost
|
|
6
4
|
* @param onContextRestored
|
|
7
5
|
*
|
|
@@ -16,9 +14,6 @@
|
|
|
16
14
|
* @param failIfMajorPerformanceCaveat Do not create if the system performance is low.
|
|
17
15
|
*/
|
|
18
16
|
type ContextProps = {
|
|
19
|
-
type?: 'webgl' | 'webgl1' | 'webgl2' | string;
|
|
20
|
-
webgl1?: boolean;
|
|
21
|
-
webgl2?: boolean;
|
|
22
17
|
onContextLost?: (event: Event) => void;
|
|
23
18
|
onContextRestored?: (event: Event) => void;
|
|
24
19
|
alpha?: boolean;
|
|
@@ -35,6 +30,6 @@ type ContextProps = {
|
|
|
35
30
|
* Note calling this multiple time on the same canvas does return the same context
|
|
36
31
|
* @param canvas A canvas element or offscreen canvas
|
|
37
32
|
*/
|
|
38
|
-
export declare function createBrowserContext(canvas: HTMLCanvasElement | OffscreenCanvas, props: ContextProps):
|
|
33
|
+
export declare function createBrowserContext(canvas: HTMLCanvasElement | OffscreenCanvas, props: ContextProps): WebGL2RenderingContext;
|
|
39
34
|
export {};
|
|
40
35
|
//# sourceMappingURL=create-browser-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-browser-context.d.ts","sourceRoot":"","sources":["../../../src/context/context/create-browser-context.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"create-browser-context.d.ts","sourceRoot":"","sources":["../../../src/context/context/create-browser-context.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,KAAK,YAAY,GAAG;IAClB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACvC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,eAAe,CAAC,EAAE,SAAS,GAAG,kBAAkB,GAAG,WAAW,CAAC;IAC/D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAUF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,iBAAiB,GAAG,eAAe,EAC3C,KAAK,EAAE,YAAY,GAClB,sBAAsB,CA+CxB"}
|
|
@@ -1,53 +1,66 @@
|
|
|
1
|
+
// luma.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
1
3
|
const DEFAULT_CONTEXT_PROPS = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
powerPreference: 'high-performance', // After all, most apps are using WebGL for performance reasons
|
|
5
|
+
// eslint-disable-next-line no-console
|
|
6
|
+
onContextLost: () => console.error('WebGL context lost'),
|
|
7
|
+
// eslint-disable-next-line no-console
|
|
8
|
+
onContextRestored: () => console.info('WebGL context restored')
|
|
7
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Create a WebGL context for a canvas
|
|
12
|
+
* Note calling this multiple time on the same canvas does return the same context
|
|
13
|
+
* @param canvas A canvas element or offscreen canvas
|
|
14
|
+
*/
|
|
8
15
|
export function createBrowserContext(canvas, props) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const {
|
|
41
|
-
onContextLost
|
|
42
|
-
} = props;
|
|
43
|
-
canvas.addEventListener('webglcontextlost', event => onContextLost(event), false);
|
|
44
|
-
}
|
|
45
|
-
if (props.onContextRestored) {
|
|
46
|
-
const {
|
|
47
|
-
onContextRestored
|
|
48
|
-
} = props;
|
|
49
|
-
canvas.addEventListener('webglcontextrestored', event => onContextRestored(event), false);
|
|
50
|
-
}
|
|
51
|
-
return gl;
|
|
16
|
+
props = { ...DEFAULT_CONTEXT_PROPS, ...props };
|
|
17
|
+
// Try to extract any extra information about why context creation failed
|
|
18
|
+
let errorMessage = null;
|
|
19
|
+
const onCreateError = error => (errorMessage = error.statusMessage || errorMessage);
|
|
20
|
+
canvas.addEventListener('webglcontextcreationerror', onCreateError, false);
|
|
21
|
+
// Create the desired context
|
|
22
|
+
let gl = null;
|
|
23
|
+
// props.failIfMajorPerformanceCaveat = true;
|
|
24
|
+
// We require webgl2 context
|
|
25
|
+
gl ||= canvas.getContext('webgl2', props);
|
|
26
|
+
// Software GPU
|
|
27
|
+
// props.failIfMajorPerformanceCaveat = false;
|
|
28
|
+
// if (!gl && props.webgl1) {
|
|
29
|
+
// gl = canvas.getContext('webgl', props);
|
|
30
|
+
// }
|
|
31
|
+
// TODO are we removing this listener before giving it a chance to fire?
|
|
32
|
+
canvas.removeEventListener('webglcontextcreationerror', onCreateError, false);
|
|
33
|
+
if (!gl) {
|
|
34
|
+
throw new Error(`Failed to create WebGL context: ${errorMessage || 'Unknown error'}`);
|
|
35
|
+
}
|
|
36
|
+
if (props.onContextLost) {
|
|
37
|
+
// Carefully extract and wrap callbacks to prevent addEventListener from rebinding them.
|
|
38
|
+
const { onContextLost } = props;
|
|
39
|
+
canvas.addEventListener('webglcontextlost', (event) => onContextLost(event), false);
|
|
40
|
+
}
|
|
41
|
+
if (props.onContextRestored) {
|
|
42
|
+
// Carefully extract and wrap callbacks to prevent addEventListener from rebinding them.
|
|
43
|
+
const { onContextRestored } = props;
|
|
44
|
+
canvas.addEventListener('webglcontextrestored', (event) => onContextRestored(event), false);
|
|
45
|
+
}
|
|
46
|
+
return gl;
|
|
52
47
|
}
|
|
53
|
-
|
|
48
|
+
/* TODO - can we call this asynchronously to catch the error events?
|
|
49
|
+
export async function createBrowserContextAsync(canvas: HTMLCanvasElement | OffscreenCanvas, props: ContextProps): Promise<WebGL2RenderingContext> {
|
|
50
|
+
props = {...DEFAULT_CONTEXT_PROPS, ...props};
|
|
51
|
+
|
|
52
|
+
// Try to extract any extra information about why context creation failed
|
|
53
|
+
let errorMessage = null;
|
|
54
|
+
const onCreateError = (error) => (errorMessage = error.statusMessage || errorMessage);
|
|
55
|
+
canvas.addEventListener('webglcontextcreationerror', onCreateError, false);
|
|
56
|
+
|
|
57
|
+
const gl = createBrowserContext(canvas, props);
|
|
58
|
+
|
|
59
|
+
// Give the listener a chance to fire
|
|
60
|
+
await new Promise(resolve => setTimeout(resolve, 0));
|
|
61
|
+
|
|
62
|
+
canvas.removeEventListener('webglcontextcreationerror', onCreateError, false);
|
|
63
|
+
|
|
64
|
+
return gl;
|
|
65
|
+
}
|
|
66
|
+
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spector.d.ts","sourceRoot":"","sources":["../../../src/context/debug/spector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spector.d.ts","sourceRoot":"","sources":["../../../src/context/debug/spector.ts"],"names":[],"mappings":"AAMA,2CAA2C;AAC3C,KAAK,YAAY,GAAG;IAClB,wBAAwB;IACxB,MAAM,CAAC,EAAE,iBAAiB,GAAG,eAAe,CAAC;IAC7C,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;CACrC,CAAC;AAaF,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,OAAO,EAAE,GAAG,CAAC;CAClB;AAED,sDAAsD;AACtD,wBAAsB,aAAa,CAAC,KAAK,CAAC,EAAE,YAAY,iBAQvD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,YAAY,OAsDvD"}
|
|
@@ -1,64 +1,69 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
1
4
|
import { log, loadScript } from '@luma.gl/core';
|
|
2
5
|
const DEFAULT_SPECTOR_PROPS = {
|
|
3
|
-
|
|
6
|
+
spector: log.get('spector') || log.get('inspect')
|
|
4
7
|
};
|
|
8
|
+
// https://github.com/BabylonJS/Spector.js#basic-usage
|
|
5
9
|
const SPECTOR_CDN_URL = 'https://spectorcdn.babylonjs.com/spector.bundle.js';
|
|
6
10
|
const LOG_LEVEL = 1;
|
|
7
11
|
let spector = null;
|
|
8
12
|
let initialized = false;
|
|
13
|
+
/** Loads spector from CDN if not already installed */
|
|
9
14
|
export async function loadSpectorJS(props) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
if (!globalThis.SPECTOR) {
|
|
16
|
+
try {
|
|
17
|
+
await loadScript(SPECTOR_CDN_URL);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
log.warn(String(error));
|
|
21
|
+
}
|
|
15
22
|
}
|
|
16
|
-
}
|
|
17
23
|
}
|
|
18
24
|
export function initializeSpectorJS(props) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
...props
|
|
23
|
-
};
|
|
24
|
-
if (!((_props = props) !== null && _props !== void 0 && _props.spector)) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
if (!spector && globalThis.SPECTOR) {
|
|
28
|
-
log.probe(LOG_LEVEL, 'SPECTOR found and initialized')();
|
|
29
|
-
spector = new globalThis.SPECTOR.Spector();
|
|
30
|
-
if (globalThis.luma) {
|
|
31
|
-
globalThis.luma.spector = spector;
|
|
25
|
+
props = { ...DEFAULT_SPECTOR_PROPS, ...props };
|
|
26
|
+
if (!props?.spector) {
|
|
27
|
+
return null;
|
|
32
28
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
initialized = true;
|
|
40
|
-
spector.spyCanvases();
|
|
41
|
-
(_spector = spector) === null || _spector === void 0 ? void 0 : _spector.onCaptureStarted.add(capture => log.info('Spector capture started:', capture)());
|
|
42
|
-
(_spector2 = spector) === null || _spector2 === void 0 ? void 0 : _spector2.onCapture.add(capture => {
|
|
43
|
-
var _spector3, _spector4, _spector5;
|
|
44
|
-
log.info('Spector capture complete:', capture)();
|
|
45
|
-
(_spector3 = spector) === null || _spector3 === void 0 ? void 0 : _spector3.getResultUI();
|
|
46
|
-
(_spector4 = spector) === null || _spector4 === void 0 ? void 0 : _spector4.resultView.display();
|
|
47
|
-
(_spector5 = spector) === null || _spector5 === void 0 ? void 0 : _spector5.resultView.addCapture(capture);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
if ((_props2 = props) !== null && _props2 !== void 0 && _props2.canvas) {
|
|
51
|
-
var _spector6, _props3;
|
|
52
|
-
if (typeof props.spector === 'string' && props.spector !== props.canvas.id) {
|
|
53
|
-
return spector;
|
|
29
|
+
if (!spector && globalThis.SPECTOR) {
|
|
30
|
+
log.probe(LOG_LEVEL, 'SPECTOR found and initialized')();
|
|
31
|
+
spector = new globalThis.SPECTOR.Spector();
|
|
32
|
+
if (globalThis.luma) {
|
|
33
|
+
globalThis.luma.spector = spector;
|
|
34
|
+
}
|
|
54
35
|
}
|
|
55
|
-
(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
36
|
+
if (!spector) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
if (!initialized) {
|
|
40
|
+
initialized = true;
|
|
41
|
+
// enables recording some extra information merged in the capture like texture memory sizes and formats
|
|
42
|
+
spector.spyCanvases();
|
|
43
|
+
// A callback when results are ready
|
|
44
|
+
spector?.onCaptureStarted.add((capture) => log.info('Spector capture started:', capture)());
|
|
45
|
+
spector?.onCapture.add((capture) => {
|
|
46
|
+
log.info('Spector capture complete:', capture)();
|
|
47
|
+
// Use undocumented Spector API to open the UI with our capture
|
|
48
|
+
// See https://github.com/BabylonJS/Spector.js/blob/767ad1195a25b85a85c381f400eb50a979239eca/src/spector.ts#L124
|
|
49
|
+
spector?.getResultUI();
|
|
50
|
+
spector?.resultView.display();
|
|
51
|
+
spector?.resultView.addCapture(capture);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (props?.canvas) {
|
|
55
|
+
// @ts-expect-error If spector is specified as a canvas id, only monitor that canvas
|
|
56
|
+
if (typeof props.spector === 'string' && props.spector !== props.canvas.id) {
|
|
57
|
+
return spector;
|
|
58
|
+
}
|
|
59
|
+
// capture startup
|
|
60
|
+
// spector?.captureCanvas(props?.canvas);
|
|
61
|
+
spector?.startCapture(props?.canvas, 500); // 500 commands
|
|
62
|
+
new Promise(resolve => setTimeout(resolve, 2000)).then(_ => {
|
|
63
|
+
log.info('Spector capture stopped after 2 seconds')();
|
|
64
|
+
spector?.stopCapture();
|
|
65
|
+
// spector?.displayUI();
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return spector;
|
|
63
69
|
}
|
|
64
|
-
//# sourceMappingURL=spector.js.map
|
|
@@ -2,7 +2,6 @@ type DebugContextProps = {
|
|
|
2
2
|
debug?: boolean;
|
|
3
3
|
throwOnError?: boolean;
|
|
4
4
|
break?: string[];
|
|
5
|
-
webgl2?: boolean;
|
|
6
5
|
};
|
|
7
6
|
declare global {
|
|
8
7
|
var WebGLDebugUtils: any;
|
|
@@ -14,6 +13,6 @@ declare global {
|
|
|
14
13
|
* @see https://github.com/vorg/webgl-debug
|
|
15
14
|
*/
|
|
16
15
|
export declare function loadWebGLDeveloperTools(): Promise<void>;
|
|
17
|
-
export declare function makeDebugContext(gl:
|
|
16
|
+
export declare function makeDebugContext(gl: WebGL2RenderingContext, props?: DebugContextProps): WebGL2RenderingContext | null;
|
|
18
17
|
export {};
|
|
19
18
|
//# sourceMappingURL=webgl-developer-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-developer-tools.d.ts","sourceRoot":"","sources":["../../../src/context/debug/webgl-developer-tools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webgl-developer-tools.d.ts","sourceRoot":"","sources":["../../../src/context/debug/webgl-developer-tools.ts"],"names":[],"mappings":"AAWA,KAAK,iBAAiB,GAAG;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAoBF,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,eAAe,EAAE,GAAG,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAO7D;AAID,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,sBAAsB,EAC1B,KAAK,GAAE,iBAAsB,GAC5B,sBAAsB,GAAG,IAAI,CAO/B"}
|