@luma.gl/webgl 9.0.0-beta.1 → 9.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter/converters/device-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/device-parameters.js +295 -156
- package/dist/adapter/converters/sampler-parameters.d.ts +0 -4
- package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/sampler-parameters.js +73 -67
- package/dist/adapter/converters/shader-formats.d.ts.map +1 -1
- package/dist/adapter/converters/shader-formats.js +53 -46
- package/dist/adapter/converters/texture-formats.d.ts +17 -21
- package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
- package/dist/adapter/converters/texture-formats.js +481 -879
- package/dist/adapter/converters/vertex-formats.d.ts.map +1 -1
- package/dist/adapter/converters/vertex-formats.js +53 -61
- package/dist/adapter/device-helpers/webgl-device-features.d.ts +20 -0
- package/dist/adapter/device-helpers/webgl-device-features.d.ts.map +1 -0
- package/dist/adapter/device-helpers/webgl-device-features.js +98 -0
- package/dist/adapter/device-helpers/webgl-device-info.d.ts +5 -0
- package/dist/adapter/device-helpers/webgl-device-info.d.ts.map +1 -0
- package/dist/adapter/device-helpers/webgl-device-info.js +90 -0
- package/dist/adapter/device-helpers/webgl-device-limits.d.ts +35 -0
- package/dist/adapter/device-helpers/webgl-device-limits.d.ts.map +1 -0
- package/dist/adapter/device-helpers/webgl-device-limits.js +47 -0
- package/dist/adapter/helpers/decode-webgl-types.d.ts.map +1 -1
- package/dist/adapter/helpers/decode-webgl-types.js +88 -76
- package/dist/adapter/helpers/get-shader-layout.d.ts +1 -1
- package/dist/adapter/helpers/get-shader-layout.d.ts.map +1 -1
- package/dist/adapter/helpers/get-shader-layout.js +261 -225
- package/dist/adapter/helpers/parse-shader-compiler-log.d.ts.map +1 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.js +47 -37
- package/dist/adapter/helpers/set-uniform.d.ts +1 -1
- package/dist/adapter/helpers/set-uniform.d.ts.map +1 -1
- package/dist/adapter/helpers/set-uniform.js +68 -82
- package/dist/adapter/helpers/webgl-topology-utils.d.ts.map +1 -1
- package/dist/adapter/helpers/webgl-topology-utils.js +78 -93
- package/dist/adapter/objects/constants-to-keys.d.ts +1 -1
- package/dist/adapter/objects/constants-to-keys.d.ts.map +1 -1
- package/dist/adapter/objects/constants-to-keys.js +19 -12
- package/dist/adapter/objects/webgl-renderbuffer.d.ts +2 -2
- package/dist/adapter/objects/webgl-renderbuffer.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-renderbuffer.js +86 -77
- package/dist/adapter/objects/webgl-resource.d.ts +3 -25
- package/dist/adapter/objects/webgl-resource.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-resource.js +102 -147
- package/dist/adapter/resources/webgl-buffer.d.ts +3 -4
- package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-buffer.js +159 -117
- package/dist/adapter/resources/webgl-command-buffer.d.ts +1 -1
- package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.js +266 -168
- package/dist/adapter/resources/webgl-command-encoder.d.ts +8 -3
- package/dist/adapter/resources/webgl-command-encoder.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-encoder.js +33 -39
- package/dist/adapter/resources/webgl-external-texture.js +93 -1
- package/dist/adapter/resources/webgl-framebuffer.d.ts +8 -12
- package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +174 -139
- package/dist/adapter/resources/webgl-query-set.d.ts +44 -0
- package/dist/adapter/resources/webgl-query-set.d.ts.map +1 -0
- package/dist/adapter/resources/webgl-query-set.js +136 -0
- package/dist/adapter/resources/webgl-render-pass.d.ts +3 -1
- package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.js +124 -90
- package/dist/adapter/resources/webgl-render-pipeline.d.ts +15 -6
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +362 -221
- package/dist/adapter/resources/webgl-sampler.d.ts +1 -3
- package/dist/adapter/resources/webgl-sampler.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-sampler.js +43 -33
- package/dist/adapter/resources/webgl-shader.d.ts +12 -2
- package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-shader.js +114 -47
- package/dist/adapter/resources/webgl-texture-view.d.ts +14 -0
- package/dist/adapter/resources/webgl-texture-view.d.ts.map +1 -0
- package/dist/adapter/resources/webgl-texture-view.js +18 -0
- package/dist/adapter/resources/webgl-texture.d.ts +8 -10
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +616 -694
- package/dist/adapter/resources/webgl-transform-feedback.d.ts +2 -2
- package/dist/adapter/resources/webgl-transform-feedback.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-transform-feedback.js +141 -143
- package/dist/adapter/resources/webgl-vertex-array.d.ts +3 -3
- package/dist/adapter/resources/webgl-vertex-array.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-vertex-array.js +229 -157
- package/dist/adapter/webgl-canvas-context.d.ts +2 -2
- package/dist/adapter/webgl-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgl-canvas-context.js +58 -36
- package/dist/adapter/webgl-device.d.ts +50 -44
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +427 -352
- package/dist/classic/accessor.d.ts.map +1 -1
- package/dist/classic/accessor.js +132 -101
- package/dist/classic/clear.d.ts +2 -2
- package/dist/classic/clear.d.ts.map +1 -1
- package/dist/classic/clear.js +73 -72
- package/dist/classic/copy-and-blit.d.ts +1 -1
- package/dist/classic/copy-and-blit.d.ts.map +1 -1
- package/dist/classic/copy-and-blit.js +174 -175
- package/dist/classic/format-utils.d.ts +2 -2
- package/dist/classic/format-utils.d.ts.map +1 -1
- package/dist/classic/format-utils.js +39 -32
- package/dist/classic/typed-array-utils.d.ts.map +1 -1
- package/dist/classic/typed-array-utils.js +96 -81
- package/dist/context/debug/spector.d.ts.map +1 -1
- package/dist/context/debug/spector.js +55 -50
- package/dist/context/debug/webgl-developer-tools.d.ts +1 -2
- package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -1
- package/dist/context/debug/webgl-developer-tools.js +104 -77
- package/dist/context/{context → helpers}/create-browser-context.d.ts +1 -6
- package/dist/context/helpers/create-browser-context.d.ts.map +1 -0
- package/dist/context/helpers/create-browser-context.js +67 -0
- package/dist/context/{polyfill/context-data.d.ts → helpers/webgl-context-data.d.ts} +2 -2
- package/dist/context/helpers/webgl-context-data.d.ts.map +1 -0
- package/dist/context/helpers/webgl-context-data.js +21 -0
- package/dist/context/helpers/webgl-extensions.d.ts +4 -0
- package/dist/context/helpers/webgl-extensions.d.ts.map +1 -0
- package/dist/context/helpers/webgl-extensions.js +10 -0
- package/dist/context/parameters/unified-parameter-api.d.ts +3 -4
- package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
- package/dist/context/parameters/unified-parameter-api.js +92 -47
- package/dist/context/parameters/webgl-parameter-tables.d.ts +109 -99
- package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.js +463 -404
- package/dist/context/state-tracker/deep-array-equal.d.ts.map +1 -1
- package/dist/context/state-tracker/deep-array-equal.js +19 -14
- package/dist/context/state-tracker/track-context-state.d.ts +4 -4
- package/dist/context/state-tracker/track-context-state.d.ts.map +1 -1
- package/dist/context/state-tracker/track-context-state.js +188 -123
- package/dist/context/state-tracker/with-parameters.d.ts +2 -3
- package/dist/context/state-tracker/with-parameters.d.ts.map +1 -1
- package/dist/context/state-tracker/with-parameters.js +42 -28
- package/dist/dist.dev.js +4465 -7235
- package/dist/dist.min.js +10 -0
- package/dist/index.cjs +2146 -3116
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +25 -31
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -1
- package/dist.min.js +9 -42
- package/package.json +10 -15
- package/src/adapter/converters/device-parameters.ts +114 -28
- package/src/adapter/converters/sampler-parameters.ts +12 -20
- package/src/adapter/converters/shader-formats.ts +47 -22
- package/src/adapter/converters/texture-formats.ts +183 -227
- package/src/adapter/converters/vertex-formats.ts +3 -3
- package/src/adapter/device-helpers/webgl-device-features.ts +121 -0
- package/src/adapter/device-helpers/{get-device-info.ts → webgl-device-info.ts} +30 -22
- package/src/adapter/device-helpers/webgl-device-limits.ts +53 -0
- package/src/adapter/helpers/decode-webgl-types.ts +13 -7
- package/src/adapter/helpers/get-shader-layout.ts +21 -31
- package/src/adapter/helpers/parse-shader-compiler-log.ts +10 -6
- package/src/adapter/helpers/set-uniform.ts +3 -4
- package/src/adapter/helpers/webgl-topology-utils.ts +10 -3
- package/src/adapter/objects/constants-to-keys.ts +3 -2
- package/src/adapter/objects/webgl-renderbuffer.ts +38 -16
- package/src/adapter/objects/webgl-resource.ts +8 -141
- package/src/adapter/resources/webgl-buffer.ts +10 -14
- package/src/adapter/resources/webgl-command-buffer.ts +24 -34
- package/src/adapter/resources/webgl-command-encoder.ts +14 -11
- package/src/adapter/resources/webgl-external-texture.ts +7 -7
- package/src/adapter/resources/webgl-framebuffer.ts +65 -58
- package/src/adapter/resources/webgl-query-set.ts +171 -0
- package/src/adapter/resources/webgl-render-pass.ts +27 -18
- package/src/adapter/resources/webgl-render-pipeline.ts +148 -73
- package/src/adapter/resources/webgl-sampler.ts +7 -10
- package/src/adapter/resources/webgl-shader.ts +65 -11
- package/src/adapter/resources/webgl-texture-view.ts +28 -0
- package/src/adapter/resources/webgl-texture.ts +43 -106
- package/src/adapter/resources/webgl-transform-feedback.ts +16 -22
- package/src/adapter/resources/webgl-vertex-array.ts +20 -21
- package/src/adapter/webgl-canvas-context.ts +7 -11
- package/src/adapter/webgl-device.ts +142 -162
- package/src/classic/accessor.ts +5 -4
- package/src/classic/clear.ts +25 -20
- package/src/classic/copy-and-blit.ts +12 -6
- package/src/classic/format-utils.ts +2 -1
- package/src/classic/typed-array-utils.ts +3 -7
- package/src/context/debug/spector.ts +9 -6
- package/src/context/debug/webgl-developer-tools.ts +31 -20
- package/src/context/{context → helpers}/create-browser-context.ts +9 -33
- package/src/context/{polyfill/context-data.ts → helpers/webgl-context-data.ts} +3 -2
- package/src/context/helpers/webgl-extensions.ts +17 -0
- package/src/context/parameters/unified-parameter-api.ts +6 -17
- package/src/context/parameters/webgl-parameter-tables.ts +118 -90
- package/src/context/state-tracker/deep-array-equal.ts +2 -1
- package/src/context/state-tracker/track-context-state.ts +29 -23
- package/src/context/state-tracker/with-parameters.ts +8 -8
- package/src/index.ts +16 -56
- package/src/types.ts +2 -1
- package/dist/adapter/converters/device-parameters.js.map +0 -1
- package/dist/adapter/converters/sampler-parameters.js.map +0 -1
- package/dist/adapter/converters/shader-formats.js.map +0 -1
- package/dist/adapter/converters/texture-formats.js.map +0 -1
- package/dist/adapter/converters/vertex-formats.js.map +0 -1
- package/dist/adapter/device-helpers/device-features.d.ts +0 -9
- package/dist/adapter/device-helpers/device-features.d.ts.map +0 -1
- package/dist/adapter/device-helpers/device-features.js +0 -96
- package/dist/adapter/device-helpers/device-features.js.map +0 -1
- package/dist/adapter/device-helpers/device-limits.d.ts +0 -52
- package/dist/adapter/device-helpers/device-limits.d.ts.map +0 -1
- package/dist/adapter/device-helpers/device-limits.js +0 -87
- package/dist/adapter/device-helpers/device-limits.js.map +0 -1
- 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 -71
- package/dist/adapter/device-helpers/get-device-info.js.map +0 -1
- package/dist/adapter/device-helpers/is-old-ie.d.ts +0 -2
- package/dist/adapter/device-helpers/is-old-ie.d.ts.map +0 -1
- package/dist/adapter/device-helpers/is-old-ie.js +0 -9
- package/dist/adapter/device-helpers/is-old-ie.js.map +0 -1
- package/dist/adapter/helpers/decode-webgl-types.js.map +0 -1
- package/dist/adapter/helpers/get-shader-layout.js.map +0 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.js.map +0 -1
- package/dist/adapter/helpers/set-uniform.js.map +0 -1
- package/dist/adapter/helpers/webgl-topology-utils.js.map +0 -1
- package/dist/adapter/objects/constants-to-keys.js.map +0 -1
- package/dist/adapter/objects/webgl-renderbuffer.js.map +0 -1
- package/dist/adapter/objects/webgl-resource.js.map +0 -1
- package/dist/adapter/resources/webgl-buffer.js.map +0 -1
- package/dist/adapter/resources/webgl-command-buffer.js.map +0 -1
- package/dist/adapter/resources/webgl-command-encoder.js.map +0 -1
- package/dist/adapter/resources/webgl-external-texture.js.map +0 -1
- package/dist/adapter/resources/webgl-framebuffer.js.map +0 -1
- package/dist/adapter/resources/webgl-render-pass.js.map +0 -1
- package/dist/adapter/resources/webgl-render-pipeline.js.map +0 -1
- package/dist/adapter/resources/webgl-sampler.js.map +0 -1
- package/dist/adapter/resources/webgl-shader.js.map +0 -1
- package/dist/adapter/resources/webgl-texture.js.map +0 -1
- package/dist/adapter/resources/webgl-transform-feedback.js.map +0 -1
- package/dist/adapter/resources/webgl-vertex-array.js.map +0 -1
- package/dist/adapter/webgl-canvas-context.js.map +0 -1
- package/dist/adapter/webgl-device.js.map +0 -1
- package/dist/classic/accessor.js.map +0 -1
- package/dist/classic/clear.js.map +0 -1
- package/dist/classic/copy-and-blit.js.map +0 -1
- package/dist/classic/format-utils.js.map +0 -1
- package/dist/classic/typed-array-utils.js.map +0 -1
- package/dist/context/context/create-browser-context.d.ts.map +0 -1
- package/dist/context/context/create-browser-context.js +0 -53
- package/dist/context/context/create-browser-context.js.map +0 -1
- package/dist/context/context/create-headless-context.d.ts +0 -9
- package/dist/context/context/create-headless-context.d.ts.map +0 -1
- package/dist/context/context/create-headless-context.js +0 -42
- package/dist/context/context/create-headless-context.js.map +0 -1
- package/dist/context/context/webgl-checks.d.ts +0 -13
- package/dist/context/context/webgl-checks.d.ts.map +0 -1
- package/dist/context/context/webgl-checks.js +0 -31
- package/dist/context/context/webgl-checks.js.map +0 -1
- package/dist/context/debug/spector.js.map +0 -1
- package/dist/context/debug/webgl-developer-tools.js.map +0 -1
- package/dist/context/parameters/unified-parameter-api.js.map +0 -1
- package/dist/context/parameters/webgl-parameter-tables.js.map +0 -1
- package/dist/context/polyfill/context-data.d.ts.map +0 -1
- package/dist/context/polyfill/context-data.js +0 -12
- package/dist/context/polyfill/context-data.js.map +0 -1
- package/dist/context/polyfill/get-parameter-polyfill.d.ts +0 -2
- package/dist/context/polyfill/get-parameter-polyfill.d.ts.map +0 -1
- package/dist/context/polyfill/get-parameter-polyfill.js +0 -85
- package/dist/context/polyfill/get-parameter-polyfill.js.map +0 -1
- package/dist/context/polyfill/polyfill-context.d.ts +0 -5
- package/dist/context/polyfill/polyfill-context.d.ts.map +0 -1
- package/dist/context/polyfill/polyfill-context.js +0 -87
- package/dist/context/polyfill/polyfill-context.js.map +0 -1
- package/dist/context/polyfill/polyfill-table.d.ts +0 -48
- package/dist/context/polyfill/polyfill-table.d.ts.map +0 -1
- package/dist/context/polyfill/polyfill-table.js +0 -137
- package/dist/context/polyfill/polyfill-table.js.map +0 -1
- package/dist/context/polyfill/polyfill-vertex-array-object.d.ts +0 -2
- package/dist/context/polyfill/polyfill-vertex-array-object.d.ts.map +0 -1
- package/dist/context/polyfill/polyfill-vertex-array-object.js +0 -265
- package/dist/context/polyfill/polyfill-vertex-array-object.js.map +0 -1
- package/dist/context/state-tracker/deep-array-equal.js.map +0 -1
- package/dist/context/state-tracker/track-context-state.js.map +0 -1
- package/dist/context/state-tracker/with-parameters.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/src/adapter/device-helpers/device-features.ts +0 -161
- package/src/adapter/device-helpers/device-limits.ts +0 -155
- package/src/adapter/device-helpers/is-old-ie.ts +0 -14
- package/src/context/context/create-headless-context.ts +0 -51
- package/src/context/context/webgl-checks.ts +0 -51
- package/src/context/polyfill/get-parameter-polyfill.ts +0 -122
- package/src/context/polyfill/polyfill-context.ts +0 -104
- package/src/context/polyfill/polyfill-table.ts +0 -167
- package/src/context/polyfill/polyfill-vertex-array-object.ts +0 -365
|
@@ -1,250 +1,286 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { GL } from '@luma.gl/constants';
|
|
5
|
+
import { Accessor } from "../../classic/accessor.js"; // TODO - should NOT depend on classic API
|
|
3
6
|
import { decodeGLUniformType, decodeGLAttributeType, isSamplerUniform } from "./decode-webgl-types.js";
|
|
7
|
+
/**
|
|
8
|
+
* Extract metadata describing binding information for a program's shaders
|
|
9
|
+
* Note: `linkProgram()` needs to have been called
|
|
10
|
+
* (although linking does not need to have been successful).
|
|
11
|
+
*/
|
|
4
12
|
export function getShaderLayout(gl, program) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const uniforms = readUniformBindings(gl, program);
|
|
29
|
-
let textureUnit = 0;
|
|
30
|
-
for (const uniform of uniforms) {
|
|
31
|
-
if (isSamplerUniform(uniform.type)) {
|
|
32
|
-
const {
|
|
33
|
-
viewDimension,
|
|
34
|
-
sampleType
|
|
35
|
-
} = getSamplerInfo(uniform.type);
|
|
36
|
-
shaderLayout.bindings.push({
|
|
37
|
-
type: 'texture',
|
|
38
|
-
name: uniform.name,
|
|
39
|
-
location: textureUnit,
|
|
40
|
-
viewDimension,
|
|
41
|
-
sampleType
|
|
42
|
-
});
|
|
43
|
-
uniform.textureUnit = textureUnit;
|
|
44
|
-
textureUnit += 1;
|
|
13
|
+
const shaderLayout = {
|
|
14
|
+
attributes: [],
|
|
15
|
+
bindings: []
|
|
16
|
+
};
|
|
17
|
+
shaderLayout.attributes = readAttributeDeclarations(gl, program);
|
|
18
|
+
// Uniform blocks
|
|
19
|
+
const uniformBlocks = readUniformBlocks(gl, program);
|
|
20
|
+
for (const uniformBlock of uniformBlocks) {
|
|
21
|
+
const uniforms = uniformBlock.uniforms.map(uniform => ({
|
|
22
|
+
name: uniform.name,
|
|
23
|
+
format: uniform.format,
|
|
24
|
+
byteOffset: uniform.byteOffset,
|
|
25
|
+
byteStride: uniform.byteStride,
|
|
26
|
+
arrayLength: uniform.arrayLength
|
|
27
|
+
}));
|
|
28
|
+
shaderLayout.bindings.push({
|
|
29
|
+
type: 'uniform',
|
|
30
|
+
name: uniformBlock.name,
|
|
31
|
+
location: uniformBlock.location,
|
|
32
|
+
visibility: (uniformBlock.vertex ? 0x1 : 0) & (uniformBlock.fragment ? 0x2 : 0),
|
|
33
|
+
minBindingSize: uniformBlock.byteLength,
|
|
34
|
+
uniforms
|
|
35
|
+
});
|
|
45
36
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
37
|
+
const uniforms = readUniformBindings(gl, program);
|
|
38
|
+
let textureUnit = 0;
|
|
39
|
+
for (const uniform of uniforms) {
|
|
40
|
+
if (isSamplerUniform(uniform.type)) {
|
|
41
|
+
const { viewDimension, sampleType } = getSamplerInfo(uniform.type);
|
|
42
|
+
shaderLayout.bindings.push({
|
|
43
|
+
type: 'texture',
|
|
44
|
+
name: uniform.name,
|
|
45
|
+
location: textureUnit,
|
|
46
|
+
viewDimension,
|
|
47
|
+
sampleType
|
|
48
|
+
});
|
|
49
|
+
// @ts-expect-error
|
|
50
|
+
uniform.textureUnit = textureUnit;
|
|
51
|
+
textureUnit += 1;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (uniforms.length) {
|
|
55
|
+
shaderLayout.uniforms = uniforms;
|
|
56
|
+
}
|
|
57
|
+
// Varyings
|
|
58
|
+
const varyings = readVaryings(gl, program);
|
|
59
|
+
// Note - samplers are always in unform bindings, even if uniform blocks are used
|
|
60
|
+
if (varyings?.length) {
|
|
61
|
+
shaderLayout.varyings = varyings;
|
|
62
|
+
}
|
|
63
|
+
return shaderLayout;
|
|
55
64
|
}
|
|
65
|
+
// HELPERS
|
|
66
|
+
/**
|
|
67
|
+
* Extract info about all transform feedback varyings
|
|
68
|
+
*
|
|
69
|
+
* linkProgram needs to have been called, although linking does not need to have been successful
|
|
70
|
+
*/
|
|
56
71
|
function readAttributeDeclarations(gl, program) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
const attributes = [];
|
|
73
|
+
const count = gl.getProgramParameter(program, 35721);
|
|
74
|
+
for (let index = 0; index < count; index++) {
|
|
75
|
+
const activeInfo = gl.getActiveAttrib(program, index);
|
|
76
|
+
if (!activeInfo) {
|
|
77
|
+
throw new Error('activeInfo');
|
|
78
|
+
}
|
|
79
|
+
const { name, type: compositeType /* , size*/ } = activeInfo;
|
|
80
|
+
const location = gl.getAttribLocation(program, name);
|
|
81
|
+
// Add only user provided attributes, for built-in attributes like `gl_InstanceID` location will be < 0
|
|
82
|
+
if (location >= 0) {
|
|
83
|
+
const { attributeType } = decodeGLAttributeType(compositeType);
|
|
84
|
+
// Whether an attribute is instanced is essentially fixed by the structure of the shader code,
|
|
85
|
+
// so it is arguably a static property of the shader.
|
|
86
|
+
// There is no hint in the shader declarations
|
|
87
|
+
// Heuristic: Any attribute name containing the word "instance" will be assumed to be instanced
|
|
88
|
+
const stepMode = /instance/i.test(name) ? 'instance' : 'vertex';
|
|
89
|
+
attributes.push({
|
|
90
|
+
name,
|
|
91
|
+
location,
|
|
92
|
+
stepMode,
|
|
93
|
+
type: attributeType
|
|
94
|
+
// size - for arrays, size is the number of elements in the array
|
|
95
|
+
});
|
|
96
|
+
}
|
|
80
97
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
98
|
+
// Sort by declaration order
|
|
99
|
+
attributes.sort((a, b) => a.location - b.location);
|
|
100
|
+
return attributes;
|
|
84
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Extract info about all transform feedback varyings
|
|
104
|
+
*
|
|
105
|
+
* linkProgram needs to have been called, although linking does not need to have been successful
|
|
106
|
+
*/
|
|
85
107
|
function readVaryings(gl, program) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
108
|
+
const varyings = [];
|
|
109
|
+
const count = gl.getProgramParameter(program, 35971);
|
|
110
|
+
for (let location = 0; location < count; location++) {
|
|
111
|
+
const activeInfo = gl.getTransformFeedbackVarying(program, location);
|
|
112
|
+
if (!activeInfo) {
|
|
113
|
+
throw new Error('activeInfo');
|
|
114
|
+
}
|
|
115
|
+
const { name, type: compositeType, size } = activeInfo;
|
|
116
|
+
const { glType, components } = decodeGLUniformType(compositeType);
|
|
117
|
+
const accessor = new Accessor({ type: glType, size: size * components });
|
|
118
|
+
const varying = { location, name, accessor }; // Base values
|
|
119
|
+
varyings.push(varying);
|
|
96
120
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
type: compositeType,
|
|
100
|
-
size
|
|
101
|
-
} = activeInfo;
|
|
102
|
-
const {
|
|
103
|
-
glType,
|
|
104
|
-
components
|
|
105
|
-
} = decodeGLUniformType(compositeType);
|
|
106
|
-
const accessor = new Accessor({
|
|
107
|
-
type: glType,
|
|
108
|
-
size: size * components
|
|
109
|
-
});
|
|
110
|
-
const varying = {
|
|
111
|
-
location,
|
|
112
|
-
name,
|
|
113
|
-
accessor
|
|
114
|
-
};
|
|
115
|
-
varyings.push(varying);
|
|
116
|
-
}
|
|
117
|
-
varyings.sort((a, b) => a.location - b.location);
|
|
118
|
-
return varyings;
|
|
121
|
+
varyings.sort((a, b) => a.location - b.location);
|
|
122
|
+
return varyings;
|
|
119
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Extract info about all uniforms
|
|
126
|
+
*
|
|
127
|
+
* Query uniform locations and build name to setter map.
|
|
128
|
+
*/
|
|
120
129
|
function readUniformBindings(gl, program) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const uniformInfo = {
|
|
139
|
-
location: webglLocation,
|
|
140
|
-
name,
|
|
141
|
-
size,
|
|
142
|
-
type,
|
|
143
|
-
isArray
|
|
144
|
-
};
|
|
145
|
-
uniforms.push(uniformInfo);
|
|
146
|
-
if (uniformInfo.size > 1) {
|
|
147
|
-
for (let j = 0; j < uniformInfo.size; j++) {
|
|
148
|
-
const elementName = `${name}[${j}]`;
|
|
149
|
-
webglLocation = gl.getUniformLocation(program, elementName);
|
|
150
|
-
const arrayElementUniformInfo = {
|
|
151
|
-
...uniformInfo,
|
|
152
|
-
name: elementName,
|
|
153
|
-
location: webglLocation
|
|
130
|
+
const uniforms = [];
|
|
131
|
+
const uniformCount = gl.getProgramParameter(program, 35718);
|
|
132
|
+
for (let i = 0; i < uniformCount; i++) {
|
|
133
|
+
const activeInfo = gl.getActiveUniform(program, i);
|
|
134
|
+
if (!activeInfo) {
|
|
135
|
+
throw new Error('activeInfo');
|
|
136
|
+
}
|
|
137
|
+
const { name: rawName, size, type } = activeInfo;
|
|
138
|
+
const { name, isArray } = parseUniformName(rawName);
|
|
139
|
+
let webglLocation = gl.getUniformLocation(program, name);
|
|
140
|
+
const uniformInfo = {
|
|
141
|
+
// WebGL locations are uniquely typed but just numbers
|
|
142
|
+
location: webglLocation,
|
|
143
|
+
name,
|
|
144
|
+
size,
|
|
145
|
+
type,
|
|
146
|
+
isArray
|
|
154
147
|
};
|
|
155
|
-
uniforms.push(
|
|
156
|
-
|
|
148
|
+
uniforms.push(uniformInfo);
|
|
149
|
+
// Array (e.g. matrix) uniforms can occupy several 4x4 byte banks
|
|
150
|
+
if (uniformInfo.size > 1) {
|
|
151
|
+
for (let j = 0; j < uniformInfo.size; j++) {
|
|
152
|
+
const elementName = `${name}[${j}]`;
|
|
153
|
+
webglLocation = gl.getUniformLocation(program, elementName);
|
|
154
|
+
const arrayElementUniformInfo = {
|
|
155
|
+
...uniformInfo,
|
|
156
|
+
name: elementName,
|
|
157
|
+
location: webglLocation
|
|
158
|
+
};
|
|
159
|
+
uniforms.push(arrayElementUniformInfo);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
157
162
|
}
|
|
158
|
-
|
|
159
|
-
return uniforms;
|
|
163
|
+
return uniforms;
|
|
160
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* Extract info about all "active" uniform blocks
|
|
167
|
+
* @note In WebGL, "active" just means that unused (inactive) blocks may have been optimized away during linking)
|
|
168
|
+
*/
|
|
161
169
|
function readUniformBlocks(gl, program) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
170
|
+
const getBlockParameter = (blockIndex, pname) => gl.getActiveUniformBlockParameter(program, blockIndex, pname);
|
|
171
|
+
const uniformBlocks = [];
|
|
172
|
+
const blockCount = gl.getProgramParameter(program, 35382);
|
|
173
|
+
for (let blockIndex = 0; blockIndex < blockCount; blockIndex++) {
|
|
174
|
+
const blockInfo = {
|
|
175
|
+
name: gl.getActiveUniformBlockName(program, blockIndex) || '',
|
|
176
|
+
location: getBlockParameter(blockIndex, 35391),
|
|
177
|
+
byteLength: getBlockParameter(blockIndex, 35392),
|
|
178
|
+
vertex: getBlockParameter(blockIndex, 35396),
|
|
179
|
+
fragment: getBlockParameter(blockIndex, 35398),
|
|
180
|
+
uniformCount: getBlockParameter(blockIndex, 35394),
|
|
181
|
+
uniforms: []
|
|
182
|
+
};
|
|
183
|
+
const uniformIndices = getBlockParameter(blockIndex, 35395) || [];
|
|
184
|
+
const uniformType = gl.getActiveUniforms(program, uniformIndices, 35383); // Array of GLenum indicating the types of the uniforms.
|
|
185
|
+
const uniformArrayLength = gl.getActiveUniforms(program, uniformIndices, 35384); // Array of GLuint indicating the sizes of the uniforms.
|
|
186
|
+
// const uniformBlockIndex = gl.getActiveUniforms(
|
|
187
|
+
// program,
|
|
188
|
+
// uniformIndices,
|
|
189
|
+
// GL.UNIFORM_BLOCK_INDEX
|
|
190
|
+
// ); // Array of GLint indicating the block indices of the uniforms.
|
|
191
|
+
const uniformOffset = gl.getActiveUniforms(program, uniformIndices, 35387); // Array of GLint indicating the uniform buffer offsets.
|
|
192
|
+
const uniformStride = gl.getActiveUniforms(program, uniformIndices, 35388); // Array of GLint indicating the strides between the elements.
|
|
193
|
+
// const uniformMatrixStride = gl.getActiveUniforms(
|
|
194
|
+
// program,
|
|
195
|
+
// uniformIndices,
|
|
196
|
+
// GL.UNIFORM_MATRIX_STRIDE
|
|
197
|
+
// ); // Array of GLint indicating the strides between columns of a column-major matrix or a row-major matrix.
|
|
198
|
+
// const uniformRowMajor = gl.getActiveUniforms(program, uniformIndices, GL.UNIFORM_IS_ROW_MAJOR);
|
|
199
|
+
for (let i = 0; i < blockInfo.uniformCount; ++i) {
|
|
200
|
+
const activeInfo = gl.getActiveUniform(program, uniformIndices[i]);
|
|
201
|
+
if (!activeInfo) {
|
|
202
|
+
throw new Error('activeInfo');
|
|
203
|
+
}
|
|
204
|
+
blockInfo.uniforms.push({
|
|
205
|
+
name: activeInfo.name,
|
|
206
|
+
format: decodeGLUniformType(uniformType[i]).format,
|
|
207
|
+
type: uniformType[i],
|
|
208
|
+
arrayLength: uniformArrayLength[i],
|
|
209
|
+
byteOffset: uniformOffset[i],
|
|
210
|
+
byteStride: uniformStride[i]
|
|
211
|
+
// matrixStride: uniformStride[i],
|
|
212
|
+
// rowMajor: uniformRowMajor[i]
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
uniformBlocks.push(blockInfo);
|
|
197
216
|
}
|
|
198
|
-
uniformBlocks.
|
|
199
|
-
|
|
200
|
-
uniformBlocks.sort((a, b) => a.location - b.location);
|
|
201
|
-
return uniformBlocks;
|
|
217
|
+
uniformBlocks.sort((a, b) => a.location - b.location);
|
|
218
|
+
return uniformBlocks;
|
|
202
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* TOOD - compare with a above, confirm copy, then delete
|
|
222
|
+
const bindings: Binding[] = [];
|
|
223
|
+
const count = gl.getProgramParameter(program, gl.ACTIVE_UNIFORM_BLOCKS);
|
|
224
|
+
for (let blockIndex = 0; blockIndex < count; blockIndex++) {
|
|
225
|
+
const vertex = gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER),
|
|
226
|
+
const fragment = gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER),
|
|
227
|
+
const visibility = (vertex) + (fragment);
|
|
228
|
+
const binding: BufferBinding = {
|
|
229
|
+
location: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_BINDING),
|
|
230
|
+
// name: gl.getActiveUniformBlockName(program, blockIndex),
|
|
231
|
+
type: 'uniform',
|
|
232
|
+
visibility,
|
|
233
|
+
minBindingSize: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_DATA_SIZE),
|
|
234
|
+
// uniformCount: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS),
|
|
235
|
+
// uniformIndices: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES),
|
|
236
|
+
}
|
|
237
|
+
bindings.push(binding);
|
|
238
|
+
}
|
|
239
|
+
*/
|
|
203
240
|
const SAMPLER_UNIFORMS_GL_TO_GPU = {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
241
|
+
[35678]: ['2d', 'float'],
|
|
242
|
+
[35680]: ['cube', 'float'],
|
|
243
|
+
[35679]: ['3d', 'float'],
|
|
244
|
+
[35682]: ['3d', 'depth'],
|
|
245
|
+
[36289]: ['2d-array', 'float'],
|
|
246
|
+
[36292]: ['2d-array', 'depth'],
|
|
247
|
+
[36293]: ['cube', 'float'],
|
|
248
|
+
[36298]: ['2d', 'sint'],
|
|
249
|
+
[36299]: ['3d', 'sint'],
|
|
250
|
+
[36300]: ['cube', 'sint'],
|
|
251
|
+
[36303]: ['2d-array', 'uint'],
|
|
252
|
+
[36306]: ['2d', 'uint'],
|
|
253
|
+
[36307]: ['3d', 'uint'],
|
|
254
|
+
[36308]: ['cube', 'uint'],
|
|
255
|
+
[36311]: ['2d-array', 'uint']
|
|
219
256
|
};
|
|
220
257
|
function getSamplerInfo(type) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
viewDimension,
|
|
228
|
-
sampleType
|
|
229
|
-
};
|
|
258
|
+
const sampler = SAMPLER_UNIFORMS_GL_TO_GPU[type];
|
|
259
|
+
if (!sampler) {
|
|
260
|
+
throw new Error('sampler');
|
|
261
|
+
}
|
|
262
|
+
const [viewDimension, sampleType] = sampler;
|
|
263
|
+
return { viewDimension, sampleType };
|
|
230
264
|
}
|
|
265
|
+
// HELPERS
|
|
231
266
|
function parseUniformName(name) {
|
|
232
|
-
|
|
267
|
+
// Shortcut to avoid redundant or bad matches
|
|
268
|
+
if (name[name.length - 1] !== ']') {
|
|
269
|
+
return {
|
|
270
|
+
name,
|
|
271
|
+
length: 1,
|
|
272
|
+
isArray: false
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
// if array name then clean the array brackets
|
|
276
|
+
const UNIFORM_NAME_REGEXP = /([^[]*)(\[[0-9]+\])?/;
|
|
277
|
+
const matches = UNIFORM_NAME_REGEXP.exec(name);
|
|
278
|
+
if (!matches || matches.length < 2) {
|
|
279
|
+
throw new Error(`Failed to parse GLSL uniform name ${name}`);
|
|
280
|
+
}
|
|
233
281
|
return {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
282
|
+
name: matches[1],
|
|
283
|
+
length: matches[2] ? 1 : 0,
|
|
284
|
+
isArray: Boolean(matches[2])
|
|
237
285
|
};
|
|
238
|
-
}
|
|
239
|
-
const UNIFORM_NAME_REGEXP = /([^[]*)(\[[0-9]+\])?/;
|
|
240
|
-
const matches = UNIFORM_NAME_REGEXP.exec(name);
|
|
241
|
-
if (!matches || matches.length < 2) {
|
|
242
|
-
throw new Error(`Failed to parse GLSL uniform name ${name}`);
|
|
243
|
-
}
|
|
244
|
-
return {
|
|
245
|
-
name: matches[1],
|
|
246
|
-
length: matches[2] ? 1 : 0,
|
|
247
|
-
isArray: Boolean(matches[2])
|
|
248
|
-
};
|
|
249
286
|
}
|
|
250
|
-
//# sourceMappingURL=get-shader-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-shader-compiler-log.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/parse-shader-compiler-log.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-shader-compiler-log.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/parse-shader-compiler-log.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,eAAe,EAAE,CA8CjF"}
|
|
@@ -1,42 +1,52 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
/**
|
|
5
|
+
* Parse a WebGL-format GLSL compilation log into an array of WebGPU style message records.
|
|
6
|
+
* This follows documented WebGL conventions for compilation logs.
|
|
7
|
+
* Based on https://github.com/wwwtyro/gl-format-compiler-error (public domain)
|
|
8
|
+
*/
|
|
1
9
|
export function parseShaderCompilerLog(errLog) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
10
|
+
// Parse the error - note: browser and driver dependent
|
|
11
|
+
const lines = errLog.split(/\r?\n/);
|
|
12
|
+
const messages = [];
|
|
13
|
+
for (const line of lines) {
|
|
14
|
+
if (line.length <= 1) {
|
|
15
|
+
continue; // eslint-disable-line no-continue
|
|
16
|
+
}
|
|
17
|
+
const segments = line.split(':');
|
|
18
|
+
// Check for messages with no line information `ERROR: unsupported shader version`
|
|
19
|
+
if (segments.length === 2) {
|
|
20
|
+
const [messageType, message] = segments;
|
|
21
|
+
messages.push({
|
|
22
|
+
message: message.trim(),
|
|
23
|
+
type: getMessageType(messageType),
|
|
24
|
+
lineNum: 0,
|
|
25
|
+
linePos: 0
|
|
26
|
+
});
|
|
27
|
+
continue; // eslint-disable-line no-continue
|
|
28
|
+
}
|
|
29
|
+
const [messageType, linePosition, lineNumber, ...rest] = segments;
|
|
30
|
+
let lineNum = parseInt(lineNumber, 10);
|
|
31
|
+
if (isNaN(lineNum)) {
|
|
32
|
+
lineNum = 0;
|
|
33
|
+
}
|
|
34
|
+
let linePos = parseInt(linePosition, 10);
|
|
35
|
+
if (isNaN(linePos)) {
|
|
36
|
+
linePos = 0;
|
|
37
|
+
}
|
|
38
|
+
messages.push({
|
|
39
|
+
message: rest.join(':').trim(),
|
|
40
|
+
type: getMessageType(messageType),
|
|
41
|
+
lineNum,
|
|
42
|
+
linePos // TODO
|
|
43
|
+
});
|
|
7
44
|
}
|
|
8
|
-
|
|
9
|
-
if (segments.length === 2) {
|
|
10
|
-
const [messageType, message] = segments;
|
|
11
|
-
messages.push({
|
|
12
|
-
message: message.trim(),
|
|
13
|
-
type: getMessageType(messageType),
|
|
14
|
-
lineNum: 0,
|
|
15
|
-
linePos: 0
|
|
16
|
-
});
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
const [messageType, linePosition, lineNumber, ...rest] = segments;
|
|
20
|
-
let lineNum = parseInt(lineNumber, 10);
|
|
21
|
-
if (isNaN(lineNum)) {
|
|
22
|
-
lineNum = 0;
|
|
23
|
-
}
|
|
24
|
-
let linePos = parseInt(linePosition, 10);
|
|
25
|
-
if (isNaN(linePos)) {
|
|
26
|
-
linePos = 0;
|
|
27
|
-
}
|
|
28
|
-
messages.push({
|
|
29
|
-
message: rest.join(':').trim(),
|
|
30
|
-
type: getMessageType(messageType),
|
|
31
|
-
lineNum,
|
|
32
|
-
linePos
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
return messages;
|
|
45
|
+
return messages;
|
|
36
46
|
}
|
|
47
|
+
/** Ensure supported type */
|
|
37
48
|
function getMessageType(messageType) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
const MESSAGE_TYPES = ['warning', 'error', 'info'];
|
|
50
|
+
const lowerCaseType = messageType.toLowerCase();
|
|
51
|
+
return (MESSAGE_TYPES.includes(lowerCaseType) ? lowerCaseType : 'info');
|
|
41
52
|
}
|
|
42
|
-
//# sourceMappingURL=parse-shader-compiler-log.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UniformValue } from '@luma.gl/core';
|
|
2
2
|
import { GLCompositeType, GLSamplerType } from '@luma.gl/constants';
|
|
3
3
|
/** Set a raw uniform (without type conversion and caching) */
|
|
4
|
-
export declare function setUniform(gl:
|
|
4
|
+
export declare function setUniform(gl: WebGL2RenderingContext, location: WebGLUniformLocation, type: GLCompositeType | GLSamplerType, value: UniformValue): void;
|
|
5
5
|
//# sourceMappingURL=set-uniform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-uniform.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/set-uniform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"set-uniform.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/set-uniform.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,EAAK,eAAe,EAAE,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEtE,8DAA8D;AAE9D,wBAAgB,UAAU,CACxB,EAAE,EAAE,sBAAsB,EAC1B,QAAQ,EAAE,oBAAoB,EAC9B,IAAI,EAAE,eAAe,GAAG,aAAa,EACrC,KAAK,EAAE,YAAY,GAClB,IAAI,CAwEN"}
|