@luma.gl/webgl 9.0.11 → 9.1.0-alpha.2
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/LICENSE +34 -0
- package/dist/adapter/converters/device-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/device-parameters.js +12 -1
- 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 +31 -32
- package/dist/adapter/device-helpers/webgl-device-features.js +1 -1
- 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 +368 -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 +1 -3
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +45 -20
- package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-shader.js +2 -2
- 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 +58 -172
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +402 -510
- package/dist/adapter/resources/webgl-transform-feedback.js +1 -1
- 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 +5 -2
- 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 +4 -3
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +6 -5
- 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 +2 -1
- package/dist/classic/copy-and-blit.d.ts.map +1 -1
- package/dist/classic/copy-and-blit.js +11 -9
- 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.d.ts.map +1 -1
- package/dist/context/debug/spector.js +2 -1
- 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/state-tracker/track-context-state.d.ts.map +1 -1
- package/dist/context/state-tracker/track-context-state.js +5 -6
- package/dist/dist.dev.js +872 -1262
- package/dist/dist.min.js +2 -2
- package/dist/index.cjs +861 -1138
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- 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/package.json +6 -5
- package/src/adapter/converters/device-parameters.ts +13 -1
- package/src/adapter/converters/texture-formats.ts +45 -42
- package/src/adapter/device-helpers/webgl-device-features.ts +1 -1
- package/src/adapter/device-helpers/webgl-device-limits.ts +1 -1
- package/src/adapter/helpers/webgl-texture-utils.ts +481 -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 +4 -5
- package/src/adapter/resources/webgl-render-pipeline.ts +48 -23
- package/src/adapter/resources/webgl-shader.ts +3 -3
- package/src/adapter/resources/webgl-texture-view.ts +1 -3
- package/src/adapter/resources/webgl-texture.ts +432 -784
- package/src/adapter/resources/webgl-transform-feedback.ts +1 -1
- package/src/adapter/resources/webgl-vertex-array.ts +11 -7
- package/src/adapter/webgl-canvas-context.ts +4 -1
- package/src/adapter/webgl-device.ts +10 -18
- package/src/classic/accessor.ts +31 -11
- package/src/classic/clear.ts +3 -6
- package/src/classic/copy-and-blit.ts +19 -19
- package/src/classic/format-utils.ts +0 -3
- package/src/classic/typed-array-utils.ts +1 -1
- package/src/context/debug/spector.ts +2 -1
- package/src/context/debug/webgl-developer-tools.ts +3 -7
- package/src/context/parameters/webgl-parameter-tables.ts +3 -3
- package/src/context/state-tracker/track-context-state.ts +5 -6
- package/src/index.ts +0 -6
- 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/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/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,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TypedArray } from '@math.gl/types';
|
|
2
|
+
import type { Device, Buffer, VertexArrayProps } from '@luma.gl/core';
|
|
2
3
|
import { VertexArray } from '@luma.gl/core';
|
|
3
4
|
import { GL } from '@luma.gl/constants';
|
|
4
5
|
import { WebGLDevice } from "../webgl-device.js";
|
|
@@ -12,7 +13,7 @@ export declare class WEBGLVertexArray extends VertexArray {
|
|
|
12
13
|
private bufferValue;
|
|
13
14
|
/** * Attribute 0 can not be disable on most desktop OpenGL based browsers */
|
|
14
15
|
static isConstantAttributeZeroSupported(device: Device): boolean;
|
|
15
|
-
constructor(device: WebGLDevice, props
|
|
16
|
+
constructor(device: WebGLDevice, props: VertexArrayProps);
|
|
16
17
|
destroy(): void;
|
|
17
18
|
/**
|
|
18
19
|
// Set (bind/unbind) an elements buffer, for indexed rendering.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-vertex-array.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-vertex-array.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,
|
|
1
|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Y,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;IAsBvC;;;;;OAKG;IACH,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,IAAI;IAiBxD;;;;;OAKG;IACH,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM;CA8BnE"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { VertexArray, getScratchArray
|
|
4
|
+
import { VertexArray, getScratchArray } from '@luma.gl/core';
|
|
5
5
|
import { GL } from '@luma.gl/constants';
|
|
6
6
|
import { getBrowser } from '@probe.gl/env';
|
|
7
7
|
import { getGLFromVertexType } from "../converters/vertex-formats.js";
|
|
8
|
-
|
|
8
|
+
import { fillArray } from "../../utils/fill-array.js";
|
|
9
9
|
/** VertexArrayObject wrapper */
|
|
10
10
|
export class WEBGLVertexArray extends VertexArray {
|
|
11
11
|
get [Symbol.toStringTag]() {
|
|
@@ -77,6 +77,9 @@ export class WEBGLVertexArray extends VertexArray {
|
|
|
77
77
|
// Attaches ARRAY_BUFFER with specified buffer format to location
|
|
78
78
|
this.device.gl.vertexAttribPointer(location, size, type, normalized, stride, offset);
|
|
79
79
|
}
|
|
80
|
+
// Clear binding - keeping it may cause [.WebGL-0x12804417100]
|
|
81
|
+
// GL_INVALID_OPERATION: A transform feedback buffer that would be written to is also bound to a non-transform-feedback target
|
|
82
|
+
this.device.gl.bindBuffer(34962, null);
|
|
80
83
|
// Mark as non-constant
|
|
81
84
|
this.device.gl.enableVertexAttribArray(location);
|
|
82
85
|
// Set the step mode 0=vertex, 1=instance
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CanvasContextProps } from '@luma.gl/core';
|
|
1
|
+
import type { CanvasContextProps, TextureFormat } from '@luma.gl/core';
|
|
2
2
|
import { CanvasContext } from '@luma.gl/core';
|
|
3
3
|
import { WebGLDevice } from "./webgl-device.js";
|
|
4
4
|
import { WEBGLFramebuffer } from "./resources/webgl-framebuffer.js";
|
|
@@ -7,6 +7,8 @@ import { WEBGLFramebuffer } from "./resources/webgl-framebuffer.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class WebGLCanvasContext extends CanvasContext {
|
|
9
9
|
readonly device: WebGLDevice;
|
|
10
|
+
readonly format: TextureFormat;
|
|
11
|
+
readonly depthStencilFormat: TextureFormat;
|
|
10
12
|
presentationSize: [number, number];
|
|
11
13
|
private _framebuffer;
|
|
12
14
|
constructor(device: WebGLDevice, props: CanvasContextProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-canvas-context.d.ts","sourceRoot":"","sources":["../../src/adapter/webgl-canvas-context.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"webgl-canvas-context.d.ts","sourceRoot":"","sources":["../../src/adapter/webgl-canvas-context.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AACrE,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAC,WAAW,EAAC,0BAAuB;AAC3C,OAAO,EAAC,gBAAgB,EAAC,yCAAsC;AAE/D;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAgB;IAC9C,QAAQ,CAAC,kBAAkB,EAAE,aAAa,CAAiB;IAE3D,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,CAAC,YAAY,CAAiC;gBAEzC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,kBAAkB;IAS1D,qBAAqB,IAAI,gBAAgB;IAOzC,sDAAsD;IACtD,MAAM;IAUN;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,OAAO,CAAC,EAAE;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;KAAC,GAAG,IAAI;IAW7F,MAAM;CAOP"}
|
|
@@ -8,6 +8,8 @@ import { WEBGLFramebuffer } from "./resources/webgl-framebuffer.js";
|
|
|
8
8
|
*/
|
|
9
9
|
export class WebGLCanvasContext extends CanvasContext {
|
|
10
10
|
device;
|
|
11
|
+
format = 'rgba8unorm';
|
|
12
|
+
depthStencilFormat = 'depth24plus';
|
|
11
13
|
presentationSize;
|
|
12
14
|
_framebuffer = null;
|
|
13
15
|
constructor(device, props) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TypedArray } from '@math.gl/types';
|
|
2
|
+
import type { DeviceProps, DeviceInfo, CanvasContextProps, TextureFormat } from '@luma.gl/core';
|
|
3
|
+
import type { Buffer, Texture, Framebuffer, VertexArray, VertexArrayProps } from '@luma.gl/core';
|
|
2
4
|
import { Device, CanvasContext } from '@luma.gl/core';
|
|
3
5
|
import type { GLExtensions } from '@luma.gl/constants';
|
|
4
6
|
import { WebGLDeviceFeatures } from "./device-helpers/webgl-device-features.js";
|
|
@@ -8,7 +10,6 @@ import type { BufferProps, ShaderProps, SamplerProps, TextureProps, ExternalText
|
|
|
8
10
|
import { WEBGLBuffer } from "./resources/webgl-buffer.js";
|
|
9
11
|
import { WEBGLShader } from "./resources/webgl-shader.js";
|
|
10
12
|
import { WEBGLSampler } from "./resources/webgl-sampler.js";
|
|
11
|
-
import { WEBGLTexture } from "./resources/webgl-texture.js";
|
|
12
13
|
import { WEBGLFramebuffer } from "./resources/webgl-framebuffer.js";
|
|
13
14
|
import { WEBGLRenderPass } from "./resources/webgl-render-pass.js";
|
|
14
15
|
import { WEBGLRenderPipeline } from "./resources/webgl-render-pipeline.js";
|
|
@@ -55,7 +56,7 @@ export declare class WebGLDevice extends Device {
|
|
|
55
56
|
isTextureFormatRenderable(format: TextureFormat): boolean;
|
|
56
57
|
createCanvasContext(props?: CanvasContextProps): CanvasContext;
|
|
57
58
|
createBuffer(props: BufferProps | ArrayBuffer | ArrayBufferView): WEBGLBuffer;
|
|
58
|
-
_createTexture(props: TextureProps):
|
|
59
|
+
_createTexture(props: TextureProps): Texture;
|
|
59
60
|
createExternalTexture(props: ExternalTextureProps): ExternalTexture;
|
|
60
61
|
createSampler(props: SamplerProps): WEBGLSampler;
|
|
61
62
|
createShader(props: ShaderProps): WEBGLShader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-device.d.ts","sourceRoot":"","sources":["../../src/adapter/webgl-device.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"webgl-device.d.ts","sourceRoot":"","sources":["../../src/adapter/webgl-device.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAC,WAAW,EAAE,UAAU,EAAE,kBAAkB,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AAC9F,OAAO,KAAK,EAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAC,MAAM,EAAE,aAAa,EAAM,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAQrD,OAAO,EAAC,mBAAmB,EAAC,kDAA+C;AAC3E,OAAO,EAAC,iBAAiB,EAAC,gDAA6C;AACvE,OAAO,EAAC,kBAAkB,EAAC,kCAA+B;AAU1D,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EAEX,YAAY,EACZ,YAAY,EACZ,eA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EAAE,GAAG,CAAC;KACf,GAAG,IAAI;IAIC,UAAU,IAAI,IAAI;IAS3B,sBAAsB;IACtB,QAAQ,CAAC,EAAE,EAAE,sBAAsB,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAS;IAEhC,iEAAiE;IACjE,QAAQ,CAAC,eAAe;;;;MAA0D;IAElF,uDAAuD;IACvD,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAM;IACxC,WAAW,EAAE,OAAO,CAAS;IAE7B,8CAA8C;IAC9C,SAAS,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACM,UAAU,IAAI,OAAO;IAgB9B,8DAA8D;IAC9D,SAAS,IAAI,IAAI;IAIjB,8CAA8C;IAC9C,QAAQ,IAAI,IAAI;IAIhB;;;OAGG;IACH,kBAAkB,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAMlE;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,sBAAsB,GAAG,MAAM;IAc7D,sBAAsB;IACtB,UAAU,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC;IAElC;;;;;OAKG;IACH,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,IAAI;IA2BvE,gDAAgD;IAChD,YAAY,CAAC,IAAI,EAAE,MAAM,YAAY,GAAG,YAAY;CAIrD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { Device, CanvasContext, log
|
|
4
|
+
import { Device, CanvasContext, log } from '@luma.gl/core';
|
|
5
5
|
import { popContextState, pushContextState, trackContextState } from "../context/state-tracker/track-context-state.js";
|
|
6
6
|
import { createBrowserContext } from "../context/helpers/create-browser-context.js";
|
|
7
7
|
import { getDeviceInfo } from "./device-helpers/webgl-device-info.js";
|
|
@@ -115,7 +115,7 @@ ${device.info.vendor}, ${device.info.renderer} for canvas: ${device.canvasContex
|
|
|
115
115
|
// Public API
|
|
116
116
|
//
|
|
117
117
|
constructor(props) {
|
|
118
|
-
super({ ...props, id: props.id ||
|
|
118
|
+
super({ ...props, id: props.id || 'webgl-device' });
|
|
119
119
|
// If attaching to an already attached context, return the attached device
|
|
120
120
|
// @ts-expect-error device is attached to context
|
|
121
121
|
const device = props.gl?.device;
|
|
@@ -198,6 +198,7 @@ ${device.info.vendor}, ${device.info.renderer} for canvas: ${device.canvasContex
|
|
|
198
198
|
const newProps = this._getBufferProps(props);
|
|
199
199
|
return new WEBGLBuffer(this, newProps);
|
|
200
200
|
}
|
|
201
|
+
// _createTexture(props: TextureProps): WEBGLTexture {
|
|
201
202
|
_createTexture(props) {
|
|
202
203
|
return new WEBGLTexture(this, props);
|
|
203
204
|
}
|
|
@@ -235,7 +236,7 @@ ${device.info.vendor}, ${device.info.renderer} for canvas: ${device.canvasContex
|
|
|
235
236
|
throw new Error('ComputePass not supported in WebGL');
|
|
236
237
|
}
|
|
237
238
|
renderPass = null;
|
|
238
|
-
createCommandEncoder(props) {
|
|
239
|
+
createCommandEncoder(props = {}) {
|
|
239
240
|
return new WEBGLCommandEncoder(this, props);
|
|
240
241
|
}
|
|
241
242
|
/**
|
|
@@ -369,7 +370,7 @@ ${device.info.vendor}, ${device.info.renderer} for canvas: ${device.canvasContex
|
|
|
369
370
|
setConstantUintArray(this, location, constant);
|
|
370
371
|
break;
|
|
371
372
|
default:
|
|
372
|
-
|
|
373
|
+
throw new Error('constant');
|
|
373
374
|
}
|
|
374
375
|
}
|
|
375
376
|
/** Ensure extensions are only requested once */
|
|
@@ -402,7 +403,7 @@ function setConstantFloatArray(device, location, array) {
|
|
|
402
403
|
device.gl.vertexAttrib4fv(location, array);
|
|
403
404
|
break;
|
|
404
405
|
default:
|
|
405
|
-
|
|
406
|
+
// assert(false);
|
|
406
407
|
}
|
|
407
408
|
}
|
|
408
409
|
/** Set constant signed int array attribute */
|
|
@@ -1,5 +1,26 @@
|
|
|
1
|
-
import { Buffer
|
|
1
|
+
import { Buffer } from '@luma.gl/core';
|
|
2
2
|
import { GL } from '@luma.gl/constants';
|
|
3
|
+
/**
|
|
4
|
+
* Attribute descriptor object
|
|
5
|
+
* @deprecated Use ShaderLayout
|
|
6
|
+
*/
|
|
7
|
+
export interface AccessorObject {
|
|
8
|
+
buffer?: Buffer;
|
|
9
|
+
offset?: number;
|
|
10
|
+
stride?: number;
|
|
11
|
+
/** @deprecated - Use accessor.stepMode */
|
|
12
|
+
divisor?: number;
|
|
13
|
+
/** @deprecated - Infer from format */
|
|
14
|
+
type?: number;
|
|
15
|
+
/** @deprecated - Infer from format */
|
|
16
|
+
size?: number;
|
|
17
|
+
/** @deprecated - Infer from format */
|
|
18
|
+
normalized?: boolean;
|
|
19
|
+
/** @deprecated - Infer from format */
|
|
20
|
+
integer?: boolean;
|
|
21
|
+
/** @deprecated */
|
|
22
|
+
index?: number;
|
|
23
|
+
}
|
|
3
24
|
declare const DEFAULT_ACCESSOR_VALUES: {
|
|
4
25
|
offset: number;
|
|
5
26
|
stride: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessor.d.ts","sourceRoot":"","sources":["../../src/classic/accessor.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"accessor.d.ts","sourceRoot":"","sources":["../../src/classic/accessor.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AAGtC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,0CAA0C;IAC1C,OAAO,CA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License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { assert, checkProps } from '@luma.gl/core';
|
|
5
4
|
import { GL } from '@luma.gl/constants';
|
|
6
5
|
import { getTypedArrayFromGLType } from "./typed-array-utils.js";
|
|
7
6
|
const DEFAULT_ACCESSOR_VALUES = {
|
|
@@ -13,12 +12,6 @@ const DEFAULT_ACCESSOR_VALUES = {
|
|
|
13
12
|
normalized: false,
|
|
14
13
|
integer: false
|
|
15
14
|
};
|
|
16
|
-
const PROP_CHECKS = {
|
|
17
|
-
deprecatedProps: {
|
|
18
|
-
instanced: 'divisor',
|
|
19
|
-
isInstanced: 'divisor'
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
15
|
export class Accessor {
|
|
23
16
|
offset;
|
|
24
17
|
stride;
|
|
@@ -36,7 +29,7 @@ export class Accessor {
|
|
|
36
29
|
return ArrayType.BYTES_PER_ELEMENT;
|
|
37
30
|
}
|
|
38
31
|
static getBytesPerVertex(accessor) {
|
|
39
|
-
assert(accessor.size);
|
|
32
|
+
// assert(accessor.size);
|
|
40
33
|
// TODO: using `FLOAT` when type is not specified,
|
|
41
34
|
// ensure this assumption is valid or force API to specify type.
|
|
42
35
|
const ArrayType = getTypedArrayFromGLType(accessor.type || 5126);
|
|
@@ -67,7 +60,6 @@ export class Accessor {
|
|
|
67
60
|
// PRIVATE
|
|
68
61
|
// eslint-disable-next-line complexity, max-statements
|
|
69
62
|
_assign(props = {}) {
|
|
70
|
-
props = checkProps('Accessor', props, PROP_CHECKS);
|
|
71
63
|
if (props.type !== undefined) {
|
|
72
64
|
this.type = props.type;
|
|
73
65
|
// Auto-deduce integer type?
|
|
@@ -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.
|
|
@@ -58,5 +59,5 @@ export declare function copyToTexture(source: Framebuffer | Texture, target: Tex
|
|
|
58
59
|
* Wraps a given texture into a framebuffer object, that can be further used
|
|
59
60
|
* to read data from the texture object.
|
|
60
61
|
*/
|
|
61
|
-
export declare function toFramebuffer(texture: Texture, props?: FramebufferProps):
|
|
62
|
+
export declare function toFramebuffer(texture: Texture, props?: FramebufferProps): WEBGLFramebuffer;
|
|
62
63
|
//# 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"],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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
|
|
@@ -23,7 +24,7 @@ export function readPixelsToArray(source, options) {
|
|
|
23
24
|
// following parameters are auto deduced if not provided
|
|
24
25
|
sourceWidth, sourceHeight, sourceType } = options || {};
|
|
25
26
|
const { framebuffer, deleteFramebuffer } = getFramebuffer(source);
|
|
26
|
-
assert(framebuffer);
|
|
27
|
+
// assert(framebuffer);
|
|
27
28
|
const { gl, handle } = framebuffer;
|
|
28
29
|
sourceWidth = sourceWidth || framebuffer.width;
|
|
29
30
|
sourceHeight = sourceHeight || framebuffer.height;
|
|
@@ -35,8 +36,7 @@ export function readPixelsToArray(source, options) {
|
|
|
35
36
|
// assert(attachments[sourceAttachment]);
|
|
36
37
|
// Deduce the type from color attachment if not provided.
|
|
37
38
|
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
41
|
target = getPixelArray(target, sourceType, sourceFormat, sourceWidth, sourceHeight);
|
|
42
42
|
// Pixel array available, if necessary, deduce type from it.
|
|
@@ -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) {
|
|
@@ -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"}
|
|
@@ -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":"AAOA,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,7 +1,8 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { log
|
|
4
|
+
import { log } from '@luma.gl/core';
|
|
5
|
+
import { loadScript } from "../../utils/load-script.js";
|
|
5
6
|
const DEFAULT_SPECTOR_PROPS = {
|
|
6
7
|
spector: log.get('spector') || log.get('inspect')
|
|
7
8
|
};
|
|
@@ -13,6 +13,6 @@ declare global {
|
|
|
13
13
|
* @see https://github.com/vorg/webgl-debug
|
|
14
14
|
*/
|
|
15
15
|
export declare function loadWebGLDeveloperTools(): Promise<void>;
|
|
16
|
-
export declare function makeDebugContext(gl: WebGL2RenderingContext, props?: DebugContextProps): WebGL2RenderingContext
|
|
16
|
+
export declare function makeDebugContext(gl: WebGL2RenderingContext, props?: DebugContextProps): WebGL2RenderingContext;
|
|
17
17
|
export {};
|
|
18
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":"AAYA,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,CAExB"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { log
|
|
4
|
+
import { log } from '@luma.gl/core';
|
|
5
5
|
// Rename constant to prevent inlining. We need the full set of constants for generating debug strings.
|
|
6
6
|
import { GL as GLEnum } from '@luma.gl/constants';
|
|
7
7
|
import { isBrowser } from '@probe.gl/env';
|
|
8
|
+
import { loadScript } from "../../utils/load-script.js";
|
|
8
9
|
const WEBGL_DEBUG_CDN_URL = 'https://unpkg.com/webgl-debug@2.0.1/index.js';
|
|
9
10
|
// Helper to get shared context data
|
|
10
11
|
function getWebGLContextData(gl) {
|
|
@@ -28,10 +29,6 @@ export async function loadWebGLDeveloperTools() {
|
|
|
28
29
|
// Returns (a potentially new) context with debug instrumentation turned off or on.
|
|
29
30
|
// Note that this actually returns a new context
|
|
30
31
|
export function makeDebugContext(gl, props = {}) {
|
|
31
|
-
// Return null to ensure we don't try to create a context in this case (TODO what case is that?)
|
|
32
|
-
if (!gl) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
32
|
return props.debug ? getDebugContext(gl, props) : getRealContext(gl);
|
|
36
33
|
}
|
|
37
34
|
// Returns the real context from either of the real/debug contexts
|
|
@@ -240,7 +240,7 @@ export const GL_PARAMETER_SETTERS = {
|
|
|
240
240
|
lineWidth: (gl, value) => gl.lineWidth(value),
|
|
241
241
|
polygonOffsetFill: (gl, value) => value ? gl.enable(32823) : gl.disable(32823),
|
|
242
242
|
polygonOffset: (gl, value) => gl.polygonOffset(...value),
|
|
243
|
-
sampleCoverage: (gl, value) => gl.sampleCoverage(
|
|
243
|
+
sampleCoverage: (gl, value) => gl.sampleCoverage(value[0], value[1] || false),
|
|
244
244
|
scissorTest: (gl, value) => value ? gl.enable(3089) : gl.disable(3089),
|
|
245
245
|
scissor: (gl, value) => gl.scissor(...value),
|
|
246
246
|
stencilTest: (gl, value) => value ? gl.enable(2960) : gl.disable(2960),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track-context-state.d.ts","sourceRoot":"","sources":["../../../src/context/state-tracker/track-context-state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"track-context-state.d.ts","sourceRoot":"","sources":["../../../src/context/state-tracker/track-context-state.ts"],"names":[],"mappings":"AAkGA;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,sBAAsB,EAC1B,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC;CACX,GACA,sBAAsB,CAgCxB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,sBAAsB,GAAG,IAAI,CAOjE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,sBAAsB,GAAG,IAAI,CAIhE"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
// Support for listening to context state changes and intercepting state queries
|
|
5
5
|
// NOTE: this system does not handle buffer bindings
|
|
6
|
-
import { assert } from '@luma.gl/core';
|
|
7
6
|
import { GL_PARAMETER_DEFAULTS, GL_HOOKED_SETTERS, NON_CACHE_PARAMETERS } from "../parameters/webgl-parameter-tables.js";
|
|
8
7
|
import { setGLParameters, getGLParameters } from "../parameters/unified-parameter-api.js";
|
|
9
8
|
import { deepArrayEqual } from "./deep-array-equal.js";
|
|
@@ -29,7 +28,7 @@ class GLState {
|
|
|
29
28
|
this.stateStack.push({});
|
|
30
29
|
}
|
|
31
30
|
pop() {
|
|
32
|
-
assert(this.stateStack.length > 0);
|
|
31
|
+
// assert(this.stateStack.length > 0);
|
|
33
32
|
// Use the saved values in the state stack to restore parameters
|
|
34
33
|
const oldValues = this.stateStack[this.stateStack.length - 1];
|
|
35
34
|
setGLParameters(this.gl, oldValues);
|
|
@@ -47,7 +46,7 @@ class GLState {
|
|
|
47
46
|
let oldValue; // = undefined
|
|
48
47
|
const oldValues = this.stateStack.length > 0 ? this.stateStack[this.stateStack.length - 1] : null;
|
|
49
48
|
for (const key in values) {
|
|
50
|
-
assert(key !== undefined);
|
|
49
|
+
// assert(key !== undefined);
|
|
51
50
|
const value = values[key];
|
|
52
51
|
const cached = this.cache[key];
|
|
53
52
|
// Check that value hasn't already been shadowed
|
|
@@ -81,8 +80,8 @@ function getContextState(gl) {
|
|
|
81
80
|
* temporarily modifying, and then restoring state.
|
|
82
81
|
*/
|
|
83
82
|
export function trackContextState(gl, options) {
|
|
84
|
-
const { enable = true, copyState } = options;
|
|
85
|
-
assert(copyState !== undefined);
|
|
83
|
+
const { enable = true, copyState } = options || {};
|
|
84
|
+
// assert(copyState !== undefined);
|
|
86
85
|
// @ts-expect-error
|
|
87
86
|
if (!gl.state) {
|
|
88
87
|
// @ts-ignore
|
|
@@ -123,7 +122,7 @@ export function pushContextState(gl) {
|
|
|
123
122
|
*/
|
|
124
123
|
export function popContextState(gl) {
|
|
125
124
|
const glState = getContextState(gl);
|
|
126
|
-
assert(glState);
|
|
125
|
+
// assert(glState);
|
|
127
126
|
glState.pop();
|
|
128
127
|
}
|
|
129
128
|
// HELPER FUNCTIONS - INSTALL GET/SET INTERCEPTORS (SPYS) ON THE CONTEXT
|