@luma.gl/core 9.0.17 → 9.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter/adapter.d.ts +11 -0
- package/dist/adapter/adapter.d.ts.map +1 -0
- package/dist/adapter/adapter.js +8 -0
- package/dist/adapter/canvas-context.d.ts +5 -0
- package/dist/adapter/canvas-context.d.ts.map +1 -1
- package/dist/adapter/device.d.ts +23 -11
- package/dist/adapter/device.d.ts.map +1 -1
- package/dist/adapter/device.js +22 -20
- package/dist/adapter/luma.d.ts +70 -0
- package/dist/adapter/luma.d.ts.map +1 -0
- package/dist/adapter/luma.js +159 -0
- package/dist/adapter/resources/buffer.js +5 -5
- package/dist/adapter/resources/compute-pipeline.d.ts +2 -0
- package/dist/adapter/resources/compute-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/compute-pipeline.js +3 -0
- package/dist/adapter/resources/external-texture.d.ts +1 -1
- package/dist/adapter/resources/external-texture.d.ts.map +1 -1
- package/dist/adapter/resources/external-texture.js +1 -1
- package/dist/adapter/resources/framebuffer.d.ts +3 -3
- package/dist/adapter/resources/framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/framebuffer.js +2 -83
- package/dist/adapter/resources/render-pass.d.ts +2 -2
- package/dist/adapter/resources/render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/render-pipeline.d.ts +2 -5
- package/dist/adapter/resources/render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/resource.d.ts +3 -3
- package/dist/adapter/resources/resource.d.ts.map +1 -1
- package/dist/adapter/resources/resource.js +1 -1
- package/dist/adapter/resources/shader.d.ts +5 -2
- package/dist/adapter/resources/shader.d.ts.map +1 -1
- package/dist/adapter/resources/shader.js +15 -9
- package/dist/adapter/resources/texture-view.d.ts +1 -1
- package/dist/adapter/resources/texture-view.d.ts.map +1 -1
- package/dist/adapter/resources/texture.d.ts +144 -47
- package/dist/adapter/resources/texture.d.ts.map +1 -1
- package/dist/adapter/resources/texture.js +120 -12
- package/dist/adapter/resources/transform-feedback.d.ts +1 -1
- package/dist/adapter/resources/transform-feedback.d.ts.map +1 -1
- package/dist/adapter/resources/vertex-array.d.ts +1 -1
- package/dist/adapter/resources/vertex-array.d.ts.map +1 -1
- package/dist/adapter/resources/vertex-array.js +6 -2
- package/dist/adapter/types/{types.d.ts → attachments.d.ts} +7 -17
- package/dist/adapter/types/attachments.d.ts.map +1 -0
- package/dist/adapter/types/buffer-layout.d.ts +1 -1
- package/dist/adapter/types/buffer-layout.d.ts.map +1 -1
- package/dist/adapter/types/compiler-message.d.ts.map +1 -0
- package/dist/adapter/types/parameters.d.ts +4 -6
- package/dist/adapter/types/parameters.d.ts.map +1 -1
- package/dist/adapter/types/parameters.js +1 -0
- package/dist/adapter/types/shader-layout.d.ts +23 -3
- package/dist/adapter/types/shader-layout.d.ts.map +1 -1
- package/dist/adapter/types/uniforms.d.ts +4 -0
- package/dist/adapter/types/uniforms.d.ts.map +1 -0
- package/dist/{lib/compiler-log → adapter-utils}/format-compiler-log.d.ts +1 -1
- package/dist/adapter-utils/format-compiler-log.d.ts.map +1 -0
- package/dist/{adapter/attribute-utils → adapter-utils}/get-attribute-from-layouts.d.ts +4 -11
- package/dist/adapter-utils/get-attribute-from-layouts.d.ts.map +1 -0
- package/dist/{adapter/attribute-utils → adapter-utils}/get-attribute-from-layouts.js +10 -30
- package/dist/adapter-utils/is-uniform-value.d.ts +3 -0
- package/dist/adapter-utils/is-uniform-value.d.ts.map +1 -0
- package/dist/adapter-utils/is-uniform-value.js +7 -0
- package/dist/dist.dev.js +635 -821
- package/dist/dist.min.js +6 -6
- package/dist/{adapter/type-utils → gpu-type-utils}/decode-attribute-type.d.ts +3 -3
- package/dist/gpu-type-utils/decode-attribute-type.d.ts.map +1 -0
- package/dist/{adapter/type-utils → gpu-type-utils}/decode-data-type.d.ts +1 -1
- package/dist/gpu-type-utils/decode-data-type.d.ts.map +1 -0
- package/dist/{adapter/type-utils → gpu-type-utils}/decode-shader-types.d.ts +1 -1
- package/dist/gpu-type-utils/decode-shader-types.d.ts.map +1 -0
- package/dist/{adapter/type-utils → gpu-type-utils}/decode-shader-types.js +0 -2
- package/dist/gpu-type-utils/decode-texture-format.d.ts +43 -0
- package/dist/gpu-type-utils/decode-texture-format.d.ts.map +1 -0
- package/dist/{adapter/type-utils → gpu-type-utils}/decode-texture-format.js +67 -31
- package/dist/{adapter/type-utils → gpu-type-utils}/decode-vertex-format.d.ts +1 -1
- package/dist/gpu-type-utils/decode-vertex-format.d.ts.map +1 -0
- package/dist/gpu-type-utils/shader-types.d.ts.map +1 -0
- package/dist/{adapter/types → gpu-type-utils}/texture-formats.d.ts +3 -5
- package/dist/gpu-type-utils/texture-formats.d.ts.map +1 -0
- package/dist/{adapter/type-utils → gpu-type-utils}/vertex-format-from-attribute.d.ts +2 -2
- package/dist/gpu-type-utils/vertex-format-from-attribute.d.ts.map +1 -0
- package/dist/gpu-type-utils/vertex-formats.d.ts.map +1 -0
- package/dist/{adapter/type-utils → gpu-type-utils}/wgsl-utils.d.ts +1 -1
- package/dist/gpu-type-utils/wgsl-utils.d.ts.map +1 -0
- package/dist/index.cjs +396 -567
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +28 -44
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -37
- package/dist/{lib/uniforms → portable}/uniform-block.d.ts +3 -3
- package/dist/portable/uniform-block.d.ts.map +1 -0
- package/dist/{lib/uniforms → portable}/uniform-block.js +2 -2
- package/dist/{lib/uniforms → portable}/uniform-buffer-layout.d.ts +2 -2
- package/dist/portable/uniform-buffer-layout.d.ts.map +1 -0
- package/dist/{lib/uniforms → portable}/uniform-buffer-layout.js +6 -7
- package/dist/{lib/uniforms → portable}/uniform-store.d.ts +9 -4
- package/dist/portable/uniform-store.d.ts.map +1 -0
- package/dist/{lib/uniforms → portable}/uniform-store.js +11 -9
- package/dist/types.d.ts +0 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/array-equal.d.ts.map +1 -1
- package/dist/utils/array-equal.js +6 -7
- package/dist/utils/array-utils-flat.d.ts +1 -7
- package/dist/utils/array-utils-flat.d.ts.map +1 -1
- package/dist/utils/array-utils-flat.js +0 -23
- package/dist/utils/is-array.d.ts +3 -3
- package/dist/utils/is-array.d.ts.map +1 -1
- package/dist/utils/is-array.js +2 -2
- package/dist/utils/uid.d.ts +7 -0
- package/dist/utils/uid.d.ts.map +1 -0
- package/dist/utils/{utils.js → uid.js} +0 -11
- package/package.json +5 -5
- package/src/adapter/adapter.ts +16 -0
- package/src/adapter/canvas-context.ts +6 -0
- package/src/adapter/device.ts +52 -36
- package/src/adapter/luma.ts +219 -0
- package/src/adapter/resources/buffer.ts +5 -5
- package/src/adapter/resources/command-encoder.ts +1 -1
- package/src/adapter/resources/compute-pass.ts +3 -3
- package/src/adapter/resources/compute-pipeline.ts +6 -3
- package/src/adapter/resources/external-texture.ts +2 -2
- package/src/adapter/resources/framebuffer.ts +5 -92
- package/src/adapter/resources/query-set.ts +2 -2
- package/src/adapter/resources/render-pass.ts +11 -7
- package/src/adapter/resources/render-pipeline.ts +3 -6
- package/src/adapter/resources/resource.ts +7 -7
- package/src/adapter/resources/shader.ts +18 -11
- package/src/adapter/resources/texture-view.ts +5 -5
- package/src/adapter/resources/texture.ts +285 -76
- package/src/adapter/resources/transform-feedback.ts +1 -1
- package/src/adapter/resources/vertex-array.ts +7 -3
- package/src/adapter/types/{types.ts → attachments.ts} +10 -18
- package/src/adapter/types/buffer-layout.ts +1 -1
- package/src/adapter/types/parameters.ts +14 -14
- package/src/adapter/types/shader-layout.ts +31 -29
- package/src/adapter/types/uniforms.ts +10 -0
- package/src/{lib/compiler-log → adapter-utils}/format-compiler-log.ts +1 -1
- package/src/{adapter/attribute-utils → adapter-utils}/get-attribute-from-layouts.ts +18 -42
- package/src/adapter-utils/is-uniform-value.ts +10 -0
- package/src/{adapter/type-utils → gpu-type-utils}/decode-attribute-type.ts +3 -3
- package/src/{adapter/type-utils → gpu-type-utils}/decode-data-type.ts +1 -1
- package/src/{adapter/type-utils → gpu-type-utils}/decode-shader-types.ts +1 -3
- package/src/{adapter/type-utils → gpu-type-utils}/decode-texture-format.ts +99 -39
- package/src/{adapter/type-utils → gpu-type-utils}/decode-vertex-format.ts +1 -1
- package/src/{adapter/types → gpu-type-utils}/texture-formats.ts +3 -14
- package/src/{adapter/type-utils → gpu-type-utils}/vertex-format-from-attribute.ts +2 -2
- package/src/{adapter/type-utils → gpu-type-utils}/wgsl-utils.ts +1 -1
- package/src/index.ts +67 -83
- package/src/{lib/uniforms → portable}/uniform-block.ts +5 -5
- package/src/{lib/uniforms → portable}/uniform-buffer-layout.ts +9 -9
- package/src/{lib/uniforms → portable}/uniform-store.ts +20 -12
- package/src/types.ts +0 -12
- package/src/utils/array-equal.ts +6 -7
- package/src/utils/array-utils-flat.ts +1 -31
- package/src/utils/is-array.ts +5 -5
- package/src/utils/{utils.ts → uid.ts} +0 -12
- package/dist/adapter/attribute-utils/get-attribute-from-layouts.d.ts.map +0 -1
- package/dist/adapter/type-utils/decode-attribute-type.d.ts.map +0 -1
- package/dist/adapter/type-utils/decode-data-type.d.ts.map +0 -1
- package/dist/adapter/type-utils/decode-shader-types.d.ts.map +0 -1
- package/dist/adapter/type-utils/decode-texture-format.d.ts +0 -23
- package/dist/adapter/type-utils/decode-texture-format.d.ts.map +0 -1
- package/dist/adapter/type-utils/decode-vertex-format.d.ts.map +0 -1
- package/dist/adapter/type-utils/vertex-format-from-attribute.d.ts.map +0 -1
- package/dist/adapter/type-utils/wgsl-utils.d.ts.map +0 -1
- package/dist/adapter/types/accessor.d.ts +0 -23
- package/dist/adapter/types/accessor.d.ts.map +0 -1
- package/dist/adapter/types/shader-types.d.ts.map +0 -1
- package/dist/adapter/types/texture-formats.d.ts.map +0 -1
- package/dist/adapter/types/types.d.ts.map +0 -1
- package/dist/adapter/types/vertex-formats.d.ts.map +0 -1
- package/dist/init.d.ts +0 -5
- package/dist/init.d.ts.map +0 -1
- package/dist/init.js +0 -37
- package/dist/lib/compiler-log/compiler-message.d.ts.map +0 -1
- package/dist/lib/compiler-log/format-compiler-log.d.ts.map +0 -1
- package/dist/lib/compiler-log/get-shader-info.d.ts +0 -9
- package/dist/lib/compiler-log/get-shader-info.d.ts.map +0 -1
- package/dist/lib/compiler-log/get-shader-info.js +0 -29
- package/dist/lib/luma.d.ts +0 -38
- package/dist/lib/luma.d.ts.map +0 -1
- package/dist/lib/luma.js +0 -141
- package/dist/lib/uniforms/uniform-block.d.ts.map +0 -1
- package/dist/lib/uniforms/uniform-buffer-layout.d.ts.map +0 -1
- package/dist/lib/uniforms/uniform-store.d.ts.map +0 -1
- package/dist/lib/uniforms/uniform.d.ts +0 -10
- package/dist/lib/uniforms/uniform.d.ts.map +0 -1
- package/dist/lib/uniforms/uniform.js +0 -20
- package/dist/utils/assert.d.ts +0 -2
- package/dist/utils/assert.d.ts.map +0 -1
- package/dist/utils/assert.js +0 -10
- package/dist/utils/cast.d.ts +0 -3
- package/dist/utils/cast.d.ts.map +0 -1
- package/dist/utils/cast.js +0 -7
- package/dist/utils/check-props.d.ts +0 -7
- package/dist/utils/check-props.d.ts.map +0 -1
- package/dist/utils/check-props.js +0 -36
- package/dist/utils/deep-equal.d.ts +0 -9
- package/dist/utils/deep-equal.d.ts.map +0 -1
- package/dist/utils/deep-equal.js +0 -50
- package/dist/utils/format-value.d.ts +0 -7
- package/dist/utils/format-value.d.ts.map +0 -1
- package/dist/utils/format-value.js +0 -39
- package/dist/utils/load-file.d.ts +0 -35
- package/dist/utils/load-file.d.ts.map +0 -1
- package/dist/utils/load-file.js +0 -74
- package/dist/utils/random.d.ts +0 -5
- package/dist/utils/random.d.ts.map +0 -1
- package/dist/utils/random.js +0 -18
- package/dist/utils/request-animation-frame.d.ts +0 -3
- package/dist/utils/request-animation-frame.d.ts.map +0 -1
- package/dist/utils/request-animation-frame.js +0 -16
- package/dist/utils/stub-methods.d.ts +0 -2
- package/dist/utils/stub-methods.d.ts.map +0 -1
- package/dist/utils/stub-methods.js +0 -19
- package/dist/utils/utils.d.ts +0 -9
- package/dist/utils/utils.d.ts.map +0 -1
- package/src/adapter/types/accessor.ts +0 -37
- package/src/init.ts +0 -53
- package/src/lib/compiler-log/get-shader-info.ts +0 -42
- package/src/lib/luma.ts +0 -190
- package/src/lib/uniforms/uniform.ts +0 -31
- package/src/utils/assert.ts +0 -11
- package/src/utils/cast.ts +0 -8
- package/src/utils/check-props.ts +0 -82
- package/src/utils/deep-equal.ts +0 -51
- package/src/utils/format-value.ts +0 -47
- package/src/utils/load-file.ts +0 -91
- package/src/utils/random.ts +0 -21
- package/src/utils/request-animation-frame.ts +0 -19
- package/src/utils/stub-methods.ts +0 -29
- /package/dist/adapter/types/{accessor.js → attachments.js} +0 -0
- /package/dist/{lib/compiler-log → adapter/types}/compiler-message.d.ts +0 -0
- /package/dist/{lib/compiler-log → adapter/types}/compiler-message.js +0 -0
- /package/dist/adapter/types/{shader-types.js → uniforms.js} +0 -0
- /package/dist/{lib/compiler-log → adapter-utils}/format-compiler-log.js +0 -0
- /package/dist/{adapter/type-utils → gpu-type-utils}/decode-attribute-type.js +0 -0
- /package/dist/{adapter/type-utils → gpu-type-utils}/decode-data-type.js +0 -0
- /package/dist/{adapter/type-utils → gpu-type-utils}/decode-vertex-format.js +0 -0
- /package/dist/{adapter/types → gpu-type-utils}/shader-types.d.ts +0 -0
- /package/dist/{adapter/types/texture-formats.js → gpu-type-utils/shader-types.js} +0 -0
- /package/dist/{adapter/types/types.js → gpu-type-utils/texture-formats.js} +0 -0
- /package/dist/{adapter/type-utils → gpu-type-utils}/vertex-format-from-attribute.js +0 -0
- /package/dist/{adapter/types → gpu-type-utils}/vertex-formats.d.ts +0 -0
- /package/dist/{adapter/types → gpu-type-utils}/vertex-formats.js +0 -0
- /package/dist/{adapter/type-utils → gpu-type-utils}/wgsl-utils.js +0 -0
- /package/src/{lib/compiler-log → adapter/types}/compiler-message.ts +0 -0
- /package/src/{adapter/types → gpu-type-utils}/shader-types.ts +0 -0
- /package/src/{adapter/types → gpu-type-utils}/vertex-formats.ts +0 -0
package/src/index.ts
CHANGED
|
@@ -2,21 +2,15 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// MAIN API ACCESS POINT
|
|
6
|
+
export {luma} from './adapter/luma';
|
|
6
7
|
|
|
7
|
-
//
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
// NUMERIC TYPES - TODO: could be imported from @math.gl/types
|
|
11
|
-
export type {TypedArray, TypedArrayConstructor, NumberArray, BigIntOrNumberArray} from './types';
|
|
12
|
-
|
|
13
|
-
export {isTypedArray, isNumberArray} from './utils/is-array';
|
|
14
|
-
|
|
15
|
-
// MAIN API ACCESS POINTS
|
|
16
|
-
export {luma} from './lib/luma';
|
|
8
|
+
// ADAPTER (DEVICE AND GPU RESOURCE INTERFACES)
|
|
9
|
+
export {Adapter} from './adapter/adapter';
|
|
17
10
|
|
|
18
11
|
export type {DeviceProps, DeviceInfo, DeviceFeature} from './adapter/device';
|
|
19
12
|
export {Device, DeviceFeatures, DeviceLimits} from './adapter/device';
|
|
13
|
+
|
|
20
14
|
export type {CanvasContextProps} from './adapter/canvas-context';
|
|
21
15
|
export {CanvasContext} from './adapter/canvas-context';
|
|
22
16
|
|
|
@@ -27,7 +21,7 @@ export {Resource} from './adapter/resources/resource';
|
|
|
27
21
|
export type {BufferProps} from './adapter/resources/buffer';
|
|
28
22
|
export {Buffer} from './adapter/resources/buffer';
|
|
29
23
|
|
|
30
|
-
export type {TextureProps
|
|
24
|
+
export type {TextureProps} from './adapter/resources/texture';
|
|
31
25
|
export {Texture} from './adapter/resources/texture';
|
|
32
26
|
|
|
33
27
|
export type {TextureViewProps} from './adapter/resources/texture-view';
|
|
@@ -72,12 +66,33 @@ export {TransformFeedback} from './adapter/resources/transform-feedback';
|
|
|
72
66
|
export type {QuerySetProps} from './adapter/resources/query-set';
|
|
73
67
|
export {QuerySet} from './adapter/resources/query-set';
|
|
74
68
|
|
|
69
|
+
// PORTABLE API - UNIFORM BUFFERS
|
|
70
|
+
export {UniformBufferLayout} from './portable/uniform-buffer-layout';
|
|
71
|
+
export {UniformBlock} from './portable/uniform-block';
|
|
72
|
+
export {UniformStore} from './portable/uniform-store';
|
|
73
|
+
// TEXTURE TYPES
|
|
74
|
+
|
|
75
75
|
// API TYPES
|
|
76
|
-
export type {
|
|
76
|
+
export type {CompilerMessage} from './adapter/types/compiler-message';
|
|
77
|
+
|
|
78
|
+
export type {
|
|
79
|
+
TextureCompressionFormat,
|
|
80
|
+
TextureCubeFace,
|
|
81
|
+
TextureLevelData,
|
|
82
|
+
ExternalImage,
|
|
83
|
+
TextureData,
|
|
84
|
+
Texture1DData,
|
|
85
|
+
Texture2DData,
|
|
86
|
+
Texture3DData,
|
|
87
|
+
TextureCubeData,
|
|
88
|
+
TextureArrayData,
|
|
89
|
+
TextureCubeArrayData,
|
|
90
|
+
CopyExternalImageOptions
|
|
91
|
+
} from './adapter/resources/texture';
|
|
92
|
+
|
|
93
|
+
export type {Parameters, PrimitiveTopology, IndexFormat} from './adapter/types/parameters';
|
|
94
|
+
|
|
77
95
|
export type {
|
|
78
|
-
Parameters,
|
|
79
|
-
PrimitiveTopology,
|
|
80
|
-
IndexFormat,
|
|
81
96
|
CullMode,
|
|
82
97
|
FrontFace,
|
|
83
98
|
RasterizationParameters,
|
|
@@ -94,20 +109,7 @@ export type {
|
|
|
94
109
|
ProvokingVertex
|
|
95
110
|
} from './adapter/types/parameters';
|
|
96
111
|
|
|
97
|
-
|
|
98
|
-
export type {VertexFormat, VertexType} from './adapter/types/vertex-formats';
|
|
99
|
-
export type {
|
|
100
|
-
TextureFormat,
|
|
101
|
-
ColorTextureFormat,
|
|
102
|
-
DepthStencilTextureFormat
|
|
103
|
-
} from './adapter/types/texture-formats';
|
|
104
|
-
export type {
|
|
105
|
-
ShaderDataType,
|
|
106
|
-
ShaderAttributeType,
|
|
107
|
-
ShaderUniformType
|
|
108
|
-
} from './adapter/types/shader-types';
|
|
109
|
-
|
|
110
|
-
export type {ColorAttachment, DepthStencilAttachment} from './adapter/types/types';
|
|
112
|
+
export type {ColorAttachment, DepthStencilAttachment} from './adapter/types/attachments';
|
|
111
113
|
|
|
112
114
|
export type {
|
|
113
115
|
ShaderLayout,
|
|
@@ -125,63 +127,38 @@ export type {
|
|
|
125
127
|
VaryingBinding
|
|
126
128
|
} from './adapter/types/shader-layout';
|
|
127
129
|
|
|
128
|
-
export type {UniformValue} from './adapter/types/
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
export {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
export {decodeShaderAttributeType} from './adapter/type-utils/decode-attribute-type';
|
|
145
|
-
|
|
146
|
-
// COMPILER LOG
|
|
147
|
-
export type {CompilerMessage} from './lib/compiler-log/compiler-message';
|
|
148
|
-
export {formatCompilerLog} from './lib/compiler-log/format-compiler-log';
|
|
149
|
-
|
|
150
|
-
//
|
|
151
|
-
export type {AttributeInfo} from './adapter/attribute-utils/get-attribute-from-layouts';
|
|
152
|
-
export {
|
|
153
|
-
getAttributeInfosFromLayouts,
|
|
154
|
-
mergeShaderLayout
|
|
155
|
-
} from './adapter/attribute-utils/get-attribute-from-layouts';
|
|
156
|
-
|
|
157
|
-
// GENERAL UTILS
|
|
158
|
-
|
|
159
|
-
export {StatsManager} from './utils/stats-manager';
|
|
160
|
-
export {assert} from './utils/assert';
|
|
161
|
-
export {cast} from './utils/cast';
|
|
162
|
-
export {log} from './utils/log';
|
|
163
|
-
export {uid, isObjectEmpty} from './utils/utils';
|
|
164
|
-
export {isUniformValue, splitUniformsAndBindings} from './lib/uniforms/uniform';
|
|
165
|
-
export {formatValue} from './utils/format-value';
|
|
166
|
-
export {stubRemovedMethods} from './utils/stub-methods';
|
|
167
|
-
export {checkProps} from './utils/check-props';
|
|
168
|
-
export {setPathPrefix, loadFile, loadImage, loadImageBitmap, loadScript} from './utils/load-file';
|
|
169
|
-
export {getScratchArrayBuffer, getScratchArray, fillArray} from './utils/array-utils-flat';
|
|
170
|
-
export {makeRandomNumberGenerator, random} from './utils/random';
|
|
171
|
-
export {deepEqual} from './utils/deep-equal';
|
|
130
|
+
export type {UniformValue} from './adapter/types/uniforms';
|
|
131
|
+
|
|
132
|
+
// GPU TYPE UTILS - GPU MEMORY LAYOUT TYPES - EXTERNAL
|
|
133
|
+
|
|
134
|
+
export type {NumberArray, TypedArray, TypedArrayConstructor} from './types';
|
|
135
|
+
export type {VertexFormat, VertexType} from './gpu-type-utils/vertex-formats';
|
|
136
|
+
export type {
|
|
137
|
+
ShaderDataType,
|
|
138
|
+
ShaderAttributeType,
|
|
139
|
+
ShaderUniformType
|
|
140
|
+
} from './gpu-type-utils/shader-types';
|
|
141
|
+
export type {
|
|
142
|
+
TextureFormat,
|
|
143
|
+
ColorTextureFormat,
|
|
144
|
+
DepthStencilTextureFormat
|
|
145
|
+
} from './gpu-type-utils/texture-formats';
|
|
172
146
|
|
|
173
|
-
//
|
|
174
|
-
export {requestAnimationFrame, cancelAnimationFrame} from './utils/request-animation-frame';
|
|
147
|
+
// GPU TYPE UTILS - GPU MEMORY LAYOUT HELPERS - CAN BE USED BY APPS BUT MOSTLY USED INTERNALLY
|
|
175
148
|
|
|
176
|
-
|
|
149
|
+
export {decodeVertexFormat} from './gpu-type-utils/decode-vertex-format';
|
|
150
|
+
export {decodeTextureFormat} from './gpu-type-utils/decode-texture-format';
|
|
151
|
+
export {decodeShaderUniformType} from './gpu-type-utils/decode-shader-types';
|
|
152
|
+
export {decodeShaderAttributeType} from './gpu-type-utils/decode-attribute-type';
|
|
153
|
+
export {getDataTypeFromTypedArray} from './gpu-type-utils/vertex-format-from-attribute';
|
|
154
|
+
export {getTypedArrayFromDataType} from './gpu-type-utils/vertex-format-from-attribute';
|
|
155
|
+
export {getVertexFormatFromAttribute} from './gpu-type-utils/vertex-format-from-attribute';
|
|
177
156
|
|
|
178
|
-
|
|
179
|
-
* Marks GLSL shaders for syntax highlighting: glsl`...`
|
|
180
|
-
* Install https://marketplace.visualstudio.com/items?itemName=boyswan.glsl-literal
|
|
181
|
-
*/
|
|
182
|
-
export const glsl = (x: TemplateStringsArray) => `${x}`;
|
|
157
|
+
// GENERAL EXPORTS - FOR APPLICATIONS
|
|
183
158
|
|
|
184
|
-
//
|
|
159
|
+
export type {StatsManager} from './utils/stats-manager'; // TODO - should this be moved to probe.gl?
|
|
160
|
+
|
|
161
|
+
// ADAPTER UTILS - for implementing Device adapters (@luma.gl/webgl and @luma.gl/webgpu)
|
|
185
162
|
|
|
186
163
|
export type {
|
|
187
164
|
CopyBufferToBufferOptions,
|
|
@@ -189,3 +166,10 @@ export type {
|
|
|
189
166
|
CopyTextureToBufferOptions,
|
|
190
167
|
CopyTextureToTextureOptions
|
|
191
168
|
} from './adapter/resources/command-encoder';
|
|
169
|
+
|
|
170
|
+
export type {AttributeInfo} from './adapter-utils/get-attribute-from-layouts';
|
|
171
|
+
export {getAttributeInfosFromLayouts} from './adapter-utils/get-attribute-from-layouts';
|
|
172
|
+
export {getScratchArray} from './utils/array-utils-flat';
|
|
173
|
+
|
|
174
|
+
// INTERNAL UTILS - for use in other luma.gl modules only
|
|
175
|
+
export {log} from './utils/log';
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {ShaderUniformType} from '
|
|
6
|
-
import type {UniformValue} from '
|
|
5
|
+
import type {ShaderUniformType} from '../gpu-type-utils/shader-types';
|
|
6
|
+
import type {UniformValue} from '../adapter/types/uniforms';
|
|
7
7
|
import {
|
|
8
8
|
ShaderLayout,
|
|
9
9
|
UniformInfo,
|
|
10
10
|
UniformBufferBindingLayout
|
|
11
|
-
} from '
|
|
12
|
-
import {arrayEqual, arrayCopy} from '
|
|
11
|
+
} from '../adapter/types/shader-layout';
|
|
12
|
+
import {arrayEqual, arrayCopy} from '../utils/array-equal';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* A uniform block holds values of the of uniform values for one uniform block / buffer.
|
|
@@ -32,7 +32,7 @@ export class UniformBlock<
|
|
|
32
32
|
shaderLayout?: ShaderLayout;
|
|
33
33
|
uniformTypes?: Record<keyof TUniforms, Record<string, ShaderUniformType>>;
|
|
34
34
|
}) {
|
|
35
|
-
this.name = props?.name;
|
|
35
|
+
this.name = props?.name || 'unnamed';
|
|
36
36
|
|
|
37
37
|
// TODO - Extract uniform layout from the shaderLayout object
|
|
38
38
|
if (props?.name && props?.shaderLayout) {
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {ShaderUniformType, ShaderDataType} from '
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import type {ShaderUniformType, ShaderDataType} from '../gpu-type-utils/shader-types';
|
|
6
|
+
import {decodeShaderUniformType, alignTo} from '../gpu-type-utils/decode-shader-types';
|
|
7
|
+
|
|
8
|
+
import type {UniformValue} from '../adapter/types/uniforms';
|
|
9
|
+
import {getScratchArrayBuffer} from '../utils/array-utils-flat';
|
|
10
|
+
import {isNumberArray} from '../utils/is-array';
|
|
11
|
+
import {log} from '../utils/log';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Smallest buffer size that can be used for uniform buffers.
|
|
@@ -85,8 +86,7 @@ export class UniformBufferLayout {
|
|
|
85
86
|
// single value -> just set it
|
|
86
87
|
typedArray[offset] = Number(value);
|
|
87
88
|
} else {
|
|
88
|
-
|
|
89
|
-
if (!numericArray) {
|
|
89
|
+
if (!isNumberArray(value)) {
|
|
90
90
|
log.warn(
|
|
91
91
|
`Supplied value for multi component / array uniform ${name} is not a numeric array: ${value}`
|
|
92
92
|
)();
|
|
@@ -95,7 +95,7 @@ export class UniformBufferLayout {
|
|
|
95
95
|
}
|
|
96
96
|
// vector/matrix -> copy the supplied (typed) array, starting from offset
|
|
97
97
|
// TODO: we should limit or check size in case the supplied data overflows
|
|
98
|
-
typedArray.set(
|
|
98
|
+
typedArray.set(value, offset);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -2,13 +2,19 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {ShaderUniformType} from '
|
|
6
|
-
import type {UniformValue} from '
|
|
7
|
-
import type {Device} from '
|
|
8
|
-
import {Buffer} from '
|
|
5
|
+
import type {ShaderUniformType} from '../gpu-type-utils/shader-types';
|
|
6
|
+
import type {UniformValue} from '../adapter/types/uniforms';
|
|
7
|
+
import type {Device} from '../adapter/device';
|
|
8
|
+
import {Buffer} from '../adapter/resources/buffer';
|
|
9
|
+
import {log} from '../utils/log';
|
|
9
10
|
import {UniformBlock} from './uniform-block';
|
|
10
11
|
import {UniformBufferLayout} from './uniform-buffer-layout';
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
export type ShaderModuleInputs = {
|
|
14
|
+
uniformTypes?: Record<string, ShaderUniformType>;
|
|
15
|
+
defaultProps?: Record<string, unknown>;
|
|
16
|
+
defaultUniforms?: Record<string, UniformValue>;
|
|
17
|
+
};
|
|
12
18
|
|
|
13
19
|
/**
|
|
14
20
|
* A uniform store holds a uniform values for one or more uniform blocks,
|
|
@@ -73,7 +79,7 @@ export class UniformStore<
|
|
|
73
79
|
uniforms: Partial<{[group in keyof TPropGroups]: Partial<TPropGroups[group]>}>
|
|
74
80
|
): void {
|
|
75
81
|
for (const [blockName, uniformValues] of Object.entries(uniforms)) {
|
|
76
|
-
this.uniformBlocks.get(blockName)
|
|
82
|
+
this.uniformBlocks.get(blockName)?.setUniforms(uniformValues);
|
|
77
83
|
// We leverage logging in updateUniformBuffers(), even though slightly less efficient
|
|
78
84
|
// this.updateUniformBuffer(blockName);
|
|
79
85
|
}
|
|
@@ -83,13 +89,14 @@ export class UniformStore<
|
|
|
83
89
|
|
|
84
90
|
/** Get the required minimum length of the uniform buffer */
|
|
85
91
|
getUniformBufferByteLength(uniformBufferName: keyof TPropGroups): number {
|
|
86
|
-
return this.uniformBufferLayouts.get(uniformBufferName)
|
|
92
|
+
return this.uniformBufferLayouts.get(uniformBufferName)?.byteLength || 0;
|
|
87
93
|
}
|
|
88
94
|
|
|
89
95
|
/** Get formatted binary memory that can be uploaded to a buffer */
|
|
90
96
|
getUniformBufferData(uniformBufferName: keyof TPropGroups): Uint8Array {
|
|
91
|
-
const uniformValues = this.uniformBlocks.get(uniformBufferName)
|
|
92
|
-
|
|
97
|
+
const uniformValues = this.uniformBlocks.get(uniformBufferName)?.getAllUniforms() || {};
|
|
98
|
+
// @ts-ignore
|
|
99
|
+
return this.uniformBufferLayouts.get(uniformBufferName)?.getData(uniformValues);
|
|
93
100
|
}
|
|
94
101
|
|
|
95
102
|
/**
|
|
@@ -126,6 +133,7 @@ export class UniformStore<
|
|
|
126
133
|
this.uniformBuffers.set(uniformBufferName, uniformBuffer);
|
|
127
134
|
}
|
|
128
135
|
// this.updateUniformBuffers();
|
|
136
|
+
// @ts-ignore
|
|
129
137
|
return this.uniformBuffers.get(uniformBufferName);
|
|
130
138
|
}
|
|
131
139
|
|
|
@@ -148,16 +156,16 @@ export class UniformStore<
|
|
|
148
156
|
const uniformBuffer = this.uniformBuffers.get(uniformBufferName);
|
|
149
157
|
|
|
150
158
|
let reason: false | string = false;
|
|
151
|
-
if (uniformBuffer && uniformBlock
|
|
159
|
+
if (uniformBuffer && uniformBlock?.needsRedraw) {
|
|
152
160
|
reason ||= uniformBlock.needsRedraw;
|
|
153
161
|
// This clears the needs redraw flag
|
|
154
162
|
const uniformBufferData = this.getUniformBufferData(uniformBufferName);
|
|
155
163
|
|
|
156
164
|
const uniformBuffer = this.uniformBuffers.get(uniformBufferName);
|
|
157
|
-
uniformBuffer
|
|
165
|
+
uniformBuffer?.write(uniformBufferData);
|
|
158
166
|
|
|
159
167
|
// logging - TODO - don't query the values unnecessarily
|
|
160
|
-
const uniformValues = this.uniformBlocks.get(uniformBufferName)
|
|
168
|
+
const uniformValues = this.uniformBlocks.get(uniformBufferName)?.getAllUniforms();
|
|
161
169
|
log.log(
|
|
162
170
|
4,
|
|
163
171
|
`Writing to uniform buffer ${String(uniformBufferName)}`,
|
package/src/types.ts
CHANGED
|
@@ -23,15 +23,3 @@ export type TypedArrayConstructor =
|
|
|
23
23
|
export type BigIntTypedArray = BigInt64Array | BigUint64Array;
|
|
24
24
|
|
|
25
25
|
export type BigIntOrNumberArray = NumberArray | BigIntTypedArray;
|
|
26
|
-
|
|
27
|
-
/** Get the constructor type of a type */
|
|
28
|
-
export interface ConstructorOf<T> {
|
|
29
|
-
new (...args: unknown[]): T;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Make specific fields in a type optional. Granular version of `Partial<T>`
|
|
34
|
-
* @example
|
|
35
|
-
* type PartialProps = PartialBy<Required<DeviceProps>, 'device' | 'canvas'>
|
|
36
|
-
*/
|
|
37
|
-
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
package/src/utils/array-equal.ts
CHANGED
|
@@ -9,12 +9,12 @@ export function arrayEqual(a: unknown, b: unknown, limit: number = 16) {
|
|
|
9
9
|
if (a !== b) {
|
|
10
10
|
return false;
|
|
11
11
|
}
|
|
12
|
-
const arrayA =
|
|
13
|
-
|
|
12
|
+
const arrayA = a;
|
|
13
|
+
const arrayB = b;
|
|
14
|
+
if (!isNumberArray(arrayA)) {
|
|
14
15
|
return false;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
if (arrayB && arrayA.length === arrayB.length) {
|
|
17
|
+
if (isNumberArray(arrayB) && arrayA.length === arrayB.length) {
|
|
18
18
|
for (let i = 0; i < arrayA.length; ++i) {
|
|
19
19
|
if (arrayB[i] !== arrayA[i]) {
|
|
20
20
|
return false;
|
|
@@ -26,9 +26,8 @@ export function arrayEqual(a: unknown, b: unknown, limit: number = 16) {
|
|
|
26
26
|
|
|
27
27
|
/** Copy a value */
|
|
28
28
|
export function arrayCopy<T>(a: T): T {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return numberArray.slice() as T;
|
|
29
|
+
if (isNumberArray(a)) {
|
|
30
|
+
return a.slice() as T;
|
|
32
31
|
}
|
|
33
32
|
return a;
|
|
34
33
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {TypedArray
|
|
5
|
+
import type {TypedArray} from '../types';
|
|
6
6
|
|
|
7
7
|
let arrayBuffer: ArrayBuffer;
|
|
8
8
|
|
|
@@ -17,33 +17,3 @@ export function getScratchArray(Type: any, length: number): TypedArray {
|
|
|
17
17
|
const scratchArrayBuffer = getScratchArrayBuffer(Type.BYTES_PER_ELEMENT * length);
|
|
18
18
|
return new Type(scratchArrayBuffer, 0, length); // arrayBuffer, byteOffset, length (in elements)
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
// Uses copyWithin to significantly speed up typed array value filling
|
|
22
|
-
export function fillArray(options: {
|
|
23
|
-
target: NumberArray;
|
|
24
|
-
source: NumberArray;
|
|
25
|
-
start?: number;
|
|
26
|
-
count?: number;
|
|
27
|
-
}): NumberArray {
|
|
28
|
-
const {target, source, start = 0, count = 1} = options;
|
|
29
|
-
const length = source.length;
|
|
30
|
-
const total = count * length;
|
|
31
|
-
let copied = 0;
|
|
32
|
-
for (let i = start; copied < length; copied++) {
|
|
33
|
-
target[i++] = source[copied];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
while (copied < total) {
|
|
37
|
-
// If we have copied less than half, copy everything we got
|
|
38
|
-
// else copy remaining in one operation
|
|
39
|
-
if (copied < total - copied) {
|
|
40
|
-
target.copyWithin(start + copied, start, start + copied);
|
|
41
|
-
copied *= 2;
|
|
42
|
-
} else {
|
|
43
|
-
target.copyWithin(start + copied, start, start + total - copied);
|
|
44
|
-
copied = total;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return options.target;
|
|
49
|
-
}
|
package/src/utils/is-array.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {TypedArray, NumberArray} from '../types';
|
|
5
|
+
import type {TypedArray, NumberArray} from '../types';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Check is an array is a typed array
|
|
@@ -10,8 +10,8 @@ import {TypedArray, NumberArray} from '../types';
|
|
|
10
10
|
* @returns input as TypedArray, or null
|
|
11
11
|
* @todo this should be provided by @math.gl/types
|
|
12
12
|
*/
|
|
13
|
-
export function isTypedArray(value: unknown):
|
|
14
|
-
return ArrayBuffer.isView(value) && !(value instanceof DataView)
|
|
13
|
+
export function isTypedArray(value: unknown): value is TypedArray {
|
|
14
|
+
return ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -20,9 +20,9 @@ export function isTypedArray(value: unknown): TypedArray | null {
|
|
|
20
20
|
* @returns input as NumberArray, or null
|
|
21
21
|
* @todo this should be provided by @math.gl/types
|
|
22
22
|
*/
|
|
23
|
-
export function isNumberArray(value: unknown):
|
|
23
|
+
export function isNumberArray(value: unknown): value is NumberArray {
|
|
24
24
|
if (Array.isArray(value)) {
|
|
25
|
-
return value.length === 0 || typeof value[0] === 'number'
|
|
25
|
+
return value.length === 0 || typeof value[0] === 'number';
|
|
26
26
|
}
|
|
27
27
|
return isTypedArray(value);
|
|
28
28
|
}
|
|
@@ -14,15 +14,3 @@ export function uid(id: string = 'id'): string {
|
|
|
14
14
|
const count = uidCounters[id]++;
|
|
15
15
|
return `${id}-${count}`;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
/** Returns true if given object is empty, false otherwise. */
|
|
19
|
-
export function isObjectEmpty(obj: object): boolean {
|
|
20
|
-
let isEmpty = true;
|
|
21
|
-
// @ts-ignore key is unused
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23
|
-
for (const key in obj) {
|
|
24
|
-
isEmpty = false;
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
return isEmpty;
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-attribute-from-layouts.d.ts","sourceRoot":"","sources":["../../../src/adapter/attribute-utils/get-attribute-from-layouts.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,YAAY,EAAuB,kCAA+B;AAC/E,OAAO,KAAK,EAAC,YAAY,EAAC,kCAA+B;AACzD,OAAO,KAAK,EAAC,cAAc,EAAE,mBAAmB,EAAC,iCAA8B;AAE/E,OAAO,KAAK,EAAC,YAAY,EAAE,UAAU,EAAC,mCAAgC;AAGtE,gGAAgG;AAChG,MAAM,MAAM,aAAa,GAAG;IAC1B,qBAAqB;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,UAAU,EAAE,mBAAmB,CAAC;IAChC,+EAA+E;IAC/E,cAAc,EAAE,cAAc,CAAC;IAC/B,yFAAyF;IACzF,gBAAgB,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChC,0GAA0G;IAC1G,OAAO,EAAE,OAAO,CAAC;IAEjB,iBAAiB;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,YAAY,EAAE,YAAY,CAAC;IAC3B,6DAA6D;IAC7D,cAAc,EAAE,UAAU,CAAC;IAC3B,iFAAiF;IACjF,gBAAgB,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChC,uEAAuE;IACvE,UAAU,EAAE,OAAO,CAAC;IAEpB,mHAAmH;IACnH,QAAQ,EAAE,QAAQ,GAAG,UAAU,CAAC;IAEhC,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAWF;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAAE,GAC3B,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAU/B;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAAE,EAC5B,mBAAmB,GAAE,MAAW,GAC/B,aAAa,EAAE,CAOjB;AAgJD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,YAAY,EACxB,cAAc,EAAE,YAAY,GAC3B,YAAY,CAiBd"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decode-attribute-type.d.ts","sourceRoot":"","sources":["../../../src/adapter/type-utils/decode-attribute-type.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,iCAA8B;AAC1E,OAAO,EAAC,YAAY,EAAa,mCAAgC;AAEjE,gEAAgE;AAChE,MAAM,MAAM,uBAAuB,GAAG;IACpC,oDAAoD;IACpD,QAAQ,EAAE,cAAc,CAAC;IACzB,wEAAwE;IACxE,UAAU,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,uCAAuC;IACvC,MAAM,EAAE,OAAO,CAAC;IAChB,+EAA+E;IAC/E,mBAAmB,CAAC,EAAE,YAAY,CAAC;CACpC,CAAC;AAEF,2FAA2F;AAC3F,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,mBAAmB,GACjC,uBAAuB,CAezB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decode-data-type.d.ts","sourceRoot":"","sources":["../../../src/adapter/type-utils/decode-data-type.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,QAAQ,EAAE,kBAAkB,EAAC,mCAAgC;AAErE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,uBAAuB;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,uCAAuC;IACvC,MAAM,EAAE,OAAO,CAAC;IAChB,wEAAwE;IACxE,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,2FAA2F;AAC3F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,kBAAkB,GAAG,iBAAiB,CAa5E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decode-shader-types.d.ts","sourceRoot":"","sources":["../../../src/adapter/type-utils/decode-shader-types.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,iBAAiB,EAAE,cAAc,EAAC,iCAA8B;AA2BxE,2DAA2D;AAC3D,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,iBAAiB,GAAG;IAClE,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAIA;AAED,4DAA4D;AAC5D,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAO3D"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { TextureFormat } from "../types/texture-formats.js";
|
|
2
|
-
import { VertexType } from "../types/vertex-formats.js";
|
|
3
|
-
export type DecodedTextureFormat = {
|
|
4
|
-
format: 'r' | 'rg' | 'rgb' | 'rgba';
|
|
5
|
-
components: 1 | 2 | 3 | 4;
|
|
6
|
-
dataType?: VertexType;
|
|
7
|
-
srgb: boolean;
|
|
8
|
-
webgl: boolean;
|
|
9
|
-
unsized: boolean;
|
|
10
|
-
byteLength: number;
|
|
11
|
-
integer: boolean;
|
|
12
|
-
signed: boolean;
|
|
13
|
-
normalized: boolean;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Returns true if a texture format is GPU compressed
|
|
17
|
-
*/
|
|
18
|
-
export declare function isTextureFormatCompressed(textureFormat: TextureFormat): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Decodes a vertex format, returning type, components, byte length and flags (integer, signed, normalized)
|
|
21
|
-
*/
|
|
22
|
-
export declare function decodeTextureFormat(format: TextureFormat): DecodedTextureFormat;
|
|
23
|
-
//# sourceMappingURL=decode-texture-format.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decode-texture-format.d.ts","sourceRoot":"","sources":["../../../src/adapter/type-utils/decode-texture-format.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,aAAa,EAAC,oCAAiC;AACvD,OAAO,EAAC,UAAU,EAAC,mCAAgC;AAUnD,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,GAAG,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;IACpC,UAAU,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAE/E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,oBAAoB,CAoB/E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decode-vertex-format.d.ts","sourceRoot":"","sources":["../../../src/adapter/type-utils/decode-vertex-format.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,YAAY,EAAE,UAAU,EAAC,mCAAgC;AAGjE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,4CAA4C;IAC5C,UAAU,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,6EAA6E;IAC7E,OAAO,EAAE,OAAO,CAAC;IACjB,+BAA+B;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,mCAAmC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,mCAAmC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,CAyBzE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vertex-format-from-attribute.d.ts","sourceRoot":"","sources":["../../../src/adapter/type-utils/vertex-format-from-attribute.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAC,uBAAoB;AAC9D,OAAO,EAAC,YAAY,EAAC,mCAAgC;AAIrD,KAAK,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC1F,KAAK,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAEhE,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,UAAU,GAAG,qBAAqB,GAC9C,QAAQ,CAsBV;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,GAAG,YAAY,GAChC,qBAAqB,CAwBvB;AAED,sEAAsE;AACtE,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,OAAO,GACnB,YAAY,CAkCd"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wgsl-utils.d.ts","sourceRoot":"","sources":["../../../src/adapter/type-utils/wgsl-utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,mBAAmB,EAAC,iCAA8B;AAE1D,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAcnE,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Buffer } from "../resources/buffer.js";
|
|
2
|
-
/**
|
|
3
|
-
* Attribute descriptor object
|
|
4
|
-
* @deprecated Use ShaderLayout
|
|
5
|
-
*/
|
|
6
|
-
export interface AccessorObject {
|
|
7
|
-
buffer?: Buffer;
|
|
8
|
-
offset?: number;
|
|
9
|
-
stride?: number;
|
|
10
|
-
/** @deprecated - Use accessor.stepMode */
|
|
11
|
-
divisor?: number;
|
|
12
|
-
/** @deprecated - Infer from format */
|
|
13
|
-
type?: number;
|
|
14
|
-
/** @deprecated - Infer from format */
|
|
15
|
-
size?: number;
|
|
16
|
-
/** @deprecated - Infer from format */
|
|
17
|
-
normalized?: boolean;
|
|
18
|
-
/** @deprecated - Infer from format */
|
|
19
|
-
integer?: boolean;
|
|
20
|
-
/** @deprecated */
|
|
21
|
-
index?: number;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=accessor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accessor.d.ts","sourceRoot":"","sources":["../../../src/adapter/types/accessor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,+BAA4B;AAKhD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sCAAsC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shader-types.d.ts","sourceRoot":"","sources":["../../../src/adapter/types/shader-types.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3D;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,WAAW,GACX,WAAW,GACX,WAAW,GACX,KAAK,GACL,WAAW,GACX,WAAW,GACX,WAAW,GACX,KAAK,GACL,WAAW,GACX,WAAW,GACX,WAAW,GAEX,KAAK,GACL,WAAW,GACX,WAAW,GACX,WAAW,CAAC;AAEhB;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GACzB,KAAK,GACL,KAAK,GACL,KAAK,GACL,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,aAAa,GACb,aAAa,GACb,aAAa,GACb,aAAa,GACb,aAAa,GACb,aAAa,GACb,aAAa,GACb,aAAa,GACb,aAAa,CAAC;AAElB,gDAAgD;AAChD,MAAM,MAAM,eAAe,GACvB,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GAEP,OAAO,GACP,OAAO,GACP,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"texture-formats.d.ts","sourceRoot":"","sources":["../../../src/adapter/types/texture-formats.ts"],"names":[],"mappings":"AAIA,sBAAsB;AACtB,MAAM,MAAM,aAAa,GAAG,kBAAkB,GAAG,yBAAyB,CAAC;AAE3E,wCAAwC;AACxC,MAAM,MAAM,yBAAyB,GACjC,UAAU,GACV,cAAc,GACd,aAAa,GACb,sBAAsB,GACtB,cAAc,GAEd,uBAAuB,GAEvB,uBAAuB,CAAC;AAE5B,4CAA4C;AAC5C,MAAM,MAAM,kBAAkB,GAC1B,wBAAwB,GACxB,wBAAwB,GACxB,yBAAyB,CAAC;AAE9B,MAAM,MAAM,wBAAwB,GAEhC,SAAS,GACT,SAAS,GACT,QAAQ,GACR,QAAQ,GAGR,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,UAAU,GACV,SAAS,GACT,SAAS,GAGT,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,UAAU,GACV,WAAW,GACX,YAAY,GACZ,iBAAiB,GACjB,YAAY,GACZ,WAAW,GACX,WAAW,GACX,YAAY,GACZ,iBAAiB,GAEjB,cAAc,GACd,cAAc,GACd,eAAe,GAGf,UAAU,GACV,UAAU,GACV,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,aAAa,GAGb,YAAY,GACZ,YAAY,GACZ,aAAa,GAIb,gBAAgB,GAChB,qBAAqB,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,aAAa,GACb,aAAa,GACb,cAAc,GACd,cAAc,GACd,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,qBAAqB,GAIrB,gBAAgB,GAChB,qBAAqB,GACrB,kBAAkB,GAClB,uBAAuB,GACvB,iBAAiB,GACjB,sBAAsB,GACtB,cAAc,GACd,cAAc,GACd,eAAe,GACf,eAAe,GAIf,gBAAgB,GAChB,qBAAqB,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,iBAAiB,GACjB,sBAAsB,GACtB,iBAAiB,GACjB,sBAAsB,GACtB,iBAAiB,GACjB,sBAAsB,GACtB,kBAAkB,GAClB,uBAAuB,GACvB,kBAAkB,GAClB,uBAAuB,GACvB,kBAAkB,GAClB,uBAAuB,CAAC;AAE5B,qEAAqE;AACrE,MAAM,MAAM,yBAAyB,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AAMnF,sFAAsF;AACtF,MAAM,MAAM,wBAAwB,GAChC,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,mBAAmB,GACnB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,mBAAmB,GACnB,mBAAmB,GACnB,kBAAkB,GAClB,qBAAqB,GACrB,0BAA0B,GAC1B,uBAAuB,GACvB,wBAAwB,GACxB,uBAAuB,GACvB,wBAAwB,GACxB,sBAAsB,GACtB,qBAAqB,GACrB,sBAAsB,GACtB,uBAAuB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapter/types/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vertex-formats.d.ts","sourceRoot":"","sources":["../../../src/adapter/types/vertex-formats.ts"],"names":[],"mappings":"AAIA,kFAAkF;AAClF,MAAM,MAAM,QAAQ,GAChB,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,SAAS,CAAC;AAEd,+DAA+D;AAC/D,MAAM,MAAM,kBAAkB,GAC1B,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,SAAS,GACT,QAAQ,GACR,QAAQ,GAIR,SAAS,GACT,SAAS,CAAC;AAEd,2EAA2E;AAC3E,MAAM,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAEpB,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,cAAc,GACd,UAAU,GACV,gBAAgB,GAChB,UAAU,GACV,cAAc,GACd,UAAU,GACV,gBAAgB,GAChB,UAAU,GAEV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GAEX,QAAQ,GACR,UAAU,GACV,UAAU,GACV,UAAU,GACV,QAAQ,GACR,UAAU,GACV,UAAU,GACV,UAAU,GAWV,WAAW,GACX,WAAW,GACX,SAAS,GACT,WAAW,GACX,WAAW,GACX,WAAW,CAAC"}
|
package/dist/init.d.ts
DELETED
package/dist/init.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAQA,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,IAAI,EAAE,GAAG,CAAC;CACf;AAyCD,eAAO,MAAM,OAAO,QAAmB,CAAC"}
|
package/dist/init.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// luma.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { isBrowser } from '@probe.gl/env';
|
|
5
|
-
import { log } from "./utils/log.js";
|
|
6
|
-
import { lumaStats } from "./utils/stats-manager.js";
|
|
7
|
-
/**
|
|
8
|
-
* By adding the result of init() to Device.VERSION we guarantee it will be called
|
|
9
|
-
* @returns version
|
|
10
|
-
*/
|
|
11
|
-
function initializeLuma() {
|
|
12
|
-
// Version detection using babel plugin
|
|
13
|
-
// @ts-expect-error
|
|
14
|
-
const VERSION = typeof "9.0.17" !== 'undefined' ? "9.0.17" : 'running from source';
|
|
15
|
-
const STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering';
|
|
16
|
-
// Assign luma.log.level in console to control logging: \
|
|
17
|
-
// 0: none, 1: minimal, 2: verbose, 3: attribute/uniforms, 4: gl logs
|
|
18
|
-
// luma.log.break[], set to gl funcs, luma.log.profile[] set to model names`;
|
|
19
|
-
if (globalThis.luma && globalThis.luma.VERSION !== VERSION) {
|
|
20
|
-
throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${VERSION}`);
|
|
21
|
-
}
|
|
22
|
-
if (!globalThis.luma) {
|
|
23
|
-
if (isBrowser()) {
|
|
24
|
-
log.log(1, `${VERSION} - ${STARTUP_MESSAGE}`)();
|
|
25
|
-
}
|
|
26
|
-
globalThis.luma = globalThis.luma || {
|
|
27
|
-
VERSION,
|
|
28
|
-
version: VERSION,
|
|
29
|
-
log,
|
|
30
|
-
// A global stats object that various components can add information to
|
|
31
|
-
// E.g. see webgl/resource.js
|
|
32
|
-
stats: lumaStats
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return VERSION;
|
|
36
|
-
}
|
|
37
|
-
export const VERSION = initializeLuma();
|