@luma.gl/webgl 9.1.0-alpha.1 → 9.1.0-alpha.12
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 +18 -11
- package/dist/adapter/converters/texture-formats.d.ts +1 -1
- package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
- package/dist/adapter/converters/texture-formats.js +9 -16
- package/dist/adapter/device-helpers/webgl-device-features.d.ts.map +1 -1
- package/dist/adapter/device-helpers/webgl-device-features.js +1 -3
- package/dist/adapter/helpers/format-utils.d.ts.map +1 -0
- package/dist/adapter/helpers/get-shader-layout.d.ts.map +1 -1
- package/dist/adapter/helpers/get-shader-layout.js +1 -3
- package/dist/adapter/helpers/typed-array-utils.d.ts.map +1 -0
- package/dist/adapter/helpers/webgl-texture-utils.d.ts +89 -22
- package/dist/adapter/helpers/webgl-texture-utils.d.ts.map +1 -1
- package/dist/adapter/helpers/webgl-texture-utils.js +220 -26
- package/dist/adapter/resources/webgl-framebuffer.js +1 -1
- package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.js +17 -4
- package/dist/adapter/resources/webgl-render-pipeline.d.ts +1 -3
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +1 -1
- package/dist/adapter/resources/webgl-shader.js +1 -1
- package/dist/adapter/resources/webgl-texture.d.ts +21 -3
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +49 -30
- package/dist/adapter/resources/webgl-transform-feedback.js +1 -1
- package/dist/adapter/resources/webgl-vertex-array.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-vertex-array.js +3 -0
- 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-device.d.ts +16 -29
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +34 -114
- 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 +23 -17
- 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} +44 -74
- package/dist/context/state-tracker/with-parameters.d.ts.map +1 -1
- package/dist/context/state-tracker/with-parameters.js +5 -4
- package/dist/deprecated/accessor.d.ts.map +1 -0
- package/dist/{classic → deprecated}/accessor.js +36 -1
- package/dist/deprecated/clear.d.ts.map +1 -0
- package/dist/{classic → deprecated}/clear.js +2 -0
- package/dist/dist.dev.js +816 -642
- package/dist/dist.min.js +2 -2
- package/dist/index.cjs +815 -648
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/utils/fill-array.d.ts +4 -4
- package/dist/utils/fill-array.d.ts.map +1 -1
- package/dist/utils/split-uniforms-and-bindings.d.ts +1 -1
- package/dist/utils/split-uniforms-and-bindings.d.ts.map +1 -1
- 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 +5 -5
- package/src/adapter/converters/device-parameters.ts +18 -12
- package/src/adapter/converters/texture-formats.ts +12 -20
- package/src/adapter/device-helpers/webgl-device-features.ts +5 -3
- package/src/adapter/helpers/get-shader-layout.ts +1 -3
- package/src/adapter/helpers/webgl-texture-utils.ts +366 -44
- package/src/adapter/resources/webgl-framebuffer.ts +1 -1
- package/src/adapter/resources/webgl-render-pass.ts +20 -7
- package/src/adapter/resources/webgl-render-pipeline.ts +12 -4
- package/src/adapter/resources/webgl-shader.ts +1 -1
- package/src/adapter/resources/webgl-texture.ts +76 -30
- package/src/adapter/resources/webgl-transform-feedback.ts +1 -1
- package/src/adapter/resources/webgl-vertex-array.ts +3 -0
- package/src/adapter/webgl-adapter.ts +113 -0
- package/src/adapter/webgl-device.ts +45 -139
- package/src/context/debug/spector-types.ts +1154 -0
- package/src/context/debug/spector.ts +38 -29
- package/src/context/polyfills/polyfill-webgl1-extensions.ts +202 -0
- package/src/context/state-tracker/{track-context-state.ts → webgl-state-tracker.ts} +55 -94
- package/src/context/state-tracker/with-parameters.ts +5 -4
- package/src/{classic → deprecated}/accessor.ts +44 -3
- package/src/{classic → deprecated}/clear.ts +3 -1
- package/src/index.ts +6 -8
- package/src/utils/fill-array.ts +4 -4
- package/src/utils/split-uniforms-and-bindings.ts +3 -3
- package/src/utils/uid.ts +16 -0
- package/dist/classic/accessor.d.ts.map +0 -1
- package/dist/classic/clear.d.ts.map +0 -1
- package/dist/classic/copy-and-blit.d.ts +0 -63
- package/dist/classic/copy-and-blit.d.ts.map +0 -1
- package/dist/classic/copy-and-blit.js +0 -193
- package/dist/classic/format-utils.d.ts.map +0 -1
- package/dist/classic/typed-array-utils.d.ts.map +0 -1
- 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/classic/copy-and-blit.ts +0 -318
- /package/dist/{classic → adapter/helpers}/format-utils.d.ts +0 -0
- /package/dist/{classic → adapter/helpers}/format-utils.js +0 -0
- /package/dist/{classic → adapter/helpers}/typed-array-utils.d.ts +0 -0
- /package/dist/{classic → adapter/helpers}/typed-array-utils.js +0 -0
- /package/dist/{classic → deprecated}/accessor.d.ts +0 -0
- /package/dist/{classic → deprecated}/clear.d.ts +0 -0
- /package/src/{classic → adapter/helpers}/format-utils.ts +0 -0
- /package/src/{classic → adapter/helpers}/typed-array-utils.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-parameters.d.ts","sourceRoot":"","sources":["../../../src/adapter/converters/device-parameters.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAgD,MAAM,eAAe,CAAC;AAClG,OAAO,EAAC,MAAM,EAAO,UAAU,EAA+B,MAAM,eAAe,CAAC;AAEpF,OAAO,KAAK,EAGV,UAAU,EACV,YAAY,EAIb,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"device-parameters.d.ts","sourceRoot":"","sources":["../../../src/adapter/converters/device-parameters.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAgD,MAAM,eAAe,CAAC;AAClG,OAAO,EAAC,MAAM,EAAO,UAAU,EAA+B,MAAM,eAAe,CAAC;AAEpF,OAAO,KAAK,EAGV,UAAU,EACV,YAAY,EAIb,MAAM,oBAAoB,CAAC;AAM5B;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,GAAG,OAAO,EACnD,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC,GAC3B,CAAC,CAgBH;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,GAAG,OAAO,EAC1C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,YAAY,EACxB,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC,GAC3B,CAAC,CAeH;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,GAAG,OAAO,EAC9C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC,GAC3B,CAAC,CAeH;AAED,kCAAkC;AAClC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,QAgNzE;AAyBD,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,UAAU,CAW5F;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,eAAe,CAW9F"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import { log } from '@luma.gl/core';
|
|
5
5
|
import { GL } from '@luma.gl/constants';
|
|
6
|
-
import { pushContextState, popContextState } from "../../context/state-tracker/track-context-state.js";
|
|
7
6
|
import { setGLParameters } from "../../context/parameters/unified-parameter-api.js";
|
|
8
7
|
/* eslint-disable no-unused-expressions */ // For expression ? gl.enable() : gl.disable()
|
|
9
8
|
/**
|
|
@@ -21,14 +20,14 @@ export function withDeviceAndGLParameters(device, parameters, glParameters, func
|
|
|
21
20
|
}
|
|
22
21
|
// Wrap in a try-catch to ensure that parameters are restored on exceptions
|
|
23
22
|
const webglDevice = device;
|
|
24
|
-
|
|
23
|
+
webglDevice.pushState();
|
|
25
24
|
try {
|
|
26
25
|
setDeviceParameters(device, parameters);
|
|
27
26
|
setGLParameters(webglDevice.gl, glParameters);
|
|
28
27
|
return func(device);
|
|
29
28
|
}
|
|
30
29
|
finally {
|
|
31
|
-
|
|
30
|
+
webglDevice.popState();
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
/**
|
|
@@ -47,13 +46,13 @@ export function withGLParameters(device, parameters, func) {
|
|
|
47
46
|
}
|
|
48
47
|
// Wrap in a try-catch to ensure that parameters are restored on exceptions
|
|
49
48
|
const webglDevice = device;
|
|
50
|
-
|
|
49
|
+
webglDevice.pushState();
|
|
51
50
|
try {
|
|
52
51
|
setGLParameters(webglDevice.gl, parameters);
|
|
53
52
|
return func(device);
|
|
54
53
|
}
|
|
55
54
|
finally {
|
|
56
|
-
|
|
55
|
+
webglDevice.popState();
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
58
|
/**
|
|
@@ -69,16 +68,15 @@ export function withDeviceParameters(device, parameters, func) {
|
|
|
69
68
|
// Avoid setting state if no parameters provided. Just call and return
|
|
70
69
|
return func(device);
|
|
71
70
|
}
|
|
72
|
-
// Wrap in a try-catch to ensure that parameters are restored on exceptions
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
// Wrap in a try-catch to ensure that parameters are restored on exceptions'
|
|
72
|
+
const webglDevice = device;
|
|
73
|
+
webglDevice.pushState();
|
|
75
74
|
try {
|
|
76
75
|
setDeviceParameters(device, parameters);
|
|
77
76
|
return func(device);
|
|
78
77
|
}
|
|
79
78
|
finally {
|
|
80
|
-
|
|
81
|
-
popContextState(device.gl);
|
|
79
|
+
webglDevice.popState();
|
|
82
80
|
}
|
|
83
81
|
}
|
|
84
82
|
/** Set WebGPU Style Parameters */
|
|
@@ -218,8 +216,17 @@ export function setDeviceParameters(device, parameters) {
|
|
|
218
216
|
// // handled by stencilPassOperation
|
|
219
217
|
// },
|
|
220
218
|
// COLOR STATE
|
|
219
|
+
switch (parameters.blend) {
|
|
220
|
+
case true:
|
|
221
|
+
gl.enable(3042);
|
|
222
|
+
break;
|
|
223
|
+
case false:
|
|
224
|
+
gl.disable(3042);
|
|
225
|
+
break;
|
|
226
|
+
default:
|
|
227
|
+
// leave WebGL blend state unchanged if `parameters.blend` is not set
|
|
228
|
+
}
|
|
221
229
|
if (parameters.blendColorOperation || parameters.blendAlphaOperation) {
|
|
222
|
-
gl.enable(3042);
|
|
223
230
|
const colorEquation = convertBlendOperationToEquation('blendColorOperation', parameters.blendColorOperation || 'add');
|
|
224
231
|
const alphaEquation = convertBlendOperationToEquation('blendAlphaOperation', parameters.blendAlphaOperation || 'add');
|
|
225
232
|
gl.blendEquationSeparate(colorEquation, alphaEquation);
|
|
@@ -65,7 +65,7 @@ export declare function getTextureFormatWebGL(format: TextureFormat): {
|
|
|
65
65
|
export declare function getDepthStencilAttachmentWebGL(format: TextureFormat): GL.DEPTH_ATTACHMENT | GL.STENCIL_ATTACHMENT | GL.DEPTH_STENCIL_ATTACHMENT;
|
|
66
66
|
/** TODO - VERY roundabout legacy way of calculating bytes per pixel */
|
|
67
67
|
export declare function getTextureFormatBytesPerPixel(format: TextureFormat): number;
|
|
68
|
-
export declare function getWebGLPixelDataFormat(
|
|
68
|
+
export declare function getWebGLPixelDataFormat(channels: 'r' | 'rg' | 'rgb' | 'rgba' | 'bgra', integer: boolean, normalized: boolean, format: GL): GLTexelDataFormat;
|
|
69
69
|
export {};
|
|
70
70
|
/**
|
|
71
71
|
* Map WebGL texture formats (GL constants) to WebGPU-style TextureFormat strings
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"texture-formats.d.ts","sourceRoot":"","sources":["../../../src/adapter/converters/texture-formats.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAC,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AA2CpF,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,CAwBrE,CAAC;AAEF,wGAAwG;AASxG,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAEhE;AAED,wFAAwF;AACxF,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,sBAAsB,EAC1B,OAAO,EAAE,aAAa,EACtB,UAAU,EAAE,YAAY,GACvB,OAAO,CAGT;AAID,0CAA0C;AAC1C,KAAK,MAAM,GAAG;IACZ,EAAE,CAAC,EAAE,EAAE,CAAC;IACR,mGAAmG;IACnG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AO,EAAE,OAAO,EAChB,UAAU,EAAE,OAAO,EACnB,MAAM,EAAE,EAAE,GACT,iBAAiB,CAcnB;;AAcD;;;;;;;;;;;;GAYG"}
|
|
@@ -82,14 +82,6 @@ export function checkTextureFeature(gl, feature, extensions) {
|
|
|
82
82
|
*/
|
|
83
83
|
// prettier-ignore
|
|
84
84
|
export const TEXTURE_FORMATS = {
|
|
85
|
-
// Unsized formats that leave the precision up to the driver. TODO - Fix bpp constants
|
|
86
|
-
'rgb8unorm-unsized': { gl: 6407, b: 4, c: 2, bpp: 4,
|
|
87
|
-
dataFormat: 6407, types: [5121, 33635] },
|
|
88
|
-
'rgba8unorm-unsized': { gl: 6408, b: 4, c: 2, bpp: 4,
|
|
89
|
-
dataFormat: 6408, types: [5121, 32819, 32820] },
|
|
90
|
-
// 'r8unorm-unsized': {gl: GL.LUMINANCE, b: 4, c: 2, bpp: 4},
|
|
91
|
-
// 'rgb8unorm-srgb-unsized': {gl: GL.SRGB_EXT, b: 4, c: 2, bpp: 4, gl1Ext: SRGB},
|
|
92
|
-
// 'rgba8unorm-srgb-unsized': {gl: GL.SRGB_ALPHA_EXT, b: 4, c: 2, bpp: 4, gl1Ext: SRGB},
|
|
93
85
|
// 8-bit formats
|
|
94
86
|
'r8unorm': { gl: 33321, b: 1, c: 1, rb: true },
|
|
95
87
|
'r8snorm': { gl: 36756, b: 1, c: 1, render: snorm8_renderable },
|
|
@@ -164,9 +156,6 @@ export const TEXTURE_FORMATS = {
|
|
|
164
156
|
// The depth component of the "depth24plus" and "depth24plus-stencil8" formats may be implemented as either a 24-bit depth value or a "depth32float" value.
|
|
165
157
|
'depth24plus-stencil8': { gl: 35056, b: 4, c: 2, p: 1, attachment: 33306, rb: true, depthTexture: true,
|
|
166
158
|
dataFormat: 34041, types: [34042] },
|
|
167
|
-
// "depth24unorm-stencil8" feature
|
|
168
|
-
'depth24unorm-stencil8': { gl: 35056, b: 4, c: 2, p: 1, attachment: 33306,
|
|
169
|
-
dataFormat: 34041, types: [34042], rb: true },
|
|
170
159
|
// "depth32float-stencil8" feature - TODO below is render buffer only?
|
|
171
160
|
'depth32float-stencil8': { gl: 36013, b: 5, c: 2, p: 1, attachment: 33306,
|
|
172
161
|
dataFormat: 34041, types: [36269], rb: true },
|
|
@@ -370,6 +359,10 @@ export function isTextureFormatSupported(gl, format, extensions) {
|
|
|
370
359
|
if (info.gl === undefined) {
|
|
371
360
|
return false;
|
|
372
361
|
}
|
|
362
|
+
const feature = info.f;
|
|
363
|
+
if (feature) {
|
|
364
|
+
return checkTextureFeature(gl, feature, extensions);
|
|
365
|
+
}
|
|
373
366
|
// Check extensions
|
|
374
367
|
const extension = info.x || info.gl2ext;
|
|
375
368
|
if (extension) {
|
|
@@ -452,13 +445,12 @@ export function getTextureFormatWebGL(format) {
|
|
|
452
445
|
return {
|
|
453
446
|
internalFormat: webglFormat,
|
|
454
447
|
format: formatData?.dataFormat ||
|
|
455
|
-
getWebGLPixelDataFormat(decoded.
|
|
448
|
+
getWebGLPixelDataFormat(decoded.channels, decoded.integer, decoded.normalized, webglFormat),
|
|
456
449
|
// depth formats don't have a type
|
|
457
450
|
type: decoded.dataType
|
|
458
451
|
? getGLFromVertexType(decoded.dataType)
|
|
459
452
|
: formatData?.types?.[0] || 5121,
|
|
460
|
-
|
|
461
|
-
compressed: decoded.compressed
|
|
453
|
+
compressed: decoded.compressed || false
|
|
462
454
|
};
|
|
463
455
|
}
|
|
464
456
|
export function getDepthStencilAttachmentWebGL(format) {
|
|
@@ -478,17 +470,18 @@ export function getTextureFormatBytesPerPixel(format) {
|
|
|
478
470
|
return channels * channelSize;
|
|
479
471
|
}
|
|
480
472
|
// DATA TYPE HELPERS
|
|
481
|
-
export function getWebGLPixelDataFormat(
|
|
473
|
+
export function getWebGLPixelDataFormat(channels, integer, normalized, format) {
|
|
482
474
|
// WebGL1 formats use same internalFormat
|
|
483
475
|
if (format === 6408 || format === 6407) {
|
|
484
476
|
return format;
|
|
485
477
|
}
|
|
486
478
|
// prettier-ignore
|
|
487
|
-
switch (
|
|
479
|
+
switch (channels) {
|
|
488
480
|
case 'r': return integer && !normalized ? 36244 : 6403;
|
|
489
481
|
case 'rg': return integer && !normalized ? 33320 : 33319;
|
|
490
482
|
case 'rgb': return integer && !normalized ? 36248 : 6407;
|
|
491
483
|
case 'rgba': return integer && !normalized ? 36249 : 6408;
|
|
484
|
+
case 'bgra': throw new Error('bgra pixels not supported by WebGL');
|
|
492
485
|
default: return 6408;
|
|
493
486
|
}
|
|
494
487
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-device-features.d.ts","sourceRoot":"","sources":["../../../src/adapter/device-helpers/webgl-device-features.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"webgl-device-features.d.ts","sourceRoot":"","sources":["../../../src/adapter/device-helpers/webgl-device-features.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAgChD;;;;;GAKG;AACH,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,SAAS,CAAC,EAAE,EAAE,sBAAsB,CAAC;IACrC,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC;IACnC,SAAS,CAAC,cAAc,qBAA4B;gBAGlD,EAAE,EAAE,sBAAsB,EAC1B,UAAU,EAAE,YAAY,EACxB,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAU1D,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,aAAa,CAAC;IAU5C,GAAG,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAuB7C,kBAAkB;IAWlB,WAAW,IACoE,aAAa,EAAE;IAG9F,iCAAiC;IACjC,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;CAU3D"}
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
// Provides a function that enables simple checking of which WebGL features are
|
|
6
6
|
import { DeviceFeatures } from '@luma.gl/core';
|
|
7
7
|
import { getWebGLExtension } from "../../context/helpers/webgl-extensions.js";
|
|
8
|
-
import { isTextureFeature, checkTextureFeature } from "../converters/texture-formats.js";
|
|
9
|
-
import { TEXTURE_FEATURES } from "../converters/texture-formats.js";
|
|
8
|
+
import { isTextureFeature, checkTextureFeature, TEXTURE_FEATURES } from "../converters/texture-formats.js";
|
|
10
9
|
/**
|
|
11
10
|
* Defines luma.gl "feature" names and semantics
|
|
12
11
|
* when value is 'string' it is the name of the extension that enables this feature
|
|
@@ -17,7 +16,6 @@ const WEBGL_FEATURES = {
|
|
|
17
16
|
// 'timestamp-query' // GPUQueryType "timestamp-query"
|
|
18
17
|
// "indirect-first-instance"
|
|
19
18
|
// Textures are handled by getTextureFeatures()
|
|
20
|
-
// 'depth24unorm-stencil8' // GPUTextureFormat 'depth24unorm-stencil8'
|
|
21
19
|
// 'depth32float-stencil8' // GPUTextureFormat 'depth32float-stencil8'
|
|
22
20
|
// optional WebGL features
|
|
23
21
|
'timer-query-webgl': 'EXT_disjoint_timer_query_webgl2',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-utils.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/format-utils.ts"],"names":[],"mappings":"AAOA,wBAAgB,oBAAoB,CAAC,MAAM,KAAA,qBAmB1C;AAGD,wBAAgB,aAAa,CAAC,IAAI,KAAA,iBAcjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-shader-layout.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/get-shader-layout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,YAAY,EAKb,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"get-shader-layout.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/get-shader-layout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,YAAY,EAKb,MAAM,eAAe,CAAC;AAKvB;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,sBAAsB,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,CA2D/F"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import { GL } from '@luma.gl/constants';
|
|
5
|
-
import { Accessor } from "../../classic/accessor.js"; // TODO - should NOT depend on classic API
|
|
6
5
|
import { decodeGLUniformType, decodeGLAttributeType, isSamplerUniform } from "./decode-webgl-types.js";
|
|
7
6
|
/**
|
|
8
7
|
* Extract metadata describing binding information for a program's shaders
|
|
@@ -114,8 +113,7 @@ function readVaryings(gl, program) {
|
|
|
114
113
|
}
|
|
115
114
|
const { name, type: compositeType, size } = activeInfo;
|
|
116
115
|
const { glType, components } = decodeGLUniformType(compositeType);
|
|
117
|
-
const
|
|
118
|
-
const varying = { location, name, accessor }; // Base values
|
|
116
|
+
const varying = { location, name, type: glType, size: size * components }; // Base values
|
|
119
117
|
varyings.push(varying);
|
|
120
118
|
}
|
|
121
119
|
varyings.sort((a, b) => a.location - b.location);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed-array-utils.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/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,12 +1,18 @@
|
|
|
1
1
|
import type { ExternalImage } from '@luma.gl/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Buffer, Texture, Framebuffer, FramebufferProps } from '@luma.gl/core';
|
|
3
|
+
import { GL, GLTextureTarget, GLTextureCubeMapTarget, GLTexelDataFormat, GLPixelType } from '@luma.gl/constants';
|
|
3
4
|
import { TypedArray } from '@math.gl/types';
|
|
5
|
+
import { WEBGLFramebuffer } from "../resources/webgl-framebuffer.js";
|
|
6
|
+
import { WEBGLBuffer } from "../resources/webgl-buffer.js";
|
|
7
|
+
/**
|
|
8
|
+
* Options for setting data into a texture
|
|
9
|
+
*/
|
|
4
10
|
export type WebGLSetTextureOptions = {
|
|
5
11
|
dimension: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';
|
|
6
12
|
height: number;
|
|
7
13
|
width: number;
|
|
8
|
-
depth
|
|
9
|
-
|
|
14
|
+
depth: number;
|
|
15
|
+
mipLevel?: number;
|
|
10
16
|
glTarget: GLTextureTarget;
|
|
11
17
|
glInternalFormat: GL;
|
|
12
18
|
glFormat: GLTexelDataFormat;
|
|
@@ -16,19 +22,8 @@ export type WebGLSetTextureOptions = {
|
|
|
16
22
|
byteLength?: number;
|
|
17
23
|
};
|
|
18
24
|
/**
|
|
19
|
-
*
|
|
20
|
-
* null - create empty texture of specified format
|
|
21
|
-
* Typed array - init from image data in typed array
|
|
22
|
-
* Buffer|WebGLBuffer - (WEBGL2) init from image data in WebGLBuffer
|
|
23
|
-
* HTMLImageElement|Image - Inits with content of image. Auto width/height
|
|
24
|
-
* HTMLCanvasElement - Inits with contents of canvas. Auto width/height
|
|
25
|
-
* HTMLVideoElement - Creates video texture. Auto width/height
|
|
25
|
+
* Options for copying an image or data into a texture
|
|
26
26
|
*
|
|
27
|
-
* @param x - xOffset from where texture to be updated
|
|
28
|
-
* @param y - yOffset from where texture to be updated
|
|
29
|
-
* @param width - width of the sub image to be updated
|
|
30
|
-
* @param height - height of the sub image to be updated
|
|
31
|
-
* @param level - mip level to be updated
|
|
32
27
|
* @param {GLenum} format - internal format of image data.
|
|
33
28
|
* @param {GLenum} type
|
|
34
29
|
* - format of array (autodetect from type) or
|
|
@@ -39,12 +34,19 @@ export type WebGLSetTextureOptions = {
|
|
|
39
34
|
*/
|
|
40
35
|
export type WebGLCopyTextureOptions = {
|
|
41
36
|
dimension: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';
|
|
42
|
-
level
|
|
43
|
-
|
|
37
|
+
/** mip level to be updated */
|
|
38
|
+
mipLevel?: number;
|
|
39
|
+
/** width of the sub image to be updated */
|
|
44
40
|
width: number;
|
|
41
|
+
/** height of the sub image to be updated */
|
|
42
|
+
height: number;
|
|
43
|
+
/** depth of texture to be updated */
|
|
45
44
|
depth?: number;
|
|
45
|
+
/** xOffset from where texture to be updated */
|
|
46
46
|
x?: number;
|
|
47
|
+
/** yOffset from where texture to be updated */
|
|
47
48
|
y?: number;
|
|
49
|
+
/** yOffset from where texture to be updated */
|
|
48
50
|
z?: number;
|
|
49
51
|
glTarget: GLTextureTarget;
|
|
50
52
|
glInternalFormat: GL;
|
|
@@ -69,7 +71,7 @@ export declare function initializeTextureStorage(gl: WebGL2RenderingContext, lev
|
|
|
69
71
|
/**
|
|
70
72
|
* Copy a region of compressed data from a GPU memory buffer into this texture.
|
|
71
73
|
*/
|
|
72
|
-
export declare function
|
|
74
|
+
export declare function copyExternalImageToMipLevel(gl: WebGL2RenderingContext, handle: WebGLTexture, image: ExternalImage, options: WebGLCopyTextureOptions): void;
|
|
73
75
|
/**
|
|
74
76
|
* Copy a region of data from a CPU memory buffer into this texture.
|
|
75
77
|
*/
|
|
@@ -80,6 +82,12 @@ export declare function copyCPUDataToMipLevel(gl: WebGL2RenderingContext, typedA
|
|
|
80
82
|
export declare function copyGPUBufferToMipLevel(gl: WebGL2RenderingContext, webglBuffer: WebGLBuffer, byteLength: number, options: WebGLCopyTextureOptions): void;
|
|
81
83
|
/** Convert a WebGPU style texture constant to a WebGL style texture constant */
|
|
82
84
|
export declare function getWebGLTextureTarget(dimension: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d'): GLTextureTarget;
|
|
85
|
+
/**
|
|
86
|
+
* In WebGL, cube maps specify faces by overriding target instead of using the depth parameter.
|
|
87
|
+
* @note We still bind the texture using GL.TEXTURE_CUBE_MAP, but we need to use the face-specific target when setting mip levels.
|
|
88
|
+
* @returns glTarget unchanged, if dimension !== 'cube'.
|
|
89
|
+
*/
|
|
90
|
+
export declare function getWebGLCubeFaceTarget(glTarget: GLTextureTarget, dimension: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d', level: number): GLTextureTarget | GLTextureCubeMapTarget;
|
|
83
91
|
/**
|
|
84
92
|
* Clear a texture mip level.
|
|
85
93
|
* Wrapper for the messy WebGL texture API
|
|
@@ -87,7 +95,7 @@ export declare function getWebGLTextureTarget(dimension: '1d' | '2d' | '2d-array
|
|
|
87
95
|
export function clearMipLevel(gl: WebGL2RenderingContext, options: WebGLSetTextureOptions): void {
|
|
88
96
|
const {dimension, width, height, depth = 0, level = 0} = options;
|
|
89
97
|
const {glInternalFormat, glFormat, glType, compressed} = options;
|
|
90
|
-
const glTarget =
|
|
98
|
+
const glTarget = getWebGLCubeFaceTarget(options.glTarget, dimension, depth);
|
|
91
99
|
|
|
92
100
|
switch (dimension) {
|
|
93
101
|
case '2d-array':
|
|
@@ -130,7 +138,7 @@ export function setMipLevelFromExternalImage(
|
|
|
130
138
|
const {dimension, width, height, depth = 0, level = 0} = options;
|
|
131
139
|
const {glInternalFormat, glType} = options;
|
|
132
140
|
|
|
133
|
-
const glTarget =
|
|
141
|
+
const glTarget = getWebGLCubeFaceTarget(options.glTarget, dimension, depth);
|
|
134
142
|
|
|
135
143
|
// TODO - we can't change texture width (due to WebGPU limitations) -
|
|
136
144
|
// and the width/heigh of an external image is implicit, so why do we need to extract it?
|
|
@@ -181,7 +189,7 @@ export function setMipLevelFromTypedArray(
|
|
|
181
189
|
const {dimension, width, height, depth = 0, level = 0, offset = 0} = options;
|
|
182
190
|
const {glInternalFormat, glFormat, glType, compressed} = options;
|
|
183
191
|
|
|
184
|
-
const glTarget =
|
|
192
|
+
const glTarget = getWebGLCubeFaceTarget(options.glTarget, dimension, depth);
|
|
185
193
|
|
|
186
194
|
withGLParameters(gl, parameters, () => {
|
|
187
195
|
switch (dimension) {
|
|
@@ -260,7 +268,7 @@ export function setMipLevelFromGPUBuffer(
|
|
|
260
268
|
): void {
|
|
261
269
|
const {dimension, width, height, depth = 0, level = 0, byteOffset = 0} = options;
|
|
262
270
|
const {glInternalFormat, glFormat, glType, compressed} = options;
|
|
263
|
-
const glTarget =
|
|
271
|
+
const glTarget = getWebGLCubeFaceTarget(options.glTarget, dimension, depth);
|
|
264
272
|
|
|
265
273
|
const webglBuffer = buffer as WEBGLBuffer;
|
|
266
274
|
const imageSize = buffer.byteLength;
|
|
@@ -297,4 +305,63 @@ export function setMipLevelFromGPUBuffer(
|
|
|
297
305
|
gl.bindBuffer(GL.PIXEL_UNPACK_BUFFER, null);
|
|
298
306
|
}
|
|
299
307
|
*/
|
|
308
|
+
/**
|
|
309
|
+
* Copies data from a type or a Texture object into ArrayBuffer object.
|
|
310
|
+
* App can provide targetPixelArray or have it auto allocated by this method
|
|
311
|
+
* newly allocated by this method unless provided by app.
|
|
312
|
+
* @deprecated Use CommandEncoder.copyTextureToBuffer and Buffer.read
|
|
313
|
+
* @note Slow requires roundtrip to GPU
|
|
314
|
+
*
|
|
315
|
+
* @param source
|
|
316
|
+
* @param options
|
|
317
|
+
* @returns pixel array,
|
|
318
|
+
*/
|
|
319
|
+
export declare function readPixelsToArray(source: Framebuffer | Texture, options?: {
|
|
320
|
+
sourceX?: number;
|
|
321
|
+
sourceY?: number;
|
|
322
|
+
sourceFormat?: number;
|
|
323
|
+
sourceAttachment?: number;
|
|
324
|
+
target?: Uint8Array | Uint16Array | Float32Array;
|
|
325
|
+
sourceWidth?: number;
|
|
326
|
+
sourceHeight?: number;
|
|
327
|
+
sourceDepth?: number;
|
|
328
|
+
sourceType?: number;
|
|
329
|
+
}): Uint8Array | Uint16Array | Float32Array;
|
|
330
|
+
/**
|
|
331
|
+
* Copies data from a Framebuffer or a Texture object into a Buffer object.
|
|
332
|
+
* NOTE: doesn't wait for copy to be complete, it programs GPU to perform a DMA transffer.
|
|
333
|
+
* @deprecated Use CommandEncoder
|
|
334
|
+
* @param source
|
|
335
|
+
* @param options
|
|
336
|
+
*/
|
|
337
|
+
export declare function readPixelsToBuffer(source: Framebuffer | Texture, options?: {
|
|
338
|
+
sourceX?: number;
|
|
339
|
+
sourceY?: number;
|
|
340
|
+
sourceFormat?: number;
|
|
341
|
+
target?: Buffer;
|
|
342
|
+
targetByteOffset?: number;
|
|
343
|
+
sourceWidth?: number;
|
|
344
|
+
sourceHeight?: number;
|
|
345
|
+
sourceType?: number;
|
|
346
|
+
}): WEBGLBuffer;
|
|
347
|
+
/**
|
|
348
|
+
* Copy a rectangle from a Framebuffer or Texture object into a texture (at an offset)
|
|
349
|
+
* @deprecated Use CommandEncoder
|
|
350
|
+
*/
|
|
351
|
+
export declare function copyToTexture(source: Framebuffer | Texture, target: Texture | GL, options?: {
|
|
352
|
+
sourceX?: number;
|
|
353
|
+
sourceY?: number;
|
|
354
|
+
targetX?: number;
|
|
355
|
+
targetY?: number;
|
|
356
|
+
targetZ?: number;
|
|
357
|
+
targetMipmaplevel?: number;
|
|
358
|
+
targetInternalFormat?: number;
|
|
359
|
+
width?: number;
|
|
360
|
+
height?: number;
|
|
361
|
+
}): Texture;
|
|
362
|
+
/**
|
|
363
|
+
* Wraps a given texture into a framebuffer object, that can be further used
|
|
364
|
+
* to read data from the texture object.
|
|
365
|
+
*/
|
|
366
|
+
export declare function toFramebuffer(texture: Texture, props?: FramebufferProps): WEBGLFramebuffer;
|
|
300
367
|
//# sourceMappingURL=webgl-texture-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-texture-utils.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/webgl-texture-utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"webgl-texture-utils.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/webgl-texture-utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE7E,OAAO,EACL,EAAE,EACF,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,0CAAuC;AAGhE,OAAO,EAAC,WAAW,EAAC,qCAA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