@luma.gl/webgl 9.0.17 → 9.1.0-alpha.10
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 +30 -12
- package/dist/adapter/converters/texture-formats.d.ts +22 -16
- package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
- package/dist/adapter/converters/texture-formats.js +39 -47
- package/dist/adapter/device-helpers/webgl-device-features.d.ts.map +1 -1
- package/dist/adapter/device-helpers/webgl-device-features.js +1 -2
- package/dist/adapter/device-helpers/webgl-device-limits.js +1 -1
- package/dist/adapter/helpers/webgl-texture-utils.d.ts +300 -0
- package/dist/adapter/helpers/webgl-texture-utils.d.ts.map +1 -0
- package/dist/adapter/helpers/webgl-texture-utils.js +370 -0
- package/dist/adapter/helpers/webgl-topology-utils.d.ts.map +1 -1
- package/dist/adapter/helpers/webgl-topology-utils.js +0 -4
- package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-buffer.js +2 -2
- package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.js +6 -9
- package/dist/adapter/resources/webgl-framebuffer.d.ts +32 -5
- package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +42 -60
- package/dist/adapter/resources/webgl-render-pass.d.ts +3 -2
- package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.js +18 -7
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +46 -21
- package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-shader.js +3 -3
- package/dist/adapter/resources/webgl-texture-view.d.ts +1 -1
- package/dist/adapter/resources/webgl-texture-view.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture-view.js +1 -1
- package/dist/adapter/resources/webgl-texture.d.ts +76 -172
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +397 -511
- package/dist/adapter/resources/webgl-vertex-array.d.ts +3 -2
- package/dist/adapter/resources/webgl-vertex-array.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-vertex-array.js +2 -2
- package/dist/adapter/webgl-adapter.d.ts +21 -0
- package/dist/adapter/webgl-adapter.d.ts.map +1 -0
- package/dist/adapter/webgl-adapter.js +91 -0
- package/dist/adapter/webgl-canvas-context.d.ts +3 -1
- package/dist/adapter/webgl-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgl-canvas-context.js +2 -0
- package/dist/adapter/webgl-device.d.ts +19 -30
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +35 -114
- package/dist/classic/accessor.d.ts +22 -1
- package/dist/classic/accessor.d.ts.map +1 -1
- package/dist/classic/accessor.js +1 -9
- package/dist/classic/clear.d.ts.map +1 -1
- package/dist/classic/clear.js +2 -5
- package/dist/classic/copy-and-blit.d.ts +3 -1
- package/dist/classic/copy-and-blit.d.ts.map +1 -1
- package/dist/classic/copy-and-blit.js +21 -18
- package/dist/classic/format-utils.d.ts.map +1 -1
- package/dist/classic/format-utils.js +0 -3
- package/dist/classic/typed-array-utils.d.ts +1 -1
- package/dist/classic/typed-array-utils.d.ts.map +1 -1
- package/dist/context/debug/spector-types.d.ts +1108 -0
- package/dist/context/debug/spector-types.d.ts.map +1 -0
- package/dist/context/debug/spector-types.js +697 -0
- package/dist/context/debug/spector.d.ts +12 -8
- package/dist/context/debug/spector.d.ts.map +1 -1
- package/dist/context/debug/spector.js +25 -18
- package/dist/context/debug/webgl-developer-tools.d.ts +1 -1
- package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -1
- package/dist/context/debug/webgl-developer-tools.js +2 -5
- package/dist/context/parameters/webgl-parameter-tables.js +1 -1
- package/dist/context/polyfills/polyfill-webgl1-extensions.d.ts +9 -0
- package/dist/context/polyfills/polyfill-webgl1-extensions.d.ts.map +1 -0
- package/dist/context/polyfills/polyfill-webgl1-extensions.js +181 -0
- package/dist/context/state-tracker/webgl-state-tracker.d.ts +43 -0
- package/dist/context/state-tracker/webgl-state-tracker.d.ts.map +1 -0
- package/dist/context/state-tracker/{track-context-state.js → webgl-state-tracker.js} +46 -77
- package/dist/context/state-tracker/with-parameters.d.ts.map +1 -1
- package/dist/context/state-tracker/with-parameters.js +5 -4
- package/dist/dist.dev.js +1112 -1380
- package/dist/dist.min.js +2 -2
- package/dist/index.cjs +1122 -1284
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -5
- package/dist/utils/fill-array.d.ts +8 -0
- package/dist/utils/fill-array.d.ts.map +1 -0
- package/dist/utils/fill-array.js +26 -0
- package/dist/utils/load-script.d.ts +8 -0
- package/dist/utils/load-script.d.ts.map +1 -0
- package/dist/utils/load-script.js +26 -0
- package/dist/utils/split-uniforms-and-bindings.d.ts +9 -0
- package/dist/utils/split-uniforms-and-bindings.d.ts.map +1 -0
- package/dist/utils/split-uniforms-and-bindings.js +20 -0
- package/dist/utils/uid.d.ts +7 -0
- package/dist/utils/uid.d.ts.map +1 -0
- package/dist/utils/uid.js +14 -0
- package/package.json +6 -5
- package/src/adapter/converters/device-parameters.ts +31 -13
- package/src/adapter/converters/texture-formats.ts +51 -56
- package/src/adapter/device-helpers/webgl-device-features.ts +1 -2
- package/src/adapter/device-helpers/webgl-device-limits.ts +1 -1
- package/src/adapter/helpers/webgl-texture-utils.ts +484 -0
- package/src/adapter/helpers/webgl-topology-utils.ts +0 -4
- package/src/adapter/resources/webgl-buffer.ts +2 -2
- package/src/adapter/resources/webgl-command-buffer.ts +8 -10
- package/src/adapter/resources/webgl-framebuffer.ts +22 -56
- package/src/adapter/resources/webgl-render-pass.ts +21 -9
- package/src/adapter/resources/webgl-render-pipeline.ts +50 -24
- package/src/adapter/resources/webgl-shader.ts +4 -4
- package/src/adapter/resources/webgl-texture-view.ts +1 -3
- package/src/adapter/resources/webgl-texture.ts +445 -784
- package/src/adapter/resources/webgl-vertex-array.ts +8 -7
- package/src/adapter/webgl-adapter.ts +113 -0
- package/src/adapter/webgl-canvas-context.ts +4 -1
- package/src/adapter/webgl-device.ts +40 -151
- package/src/classic/accessor.ts +31 -11
- package/src/classic/clear.ts +3 -6
- package/src/classic/copy-and-blit.ts +32 -27
- package/src/classic/format-utils.ts +0 -3
- package/src/classic/typed-array-utils.ts +1 -1
- package/src/context/debug/spector-types.ts +1154 -0
- package/src/context/debug/spector.ts +40 -30
- package/src/context/debug/webgl-developer-tools.ts +3 -7
- package/src/context/parameters/webgl-parameter-tables.ts +3 -3
- package/src/context/polyfills/polyfill-webgl1-extensions.ts +202 -0
- package/src/context/state-tracker/{track-context-state.ts → webgl-state-tracker.ts} +57 -97
- package/src/context/state-tracker/with-parameters.ts +5 -4
- package/src/index.ts +5 -13
- package/src/utils/fill-array.ts +35 -0
- package/src/utils/load-script.ts +30 -0
- package/src/utils/split-uniforms-and-bindings.ts +31 -0
- package/src/utils/uid.ts +16 -0
- package/dist/adapter/objects/constants-to-keys.d.ts +0 -3
- package/dist/adapter/objects/constants-to-keys.d.ts.map +0 -1
- package/dist/adapter/objects/constants-to-keys.js +0 -22
- package/dist/adapter/objects/webgl-renderbuffer.d.ts +0 -43
- package/dist/adapter/objects/webgl-renderbuffer.d.ts.map +0 -1
- package/dist/adapter/objects/webgl-renderbuffer.js +0 -95
- package/dist/adapter/objects/webgl-resource.d.ts +0 -32
- package/dist/adapter/objects/webgl-resource.d.ts.map +0 -1
- package/dist/adapter/objects/webgl-resource.js +0 -114
- package/dist/context/state-tracker/track-context-state.d.ts +0 -22
- package/dist/context/state-tracker/track-context-state.d.ts.map +0 -1
- package/src/adapter/objects/constants-to-keys.ts +0 -27
- package/src/adapter/objects/webgl-renderbuffer.ts +0 -132
- package/src/adapter/objects/webgl-resource.ts +0 -183
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear.d.ts","sourceRoot":"","sources":["../../src/classic/clear.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"clear.d.ts","sourceRoot":"","sources":["../../src/classic/clear.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAclD;;;GAGG;AACH,wBAAgB,KAAK,CACnB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAC;IAAC,OAAO,CAAC,EAAE,GAAG,CAAA;CAAC,GAC7E,IAAI,CAsCN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IAAC,MAAM,CAAC,EAAE,GAAG,CAAC;IAAC,UAAU,CAAC,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAA;CAAC,QA2CnF"}
|
package/dist/classic/clear.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { assert } from '@luma.gl/core';
|
|
5
4
|
import { withGLParameters } from "../context/state-tracker/with-parameters.js";
|
|
6
5
|
// Should collapse during minification
|
|
7
6
|
const GL_DEPTH_BUFFER_BIT = 0x00000100;
|
|
@@ -11,8 +10,6 @@ const GL_COLOR = 0x1800;
|
|
|
11
10
|
const GL_DEPTH = 0x1801;
|
|
12
11
|
const GL_STENCIL = 0x1802;
|
|
13
12
|
const GL_DEPTH_STENCIL = 0x84f9;
|
|
14
|
-
// Should disappear if asserts are removed
|
|
15
|
-
const ERR_ARGUMENTS = 'clear: bad arguments';
|
|
16
13
|
/**
|
|
17
14
|
* Optionally clears depth, color and stencil buffers
|
|
18
15
|
* @deprecated Set clear color when creating a RenderPass.
|
|
@@ -42,7 +39,7 @@ export function clear(device, options) {
|
|
|
42
39
|
parameters.clearStencil = depth;
|
|
43
40
|
}
|
|
44
41
|
}
|
|
45
|
-
assert(clearFlags !== 0, ERR_ARGUMENTS);
|
|
42
|
+
// assert(clearFlags !== 0, ERR_ARGUMENTS);
|
|
46
43
|
// Temporarily set any clear "colors" and call clear
|
|
47
44
|
const gl = device.gl;
|
|
48
45
|
withGLParameters(gl, parameters, () => {
|
|
@@ -83,7 +80,7 @@ export function clearBuffer(device, options) {
|
|
|
83
80
|
gl.clearBufferfi(GL_DEPTH_STENCIL, 0, depth, stencil);
|
|
84
81
|
break;
|
|
85
82
|
default:
|
|
86
|
-
|
|
83
|
+
// assert(false, ERR_ARGUMENTS);
|
|
87
84
|
}
|
|
88
85
|
});
|
|
89
86
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Buffer, Texture, Framebuffer, FramebufferProps } from '@luma.gl/core';
|
|
2
2
|
import { GL } from '@luma.gl/constants';
|
|
3
|
+
import { WEBGLFramebuffer } from "../adapter/resources/webgl-framebuffer.js";
|
|
3
4
|
import { WEBGLBuffer } from "../adapter/resources/webgl-buffer.js";
|
|
4
5
|
/**
|
|
5
6
|
* Copies data from a type or a Texture object into ArrayBuffer object.
|
|
@@ -20,6 +21,7 @@ export declare function readPixelsToArray(source: Framebuffer | Texture, options
|
|
|
20
21
|
target?: Uint8Array | Uint16Array | Float32Array;
|
|
21
22
|
sourceWidth?: number;
|
|
22
23
|
sourceHeight?: number;
|
|
24
|
+
sourceDepth?: number;
|
|
23
25
|
sourceType?: number;
|
|
24
26
|
}): Uint8Array | Uint16Array | Float32Array;
|
|
25
27
|
/**
|
|
@@ -58,5 +60,5 @@ export declare function copyToTexture(source: Framebuffer | Texture, target: Tex
|
|
|
58
60
|
* Wraps a given texture into a framebuffer object, that can be further used
|
|
59
61
|
* to read data from the texture object.
|
|
60
62
|
*/
|
|
61
|
-
export declare function toFramebuffer(texture: Texture, props?: FramebufferProps):
|
|
63
|
+
export declare function toFramebuffer(texture: Texture, props?: FramebufferProps): WEBGLFramebuffer;
|
|
62
64
|
//# sourceMappingURL=copy-and-blit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-and-blit.d.ts","sourceRoot":"","sources":["../../src/classic/copy-and-blit.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"copy-and-blit.d.ts","sourceRoot":"","sources":["../../src/classic/copy-and-blit.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AAEtC,OAAO,EAAC,gBAAgB,EAAC,kDAA+C;AAGxE,OAAO,EAAC,WAAW,EAAC,6CAA0C;AAG9D;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,WAAW,GAAG,OAAO,EAC7B,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC;IAEjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GACA,UAAU,GAAG,WAAW,GAAG,YAAY,CAiDzC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,WAAW,GAAG,OAAO,EAC7B,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GACA,WAAW,CA+Cb;AAED;;;GAGG;AAEH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,WAAW,GAAG,OAAO,EAC7B,MAAM,EAAE,OAAO,GAAG,EAAE,EACpB,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACA,OAAO,CAiGT;AAYD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,gBAAgB,GAAG,gBAAgB,CAU1F"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import {
|
|
4
|
+
import { Framebuffer } from '@luma.gl/core';
|
|
5
5
|
import { GL } from '@luma.gl/constants';
|
|
6
6
|
import { getGLTypeFromTypedArray, getTypedArrayFromGLType } from "./typed-array-utils.js";
|
|
7
7
|
import { glFormatToComponents, glTypeToBytes } from "./format-utils.js";
|
|
8
|
+
import { WEBGLTexture } from "../adapter/resources/webgl-texture.js";
|
|
8
9
|
/**
|
|
9
10
|
* Copies data from a type or a Texture object into ArrayBuffer object.
|
|
10
11
|
* App can provide targetPixelArray or have it auto allocated by this method
|
|
@@ -17,28 +18,27 @@ import { glFormatToComponents, glTypeToBytes } from "./format-utils.js";
|
|
|
17
18
|
* @returns pixel array,
|
|
18
19
|
*/
|
|
19
20
|
export function readPixelsToArray(source, options) {
|
|
20
|
-
const { sourceX = 0, sourceY = 0,
|
|
21
|
+
const { sourceX = 0, sourceY = 0, sourceAttachment = 36064 // TODO - support gl.readBuffer
|
|
21
22
|
} = options || {};
|
|
22
23
|
let { target = null,
|
|
23
24
|
// following parameters are auto deduced if not provided
|
|
24
|
-
sourceWidth, sourceHeight, sourceType } = options || {};
|
|
25
|
+
sourceWidth, sourceHeight, sourceDepth, sourceFormat, sourceType } = options || {};
|
|
25
26
|
const { framebuffer, deleteFramebuffer } = getFramebuffer(source);
|
|
26
|
-
assert(framebuffer);
|
|
27
|
+
// assert(framebuffer);
|
|
27
28
|
const { gl, handle } = framebuffer;
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
const attachment = sourceAttachment - 36064;
|
|
30
|
+
sourceWidth ||= framebuffer.width;
|
|
31
|
+
sourceHeight ||= framebuffer.height;
|
|
30
32
|
// TODO - Set and unset gl.readBuffer
|
|
31
33
|
// if (sourceAttachment === GL.COLOR_ATTACHMENT0 && handle === null) {
|
|
32
34
|
// sourceAttachment = GL.FRONT;
|
|
33
35
|
// }
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
sourceDepth = framebuffer.colorAttachments[attachment]?.texture?.depth || 1;
|
|
37
|
+
sourceFormat ||= framebuffer.colorAttachments[attachment]?.texture?.glFormat || 6408;
|
|
36
38
|
// Deduce the type from color attachment if not provided.
|
|
37
|
-
sourceType
|
|
38
|
-
sourceType ||
|
|
39
|
-
framebuffer.colorAttachments[attachment]?.texture?.type || 5121;
|
|
39
|
+
sourceType ||= framebuffer.colorAttachments[attachment]?.texture?.glType || 5121;
|
|
40
40
|
// Deduce type and allocated pixelArray if needed
|
|
41
|
-
target = getPixelArray(target, sourceType, sourceFormat, sourceWidth, sourceHeight);
|
|
41
|
+
target = getPixelArray(target, sourceType, sourceFormat, sourceWidth, sourceHeight, sourceDepth);
|
|
42
42
|
// Pixel array available, if necessary, deduce type from it.
|
|
43
43
|
sourceType = sourceType || getGLTypeFromTypedArray(target);
|
|
44
44
|
const prevHandle = gl.bindFramebuffer(36160, handle);
|
|
@@ -62,7 +62,7 @@ export function readPixelsToBuffer(source, options) {
|
|
|
62
62
|
// following parameters are auto deduced if not provided
|
|
63
63
|
let { sourceWidth, sourceHeight, sourceType } = options || {};
|
|
64
64
|
const { framebuffer, deleteFramebuffer } = getFramebuffer(source);
|
|
65
|
-
assert(framebuffer);
|
|
65
|
+
// assert(framebuffer);
|
|
66
66
|
sourceWidth = sourceWidth || framebuffer.width;
|
|
67
67
|
sourceHeight = sourceHeight || framebuffer.height;
|
|
68
68
|
// Asynchronous read (PIXEL_PACK_BUFFER) is WebGL2 only feature
|
|
@@ -106,7 +106,7 @@ export function copyToTexture(source, target, options) {
|
|
|
106
106
|
height // defaults to target height
|
|
107
107
|
} = options || {};
|
|
108
108
|
const { framebuffer, deleteFramebuffer } = getFramebuffer(source);
|
|
109
|
-
assert(framebuffer);
|
|
109
|
+
// assert(framebuffer);
|
|
110
110
|
const webglFramebuffer = framebuffer;
|
|
111
111
|
const { device, handle } = webglFramebuffer;
|
|
112
112
|
const isSubCopy = typeof targetX !== 'undefined' ||
|
|
@@ -118,17 +118,19 @@ export function copyToTexture(source, target, options) {
|
|
|
118
118
|
const prevHandle = device.gl.bindFramebuffer(36160, handle);
|
|
119
119
|
// TODO - support gl.readBuffer (WebGL2 only)
|
|
120
120
|
// const prevBuffer = gl.readBuffer(attachment);
|
|
121
|
-
assert(target);
|
|
121
|
+
// assert(target);
|
|
122
122
|
let texture = null;
|
|
123
123
|
let textureTarget;
|
|
124
|
-
if (target instanceof
|
|
124
|
+
if (target instanceof WEBGLTexture) {
|
|
125
125
|
texture = target;
|
|
126
126
|
width = Number.isFinite(width) ? width : texture.width;
|
|
127
127
|
height = Number.isFinite(height) ? height : texture.height;
|
|
128
|
-
texture
|
|
128
|
+
texture?.bind(0);
|
|
129
|
+
// @ts-ignore
|
|
129
130
|
textureTarget = texture.target;
|
|
130
131
|
}
|
|
131
132
|
else {
|
|
133
|
+
// @ts-ignore
|
|
132
134
|
textureTarget = target;
|
|
133
135
|
}
|
|
134
136
|
if (!isSubCopy) {
|
|
@@ -178,7 +180,8 @@ export function toFramebuffer(texture, props) {
|
|
|
178
180
|
});
|
|
179
181
|
return framebuffer;
|
|
180
182
|
}
|
|
181
|
-
|
|
183
|
+
// eslint-disable-next-line max-params
|
|
184
|
+
function getPixelArray(pixelArray, type, format, width, height, depth) {
|
|
182
185
|
if (pixelArray) {
|
|
183
186
|
return pixelArray;
|
|
184
187
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-utils.d.ts","sourceRoot":"","sources":["../../src/classic/format-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"format-utils.d.ts","sourceRoot":"","sources":["../../src/classic/format-utils.ts"],"names":[],"mappings":"AAOA,wBAAgB,oBAAoB,CAAC,MAAM,KAAA,qBAmB1C;AAGD,wBAAgB,aAAa,CAAC,IAAI,KAAA,iBAcjC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { assert } from '@luma.gl/core';
|
|
5
4
|
import { GL } from '@luma.gl/constants';
|
|
6
5
|
// Returns number of components in a specific readPixels WebGL format
|
|
7
6
|
export function glFormatToComponents(format) {
|
|
@@ -21,7 +20,6 @@ export function glFormatToComponents(format) {
|
|
|
21
20
|
return 4;
|
|
22
21
|
// TODO: Add support for additional WebGL2 formats
|
|
23
22
|
default:
|
|
24
|
-
assert(false);
|
|
25
23
|
return 0;
|
|
26
24
|
}
|
|
27
25
|
}
|
|
@@ -38,7 +36,6 @@ export function glTypeToBytes(type) {
|
|
|
38
36
|
return 4;
|
|
39
37
|
// TODO: Add support for additional WebGL2 types
|
|
40
38
|
default:
|
|
41
|
-
assert(false);
|
|
42
39
|
return 0;
|
|
43
40
|
}
|
|
44
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typed-array-utils.d.ts","sourceRoot":"","sources":["../../src/classic/typed-array-utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"typed-array-utils.d.ts","sourceRoot":"","sources":["../../src/classic/typed-array-utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAC,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAK,UAAU,EAAE,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAI/D;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,UAAU,GAAG,UAAU,CAuB3E;AAED;;;;;;;GAOG;AAEH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,UAAU,GAAG,WAAW,EAChC,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GACA,qBAAqB,CAwBvB;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,GAAG,IAAI,CAgBP;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,GAAG;IACvF,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAaA"}
|