@luma.gl/core 9.0.11 → 9.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +34 -0
- package/dist/adapter/canvas-context.d.ts +5 -0
- package/dist/adapter/canvas-context.d.ts.map +1 -1
- package/dist/adapter/device.d.ts +10 -8
- package/dist/adapter/device.d.ts.map +1 -1
- package/dist/adapter/device.js +20 -18
- package/dist/{lib → adapter}/luma.d.ts +2 -2
- package/dist/adapter/luma.d.ts.map +1 -0
- package/dist/{lib → adapter}/luma.js +7 -7
- 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 +111 -49
- package/dist/adapter/resources/texture.d.ts.map +1 -1
- package/dist/adapter/resources/texture.js +96 -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} +5 -16
- 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 +2 -6
- package/dist/adapter/types/parameters.d.ts.map +1 -1
- 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 +266 -588
- package/dist/dist.min.js +4 -4
- 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/{adapter/type-utils → gpu-type-utils}/decode-texture-format.d.ts +2 -2
- package/dist/gpu-type-utils/decode-texture-format.d.ts.map +1 -0
- 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 +1 -1
- 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 +190 -411
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +28 -42
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -36
- package/dist/init.js +1 -1
- 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 +4 -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 +2 -2
- 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/canvas-context.ts +6 -0
- package/src/adapter/device.ts +34 -31
- package/src/{lib → adapter}/luma.ts +9 -9
- 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 +226 -77
- 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} +8 -17
- package/src/adapter/types/buffer-layout.ts +1 -1
- package/src/adapter/types/parameters.ts +10 -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 +2 -2
- package/src/{adapter/type-utils → gpu-type-utils}/decode-vertex-format.ts +1 -1
- package/src/{adapter/types → gpu-type-utils}/texture-formats.ts +1 -1
- 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 +69 -84
- 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 +14 -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 +4 -4
- 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.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/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.map +0 -1
- 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/lib/compiler-log/get-shader-info.ts +0 -42
- 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-texture-format.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/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export { VERSION } from "./init.js";
|
|
2
|
-
export
|
|
3
|
-
export type { TypedArray, TypedArrayConstructor, NumberArray, BigIntOrNumberArray } from "./types.js";
|
|
4
|
-
export { isTypedArray, isNumberArray } from "./utils/is-array.js";
|
|
5
|
-
export { luma } from "./lib/luma.js";
|
|
2
|
+
export { luma } from "./adapter/luma.js";
|
|
6
3
|
export type { DeviceProps, DeviceInfo, DeviceFeature } from "./adapter/device.js";
|
|
7
4
|
export { Device, DeviceFeatures, DeviceLimits } from "./adapter/device.js";
|
|
8
5
|
export type { CanvasContextProps } from "./adapter/canvas-context.js";
|
|
@@ -11,7 +8,7 @@ export type { ResourceProps } from "./adapter/resources/resource.js";
|
|
|
11
8
|
export { Resource } from "./adapter/resources/resource.js";
|
|
12
9
|
export type { BufferProps } from "./adapter/resources/buffer.js";
|
|
13
10
|
export { Buffer } from "./adapter/resources/buffer.js";
|
|
14
|
-
export type { TextureProps
|
|
11
|
+
export type { TextureProps } from "./adapter/resources/texture.js";
|
|
15
12
|
export { Texture } from "./adapter/resources/texture.js";
|
|
16
13
|
export type { TextureViewProps } from "./adapter/resources/texture-view.js";
|
|
17
14
|
export { TextureView } from "./adapter/resources/texture-view.js";
|
|
@@ -41,46 +38,35 @@ export type { TransformFeedbackProps, BufferRange } from "./adapter/resources/tr
|
|
|
41
38
|
export { TransformFeedback } from "./adapter/resources/transform-feedback.js";
|
|
42
39
|
export type { QuerySetProps } from "./adapter/resources/query-set.js";
|
|
43
40
|
export { QuerySet } from "./adapter/resources/query-set.js";
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
export
|
|
47
|
-
export type {
|
|
48
|
-
export type {
|
|
49
|
-
export type {
|
|
41
|
+
export { UniformBufferLayout } from "./portable/uniform-buffer-layout.js";
|
|
42
|
+
export { UniformBlock } from "./portable/uniform-block.js";
|
|
43
|
+
export { UniformStore } from "./portable/uniform-store.js";
|
|
44
|
+
export type { CompilerMessage } from "./adapter/types/compiler-message.js";
|
|
45
|
+
export type { TextureCompressionFormat, TextureCubeFace, TextureLevelData, ExternalImage, TextureData, Texture1DData, Texture2DData, Texture3DData, TextureCubeData, TextureArrayData, TextureCubeArrayData } from "./adapter/resources/texture.js";
|
|
46
|
+
export type { Parameters, PrimitiveTopology, IndexFormat } from "./adapter/types/parameters.js";
|
|
47
|
+
export type { CullMode, FrontFace, RasterizationParameters, CompareFunction, StencilOperation, DepthStencilParameters, BlendFactor, BlendOperation, ColorParameters, MultisampleParameters, RenderPassParameters, RenderPipelineParameters, PolygonMode, ProvokingVertex } from "./adapter/types/parameters.js";
|
|
48
|
+
export type { ColorAttachment, DepthStencilAttachment } from "./adapter/types/attachments.js";
|
|
50
49
|
export type { ShaderLayout, ComputeShaderLayout, AttributeDeclaration, BindingDeclaration, Binding } from "./adapter/types/shader-layout.js";
|
|
51
50
|
export type { BufferLayout, BufferAttributeLayout } from "./adapter/types/buffer-layout.js";
|
|
52
51
|
export type { AttributeBinding, UniformBinding, UniformBlockBinding, VaryingBinding } from "./adapter/types/shader-layout.js";
|
|
53
|
-
export type { UniformValue } from "./adapter/types/
|
|
54
|
-
export {
|
|
55
|
-
export {
|
|
56
|
-
export {
|
|
57
|
-
export {
|
|
58
|
-
export {
|
|
59
|
-
export {
|
|
60
|
-
export { decodeShaderUniformType } from "./
|
|
61
|
-
export { decodeShaderAttributeType } from "./
|
|
62
|
-
export
|
|
63
|
-
export {
|
|
64
|
-
export
|
|
65
|
-
export {
|
|
66
|
-
|
|
67
|
-
export { assert } from "./utils/assert.js";
|
|
68
|
-
export { cast } from "./utils/cast.js";
|
|
69
|
-
export { log } from "./utils/log.js";
|
|
70
|
-
export { uid, isObjectEmpty } from "./utils/utils.js";
|
|
71
|
-
export { isUniformValue, splitUniformsAndBindings } from "./lib/uniforms/uniform.js";
|
|
72
|
-
export { formatValue } from "./utils/format-value.js";
|
|
73
|
-
export { stubRemovedMethods } from "./utils/stub-methods.js";
|
|
74
|
-
export { checkProps } from "./utils/check-props.js";
|
|
75
|
-
export { setPathPrefix, loadFile, loadImage, loadImageBitmap, loadScript } from "./utils/load-file.js";
|
|
76
|
-
export { getScratchArrayBuffer, getScratchArray, fillArray } from "./utils/array-utils-flat.js";
|
|
77
|
-
export { makeRandomNumberGenerator, random } from "./utils/random.js";
|
|
78
|
-
export { deepEqual } from "./utils/deep-equal.js";
|
|
79
|
-
export { requestAnimationFrame, cancelAnimationFrame } from "./utils/request-animation-frame.js";
|
|
80
|
-
/**
|
|
81
|
-
* Marks GLSL shaders for syntax highlighting: glsl`...`
|
|
82
|
-
* Install https://marketplace.visualstudio.com/items?itemName=boyswan.glsl-literal
|
|
83
|
-
*/
|
|
52
|
+
export type { UniformValue } from "./adapter/types/uniforms.js";
|
|
53
|
+
export type { NumberArray } from "./types.js";
|
|
54
|
+
export type { VertexFormat, VertexType } from "./gpu-type-utils/vertex-formats.js";
|
|
55
|
+
export type { ShaderDataType, ShaderAttributeType, ShaderUniformType } from "./gpu-type-utils/shader-types.js";
|
|
56
|
+
export type { TextureFormat, ColorTextureFormat, DepthStencilTextureFormat } from "./gpu-type-utils/texture-formats.js";
|
|
57
|
+
export { decodeVertexFormat } from "./gpu-type-utils/decode-vertex-format.js";
|
|
58
|
+
export { decodeTextureFormat } from "./gpu-type-utils/decode-texture-format.js";
|
|
59
|
+
export { decodeShaderUniformType } from "./gpu-type-utils/decode-shader-types.js";
|
|
60
|
+
export { decodeShaderAttributeType } from "./gpu-type-utils/decode-attribute-type.js";
|
|
61
|
+
export { getDataTypeFromTypedArray } from "./gpu-type-utils/vertex-format-from-attribute.js";
|
|
62
|
+
export { getTypedArrayFromDataType } from "./gpu-type-utils/vertex-format-from-attribute.js";
|
|
63
|
+
export { getVertexFormatFromAttribute } from "./gpu-type-utils/vertex-format-from-attribute.js";
|
|
64
|
+
export type { StatsManager } from "./utils/stats-manager.js";
|
|
65
|
+
/** GLSL syntax highlighting: glsl`...` Install https://marketplace.visualstudio.com/items?itemName=boyswan.glsl-literal */
|
|
84
66
|
export declare const glsl: (x: TemplateStringsArray) => string;
|
|
85
67
|
export type { CopyBufferToBufferOptions, CopyBufferToTextureOptions, CopyTextureToBufferOptions, CopyTextureToTextureOptions } from "./adapter/resources/command-encoder.js";
|
|
68
|
+
export type { AttributeInfo } from "./adapter-utils/get-attribute-from-layouts.js";
|
|
69
|
+
export { getAttributeInfosFromLayouts } from "./adapter-utils/get-attribute-from-layouts.js";
|
|
70
|
+
export { getScratchArrayBuffer, getScratchArray } from "./utils/array-utils-flat.js";
|
|
71
|
+
export { log } from "./utils/log.js";
|
|
86
72
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,EAAC,kBAAe;AAG/B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,EAAC,kBAAe;AAG/B,OAAO,EAAC,IAAI,EAAC,0BAAuB;AAGpC,YAAY,EAAC,WAAW,EAAE,UAAU,EAAE,aAAa,EAAC,4BAAyB;AAC7E,OAAO,EAAC,MAAM,EAAE,cAAc,EAAE,YAAY,EAAC,4BAAyB;AAEtE,YAAY,EAAC,kBAAkB,EAAC,oCAAiC;AACjE,OAAO,EAAC,aAAa,EAAC,oCAAiC;AAGvD,YAAY,EAAC,aAAa,EAAC,wCAAqC;AAChE,OAAO,EAAC,QAAQ,EAAC,wCAAqC;AAEtD,YAAY,EAAC,WAAW,EAAC,sCAAmC;AAC5D,OAAO,EAAC,MAAM,EAAC,sCAAmC;AAElD,YAAY,EAAC,YAAY,EAAC,uCAAoC;AAC9D,OAAO,EAAC,OAAO,EAAC,uCAAoC;AAEpD,YAAY,EAAC,gBAAgB,EAAC,4CAAyC;AACvE,OAAO,EAAC,WAAW,EAAC,4CAAyC;AAE7D,YAAY,EAAC,oBAAoB,EAAC,gDAA6C;AAC/E,OAAO,EAAC,eAAe,EAAC,gDAA6C;AAErE,YAAY,EAAC,WAAW,EAAC,sCAAmC;AAC5D,OAAO,EAAC,MAAM,EA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AAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,EAC5B,+CAA4C;AAE7C,YAAY,EAAC,aAAa,EAAC,sDAAmD;AAC9E,OAAO,EAAC,4BAA4B,EAAC,sDAAmD;AACxF,OAAO,EAAC,qBAAqB,EAAE,eAAe,EAAC,oCAAiC;AAGhF,OAAO,EAAC,GAAG,EAAC,uBAAoB"}
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
export { VERSION } from "./init.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { luma } from "./lib/luma.js";
|
|
5
|
+
// MAIN API ACCESS POINT
|
|
6
|
+
export { luma } from "./adapter/luma.js";
|
|
8
7
|
export { Device, DeviceFeatures, DeviceLimits } from "./adapter/device.js";
|
|
9
8
|
export { CanvasContext } from "./adapter/canvas-context.js";
|
|
10
9
|
export { Resource } from "./adapter/resources/resource.js";
|
|
@@ -24,37 +23,21 @@ export { CommandBuffer } from "./adapter/resources/command-buffer.js";
|
|
|
24
23
|
export { VertexArray } from "./adapter/resources/vertex-array.js";
|
|
25
24
|
export { TransformFeedback } from "./adapter/resources/transform-feedback.js";
|
|
26
25
|
export { QuerySet } from "./adapter/resources/query-set.js";
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
38
|
-
export {
|
|
39
|
-
|
|
40
|
-
export { StatsManager } from "./utils/stats-manager.js";
|
|
41
|
-
export { assert } from "./utils/assert.js";
|
|
42
|
-
export { cast } from "./utils/cast.js";
|
|
43
|
-
export { log } from "./utils/log.js";
|
|
44
|
-
export { uid, isObjectEmpty } from "./utils/utils.js";
|
|
45
|
-
export { isUniformValue, splitUniformsAndBindings } from "./lib/uniforms/uniform.js";
|
|
46
|
-
export { formatValue } from "./utils/format-value.js";
|
|
47
|
-
export { stubRemovedMethods } from "./utils/stub-methods.js";
|
|
48
|
-
export { checkProps } from "./utils/check-props.js";
|
|
49
|
-
export { setPathPrefix, loadFile, loadImage, loadImageBitmap, loadScript } from "./utils/load-file.js";
|
|
50
|
-
export { getScratchArrayBuffer, getScratchArray, fillArray } from "./utils/array-utils-flat.js";
|
|
51
|
-
export { makeRandomNumberGenerator, random } from "./utils/random.js";
|
|
52
|
-
export { deepEqual } from "./utils/deep-equal.js";
|
|
53
|
-
// ENGINE - TODO/move to @luma.gl/engine once that module is webgl-independent?
|
|
54
|
-
export { requestAnimationFrame, cancelAnimationFrame } from "./utils/request-animation-frame.js";
|
|
55
|
-
// SHADER HELPERS
|
|
56
|
-
/**
|
|
57
|
-
* Marks GLSL shaders for syntax highlighting: glsl`...`
|
|
58
|
-
* Install https://marketplace.visualstudio.com/items?itemName=boyswan.glsl-literal
|
|
59
|
-
*/
|
|
26
|
+
// PORTABLE API - UNIFORM BUFFERS
|
|
27
|
+
export { UniformBufferLayout } from "./portable/uniform-buffer-layout.js";
|
|
28
|
+
export { UniformBlock } from "./portable/uniform-block.js";
|
|
29
|
+
export { UniformStore } from "./portable/uniform-store.js";
|
|
30
|
+
// GPU TYPE UTILS - GPU MEMORY LAYOUT HELPERS - CAN BE USED BY APPS BUT MOSTLY USED INTERNALLY
|
|
31
|
+
export { decodeVertexFormat } from "./gpu-type-utils/decode-vertex-format.js";
|
|
32
|
+
export { decodeTextureFormat } from "./gpu-type-utils/decode-texture-format.js";
|
|
33
|
+
export { decodeShaderUniformType } from "./gpu-type-utils/decode-shader-types.js";
|
|
34
|
+
export { decodeShaderAttributeType } from "./gpu-type-utils/decode-attribute-type.js";
|
|
35
|
+
export { getDataTypeFromTypedArray } from "./gpu-type-utils/vertex-format-from-attribute.js";
|
|
36
|
+
export { getTypedArrayFromDataType } from "./gpu-type-utils/vertex-format-from-attribute.js";
|
|
37
|
+
export { getVertexFormatFromAttribute } from "./gpu-type-utils/vertex-format-from-attribute.js";
|
|
38
|
+
/** GLSL syntax highlighting: glsl`...` Install https://marketplace.visualstudio.com/items?itemName=boyswan.glsl-literal */
|
|
60
39
|
export const glsl = (x) => `${x}`;
|
|
40
|
+
export { getAttributeInfosFromLayouts } from "./adapter-utils/get-attribute-from-layouts.js";
|
|
41
|
+
export { getScratchArrayBuffer, getScratchArray } from "./utils/array-utils-flat.js";
|
|
42
|
+
// INTERNAL UTILS - for use in other luma.gl modules only
|
|
43
|
+
export { log } from "./utils/log.js";
|
package/dist/init.js
CHANGED
|
@@ -11,7 +11,7 @@ import { lumaStats } from "./utils/stats-manager.js";
|
|
|
11
11
|
function initializeLuma() {
|
|
12
12
|
// Version detection using babel plugin
|
|
13
13
|
// @ts-expect-error
|
|
14
|
-
const VERSION = typeof "9.0.
|
|
14
|
+
const VERSION = typeof "9.1.0-alpha.1" !== 'undefined' ? "9.1.0-alpha.1" : 'running from source';
|
|
15
15
|
const STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering';
|
|
16
16
|
// Assign luma.log.level in console to control logging: \
|
|
17
17
|
// 0: none, 1: minimal, 2: verbose, 3: attribute/uniforms, 4: gl logs
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ShaderUniformType } from "
|
|
2
|
-
import type { UniformValue } from "
|
|
3
|
-
import { ShaderLayout, UniformInfo } from "
|
|
1
|
+
import type { ShaderUniformType } from "../gpu-type-utils/shader-types.js";
|
|
2
|
+
import type { UniformValue } from "../adapter/types/uniforms.js";
|
|
3
|
+
import { ShaderLayout, UniformInfo } from "../adapter/types/shader-layout.js";
|
|
4
4
|
/**
|
|
5
5
|
* A uniform block holds values of the of uniform values for one uniform block / buffer.
|
|
6
6
|
* It also does some book keeping on what has changed, to minimize unnecessary writes to uniform buffers.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniform-block.d.ts","sourceRoot":"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qual, arrayCopy } from "
|
|
4
|
+
import { arrayEqual, arrayCopy } from "../utils/array-equal.js";
|
|
5
5
|
/**
|
|
6
6
|
* A uniform block holds values of the of uniform values for one uniform block / buffer.
|
|
7
7
|
* It also does some book keeping on what has changed, to minimize unnecessary writes to uniform buffers.
|
|
@@ -14,7 +14,7 @@ export class UniformBlock {
|
|
|
14
14
|
bindingLayout = {};
|
|
15
15
|
needsRedraw = 'initialized';
|
|
16
16
|
constructor(props) {
|
|
17
|
-
this.name = props?.name;
|
|
17
|
+
this.name = props?.name || 'unnamed';
|
|
18
18
|
// TODO - Extract uniform layout from the shaderLayout object
|
|
19
19
|
if (props?.name && props?.shaderLayout) {
|
|
20
20
|
const binding = props?.shaderLayout.bindings?.find(binding => binding.type === 'uniform' && binding.name === props?.name);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ShaderUniformType, ShaderDataType } from "
|
|
2
|
-
import type { UniformValue } from "
|
|
1
|
+
import type { ShaderUniformType, ShaderDataType } from "../gpu-type-utils/shader-types.js";
|
|
2
|
+
import type { UniformValue } from "../adapter/types/uniforms.js";
|
|
3
3
|
/**
|
|
4
4
|
* Std140 layout for uniform buffers
|
|
5
5
|
* Supports manual listing of uniforms
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniform-buffer-layout.d.ts","sourceRoot":"","sources":["../../src/portable/uniform-buffer-layout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,iBAAiB,EAAE,cAAc,EAAC,0CAAuC;AAGtF,OAAO,KAAK,EAAC,YAAY,EAAC,qCAAkC;AAW5D;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,cAAc,CAAA;KAAC,CAAC,CAAM;IAE3F,mDAAmD;IACnD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,kEAAkE;gBACtD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAsB3D,2CAA2C;IAC3C,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,UAAU;IAoDhE,wDAAwD;IACxD,GAAG,CAAC,IAAI,EAAE,MAAM;IAIhB,0DAA0D;IAC1D,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAG,SAAS;CAI9D"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { decodeShaderUniformType, alignTo } from "
|
|
5
|
-
import { getScratchArrayBuffer } from "
|
|
6
|
-
import { isNumberArray } from "
|
|
7
|
-
import { log } from "
|
|
4
|
+
import { decodeShaderUniformType, alignTo } from "../gpu-type-utils/decode-shader-types.js";
|
|
5
|
+
import { getScratchArrayBuffer } from "../utils/array-utils-flat.js";
|
|
6
|
+
import { isNumberArray } from "../utils/is-array.js";
|
|
7
|
+
import { log } from "../utils/log.js";
|
|
8
8
|
/**
|
|
9
9
|
* Smallest buffer size that can be used for uniform buffers.
|
|
10
10
|
* TODO - does this depend on device?
|
|
@@ -71,15 +71,14 @@ export class UniformBufferLayout {
|
|
|
71
71
|
typedArray[offset] = Number(value);
|
|
72
72
|
}
|
|
73
73
|
else {
|
|
74
|
-
|
|
75
|
-
if (!numericArray) {
|
|
74
|
+
if (!isNumberArray(value)) {
|
|
76
75
|
log.warn(`Supplied value for multi component / array uniform ${name} is not a numeric array: ${value}`)();
|
|
77
76
|
// eslint-disable-next-line no-continue
|
|
78
77
|
continue;
|
|
79
78
|
}
|
|
80
79
|
// vector/matrix -> copy the supplied (typed) array, starting from offset
|
|
81
80
|
// TODO: we should limit or check size in case the supplied data overflows
|
|
82
|
-
typedArray.set(
|
|
81
|
+
typedArray.set(value, offset);
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
84
|
return new Uint8Array(arrayBuffer);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ShaderUniformType } from "
|
|
2
|
-
import type { UniformValue } from "
|
|
3
|
-
import type { Device } from "
|
|
4
|
-
import { Buffer } from "
|
|
1
|
+
import type { ShaderUniformType } from "../gpu-type-utils/shader-types.js";
|
|
2
|
+
import type { UniformValue } from "../adapter/types/uniforms.js";
|
|
3
|
+
import type { Device } from "../adapter/device.js";
|
|
4
|
+
import { Buffer } from "../adapter/resources/buffer.js";
|
|
5
5
|
import { UniformBlock } from "./uniform-block.js";
|
|
6
6
|
import { UniformBufferLayout } from "./uniform-buffer-layout.js";
|
|
7
7
|
export type ShaderModuleInputs = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniform-store.d.ts","sourceRoot":"","sources":["../../src/portable/uniform-store.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,iBAAiB,EAAC,0CAAuC;AACtE,OAAO,KAAK,EAAC,YAAY,EAAC,qCAAkC;AAC5D,OAAO,KAAK,EAAC,MAAM,EAAC,6BAA0B;AAC9C,OAAO,EAAC,MAAM,EAAC,uCAAoC;AAEnD,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAC7C,OAAO,EAAC,mBAAmB,EAAC,mCAAgC;AAE5D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CAChD,CAAC;AAEF;;;;;;GAMG;AACH,qBAAa,YAAY,CACvB,WAAW,SAAS,MAAM,CAAC,MAA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AYtC,qEAAqE;IACrE,mBAAmB,CAAC,iBAAiB,EAAE,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM;CAwB1E"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { Buffer } from "
|
|
4
|
+
import { Buffer } from "../adapter/resources/buffer.js";
|
|
5
|
+
import { log } from "../utils/log.js";
|
|
5
6
|
import { UniformBlock } from "./uniform-block.js";
|
|
6
7
|
import { UniformBufferLayout } from "./uniform-buffer-layout.js";
|
|
7
|
-
import { log } from "../../utils/log.js";
|
|
8
8
|
/**
|
|
9
9
|
* A uniform store holds a uniform values for one or more uniform blocks,
|
|
10
10
|
* - It can generate binary data for any uniform buffer
|
|
@@ -47,7 +47,7 @@ export class UniformStore {
|
|
|
47
47
|
*/
|
|
48
48
|
setUniforms(uniforms) {
|
|
49
49
|
for (const [blockName, uniformValues] of Object.entries(uniforms)) {
|
|
50
|
-
this.uniformBlocks.get(blockName)
|
|
50
|
+
this.uniformBlocks.get(blockName)?.setUniforms(uniformValues);
|
|
51
51
|
// We leverage logging in updateUniformBuffers(), even though slightly less efficient
|
|
52
52
|
// this.updateUniformBuffer(blockName);
|
|
53
53
|
}
|
|
@@ -55,12 +55,13 @@ export class UniformStore {
|
|
|
55
55
|
}
|
|
56
56
|
/** Get the required minimum length of the uniform buffer */
|
|
57
57
|
getUniformBufferByteLength(uniformBufferName) {
|
|
58
|
-
return this.uniformBufferLayouts.get(uniformBufferName)
|
|
58
|
+
return this.uniformBufferLayouts.get(uniformBufferName)?.byteLength || 0;
|
|
59
59
|
}
|
|
60
60
|
/** Get formatted binary memory that can be uploaded to a buffer */
|
|
61
61
|
getUniformBufferData(uniformBufferName) {
|
|
62
|
-
const uniformValues = this.uniformBlocks.get(uniformBufferName)
|
|
63
|
-
|
|
62
|
+
const uniformValues = this.uniformBlocks.get(uniformBufferName)?.getAllUniforms() || {};
|
|
63
|
+
// @ts-ignore
|
|
64
|
+
return this.uniformBufferLayouts.get(uniformBufferName)?.getData(uniformValues);
|
|
64
65
|
}
|
|
65
66
|
/**
|
|
66
67
|
* Creates an unmanaged uniform buffer (umnanaged means that application is responsible for destroying it)
|
|
@@ -91,6 +92,7 @@ export class UniformStore {
|
|
|
91
92
|
this.uniformBuffers.set(uniformBufferName, uniformBuffer);
|
|
92
93
|
}
|
|
93
94
|
// this.updateUniformBuffers();
|
|
95
|
+
// @ts-ignore
|
|
94
96
|
return this.uniformBuffers.get(uniformBufferName);
|
|
95
97
|
}
|
|
96
98
|
/** Updates all uniform buffers where values have changed */
|
|
@@ -110,14 +112,14 @@ export class UniformStore {
|
|
|
110
112
|
const uniformBlock = this.uniformBlocks.get(uniformBufferName);
|
|
111
113
|
const uniformBuffer = this.uniformBuffers.get(uniformBufferName);
|
|
112
114
|
let reason = false;
|
|
113
|
-
if (uniformBuffer && uniformBlock
|
|
115
|
+
if (uniformBuffer && uniformBlock?.needsRedraw) {
|
|
114
116
|
reason ||= uniformBlock.needsRedraw;
|
|
115
117
|
// This clears the needs redraw flag
|
|
116
118
|
const uniformBufferData = this.getUniformBufferData(uniformBufferName);
|
|
117
119
|
const uniformBuffer = this.uniformBuffers.get(uniformBufferName);
|
|
118
|
-
uniformBuffer
|
|
120
|
+
uniformBuffer?.write(uniformBufferData);
|
|
119
121
|
// logging - TODO - don't query the values unnecessarily
|
|
120
|
-
const uniformValues = this.uniformBlocks.get(uniformBufferName)
|
|
122
|
+
const uniformValues = this.uniformBlocks.get(uniformBufferName)?.getAllUniforms();
|
|
121
123
|
log.log(4, `Writing to uniform buffer ${String(uniformBufferName)}`, uniformBufferData, uniformValues)();
|
|
122
124
|
}
|
|
123
125
|
return reason;
|
package/dist/types.d.ts
CHANGED
|
@@ -6,14 +6,4 @@ export type TypedArrayConstructor = Int8ArrayConstructor | Uint8ArrayConstructor
|
|
|
6
6
|
/** Keep big int arrays separate as they are still problematic, can't be indexed and don't work well on Safari */
|
|
7
7
|
export type BigIntTypedArray = BigInt64Array | BigUint64Array;
|
|
8
8
|
export type BigIntOrNumberArray = NumberArray | BigIntTypedArray;
|
|
9
|
-
/** Get the constructor type of a type */
|
|
10
|
-
export interface ConstructorOf<T> {
|
|
11
|
-
new (...args: unknown[]): T;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Make specific fields in a type optional. Granular version of `Partial<T>`
|
|
15
|
-
* @example
|
|
16
|
-
* type PartialProps = PartialBy<Required<DeviceProps>, 'device' | 'canvas'>
|
|
17
|
-
*/
|
|
18
|
-
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
19
9
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,gDAAgD;AAChD,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,CAAC;AAEjC,uEAAuE;AACvE,MAAM,MAAM,qBAAqB,GAC7B,oBAAoB,GACpB,qBAAqB,GACrB,qBAAqB,GACrB,sBAAsB,GACtB,qBAAqB,GACrB,sBAAsB,GACtB,4BAA4B,GAC5B,uBAAuB,GACvB,uBAAuB,CAAC;AAE5B,iHAAiH;AACjH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,cAAc,CAAC;AAE9D,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,gBAAgB,CAAC
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,gDAAgD;AAChD,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,CAAC;AAEjC,uEAAuE;AACvE,MAAM,MAAM,qBAAqB,GAC7B,oBAAoB,GACpB,qBAAqB,GACrB,qBAAqB,GACrB,sBAAsB,GACtB,qBAAqB,GACrB,sBAAsB,GACtB,4BAA4B,GAC5B,uBAAuB,GACvB,uBAAuB,CAAC;AAE5B,iHAAiH;AACjH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,cAAc,CAAC;AAE9D,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-equal.d.ts","sourceRoot":"","sources":["../../src/utils/array-equal.ts"],"names":[],"mappings":"AAMA,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,GAAE,MAAW,WAiBpE;AAED,mBAAmB;AACnB,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"array-equal.d.ts","sourceRoot":"","sources":["../../src/utils/array-equal.ts"],"names":[],"mappings":"AAMA,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,GAAE,MAAW,WAiBpE;AAED,mBAAmB;AACnB,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAKpC"}
|
|
@@ -7,12 +7,12 @@ export function arrayEqual(a, b, limit = 16) {
|
|
|
7
7
|
if (a !== b) {
|
|
8
8
|
return false;
|
|
9
9
|
}
|
|
10
|
-
const arrayA =
|
|
11
|
-
|
|
10
|
+
const arrayA = a;
|
|
11
|
+
const arrayB = b;
|
|
12
|
+
if (!isNumberArray(arrayA)) {
|
|
12
13
|
return false;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
if (arrayB && arrayA.length === arrayB.length) {
|
|
15
|
+
if (isNumberArray(arrayB) && arrayA.length === arrayB.length) {
|
|
16
16
|
for (let i = 0; i < arrayA.length; ++i) {
|
|
17
17
|
if (arrayB[i] !== arrayA[i]) {
|
|
18
18
|
return false;
|
|
@@ -23,9 +23,8 @@ export function arrayEqual(a, b, limit = 16) {
|
|
|
23
23
|
}
|
|
24
24
|
/** Copy a value */
|
|
25
25
|
export function arrayCopy(a) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return numberArray.slice();
|
|
26
|
+
if (isNumberArray(a)) {
|
|
27
|
+
return a.slice();
|
|
29
28
|
}
|
|
30
29
|
return a;
|
|
31
30
|
}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import type { TypedArray
|
|
1
|
+
import type { TypedArray } from "../types.js";
|
|
2
2
|
export declare function getScratchArrayBuffer(byteLength: number): ArrayBuffer;
|
|
3
3
|
export declare function getScratchArray(Type: any, length: number): TypedArray;
|
|
4
|
-
export declare function fillArray(options: {
|
|
5
|
-
target: NumberArray;
|
|
6
|
-
source: NumberArray;
|
|
7
|
-
start?: number;
|
|
8
|
-
count?: number;
|
|
9
|
-
}): NumberArray;
|
|
10
4
|
//# sourceMappingURL=array-utils-flat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-utils-flat.d.ts","sourceRoot":"","sources":["../../src/utils/array-utils-flat.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"array-utils-flat.d.ts","sourceRoot":"","sources":["../../src/utils/array-utils-flat.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAC,oBAAiB;AAIzC,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAKrE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAGrE"}
|
|
@@ -12,26 +12,3 @@ export function getScratchArray(Type, length) {
|
|
|
12
12
|
const scratchArrayBuffer = getScratchArrayBuffer(Type.BYTES_PER_ELEMENT * length);
|
|
13
13
|
return new Type(scratchArrayBuffer, 0, length); // arrayBuffer, byteOffset, length (in elements)
|
|
14
14
|
}
|
|
15
|
-
// Uses copyWithin to significantly speed up typed array value filling
|
|
16
|
-
export function fillArray(options) {
|
|
17
|
-
const { target, source, start = 0, count = 1 } = options;
|
|
18
|
-
const length = source.length;
|
|
19
|
-
const total = count * length;
|
|
20
|
-
let copied = 0;
|
|
21
|
-
for (let i = start; copied < length; copied++) {
|
|
22
|
-
target[i++] = source[copied];
|
|
23
|
-
}
|
|
24
|
-
while (copied < total) {
|
|
25
|
-
// If we have copied less than half, copy everything we got
|
|
26
|
-
// else copy remaining in one operation
|
|
27
|
-
if (copied < total - copied) {
|
|
28
|
-
target.copyWithin(start + copied, start, start + copied);
|
|
29
|
-
copied *= 2;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
target.copyWithin(start + copied, start, start + total - copied);
|
|
33
|
-
copied = total;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return options.target;
|
|
37
|
-
}
|
package/dist/utils/is-array.d.ts
CHANGED
|
@@ -5,12 +5,12 @@ import { TypedArray, NumberArray } from "../types.js";
|
|
|
5
5
|
* @returns input as TypedArray, or null
|
|
6
6
|
* @todo this should be provided by @math.gl/types
|
|
7
7
|
*/
|
|
8
|
-
export declare function isTypedArray(value: unknown):
|
|
8
|
+
export declare function isTypedArray(value: unknown): value is TypedArray;
|
|
9
9
|
/**
|
|
10
10
|
* Check is an array is a numeric array (typed array or array of numbers)
|
|
11
11
|
* @param value value to be tested
|
|
12
12
|
* @returns input as NumberArray, or null
|
|
13
13
|
* @todo this should be provided by @math.gl/types
|
|
14
14
|
*/
|
|
15
|
-
export declare function isNumberArray(value: unknown):
|
|
15
|
+
export declare function isNumberArray(value: unknown): value is NumberArray;
|
|
16
16
|
//# sourceMappingURL=is-array.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-array.d.ts","sourceRoot":"","sources":["../../src/utils/is-array.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,oBAAiB;AAEjD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"is-array.d.ts","sourceRoot":"","sources":["../../src/utils/is-array.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,oBAAiB;AAEjD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAKlE"}
|
package/dist/utils/is-array.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @todo this should be provided by @math.gl/types
|
|
9
9
|
*/
|
|
10
10
|
export function isTypedArray(value) {
|
|
11
|
-
return ArrayBuffer.isView(value) && !(value instanceof DataView)
|
|
11
|
+
return ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Check is an array is a numeric array (typed array or array of numbers)
|
|
@@ -18,7 +18,7 @@ export function isTypedArray(value) {
|
|
|
18
18
|
*/
|
|
19
19
|
export function isNumberArray(value) {
|
|
20
20
|
if (Array.isArray(value)) {
|
|
21
|
-
return value.length === 0 || typeof value[0] === 'number'
|
|
21
|
+
return value.length === 0 || typeof value[0] === 'number';
|
|
22
22
|
}
|
|
23
23
|
return isTypedArray(value);
|
|
24
24
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uid.d.ts","sourceRoot":"","sources":["../../src/utils/uid.ts"],"names":[],"mappings":"AAMA;;;;IAII;AACJ,wBAAgB,GAAG,CAAC,EAAE,GAAE,MAAa,GAAG,MAAM,CAI7C"}
|
|
@@ -12,14 +12,3 @@ export function uid(id = 'id') {
|
|
|
12
12
|
const count = uidCounters[id]++;
|
|
13
13
|
return `${id}-${count}`;
|
|
14
14
|
}
|
|
15
|
-
/** Returns true if given object is empty, false otherwise. */
|
|
16
|
-
export function isObjectEmpty(obj) {
|
|
17
|
-
let isEmpty = true;
|
|
18
|
-
// @ts-ignore key is unused
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
-
for (const key in obj) {
|
|
21
|
-
isEmpty = false;
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
return isEmpty;
|
|
25
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/core",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.1.0-alpha.1",
|
|
4
4
|
"description": "The luma.gl core Device API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@math.gl/types": "^4.0.0",
|
|
44
|
-
"@probe.gl/env": "^4.0.
|
|
45
|
-
"@probe.gl/log": "^4.0.
|
|
46
|
-
"@probe.gl/stats": "^4.0.
|
|
44
|
+
"@probe.gl/env": "^4.0.8",
|
|
45
|
+
"@probe.gl/log": "^4.0.8",
|
|
46
|
+
"@probe.gl/stats": "^4.0.8",
|
|
47
47
|
"@types/offscreencanvas": "^2019.6.4"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "bc5c11c87f1e4db857e701688ca1410d7f51fd0f"
|
|
50
50
|
}
|
|
@@ -6,6 +6,7 @@ import {isBrowser} from '@probe.gl/env';
|
|
|
6
6
|
import type {Device} from './device';
|
|
7
7
|
import type {Framebuffer} from './resources/framebuffer';
|
|
8
8
|
import {log} from '../utils/log';
|
|
9
|
+
import type {TextureFormat} from '../gpu-type-utils/texture-formats';
|
|
9
10
|
|
|
10
11
|
const isPage: boolean = isBrowser() && typeof document !== 'undefined';
|
|
11
12
|
const isPageLoaded: () => boolean = () => isPage && document.readyState === 'complete';
|
|
@@ -60,6 +61,11 @@ export abstract class CanvasContext {
|
|
|
60
61
|
readonly offscreenCanvas?: OffscreenCanvas;
|
|
61
62
|
readonly type: 'html-canvas' | 'offscreen-canvas' | 'node';
|
|
62
63
|
|
|
64
|
+
/** Format of returned textures: "bgra8unorm", "rgba8unorm" */
|
|
65
|
+
abstract readonly format: TextureFormat;
|
|
66
|
+
/** Default stencil format for depth textures */
|
|
67
|
+
abstract readonly depthStencilFormat: TextureFormat;
|
|
68
|
+
|
|
63
69
|
width: number = 1;
|
|
64
70
|
height: number = 1;
|
|
65
71
|
|