@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,4 +1,5 @@
|
|
|
1
|
-
// luma.gl
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
2
3
|
// Copyright (c) vis.gl contributors
|
|
3
4
|
|
|
4
5
|
import {assert, ResourceProps, TextureFormat} from '@luma.gl/core';
|
|
@@ -6,7 +7,10 @@ import {GL} from '@luma.gl/constants';
|
|
|
6
7
|
import {WebGLDevice} from '../webgl-device';
|
|
7
8
|
import {WebGLResource} from './webgl-resource';
|
|
8
9
|
import {isRenderbufferFormatSupported} from '../converters/texture-formats';
|
|
9
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
convertTextureFormatToGL,
|
|
12
|
+
getTextureFormatBytesPerPixel
|
|
13
|
+
} from '../converters/texture-formats';
|
|
10
14
|
|
|
11
15
|
export type RenderbufferProps = ResourceProps & {
|
|
12
16
|
format: TextureFormat;
|
|
@@ -32,23 +36,35 @@ export class WEBGLRenderbuffer extends WebGLResource<RenderbufferProps> {
|
|
|
32
36
|
userData: undefined,
|
|
33
37
|
format: undefined, // 'depth16unorm'
|
|
34
38
|
width: 1,
|
|
35
|
-
height: 1,
|
|
39
|
+
height: 1,
|
|
36
40
|
samples: 0
|
|
37
|
-
};
|
|
41
|
+
};
|
|
38
42
|
|
|
39
|
-
override get [Symbol.toStringTag](): string {
|
|
43
|
+
override get [Symbol.toStringTag](): string {
|
|
44
|
+
return 'Renderbuffer';
|
|
45
|
+
}
|
|
40
46
|
|
|
41
|
-
get width(): number {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
get
|
|
45
|
-
|
|
47
|
+
get width(): number {
|
|
48
|
+
return this.props.width;
|
|
49
|
+
}
|
|
50
|
+
get height(): number {
|
|
51
|
+
return this.props.height;
|
|
52
|
+
}
|
|
53
|
+
get format(): TextureFormat {
|
|
54
|
+
return this.props.format;
|
|
55
|
+
}
|
|
56
|
+
get samples(): number {
|
|
57
|
+
return this.props.samples;
|
|
58
|
+
}
|
|
59
|
+
get attachment() {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
46
62
|
|
|
47
63
|
/** WebGL format constant */
|
|
48
64
|
glFormat: GL;
|
|
49
65
|
|
|
50
66
|
static isTextureFormatSupported(device: WebGLDevice, format: TextureFormat): boolean {
|
|
51
|
-
return isRenderbufferFormatSupported(device.gl, format);
|
|
67
|
+
return isRenderbufferFormatSupported(device.gl, format, device._extensions);
|
|
52
68
|
}
|
|
53
69
|
|
|
54
70
|
constructor(device: WebGLDevice, props: RenderbufferProps) {
|
|
@@ -57,11 +73,11 @@ export class WEBGLRenderbuffer extends WebGLResource<RenderbufferProps> {
|
|
|
57
73
|
throw new Error('Renderbuffer');
|
|
58
74
|
}
|
|
59
75
|
super(device, props, WEBGLRenderbuffer.defaultProps);
|
|
60
|
-
this.glFormat = convertTextureFormatToGL(this.props.format
|
|
76
|
+
this.glFormat = convertTextureFormatToGL(this.props.format);
|
|
61
77
|
this._initialize(this.props);
|
|
62
78
|
}
|
|
63
79
|
|
|
64
|
-
resize(size: {width: number
|
|
80
|
+
resize(size: {width: number; height: number}): void {
|
|
65
81
|
// Don't resize if width/height haven't changed
|
|
66
82
|
if (size.width !== this.width || size.height !== this.height) {
|
|
67
83
|
Object.assign(this.props, {...size, format: this.format, samples: this.samples});
|
|
@@ -80,8 +96,14 @@ export class WEBGLRenderbuffer extends WebGLResource<RenderbufferProps> {
|
|
|
80
96
|
|
|
81
97
|
this.gl.bindRenderbuffer(GL.RENDERBUFFER, this.handle);
|
|
82
98
|
|
|
83
|
-
if (samples !== 0
|
|
84
|
-
this.
|
|
99
|
+
if (samples !== 0) {
|
|
100
|
+
this.gl.renderbufferStorageMultisample(
|
|
101
|
+
GL.RENDERBUFFER,
|
|
102
|
+
samples,
|
|
103
|
+
this.glFormat,
|
|
104
|
+
width,
|
|
105
|
+
height
|
|
106
|
+
);
|
|
85
107
|
} else {
|
|
86
108
|
this.gl.renderbufferStorage(GL.RENDERBUFFER, this.glFormat, width, height);
|
|
87
109
|
}
|
|
@@ -89,7 +111,7 @@ export class WEBGLRenderbuffer extends WebGLResource<RenderbufferProps> {
|
|
|
89
111
|
this.gl.bindRenderbuffer(GL.RENDERBUFFER, null);
|
|
90
112
|
|
|
91
113
|
this.trackAllocatedMemory(
|
|
92
|
-
width * height * (samples || 1) * getTextureFormatBytesPerPixel(this.glFormat
|
|
114
|
+
width * height * (samples || 1) * getTextureFormatBytesPerPixel(this.glFormat)
|
|
93
115
|
);
|
|
94
116
|
}
|
|
95
117
|
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
// luma.gl
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
2
3
|
// Copyright (c) vis.gl contributors
|
|
3
4
|
|
|
4
|
-
import {Resource, assert, uid, stubRemovedMethods} from '@luma.gl/core';
|
|
5
5
|
import type {Device, ResourceProps} from '@luma.gl/core';
|
|
6
|
+
import {Resource, uid, stubRemovedMethods} from '@luma.gl/core';
|
|
6
7
|
import {GL} from '@luma.gl/constants';
|
|
7
|
-
import {isWebGL2, assertWebGLContext} from '../../context/context/webgl-checks';
|
|
8
8
|
import {WebGLDevice} from '../webgl-device';
|
|
9
9
|
|
|
10
|
-
// Requires full GL enum to be bundled... Make these bindings dependent on dynamic import (debug)?
|
|
11
|
-
import {getKeyValue} from './constants-to-keys';
|
|
12
|
-
|
|
13
10
|
const ERR_RESOURCE_METHOD_UNDEFINED = 'Resource subclass must define virtual methods';
|
|
14
11
|
|
|
15
12
|
/**
|
|
@@ -17,7 +14,7 @@ const ERR_RESOURCE_METHOD_UNDEFINED = 'Resource subclass must define virtual met
|
|
|
17
14
|
*/
|
|
18
15
|
export abstract class WebGLResource<Props extends ResourceProps> extends Resource<Props> {
|
|
19
16
|
readonly device: WebGLDevice;
|
|
20
|
-
readonly gl:
|
|
17
|
+
readonly gl: WebGL2RenderingContext;
|
|
21
18
|
readonly gl2: WebGL2RenderingContext;
|
|
22
19
|
private _handle: any;
|
|
23
20
|
|
|
@@ -31,12 +28,10 @@ export abstract class WebGLResource<Props extends ResourceProps> extends Resourc
|
|
|
31
28
|
this.device = WebGLDevice.attach(device);
|
|
32
29
|
const gl = this.device.gl;
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// extends
|
|
31
|
+
// extends
|
|
37
32
|
const {id} = props || {};
|
|
38
33
|
this.gl = gl;
|
|
39
|
-
this.gl2 = gl
|
|
34
|
+
this.gl2 = gl;
|
|
40
35
|
this.id = id || uid(this.constructor.name);
|
|
41
36
|
|
|
42
37
|
// Set the handle
|
|
@@ -84,7 +79,7 @@ export abstract class WebGLResource<Props extends ResourceProps> extends Resourc
|
|
|
84
79
|
// @ts-expect-error
|
|
85
80
|
if (children && deleteChildren) {
|
|
86
81
|
// @ts-expect-error
|
|
87
|
-
children.filter(Boolean).forEach(
|
|
82
|
+
children.filter(Boolean).forEach(child => child.destroy());
|
|
88
83
|
}
|
|
89
84
|
|
|
90
85
|
return this;
|
|
@@ -117,134 +112,6 @@ export abstract class WebGLResource<Props extends ResourceProps> extends Resourc
|
|
|
117
112
|
this.bind(null);
|
|
118
113
|
}
|
|
119
114
|
|
|
120
|
-
/**
|
|
121
|
-
* Query a Resource parameter
|
|
122
|
-
*
|
|
123
|
-
* @param name
|
|
124
|
-
* @return param
|
|
125
|
-
*/
|
|
126
|
-
getParameter(pname: number, props: any = {}): any {
|
|
127
|
-
pname = getKeyValue(this.gl, pname);
|
|
128
|
-
assert(pname);
|
|
129
|
-
|
|
130
|
-
// @ts-expect-error
|
|
131
|
-
const parameters = this.constructor.PARAMETERS || {};
|
|
132
|
-
|
|
133
|
-
// Use parameter definitions to handle unsupported parameters
|
|
134
|
-
const parameter = parameters[pname];
|
|
135
|
-
if (parameter) {
|
|
136
|
-
const isWebgl2 = isWebGL2(this.gl);
|
|
137
|
-
|
|
138
|
-
// Check if we can query for this parameter
|
|
139
|
-
const parameterAvailable =
|
|
140
|
-
(!('webgl2' in parameter) || isWebgl2) &&
|
|
141
|
-
(!('extension' in parameter) || this.gl.getExtension(parameter.extension));
|
|
142
|
-
|
|
143
|
-
if (!parameterAvailable) {
|
|
144
|
-
const webgl1Default = parameter.webgl1;
|
|
145
|
-
const webgl2Default = 'webgl2' in parameter ? parameter.webgl2 : parameter.webgl1;
|
|
146
|
-
const defaultValue = isWebgl2 ? webgl2Default : webgl1Default;
|
|
147
|
-
return defaultValue;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// If unknown parameter - Could be a valid parameter not covered by PARAMS
|
|
152
|
-
// Attempt to query for it and let WebGL report errors
|
|
153
|
-
return this._getParameter(pname, props);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// Many resources support a getParameter call -
|
|
157
|
-
// getParameters will get all parameters - slow but useful for debugging
|
|
158
|
-
// eslint-disable-next-line complexity
|
|
159
|
-
getParameters(options: {parameters?: any, keys?: any} = {}) {
|
|
160
|
-
const {parameters, keys} = options;
|
|
161
|
-
|
|
162
|
-
// Get parameter definitions for this Resource
|
|
163
|
-
// @ts-expect-error
|
|
164
|
-
const PARAMETERS = this.constructor.PARAMETERS || {};
|
|
165
|
-
|
|
166
|
-
const isWebgl2 = isWebGL2(this.gl);
|
|
167
|
-
|
|
168
|
-
const values: Record<string, any> = {};
|
|
169
|
-
|
|
170
|
-
// Query all parameters if no list provided
|
|
171
|
-
const parameterKeys = parameters || Object.keys(PARAMETERS);
|
|
172
|
-
|
|
173
|
-
// WEBGL limits
|
|
174
|
-
for (const pname of parameterKeys) {
|
|
175
|
-
const parameter = PARAMETERS[pname];
|
|
176
|
-
|
|
177
|
-
// Check if this parameter is available on this platform
|
|
178
|
-
const parameterAvailable =
|
|
179
|
-
parameter &&
|
|
180
|
-
(!('webgl2' in parameter) || isWebgl2) &&
|
|
181
|
-
(!('extension' in parameter) || this.gl.getExtension(parameter.extension));
|
|
182
|
-
|
|
183
|
-
if (parameterAvailable) {
|
|
184
|
-
const key = keys ? this.device.getGLKey(pname) : pname;
|
|
185
|
-
values[key] = this.getParameter(pname, options);
|
|
186
|
-
if (keys && parameter.type === 'GLenum') {
|
|
187
|
-
values[key] = this.device.getGLKey(values[key]);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
return values;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Update a Resource setting
|
|
197
|
-
*
|
|
198
|
-
* @todo - cache parameter to avoid issuing WebGL calls?
|
|
199
|
-
*
|
|
200
|
-
* @param pname - parameter (GL constant, value or key)
|
|
201
|
-
* @param value {GLint|GLfloat|GLenum}
|
|
202
|
-
* @return returns self to enable chaining
|
|
203
|
-
*/
|
|
204
|
-
setParameter(pname: GL | string, value: any): this {
|
|
205
|
-
pname = getKeyValue(this.gl, pname);
|
|
206
|
-
assert(pname);
|
|
207
|
-
|
|
208
|
-
// @ts-expect-error
|
|
209
|
-
const parameters = this.constructor.PARAMETERS || {};
|
|
210
|
-
|
|
211
|
-
const parameter = parameters[pname];
|
|
212
|
-
if (parameter) {
|
|
213
|
-
const isWebgl2 = isWebGL2(this.gl);
|
|
214
|
-
|
|
215
|
-
// Check if this parameter is available on this platform
|
|
216
|
-
const parameterAvailable =
|
|
217
|
-
(!('webgl2' in parameter) || isWebgl2) &&
|
|
218
|
-
(!('extension' in parameter) || this.gl.getExtension(parameter.extension));
|
|
219
|
-
|
|
220
|
-
if (!parameterAvailable) {
|
|
221
|
-
throw new Error('Parameter not available on this platform');
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// Handle string keys
|
|
225
|
-
if (parameter.type === 'GLenum') {
|
|
226
|
-
// @ts-expect-error
|
|
227
|
-
value = getKeyValue(value);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// If unknown parameter - Could be a valid parameter not covered by PARAMS
|
|
232
|
-
// attempt to set it and let WebGL report errors
|
|
233
|
-
this._setParameter(pname, value);
|
|
234
|
-
return this;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/*
|
|
238
|
-
* Batch update resource parameters
|
|
239
|
-
* Assumes the subclass supports a setParameter call
|
|
240
|
-
*/
|
|
241
|
-
setParameters(parameters: Record<GL, any>) {
|
|
242
|
-
for (const pname in parameters) {
|
|
243
|
-
this.setParameter(pname, parameters[pname]);
|
|
244
|
-
}
|
|
245
|
-
return this;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
115
|
// Install stubs for removed methods
|
|
249
116
|
stubRemovedMethods(className: string, version: string, methodNames: string[]) {
|
|
250
117
|
return stubRemovedMethods(this, className, version, methodNames);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// luma.gl
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
2
3
|
// Copyright (c) vis.gl contributors
|
|
3
4
|
|
|
4
5
|
import type {BufferProps} from '@luma.gl/core';
|
|
@@ -9,8 +10,7 @@ import {WebGLDevice} from '../webgl-device';
|
|
|
9
10
|
/** WebGL Buffer interface */
|
|
10
11
|
export class WEBGLBuffer extends Buffer {
|
|
11
12
|
readonly device: WebGLDevice;
|
|
12
|
-
readonly gl:
|
|
13
|
-
readonly gl2: WebGL2RenderingContext | null;
|
|
13
|
+
readonly gl: WebGL2RenderingContext;
|
|
14
14
|
readonly handle: WebGLBuffer;
|
|
15
15
|
|
|
16
16
|
/** Target in OpenGL defines the type of buffer */
|
|
@@ -30,7 +30,6 @@ export class WEBGLBuffer extends Buffer {
|
|
|
30
30
|
|
|
31
31
|
this.device = device;
|
|
32
32
|
this.gl = this.device.gl;
|
|
33
|
-
this.gl2 = this.device.gl2;
|
|
34
33
|
|
|
35
34
|
const handle = typeof props === 'object' ? props.handle : undefined;
|
|
36
35
|
this.handle = handle || this.gl.createBuffer();
|
|
@@ -118,12 +117,11 @@ export class WEBGLBuffer extends Buffer {
|
|
|
118
117
|
|
|
119
118
|
// Create the buffer - binding it here for the first time locks the type
|
|
120
119
|
// In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type
|
|
121
|
-
const glTarget =
|
|
120
|
+
const glTarget = GL.COPY_WRITE_BUFFER;
|
|
122
121
|
this.gl.bindBuffer(glTarget, this.handle);
|
|
123
122
|
// WebGL2: subData supports additional srcOffset and length parameters
|
|
124
123
|
if (srcOffset !== 0 || byteLength !== undefined) {
|
|
125
|
-
this.
|
|
126
|
-
this.gl2.bufferSubData(glTarget, byteOffset, data, srcOffset, byteLength);
|
|
124
|
+
this.gl.bufferSubData(glTarget, byteOffset, data, srcOffset, byteLength);
|
|
127
125
|
} else {
|
|
128
126
|
this.gl.bufferSubData(glTarget, byteOffset, data);
|
|
129
127
|
}
|
|
@@ -134,20 +132,18 @@ export class WEBGLBuffer extends Buffer {
|
|
|
134
132
|
|
|
135
133
|
/** Asynchronously read data from the buffer */
|
|
136
134
|
override async readAsync(byteOffset = 0, byteLength?: number): Promise<Uint8Array> {
|
|
137
|
-
return this.
|
|
135
|
+
return this.readSyncWebGL(byteOffset, byteLength);
|
|
138
136
|
}
|
|
139
137
|
|
|
140
138
|
/** Synchronously read data from the buffer. WebGL only. */
|
|
141
|
-
override
|
|
142
|
-
this.device.assertWebGL2();
|
|
143
|
-
|
|
139
|
+
override readSyncWebGL(byteOffset = 0, byteLength?: number): Uint8Array {
|
|
144
140
|
byteLength = byteLength ?? this.byteLength - byteOffset;
|
|
145
141
|
const data = new Uint8Array(byteLength);
|
|
146
142
|
const dstOffset = 0;
|
|
147
143
|
|
|
148
144
|
// Use GL.COPY_READ_BUFFER to avoid disturbing other targets and locking type
|
|
149
145
|
this.gl.bindBuffer(GL.COPY_READ_BUFFER, this.handle);
|
|
150
|
-
this.
|
|
146
|
+
this.gl.getBufferSubData(GL.COPY_READ_BUFFER, byteOffset, data, dstOffset, byteLength);
|
|
151
147
|
this.gl.bindBuffer(GL.COPY_READ_BUFFER, null);
|
|
152
148
|
|
|
153
149
|
// Update local `data` if offsets are 0
|
|
@@ -171,9 +167,9 @@ export class WEBGLBuffer extends Buffer {
|
|
|
171
167
|
* static STORAGE = 0x0080;
|
|
172
168
|
* static INDIRECT = 0x0100;
|
|
173
169
|
* static QUERY_RESOLVE = 0x0200;
|
|
174
|
-
*
|
|
170
|
+
*
|
|
175
171
|
* @returns WebGL buffer targe
|
|
176
|
-
*
|
|
172
|
+
*
|
|
177
173
|
* Buffer bind points in WebGL2
|
|
178
174
|
* gl.COPY_READ_BUFFER: Buffer for copying from one buffer object to another.
|
|
179
175
|
* gl.COPY_WRITE_BUFFER: Buffer for copying from one buffer object to another.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// luma.gl
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
2
3
|
// Copyright (c) vis.gl contributors
|
|
3
4
|
|
|
4
5
|
import type {
|
|
@@ -79,26 +80,19 @@ function _copyBufferToBuffer(device: WebGLDevice, options: CopyBufferToBufferOpt
|
|
|
79
80
|
const source = cast<WEBGLBuffer>(options.source);
|
|
80
81
|
const destination = cast<WEBGLBuffer>(options.destination);
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
gl2.bindBuffer(GL.COPY_READ_BUFFER, null);
|
|
96
|
-
gl2.bindBuffer(GL.COPY_WRITE_BUFFER, null);
|
|
97
|
-
} else {
|
|
98
|
-
// TODO - in WebGL1 we would have to read back to CPU
|
|
99
|
-
// read / write buffer from / to CPU
|
|
100
|
-
throw new Error('copyBufferToBuffer not implemented in WebGL1');
|
|
101
|
-
}
|
|
83
|
+
// {In WebGL2 we can p}erform the copy on the GPU
|
|
84
|
+
// Use GL.COPY_READ_BUFFER+GL.COPY_WRITE_BUFFER avoid disturbing other targets and locking type
|
|
85
|
+
device.gl.bindBuffer(GL.COPY_READ_BUFFER, source.handle);
|
|
86
|
+
device.gl.bindBuffer(GL.COPY_WRITE_BUFFER, destination.handle);
|
|
87
|
+
device.gl.copyBufferSubData(
|
|
88
|
+
GL.COPY_READ_BUFFER,
|
|
89
|
+
GL.COPY_WRITE_BUFFER,
|
|
90
|
+
options.sourceOffset ?? 0,
|
|
91
|
+
options.destinationOffset ?? 0,
|
|
92
|
+
options.size
|
|
93
|
+
);
|
|
94
|
+
device.gl.bindBuffer(GL.COPY_READ_BUFFER, null);
|
|
95
|
+
device.gl.bindBuffer(GL.COPY_WRITE_BUFFER, null);
|
|
102
96
|
}
|
|
103
97
|
|
|
104
98
|
/**
|
|
@@ -158,14 +152,12 @@ function _copyTextureToBuffer(device: WebGLDevice, options: CopyTextureToBufferO
|
|
|
158
152
|
}
|
|
159
153
|
|
|
160
154
|
// Asynchronous read (PIXEL_PACK_BUFFER) is WebGL2 only feature
|
|
161
|
-
const gl2 = device.assertWebGL2();
|
|
162
|
-
|
|
163
155
|
const {framebuffer, destroyFramebuffer} = getFramebuffer(source);
|
|
164
156
|
try {
|
|
165
157
|
const webglBuffer = destination as WEBGLBuffer;
|
|
166
158
|
const sourceWidth = width || framebuffer.width;
|
|
167
159
|
const sourceHeight = height || framebuffer.height;
|
|
168
|
-
const sourceParams = getWebGLTextureParameters(framebuffer.texture.format
|
|
160
|
+
const sourceParams = getWebGLTextureParameters(framebuffer.texture.props.format);
|
|
169
161
|
const sourceFormat = sourceParams.dataFormat;
|
|
170
162
|
const sourceType = sourceParams.type;
|
|
171
163
|
|
|
@@ -177,10 +169,10 @@ function _copyTextureToBuffer(device: WebGLDevice, options: CopyTextureToBufferO
|
|
|
177
169
|
// target = device.createBuffer({byteLength});
|
|
178
170
|
// }
|
|
179
171
|
|
|
180
|
-
|
|
181
|
-
|
|
172
|
+
device.gl.bindBuffer(GL.PIXEL_PACK_BUFFER, webglBuffer.handle);
|
|
173
|
+
device.gl.bindFramebuffer(GL.FRAMEBUFFER, framebuffer.handle);
|
|
182
174
|
|
|
183
|
-
|
|
175
|
+
device.gl.readPixels(
|
|
184
176
|
origin[0],
|
|
185
177
|
origin[1],
|
|
186
178
|
sourceWidth,
|
|
@@ -190,8 +182,8 @@ function _copyTextureToBuffer(device: WebGLDevice, options: CopyTextureToBufferO
|
|
|
190
182
|
byteOffset
|
|
191
183
|
);
|
|
192
184
|
} finally {
|
|
193
|
-
|
|
194
|
-
|
|
185
|
+
device.gl.bindBuffer(GL.PIXEL_PACK_BUFFER, null);
|
|
186
|
+
device.gl.bindFramebuffer(GL.FRAMEBUFFER, null);
|
|
195
187
|
|
|
196
188
|
if (destroyFramebuffer) {
|
|
197
189
|
framebuffer.destroy();
|
|
@@ -234,19 +226,18 @@ function _copyTextureToTexture(device: WebGLDevice, options: CopyTextureToTextur
|
|
|
234
226
|
origin = [0, 0],
|
|
235
227
|
|
|
236
228
|
/** Texture to copy to/from. */
|
|
237
|
-
destination
|
|
229
|
+
destination
|
|
238
230
|
/** Mip-map level of the texture to copy to/from. (Default 0) */
|
|
239
231
|
// destinationMipLevel = options.mipLevel,
|
|
240
232
|
/** Defines the origin of the copy - the minimum corner of the texture sub-region to copy to/from. */
|
|
241
233
|
// destinationOrigin = [0, 0],
|
|
242
234
|
/** Defines which aspects of the texture to copy to/from. */
|
|
243
235
|
// destinationAspect = options.aspect,
|
|
244
|
-
|
|
245
236
|
} = options;
|
|
246
237
|
|
|
247
238
|
let {
|
|
248
239
|
width = options.destination.width,
|
|
249
|
-
height = options.destination.width
|
|
240
|
+
height = options.destination.width
|
|
250
241
|
// depthOrArrayLayers = 0
|
|
251
242
|
} = options;
|
|
252
243
|
|
|
@@ -309,8 +300,7 @@ function _copyTextureToTexture(device: WebGLDevice, options: CopyTextureToTextur
|
|
|
309
300
|
// break;
|
|
310
301
|
// case GL.TEXTURE_2D_ARRAY:
|
|
311
302
|
// case GL.TEXTURE_3D:
|
|
312
|
-
//
|
|
313
|
-
// gl2.copyTexSubImage3D(
|
|
303
|
+
// device.gl.copyTexSubImage3D(
|
|
314
304
|
// textureTarget,
|
|
315
305
|
// destinationMipmaplevel,
|
|
316
306
|
// destinationX,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// luma.gl
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
2
3
|
// Copyright (c) vis.gl contributors
|
|
3
4
|
|
|
4
5
|
import {CommandEncoder, CommandEncoderProps} from '@luma.gl/core';
|
|
@@ -6,7 +7,9 @@ import type {
|
|
|
6
7
|
CopyBufferToBufferOptions,
|
|
7
8
|
CopyBufferToTextureOptions,
|
|
8
9
|
CopyTextureToBufferOptions,
|
|
9
|
-
CopyTextureToTextureOptions
|
|
10
|
+
CopyTextureToTextureOptions,
|
|
11
|
+
QuerySet,
|
|
12
|
+
Buffer
|
|
10
13
|
} from '@luma.gl/core';
|
|
11
14
|
|
|
12
15
|
import {WEBGLCommandBuffer} from './webgl-command-buffer';
|
|
@@ -54,13 +57,13 @@ export class WEBGLCommandEncoder extends CommandEncoder {
|
|
|
54
57
|
|
|
55
58
|
override insertDebugMarker(markerLabel: string): void {}
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
override resolveQuerySet(
|
|
61
|
+
querySet: QuerySet,
|
|
62
|
+
destination: Buffer,
|
|
63
|
+
options?: {
|
|
64
|
+
firstQuery?: number;
|
|
65
|
+
queryCount?: number;
|
|
66
|
+
destinationOffset?: number;
|
|
67
|
+
}
|
|
68
|
+
): void {}
|
|
66
69
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// luma.gl
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
2
3
|
// Copyright (c) vis.gl contributors
|
|
3
4
|
|
|
4
5
|
/*
|
|
5
6
|
export class WEBGLExternalTexture extends WEBGLTexture {
|
|
6
7
|
readonly device: WebGLDevice;
|
|
7
|
-
readonly gl:
|
|
8
|
-
readonly gl2: WebGL2RenderingContext | null;
|
|
8
|
+
readonly gl: WebGL2RenderingContext;
|
|
9
9
|
readonly handle: WebGLTexture;
|
|
10
10
|
|
|
11
11
|
data;
|
|
@@ -53,7 +53,7 @@ export class WEBGLExternalTexture extends WEBGLTexture {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// eslint-disable-next-line max-statements
|
|
56
|
-
constructor(device: Device |
|
|
56
|
+
constructor(device: Device | WebGL2RenderingContext, props: TextureProps) {
|
|
57
57
|
super(WebGLDevice.attach(device), {id: uid('texture'), ...props});
|
|
58
58
|
|
|
59
59
|
this.glTarget = getWebGLTextureTarget(props);
|
|
@@ -92,4 +92,4 @@ export class WEBGLExternalTexture extends WEBGLTexture {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
|
|
95
|
-
*/
|
|
95
|
+
*/
|