@luma.gl/webgl 9.0.0-beta.5 → 9.0.0-beta.7
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 +128 -71
- package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/sampler-parameters.js +20 -19
- package/dist/adapter/converters/shader-formats.d.ts.map +1 -1
- package/dist/adapter/converters/shader-formats.js +40 -20
- package/dist/adapter/converters/texture-formats.d.ts +16 -11
- package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
- package/dist/adapter/converters/texture-formats.js +224 -205
- package/dist/adapter/converters/vertex-formats.d.ts.map +1 -1
- package/dist/adapter/converters/vertex-formats.js +22 -21
- package/dist/adapter/device-helpers/webgl-device-features.d.ts +19 -5
- package/dist/adapter/device-helpers/webgl-device-features.d.ts.map +1 -1
- package/dist/adapter/device-helpers/webgl-device-features.js +89 -43
- package/dist/adapter/device-helpers/webgl-device-info.d.ts +2 -1
- package/dist/adapter/device-helpers/webgl-device-info.d.ts.map +1 -1
- package/dist/adapter/device-helpers/webgl-device-info.js +22 -19
- package/dist/adapter/device-helpers/webgl-device-limits.d.ts +33 -48
- package/dist/adapter/device-helpers/webgl-device-limits.d.ts.map +1 -1
- package/dist/adapter/device-helpers/webgl-device-limits.js +42 -87
- package/dist/adapter/helpers/decode-webgl-types.d.ts.map +1 -1
- package/dist/adapter/helpers/decode-webgl-types.js +47 -46
- package/dist/adapter/helpers/get-shader-layout.d.ts.map +1 -1
- package/dist/adapter/helpers/get-shader-layout.js +35 -34
- package/dist/adapter/helpers/parse-shader-compiler-log.d.ts.map +1 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.js +3 -2
- package/dist/adapter/helpers/set-uniform.d.ts.map +1 -1
- package/dist/adapter/helpers/set-uniform.js +42 -41
- package/dist/adapter/helpers/webgl-topology-utils.d.ts.map +1 -1
- package/dist/adapter/helpers/webgl-topology-utils.js +40 -39
- package/dist/adapter/objects/constants-to-keys.d.ts.map +1 -1
- package/dist/adapter/objects/constants-to-keys.js +2 -1
- 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 +30 -17
- package/dist/adapter/objects/webgl-resource.d.ts +2 -24
- package/dist/adapter/objects/webgl-resource.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-resource.js +6 -101
- package/dist/adapter/resources/webgl-buffer.d.ts +1 -1
- package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-buffer.js +16 -15
- 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 +32 -31
- 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 +4 -2
- package/dist/adapter/resources/webgl-external-texture.js +6 -5
- package/dist/adapter/resources/webgl-framebuffer.d.ts +6 -10
- package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +60 -53
- 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 +20 -12
- package/dist/adapter/resources/webgl-render-pipeline.d.ts +4 -5
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +52 -61
- package/dist/adapter/resources/webgl-sampler.d.ts +1 -1
- package/dist/adapter/resources/webgl-sampler.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-sampler.js +5 -4
- package/dist/adapter/resources/webgl-shader.d.ts +3 -2
- package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-shader.js +15 -9
- 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 -4
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +39 -32
- package/dist/adapter/resources/webgl-transform-feedback.d.ts +1 -1
- package/dist/adapter/resources/webgl-transform-feedback.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-transform-feedback.js +10 -10
- 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 +10 -9
- 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 +3 -2
- package/dist/adapter/webgl-device.d.ts +35 -30
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +110 -109
- package/dist/classic/accessor.d.ts.map +1 -1
- package/dist/classic/accessor.js +8 -7
- package/dist/classic/clear.d.ts.map +1 -1
- package/dist/classic/clear.js +5 -4
- 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 +19 -19
- package/dist/classic/format-utils.d.ts.map +1 -1
- package/dist/classic/format-utils.js +16 -15
- package/dist/classic/typed-array-utils.d.ts.map +1 -1
- package/dist/classic/typed-array-utils.js +20 -19
- 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.map +1 -1
- package/dist/context/debug/webgl-developer-tools.js +7 -6
- package/dist/context/{context → helpers}/create-browser-context.d.ts.map +1 -1
- package/dist/context/{context → helpers}/create-browser-context.js +2 -1
- package/dist/context/{context/context-data.d.ts → helpers/webgl-context-data.d.ts} +2 -3
- 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 -4
- package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
- package/dist/context/parameters/unified-parameter-api.js +7 -11
- package/dist/context/parameters/webgl-parameter-tables.d.ts +12 -13
- package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.js +302 -295
- package/dist/context/state-tracker/deep-array-equal.d.ts.map +1 -1
- package/dist/context/state-tracker/deep-array-equal.js +2 -1
- package/dist/context/state-tracker/track-context-state.d.ts.map +1 -1
- package/dist/context/state-tracker/track-context-state.js +5 -4
- package/dist/context/state-tracker/with-parameters.d.ts +2 -3
- package/dist/context/state-tracker/with-parameters.d.ts.map +1 -1
- package/dist/context/state-tracker/with-parameters.js +6 -8
- package/dist/dist.dev.js +1635 -1387
- package/dist/index.cjs +1766 -1534
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +25 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -23
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -1
- package/dist.min.js +6 -6
- package/package.json +4 -4
- package/src/adapter/converters/device-parameters.ts +114 -27
- package/src/adapter/converters/sampler-parameters.ts +12 -3
- package/src/adapter/converters/shader-formats.ts +47 -22
- package/src/adapter/converters/texture-formats.ts +138 -114
- package/src/adapter/converters/vertex-formats.ts +3 -3
- package/src/adapter/device-helpers/webgl-device-features.ts +102 -50
- package/src/adapter/device-helpers/webgl-device-info.ts +28 -19
- package/src/adapter/device-helpers/webgl-device-limits.ts +46 -150
- package/src/adapter/helpers/decode-webgl-types.ts +13 -7
- package/src/adapter/helpers/get-shader-layout.ts +4 -3
- package/src/adapter/helpers/parse-shader-compiler-log.ts +10 -6
- package/src/adapter/helpers/set-uniform.ts +2 -1
- package/src/adapter/helpers/webgl-topology-utils.ts +10 -3
- package/src/adapter/objects/constants-to-keys.ts +2 -1
- package/src/adapter/objects/webgl-renderbuffer.ts +36 -14
- package/src/adapter/objects/webgl-resource.ts +7 -125
- package/src/adapter/resources/webgl-buffer.ts +4 -3
- package/src/adapter/resources/webgl-command-buffer.ts +5 -5
- package/src/adapter/resources/webgl-command-encoder.ts +14 -11
- package/src/adapter/resources/webgl-external-texture.ts +6 -5
- package/src/adapter/resources/webgl-framebuffer.ts +61 -53
- package/src/adapter/resources/webgl-query-set.ts +171 -0
- package/src/adapter/resources/webgl-render-pass.ts +20 -11
- package/src/adapter/resources/webgl-render-pipeline.ts +54 -54
- package/src/adapter/resources/webgl-sampler.ts +2 -1
- package/src/adapter/resources/webgl-shader.ts +12 -5
- package/src/adapter/resources/webgl-texture-view.ts +28 -0
- package/src/adapter/resources/webgl-texture.ts +14 -3
- package/src/adapter/resources/webgl-transform-feedback.ts +2 -7
- package/src/adapter/resources/webgl-vertex-array.ts +4 -3
- package/src/adapter/webgl-canvas-context.ts +6 -4
- package/src/adapter/webgl-device.ts +116 -107
- package/src/classic/accessor.ts +5 -4
- package/src/classic/clear.ts +14 -8
- package/src/classic/copy-and-blit.ts +11 -4
- 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 +27 -14
- package/src/context/{context → helpers}/create-browser-context.ts +3 -2
- package/src/context/helpers/webgl-context-data.ts +31 -0
- package/src/context/helpers/webgl-extensions.ts +17 -0
- package/src/context/parameters/unified-parameter-api.ts +6 -17
- package/src/context/parameters/webgl-parameter-tables.ts +69 -32
- package/src/context/state-tracker/deep-array-equal.ts +2 -1
- package/src/context/state-tracker/track-context-state.ts +11 -6
- package/src/context/state-tracker/with-parameters.ts +8 -8
- package/src/index.ts +7 -6
- package/src/types.ts +2 -1
- package/dist/adapter/device-helpers/device-features.d.ts +0 -6
- package/dist/adapter/device-helpers/device-features.d.ts.map +0 -1
- package/dist/adapter/device-helpers/device-features.js +0 -65
- package/dist/adapter/device-helpers/device-limits.d.ts +0 -50
- package/dist/adapter/device-helpers/device-limits.d.ts.map +0 -1
- package/dist/adapter/device-helpers/device-limits.js +0 -92
- package/dist/adapter/device-helpers/get-device-info.d.ts +0 -4
- package/dist/adapter/device-helpers/get-device-info.d.ts.map +0 -1
- package/dist/adapter/device-helpers/get-device-info.js +0 -87
- package/dist/context/context/context-data.d.ts.map +0 -1
- package/dist/context/context/context-data.js +0 -33
- package/src/context/context/context-data.ts +0 -44
- /package/dist/context/{context → helpers}/create-browser-context.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Resource } from '@luma.gl/core';
|
|
2
1
|
import type { Device, ResourceProps } from '@luma.gl/core';
|
|
2
|
+
import { Resource } from '@luma.gl/core';
|
|
3
3
|
import { GL } from '@luma.gl/constants';
|
|
4
|
-
import { WebGLDevice } from
|
|
4
|
+
import { WebGLDevice } from "../webgl-device.js";
|
|
5
5
|
/**
|
|
6
6
|
* Base class for WebGL object wrappers
|
|
7
7
|
*/
|
|
@@ -20,28 +20,6 @@ export declare abstract class WebGLResource<Props extends ResourceProps> extends
|
|
|
20
20
|
}): this;
|
|
21
21
|
bind(funcOrHandle?: any): any;
|
|
22
22
|
unbind(): void;
|
|
23
|
-
/**
|
|
24
|
-
* Query a Resource parameter
|
|
25
|
-
*
|
|
26
|
-
* @param name
|
|
27
|
-
* @return param
|
|
28
|
-
*/
|
|
29
|
-
getParameter(pname: number, props?: any): any;
|
|
30
|
-
getParameters(options?: {
|
|
31
|
-
parameters?: any;
|
|
32
|
-
keys?: any;
|
|
33
|
-
}): Record<string, any>;
|
|
34
|
-
/**
|
|
35
|
-
* Update a Resource setting
|
|
36
|
-
*
|
|
37
|
-
* @todo - cache parameter to avoid issuing WebGL calls?
|
|
38
|
-
*
|
|
39
|
-
* @param pname - parameter (GL constant, value or key)
|
|
40
|
-
* @param value {GLint|GLfloat|GLenum}
|
|
41
|
-
* @return returns self to enable chaining
|
|
42
|
-
*/
|
|
43
|
-
setParameter(pname: GL | string, value: any): this;
|
|
44
|
-
setParameters(parameters: Record<GL, any>): this;
|
|
45
23
|
stubRemovedMethods(className: string, version: string, methodNames: string[]): void;
|
|
46
24
|
initialize(props: ResourceProps): void;
|
|
47
25
|
_createHandle(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-resource.d.ts","sourceRoot":"","sources":["../../../src/adapter/objects/webgl-resource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webgl-resource.d.ts","sourceRoot":"","sources":["../../../src/adapter/objects/webgl-resource.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AACzD,OAAO,EAAC,QAAQ,EAA0B,MAAM,eAAe,CAAC;AAChE,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAI5C;;GAEG;AACH,8BAAsB,aAAa,CAAC,KAAK,SAAS,aAAa,CAAE,SAAQ,QAAQ,CAAC,KAAK,CAAC;IACtF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,EAAE,EAAE,sBAAsB,CAAC;IACpC,QAAQ,CAAC,GAAG,EAAE,sBAAsB,CAAC;IACrC,OAAO,CAAC,OAAO,CAAM;IAErB,OAAO,CAAC,MAAM,CAAS;IAEvB,UAAU,SAAK;gBAEH,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC;IA2B9D,QAAQ,IAAI,MAAM;IAI3B,IAAI,MAAM,QAWT;IAEQ,MAAM,CAAC,EAAC,cAAsB,EAAC;;KAAK;IAmB7C,IAAI,CAAC,YAAY,MAAc;IAuB/B,MAAM;IAKN,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE;IAK5E,UAAU,CAAC,KAAK,EAAE,aAAa;IAG/B,aAAa;IAIb,aAAa;IAIb,WAAW,CAAC,MAAM,EAAE,GAAG;IAIvB,kBAAkB;IAIlB,aAAa,CAAC,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM;IAI5D,aAAa,CAAC,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,GAAG;CAuC7C"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
// luma.gl
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
2
3
|
// Copyright (c) vis.gl contributors
|
|
3
|
-
import { Resource,
|
|
4
|
-
import { WebGLDevice } from '../webgl-device';
|
|
5
|
-
// Requires full GL enum to be bundled... Make these bindings dependent on dynamic import (debug)?
|
|
6
|
-
import { getKeyValue } from './constants-to-keys';
|
|
4
|
+
import { Resource, uid, stubRemovedMethods } from '@luma.gl/core';
|
|
7
5
|
const ERR_RESOURCE_METHOD_UNDEFINED = 'Resource subclass must define virtual methods';
|
|
8
6
|
/**
|
|
9
7
|
* Base class for WebGL object wrappers
|
|
@@ -18,9 +16,9 @@ export class WebGLResource extends Resource {
|
|
|
18
16
|
byteLength = 0;
|
|
19
17
|
constructor(device, props, defaultProps) {
|
|
20
18
|
super(device, props, defaultProps);
|
|
21
|
-
this.device =
|
|
19
|
+
this.device = device;
|
|
22
20
|
const gl = this.device.gl;
|
|
23
|
-
// extends
|
|
21
|
+
// extends
|
|
24
22
|
const { id } = props || {};
|
|
25
23
|
this.gl = gl;
|
|
26
24
|
this.gl2 = gl;
|
|
@@ -63,7 +61,7 @@ export class WebGLResource extends Resource {
|
|
|
63
61
|
// @ts-expect-error
|
|
64
62
|
if (children && deleteChildren) {
|
|
65
63
|
// @ts-expect-error
|
|
66
|
-
children.filter(Boolean).forEach(
|
|
64
|
+
children.filter(Boolean).forEach(child => child.destroy());
|
|
67
65
|
}
|
|
68
66
|
return this;
|
|
69
67
|
}
|
|
@@ -88,99 +86,6 @@ export class WebGLResource extends Resource {
|
|
|
88
86
|
unbind() {
|
|
89
87
|
this.bind(null);
|
|
90
88
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Query a Resource parameter
|
|
93
|
-
*
|
|
94
|
-
* @param name
|
|
95
|
-
* @return param
|
|
96
|
-
*/
|
|
97
|
-
getParameter(pname, props = {}) {
|
|
98
|
-
pname = getKeyValue(this.gl, pname);
|
|
99
|
-
assert(pname);
|
|
100
|
-
// @ts-expect-error
|
|
101
|
-
const parameters = this.constructor.PARAMETERS || {};
|
|
102
|
-
// Use parameter definitions to handle unsupported parameters
|
|
103
|
-
const parameter = parameters[pname];
|
|
104
|
-
if (parameter) {
|
|
105
|
-
// Check if we can query for this parameter
|
|
106
|
-
const parameterAvailable = (!('extension' in parameter) || this.gl.getExtension(parameter.extension));
|
|
107
|
-
if (!parameterAvailable) {
|
|
108
|
-
return parameter.webgl2;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
// If unknown parameter - Could be a valid parameter not covered by PARAMS
|
|
112
|
-
// Attempt to query for it and let WebGL report errors
|
|
113
|
-
return this._getParameter(pname, props);
|
|
114
|
-
}
|
|
115
|
-
// Many resources support a getParameter call -
|
|
116
|
-
// getParameters will get all parameters - slow but useful for debugging
|
|
117
|
-
// eslint-disable-next-line complexity
|
|
118
|
-
getParameters(options = {}) {
|
|
119
|
-
const { parameters, keys } = options;
|
|
120
|
-
// Get parameter definitions for this Resource
|
|
121
|
-
// @ts-expect-error
|
|
122
|
-
const PARAMETERS = this.constructor.PARAMETERS || {};
|
|
123
|
-
const values = {};
|
|
124
|
-
// Query all parameters if no list provided
|
|
125
|
-
const parameterKeys = parameters || Object.keys(PARAMETERS);
|
|
126
|
-
// WEBGL limits
|
|
127
|
-
for (const pname of parameterKeys) {
|
|
128
|
-
const parameter = PARAMETERS[pname];
|
|
129
|
-
// Check if this parameter is available on this platform
|
|
130
|
-
const parameterAvailable = parameter &&
|
|
131
|
-
(!('extension' in parameter) || this.gl.getExtension(parameter.extension));
|
|
132
|
-
if (parameterAvailable) {
|
|
133
|
-
const key = keys ? this.device.getGLKey(pname) : pname;
|
|
134
|
-
values[key] = this.getParameter(pname, options);
|
|
135
|
-
if (keys && parameter.type === 'GLenum') {
|
|
136
|
-
values[key] = this.device.getGLKey(values[key]);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return values;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Update a Resource setting
|
|
144
|
-
*
|
|
145
|
-
* @todo - cache parameter to avoid issuing WebGL calls?
|
|
146
|
-
*
|
|
147
|
-
* @param pname - parameter (GL constant, value or key)
|
|
148
|
-
* @param value {GLint|GLfloat|GLenum}
|
|
149
|
-
* @return returns self to enable chaining
|
|
150
|
-
*/
|
|
151
|
-
setParameter(pname, value) {
|
|
152
|
-
pname = getKeyValue(this.gl, pname);
|
|
153
|
-
assert(pname);
|
|
154
|
-
// @ts-expect-error
|
|
155
|
-
const parameters = this.constructor.PARAMETERS || {};
|
|
156
|
-
const parameter = parameters[pname];
|
|
157
|
-
if (parameter) {
|
|
158
|
-
// Check if this parameter is available on this platform
|
|
159
|
-
const parameterAvailable = (!('extension' in parameter) || this.gl.getExtension(parameter.extension));
|
|
160
|
-
if (!parameterAvailable) {
|
|
161
|
-
throw new Error('Parameter not available on this platform');
|
|
162
|
-
}
|
|
163
|
-
// Handle string keys
|
|
164
|
-
if (parameter.type === 'GLenum') {
|
|
165
|
-
// @ts-expect-error
|
|
166
|
-
value = getKeyValue(value);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
// If unknown parameter - Could be a valid parameter not covered by PARAMS
|
|
170
|
-
// attempt to set it and let WebGL report errors
|
|
171
|
-
this._setParameter(pname, value);
|
|
172
|
-
return this;
|
|
173
|
-
}
|
|
174
|
-
/*
|
|
175
|
-
* Batch update resource parameters
|
|
176
|
-
* Assumes the subclass supports a setParameter call
|
|
177
|
-
*/
|
|
178
|
-
setParameters(parameters) {
|
|
179
|
-
for (const pname in parameters) {
|
|
180
|
-
this.setParameter(pname, parameters[pname]);
|
|
181
|
-
}
|
|
182
|
-
return this;
|
|
183
|
-
}
|
|
184
89
|
// Install stubs for removed methods
|
|
185
90
|
stubRemovedMethods(className, version, methodNames) {
|
|
186
91
|
return stubRemovedMethods(this, className, version, methodNames);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BufferProps } from '@luma.gl/core';
|
|
2
2
|
import { Buffer } from '@luma.gl/core';
|
|
3
3
|
import { GL } from '@luma.gl/constants';
|
|
4
|
-
import { WebGLDevice } from
|
|
4
|
+
import { WebGLDevice } from "../webgl-device.js";
|
|
5
5
|
/** WebGL Buffer interface */
|
|
6
6
|
export declare class WEBGLBuffer extends Buffer {
|
|
7
7
|
readonly device: WebGLDevice;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-buffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-buffer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webgl-buffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-buffer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,MAAM,EAAS,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAE5C,6BAA6B;AAC7B,qBAAa,WAAY,SAAQ,MAAM;IACrC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,EAAE,EAAE,sBAAsB,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAE7B,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,oBAAoB,GAAG,EAAE,CAAC,cAAc,CAAC;IACjF,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC;IACnD,yEAAyE;IACzE,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC,cAAc,GAAG,EAAE,CAAC,YAAY,CAAqB;IAE9E,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;gBAEN,MAAM,EAAE,WAAW,EAAE,KAAK,GAAE,WAAgB;IA2BxD,sEAAsE;IACtE,aAAa,CACX,IAAI,EAAE,WAAW,GAAG,eAAe,EACnC,UAAU,GAAE,MAAU,EACtB,UAAU,GAAE,MAAqC,GAChD,IAAI;IAgBP,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IA2BpC,OAAO,IAAI,IAAI;IAWf,KAAK,CAAC,IAAI,EAAE,eAAe,EAAE,UAAU,GAAE,MAAU,GAAG,IAAI;IAmBnE,+CAA+C;IAChC,SAAS,CAAC,UAAU,SAAI,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAIlF,2DAA2D;IAClD,aAAa,CAAC,UAAU,SAAI,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU;CAexE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// luma.gl
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
2
3
|
// Copyright (c) vis.gl contributors
|
|
3
4
|
import { Buffer, assert } from '@luma.gl/core';
|
|
4
5
|
import { GL } from '@luma.gl/constants';
|
|
@@ -12,7 +13,7 @@ export class WEBGLBuffer extends Buffer {
|
|
|
12
13
|
/** Usage is a hint on how frequently the buffer will be updates */
|
|
13
14
|
glUsage;
|
|
14
15
|
/** Index type is needed when issuing draw calls, so we pre-compute it */
|
|
15
|
-
glIndexType =
|
|
16
|
+
glIndexType = 5123;
|
|
16
17
|
/** Number of bytes allocated on the GPU for this buffer */
|
|
17
18
|
byteLength;
|
|
18
19
|
/** Number of bytes used */
|
|
@@ -29,7 +30,7 @@ export class WEBGLBuffer extends Buffer {
|
|
|
29
30
|
// - In WebGL2, we can use GL.COPY_READ_BUFFER which avoids locking the type here
|
|
30
31
|
this.glTarget = getWebGLTarget(this.props.usage);
|
|
31
32
|
this.glUsage = getWebGLUsage(this.props.usage);
|
|
32
|
-
this.glIndexType = this.props.indexType === 'uint32' ?
|
|
33
|
+
this.glIndexType = this.props.indexType === 'uint32' ? 5125 : 5123;
|
|
33
34
|
// Set data: (re)initializes the buffer
|
|
34
35
|
if (props.data) {
|
|
35
36
|
this._initWithData(props.data, props.byteOffset, props.byteLength);
|
|
@@ -88,7 +89,7 @@ export class WEBGLBuffer extends Buffer {
|
|
|
88
89
|
const byteLength = undefined; // data.byteLength;
|
|
89
90
|
// Create the buffer - binding it here for the first time locks the type
|
|
90
91
|
// In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type
|
|
91
|
-
const glTarget =
|
|
92
|
+
const glTarget = 36663;
|
|
92
93
|
this.gl.bindBuffer(glTarget, this.handle);
|
|
93
94
|
// WebGL2: subData supports additional srcOffset and length parameters
|
|
94
95
|
if (srcOffset !== 0 || byteLength !== undefined) {
|
|
@@ -110,9 +111,9 @@ export class WEBGLBuffer extends Buffer {
|
|
|
110
111
|
const data = new Uint8Array(byteLength);
|
|
111
112
|
const dstOffset = 0;
|
|
112
113
|
// Use GL.COPY_READ_BUFFER to avoid disturbing other targets and locking type
|
|
113
|
-
this.gl.bindBuffer(
|
|
114
|
-
this.gl.getBufferSubData(
|
|
115
|
-
this.gl.bindBuffer(
|
|
114
|
+
this.gl.bindBuffer(36662, this.handle);
|
|
115
|
+
this.gl.getBufferSubData(36662, byteOffset, data, dstOffset, byteLength);
|
|
116
|
+
this.gl.bindBuffer(36662, null);
|
|
116
117
|
// Update local `data` if offsets are 0
|
|
117
118
|
this._setDebugData(data, byteOffset, byteLength);
|
|
118
119
|
return data;
|
|
@@ -144,28 +145,28 @@ export class WEBGLBuffer extends Buffer {
|
|
|
144
145
|
*/
|
|
145
146
|
function getWebGLTarget(usage) {
|
|
146
147
|
if (usage & Buffer.INDEX) {
|
|
147
|
-
return
|
|
148
|
+
return 34963;
|
|
148
149
|
}
|
|
149
150
|
if (usage & Buffer.VERTEX) {
|
|
150
|
-
return
|
|
151
|
+
return 34962;
|
|
151
152
|
}
|
|
152
153
|
if (usage & Buffer.UNIFORM) {
|
|
153
|
-
return
|
|
154
|
+
return 35345;
|
|
154
155
|
}
|
|
155
156
|
// Binding a buffer for the first time locks the type
|
|
156
157
|
// In WebGL2, we can use GL.COPY_WRITE_BUFFER to avoid locking the type
|
|
157
|
-
return
|
|
158
|
+
return 34962;
|
|
158
159
|
}
|
|
159
160
|
/** @todo usage is not passed correctly */
|
|
160
161
|
function getWebGLUsage(usage) {
|
|
161
162
|
if (usage & Buffer.INDEX) {
|
|
162
|
-
return
|
|
163
|
+
return 35044;
|
|
163
164
|
}
|
|
164
165
|
if (usage & Buffer.VERTEX) {
|
|
165
|
-
return
|
|
166
|
+
return 35044;
|
|
166
167
|
}
|
|
167
168
|
if (usage & Buffer.UNIFORM) {
|
|
168
|
-
return
|
|
169
|
+
return 35048;
|
|
169
170
|
}
|
|
170
|
-
return
|
|
171
|
+
return 35044;
|
|
171
172
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CopyBufferToBufferOptions, CopyBufferToTextureOptions, CopyTextureToBufferOptions, CopyTextureToTextureOptions } from '@luma.gl/core';
|
|
2
2
|
import { CommandBuffer } from '@luma.gl/core';
|
|
3
3
|
import { GL } from '@luma.gl/constants';
|
|
4
|
-
import { WebGLDevice } from
|
|
4
|
+
import { WebGLDevice } from "../webgl-device.js";
|
|
5
5
|
type CopyBufferToBufferCommand = {
|
|
6
6
|
name: 'copy-buffer-to-buffer';
|
|
7
7
|
options: CopyBufferToBufferOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-command-buffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-command-buffer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webgl-command-buffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-command-buffer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,aAAa,EAAuB,MAAM,eAAe,CAAC;AAClE,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AAEtC,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAU5C,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,uBAAuB,CAAC;IAC9B,OAAO,EAAE,yBAAyB,CAAC;CACpC,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,0BAA0B,CAAC;CACrC,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,0BAA0B,CAAC;CACrC,CAAC;AAEF,KAAK,2BAA2B,GAAG;IACjC,IAAI,EAAE,yBAAyB,CAAC;IAChC,OAAO,EAAE,2BAA2B,CAAC;CACtC,CAAC;AAEF,KAAK,OAAO,GACR,yBAAyB,GACzB,0BAA0B,GAC1B,0BAA0B,GAC1B,2BAA2B,CAAC;AAEhC,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,OAAO,EAAE,CAAM;gBAEb,MAAM,EAAE,WAAW;IAK/B,cAAc,CAAC,QAAQ,GAAE,OAAO,EAAkB;CAkBnD;AA6PD,wBAAgB,oBAAoB,CAAC,MAAM,KAAA,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAmB1D;AAGD,wBAAgB,aAAa,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAcjD"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
// luma.gl
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
2
3
|
// Copyright (c) vis.gl contributors
|
|
3
4
|
import { CommandBuffer, Texture } from '@luma.gl/core';
|
|
4
5
|
import { GL } from '@luma.gl/constants';
|
|
5
|
-
import { WEBGLTexture } from
|
|
6
|
-
import { getWebGLTextureParameters } from
|
|
6
|
+
import { WEBGLTexture } from "./webgl-texture.js";
|
|
7
|
+
import { getWebGLTextureParameters } from "../converters/texture-formats.js";
|
|
7
8
|
function cast(value) {
|
|
8
9
|
return value;
|
|
9
10
|
}
|
|
@@ -38,11 +39,11 @@ function _copyBufferToBuffer(device, options) {
|
|
|
38
39
|
const destination = cast(options.destination);
|
|
39
40
|
// {In WebGL2 we can p}erform the copy on the GPU
|
|
40
41
|
// Use GL.COPY_READ_BUFFER+GL.COPY_WRITE_BUFFER avoid disturbing other targets and locking type
|
|
41
|
-
device.gl.bindBuffer(
|
|
42
|
-
device.gl.bindBuffer(
|
|
43
|
-
device.gl.copyBufferSubData(
|
|
44
|
-
device.gl.bindBuffer(
|
|
45
|
-
device.gl.bindBuffer(
|
|
42
|
+
device.gl.bindBuffer(36662, source.handle);
|
|
43
|
+
device.gl.bindBuffer(36663, destination.handle);
|
|
44
|
+
device.gl.copyBufferSubData(36662, 36663, options.sourceOffset ?? 0, options.destinationOffset ?? 0, options.size);
|
|
45
|
+
device.gl.bindBuffer(36662, null);
|
|
46
|
+
device.gl.bindBuffer(36663, null);
|
|
46
47
|
}
|
|
47
48
|
/**
|
|
48
49
|
* Copies data from a Buffer object into a Texture object
|
|
@@ -98,7 +99,7 @@ function _copyTextureToBuffer(device, options) {
|
|
|
98
99
|
const webglBuffer = destination;
|
|
99
100
|
const sourceWidth = width || framebuffer.width;
|
|
100
101
|
const sourceHeight = height || framebuffer.height;
|
|
101
|
-
const sourceParams = getWebGLTextureParameters(framebuffer.texture.format);
|
|
102
|
+
const sourceParams = getWebGLTextureParameters(framebuffer.texture.props.format);
|
|
102
103
|
const sourceFormat = sourceParams.dataFormat;
|
|
103
104
|
const sourceType = sourceParams.type;
|
|
104
105
|
// if (!target) {
|
|
@@ -108,13 +109,13 @@ function _copyTextureToBuffer(device, options) {
|
|
|
108
109
|
// const byteLength = byteOffset + sourceWidth * sourceHeight * components * byteCount;
|
|
109
110
|
// target = device.createBuffer({byteLength});
|
|
110
111
|
// }
|
|
111
|
-
device.gl.bindBuffer(
|
|
112
|
-
device.gl.bindFramebuffer(
|
|
112
|
+
device.gl.bindBuffer(35051, webglBuffer.handle);
|
|
113
|
+
device.gl.bindFramebuffer(36160, framebuffer.handle);
|
|
113
114
|
device.gl.readPixels(origin[0], origin[1], sourceWidth, sourceHeight, sourceFormat, sourceType, byteOffset);
|
|
114
115
|
}
|
|
115
116
|
finally {
|
|
116
|
-
device.gl.bindBuffer(
|
|
117
|
-
device.gl.bindFramebuffer(
|
|
117
|
+
device.gl.bindBuffer(35051, null);
|
|
118
|
+
device.gl.bindFramebuffer(36160, null);
|
|
118
119
|
if (destroyFramebuffer) {
|
|
119
120
|
framebuffer.destroy();
|
|
120
121
|
}
|
|
@@ -153,7 +154,7 @@ function _copyTextureToTexture(device, options) {
|
|
|
153
154
|
/** Defines the origin of the copy - the minimum corner of the texture sub-region to copy to/from. */
|
|
154
155
|
origin = [0, 0],
|
|
155
156
|
/** Texture to copy to/from. */
|
|
156
|
-
destination
|
|
157
|
+
destination
|
|
157
158
|
/** Mip-map level of the texture to copy to/from. (Default 0) */
|
|
158
159
|
// destinationMipLevel = options.mipLevel,
|
|
159
160
|
/** Defines the origin of the copy - the minimum corner of the texture sub-region to copy to/from. */
|
|
@@ -161,11 +162,11 @@ function _copyTextureToTexture(device, options) {
|
|
|
161
162
|
/** Defines which aspects of the texture to copy to/from. */
|
|
162
163
|
// destinationAspect = options.aspect,
|
|
163
164
|
} = options;
|
|
164
|
-
let { width = options.destination.width, height = options.destination.width
|
|
165
|
+
let { width = options.destination.width, height = options.destination.width
|
|
165
166
|
// depthOrArrayLayers = 0
|
|
166
167
|
} = options;
|
|
167
168
|
const destinationMipmaplevel = 0;
|
|
168
|
-
const destinationInternalFormat =
|
|
169
|
+
const destinationInternalFormat = 6408;
|
|
169
170
|
const { framebuffer, destroyFramebuffer } = getFramebuffer(source);
|
|
170
171
|
const [sourceX, sourceY] = origin;
|
|
171
172
|
const isSubCopy = false;
|
|
@@ -175,7 +176,7 @@ function _copyTextureToTexture(device, options) {
|
|
|
175
176
|
// destinationX = destinationX || 0;
|
|
176
177
|
// destinationY = destinationY || 0;
|
|
177
178
|
// destinationZ = destinationZ || 0;
|
|
178
|
-
device.gl.bindFramebuffer(
|
|
179
|
+
device.gl.bindFramebuffer(36160, framebuffer.handle);
|
|
179
180
|
// TODO - support gl.readBuffer (WebGL2 only)
|
|
180
181
|
// const prevBuffer = gl.readBuffer(attachment);
|
|
181
182
|
let texture = null;
|
|
@@ -239,18 +240,18 @@ function _copyTextureToTexture(device, options) {
|
|
|
239
240
|
// Returns number of components in a specific readPixels WebGL format
|
|
240
241
|
export function glFormatToComponents(format) {
|
|
241
242
|
switch (format) {
|
|
242
|
-
case
|
|
243
|
-
case
|
|
244
|
-
case
|
|
243
|
+
case 6406:
|
|
244
|
+
case 33326:
|
|
245
|
+
case 6403:
|
|
245
246
|
return 1;
|
|
246
|
-
case
|
|
247
|
-
case
|
|
247
|
+
case 33328:
|
|
248
|
+
case 33319:
|
|
248
249
|
return 2;
|
|
249
|
-
case
|
|
250
|
-
case
|
|
250
|
+
case 6407:
|
|
251
|
+
case 34837:
|
|
251
252
|
return 3;
|
|
252
|
-
case
|
|
253
|
-
case
|
|
253
|
+
case 6408:
|
|
254
|
+
case 34836:
|
|
254
255
|
return 4;
|
|
255
256
|
// TODO: Add support for additional WebGL2 formats
|
|
256
257
|
default:
|
|
@@ -260,13 +261,13 @@ export function glFormatToComponents(format) {
|
|
|
260
261
|
// Return byte count for given readPixels WebGL type
|
|
261
262
|
export function glTypeToBytes(type) {
|
|
262
263
|
switch (type) {
|
|
263
|
-
case
|
|
264
|
+
case 5121:
|
|
264
265
|
return 1;
|
|
265
|
-
case
|
|
266
|
-
case
|
|
267
|
-
case
|
|
266
|
+
case 33635:
|
|
267
|
+
case 32819:
|
|
268
|
+
case 32820:
|
|
268
269
|
return 2;
|
|
269
|
-
case
|
|
270
|
+
case 5126:
|
|
270
271
|
return 4;
|
|
271
272
|
// TODO: Add support for additional WebGL2 types
|
|
272
273
|
default:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommandEncoder, CommandEncoderProps } from '@luma.gl/core';
|
|
2
|
-
import type { CopyBufferToBufferOptions, CopyBufferToTextureOptions, CopyTextureToBufferOptions, CopyTextureToTextureOptions } from '@luma.gl/core';
|
|
3
|
-
import { WEBGLCommandBuffer } from
|
|
4
|
-
import { WebGLDevice } from
|
|
2
|
+
import type { CopyBufferToBufferOptions, CopyBufferToTextureOptions, CopyTextureToBufferOptions, CopyTextureToTextureOptions, QuerySet, Buffer } from '@luma.gl/core';
|
|
3
|
+
import { WEBGLCommandBuffer } from "./webgl-command-buffer.js";
|
|
4
|
+
import { WebGLDevice } from "../webgl-device.js";
|
|
5
5
|
export declare class WEBGLCommandEncoder extends CommandEncoder {
|
|
6
6
|
readonly device: WebGLDevice;
|
|
7
7
|
readonly commandBuffer: WEBGLCommandBuffer;
|
|
@@ -15,5 +15,10 @@ export declare class WEBGLCommandEncoder extends CommandEncoder {
|
|
|
15
15
|
pushDebugGroup(groupLabel: string): void;
|
|
16
16
|
popDebugGroup(): void;
|
|
17
17
|
insertDebugMarker(markerLabel: string): void;
|
|
18
|
+
resolveQuerySet(querySet: QuerySet, destination: Buffer, options?: {
|
|
19
|
+
firstQuery?: number;
|
|
20
|
+
queryCount?: number;
|
|
21
|
+
destinationOffset?: number;
|
|
22
|
+
}): void;
|
|
18
23
|
}
|
|
19
24
|
//# sourceMappingURL=webgl-command-encoder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-command-encoder.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-command-encoder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webgl-command-encoder.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-command-encoder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,EAC3B,QAAQ,EACR,MAAM,EACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAC,kBAAkB,EAAC,kCAA+B;AAC1D,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAE5C,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAE7B,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;gBAE/B,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,mBAAmB;IAMlD,OAAO,IAAI,IAAI;IAEf,MAAM,IAAI,IAAI;IAQvB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI;IAI5D,mBAAmB,CAAC,OAAO,EAAE,0BAA0B;IAIvD,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,IAAI;IAI9D,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,IAAI;IAIvD,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IACxC,aAAa;IAEb,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAE5C,eAAe,CACtB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;QACR,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,GACA,IAAI;CACR"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
// luma.gl
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
2
3
|
// Copyright (c) vis.gl contributors
|
|
3
4
|
import { CommandEncoder } from '@luma.gl/core';
|
|
4
|
-
import { WEBGLCommandBuffer } from
|
|
5
|
+
import { WEBGLCommandBuffer } from "./webgl-command-buffer.js";
|
|
5
6
|
export class WEBGLCommandEncoder extends CommandEncoder {
|
|
6
7
|
device;
|
|
7
8
|
commandBuffer;
|
|
@@ -32,4 +33,5 @@ export class WEBGLCommandEncoder extends CommandEncoder {
|
|
|
32
33
|
pushDebugGroup(groupLabel) { }
|
|
33
34
|
popDebugGroup() { }
|
|
34
35
|
insertDebugMarker(markerLabel) { }
|
|
36
|
+
resolveQuerySet(querySet, destination, options) { }
|
|
35
37
|
}
|
|
@@ -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
|
export class WEBGLExternalTexture extends WEBGLTexture {
|
|
@@ -51,12 +52,12 @@ export class WEBGLExternalTexture extends WEBGLTexture {
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
// eslint-disable-next-line max-statements
|
|
54
|
-
constructor(device: Device
|
|
55
|
-
super(WebGLDevice
|
|
55
|
+
constructor(device: Device , props: TextureProps) {
|
|
56
|
+
super(device as WebGLDevice, {id: uid('texture'), ...props});
|
|
56
57
|
|
|
57
58
|
this.glTarget = getWebGLTextureTarget(props);
|
|
58
59
|
|
|
59
|
-
this.device = WebGLDevice
|
|
60
|
+
this.device = device as WebGLDevice;
|
|
60
61
|
this.gl = this.device.gl;
|
|
61
62
|
this.gl2 = this.device.gl2;
|
|
62
63
|
this.handle = this.props.handle || this.gl.createTexture();
|
|
@@ -90,4 +91,4 @@ export class WEBGLExternalTexture extends WEBGLTexture {
|
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
|
|
93
|
-
*/
|
|
94
|
+
*/
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import type { FramebufferProps, TextureFormat } from '@luma.gl/core';
|
|
2
2
|
import { Framebuffer, Texture } from '@luma.gl/core';
|
|
3
3
|
import { GL } from '@luma.gl/constants';
|
|
4
|
-
import { WebGLDevice } from
|
|
5
|
-
import { WEBGLTexture } from
|
|
6
|
-
import {
|
|
7
|
-
export type
|
|
8
|
-
export type Attachment = WEBGLTexture | WEBGLRenderbuffer | TextureAttachment;
|
|
4
|
+
import { WebGLDevice } from "../webgl-device.js";
|
|
5
|
+
import { WEBGLTexture } from "./webgl-texture.js";
|
|
6
|
+
import { WEBGLTextureView } from "./webgl-texture-view.js";
|
|
7
|
+
export type Attachment = WEBGLTextureView | WEBGLTexture;
|
|
9
8
|
/** luma.gl Framebuffer, WebGL implementation */
|
|
10
9
|
export declare class WEBGLFramebuffer extends Framebuffer {
|
|
11
10
|
device: WebGLDevice;
|
|
12
11
|
gl: WebGL2RenderingContext;
|
|
13
12
|
handle: WebGLFramebuffer;
|
|
14
|
-
get texture():
|
|
13
|
+
get texture(): import("@luma.gl/core").TextureView;
|
|
15
14
|
constructor(device: WebGLDevice, props: FramebufferProps);
|
|
16
15
|
/** destroys any auto created resources etc. */
|
|
17
16
|
destroy(): void;
|
|
18
|
-
/** Check the status */
|
|
19
|
-
protected _checkStatus(): void;
|
|
20
17
|
/** In WebGL we must use renderbuffers for depth/stencil attachments (unless we have extensions) */
|
|
21
18
|
protected createDepthStencilTexture(format: TextureFormat): Texture;
|
|
22
19
|
/**
|
|
@@ -24,8 +21,7 @@ export declare class WEBGLFramebuffer extends Framebuffer {
|
|
|
24
21
|
*/
|
|
25
22
|
protected resizeAttachments(width: number, height: number): this;
|
|
26
23
|
/** Attach one attachment */
|
|
27
|
-
protected _attachOne(attachmentPoint: GL, attachment: Attachment): WEBGLTexture
|
|
28
|
-
protected _attachWEBGLRenderbuffer(attachment: GL, renderbuffer: WEBGLRenderbuffer): void;
|
|
24
|
+
protected _attachOne(attachmentPoint: GL, attachment: Attachment): WEBGLTexture;
|
|
29
25
|
/**
|
|
30
26
|
* @param attachment
|
|
31
27
|
* @param texture
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-framebuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-framebuffer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webgl-framebuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-framebuffer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AACnE,OAAO,EAAC,WAAW,EAAE,OAAO,EAAS,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAC5C,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAC7C,OAAO,EAAC,gBAAgB,EAAC,gCAA6B;AAMtD,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG,YAAY,CAAC;AAEzD,iDAAiD;AACjD,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,MAAM,EAAE,WAAW,CAAC;IACpB,EAAE,EAAE,sBAAsB,CAAC;IAC3B,MAAM,EAAE,gBAAgB,CAAC;IAEzB,IAAI,OAAO,wCAEV;gBAEW,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB;IAkDxD,+CAA+C;IACtC,OAAO,IAAI,IAAI;IAUxB,mGAAmG;cAChF,yBAAyB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO;IAW5E;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IA2BzE,4BAA4B;IAC5B,SAAS,CAAC,UAAU,CAAC,eAAe,EAAE,EAAE,EAAE,UAAU,EAAE,UAAU,GAAG,YAAY;IAqC/E;;;;;OAKG;IACH,SAAS,CAAC,cAAc,CACtB,UAAU,EAAE,EAAE,EACd,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,IAAI;CA2BR"}
|