@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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import type {Device} from '../device';
|
|
6
6
|
import type {Texture} from './texture';
|
|
7
|
-
import type {TextureFormat} from '
|
|
7
|
+
import type {TextureFormat} from '../../gpu-type-utils/texture-formats';
|
|
8
8
|
import {Resource, ResourceProps} from './resource';
|
|
9
9
|
|
|
10
10
|
/** Properties for initializing a texture view */
|
|
@@ -29,13 +29,13 @@ export type TextureViewProps = ResourceProps & {
|
|
|
29
29
|
export abstract class TextureView extends Resource<TextureViewProps> {
|
|
30
30
|
static override defaultProps: Required<TextureViewProps> = {
|
|
31
31
|
...Resource.defaultProps,
|
|
32
|
-
format: undefined
|
|
33
|
-
dimension: undefined
|
|
32
|
+
format: undefined!,
|
|
33
|
+
dimension: undefined!,
|
|
34
34
|
aspect: 'all',
|
|
35
35
|
baseMipLevel: 0,
|
|
36
|
-
mipLevelCount: undefined
|
|
36
|
+
mipLevelCount: undefined!,
|
|
37
37
|
baseArrayLayer: 0,
|
|
38
|
-
arrayLayerCount: undefined
|
|
38
|
+
arrayLayerCount: undefined!
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
abstract texture: Texture;
|
|
@@ -4,81 +4,138 @@
|
|
|
4
4
|
|
|
5
5
|
import type {Device} from '../device';
|
|
6
6
|
import type {TypedArray} from '../../types';
|
|
7
|
-
import type {TextureFormat} from '
|
|
7
|
+
import type {TextureFormat} from '../../gpu-type-utils/texture-formats';
|
|
8
|
+
import type {TextureView, TextureViewProps} from './texture-view';
|
|
8
9
|
import {Resource, ResourceProps} from './resource';
|
|
9
10
|
import {Sampler, SamplerProps} from './sampler';
|
|
10
|
-
import {TextureView, TextureViewProps} from './texture-view';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
/**
|
|
13
|
+
* These represent the main compressed texture formats
|
|
14
|
+
* Each format typically has a number of more specific subformats
|
|
15
|
+
*/
|
|
16
|
+
export type TextureCompressionFormat =
|
|
17
|
+
| 'dxt'
|
|
18
|
+
| 'dxt-srgb'
|
|
19
|
+
| 'etc1'
|
|
20
|
+
| 'etc2'
|
|
21
|
+
| 'pvrtc'
|
|
22
|
+
| 'atc'
|
|
23
|
+
| 'astc'
|
|
24
|
+
| 'rgtc';
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
/** Names of cube texture faces */
|
|
27
|
+
export type TextureCubeFace = '+X' | '-X' | '+Y' | '-Y' | '+Z' | '-Z';
|
|
25
28
|
|
|
26
|
-
/**
|
|
27
|
-
|
|
29
|
+
/**
|
|
30
|
+
* One mip level
|
|
31
|
+
* Basic data structure is similar to `ImageData`
|
|
32
|
+
* additional optional fields can describe compressed texture data.
|
|
33
|
+
*/
|
|
34
|
+
export type TextureLevelData = {
|
|
35
|
+
/** WebGPU style format string. Defaults to 'rgba8unorm' */
|
|
28
36
|
format?: TextureFormat;
|
|
29
|
-
|
|
30
|
-
width?: number | undefined;
|
|
31
|
-
height?: number | undefined;
|
|
32
|
-
depth?: number;
|
|
33
|
-
usage?: number;
|
|
34
|
-
|
|
35
|
-
data?: TextureData | Promise<TextureData> | CubeTextureData | string | HTMLVideoElement | null;
|
|
36
|
-
mipmaps?: boolean;
|
|
37
|
-
|
|
38
|
-
mipLevels?: number;
|
|
39
|
-
samples?: number;
|
|
40
|
-
type?: number;
|
|
41
|
-
compressed?: boolean;
|
|
42
|
-
|
|
43
|
-
sampler?: Sampler | SamplerProps;
|
|
44
|
-
view?: TextureViewProps;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export type WebGPUTextureProps = ResourceProps & {
|
|
37
|
+
data: TypedArray;
|
|
48
38
|
width: number;
|
|
49
39
|
height: number;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
|
|
41
|
+
compressed?: boolean;
|
|
42
|
+
byteLength?: number;
|
|
43
|
+
hasAlpha?: boolean;
|
|
53
44
|
};
|
|
54
45
|
|
|
55
46
|
/**
|
|
56
|
-
*
|
|
57
|
-
* @
|
|
47
|
+
* Built-in data types that can be used to initialize textures
|
|
48
|
+
* @note WebGL supports OffscreenCanvas but seems WebGPU does not?
|
|
58
49
|
*/
|
|
59
|
-
export type
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
50
|
+
export type ExternalImage =
|
|
51
|
+
| ImageData
|
|
52
|
+
| ImageBitmap
|
|
53
|
+
| HTMLImageElement
|
|
54
|
+
| HTMLVideoElement
|
|
55
|
+
| HTMLCanvasElement;
|
|
56
|
+
|
|
57
|
+
export type TextureLevelSource = TextureLevelData | ExternalImage;
|
|
58
|
+
|
|
59
|
+
/** Texture data can be one or more mip levels */
|
|
60
|
+
export type TextureData = TextureLevelData | ExternalImage | (TextureLevelData | ExternalImage)[];
|
|
61
|
+
|
|
62
|
+
/** @todo - define what data type is supported for 1D textures */
|
|
63
|
+
export type Texture1DData = TypedArray | TextureLevelData;
|
|
64
|
+
|
|
65
|
+
/** Texture data can be one or more mip levels */
|
|
66
|
+
export type Texture2DData =
|
|
67
|
+
| TypedArray
|
|
68
|
+
| TextureLevelData
|
|
69
|
+
| ExternalImage
|
|
70
|
+
| (TextureLevelData | ExternalImage)[];
|
|
71
|
+
|
|
72
|
+
/** Array of textures */
|
|
73
|
+
export type Texture3DData = TypedArray | TextureData[];
|
|
74
|
+
|
|
75
|
+
/** 6 face textures */
|
|
76
|
+
export type TextureCubeData = Record<TextureCubeFace, Texture2DData>;
|
|
77
|
+
|
|
78
|
+
/** Array of textures */
|
|
79
|
+
export type TextureArrayData = TextureData[];
|
|
80
|
+
|
|
81
|
+
/** Array of 6 face textures */
|
|
82
|
+
export type TextureCubeArrayData = Record<TextureCubeFace, TextureData>[];
|
|
83
|
+
|
|
84
|
+
type TextureDataProps =
|
|
85
|
+
| Texture1DProps
|
|
86
|
+
| Texture2DProps
|
|
87
|
+
| Texture3DProps
|
|
88
|
+
| TextureArrayProps
|
|
89
|
+
| TextureCubeProps
|
|
90
|
+
| TextureCubeArrayProps;
|
|
91
|
+
|
|
92
|
+
type Texture1DProps = {dimension: '1d'; data?: Texture1DData | null};
|
|
93
|
+
type Texture2DProps = {dimension?: '2d'; data?: Texture2DData | null};
|
|
94
|
+
type Texture3DProps = {dimension: '3d'; data?: Texture3DData | null};
|
|
95
|
+
type TextureArrayProps = {dimension: '2d-array'; data?: TextureArrayData | null};
|
|
96
|
+
type TextureCubeProps = {dimension: 'cube'; data?: TextureCubeData | null};
|
|
97
|
+
type TextureCubeArrayProps = {dimension: 'cube-array'; data: TextureCubeArrayData | null};
|
|
98
|
+
|
|
99
|
+
/** Texture properties */
|
|
100
|
+
export type TextureProps = ResourceProps &
|
|
101
|
+
TextureDataProps & {
|
|
102
|
+
format?: TextureFormat;
|
|
103
|
+
width?: number | undefined;
|
|
104
|
+
height?: number | undefined;
|
|
105
|
+
depth?: number;
|
|
106
|
+
usage?: number;
|
|
107
|
+
|
|
108
|
+
/** How many mip levels */
|
|
109
|
+
mipLevels?: number | 'pyramid';
|
|
110
|
+
/** Multi sampling */
|
|
111
|
+
samples?: number;
|
|
112
|
+
|
|
113
|
+
/** Specifying mipmaps will default mipLevels to 'pyramid' and attempt to generate mipmaps */
|
|
114
|
+
mipmaps?: boolean;
|
|
115
|
+
|
|
116
|
+
/** Sampler (or SamplerProps) for the default sampler for this texture. Used if no sampler provided. Note that other samplers can still be used. */
|
|
117
|
+
sampler?: Sampler | SamplerProps;
|
|
118
|
+
/** Props for the default TextureView for this texture. Note that other views can still be created and used. */
|
|
119
|
+
view?: TextureViewProps;
|
|
120
|
+
|
|
121
|
+
/** @deprecated - this is implicit from format */
|
|
122
|
+
compressed?: boolean;
|
|
123
|
+
};
|
|
75
124
|
|
|
76
125
|
/**
|
|
77
126
|
* Abstract Texture interface
|
|
78
127
|
* Texture Object
|
|
79
128
|
* https://gpuweb.github.io/gpuweb/#gputexture
|
|
80
129
|
*/
|
|
81
|
-
export abstract class Texture
|
|
130
|
+
export abstract class Texture extends Resource<TextureProps> {
|
|
131
|
+
static COPY_SRC = 0x01;
|
|
132
|
+
static COPY_DST = 0x02;
|
|
133
|
+
static TEXTURE = 0x04;
|
|
134
|
+
static STORAGE = 0x08;
|
|
135
|
+
static RENDER_ATTACHMENT = 0x10;
|
|
136
|
+
|
|
137
|
+
static CubeFaces: TextureCubeFace[] = ['+X', '-X', '+Y', '-Y', '+Z', '-Z'];
|
|
138
|
+
|
|
82
139
|
static override defaultProps: Required<TextureProps> = {
|
|
83
140
|
...Resource.defaultProps,
|
|
84
141
|
data: null,
|
|
@@ -87,25 +144,15 @@ export abstract class Texture<Props extends TextureProps = TextureProps> extends
|
|
|
87
144
|
width: undefined!,
|
|
88
145
|
height: undefined!,
|
|
89
146
|
depth: 1,
|
|
90
|
-
mipmaps:
|
|
91
|
-
// type: undefined,
|
|
147
|
+
mipmaps: false,
|
|
92
148
|
compressed: false,
|
|
93
|
-
// mipLevels: 1,
|
|
94
149
|
usage: 0,
|
|
95
|
-
// usage: GPUTextureUsage.COPY_DST
|
|
96
150
|
mipLevels: undefined!,
|
|
97
151
|
samples: undefined!,
|
|
98
|
-
type: undefined!,
|
|
99
152
|
sampler: {},
|
|
100
153
|
view: undefined!
|
|
101
154
|
};
|
|
102
155
|
|
|
103
|
-
static COPY_SRC = 0x01;
|
|
104
|
-
static COPY_DST = 0x02;
|
|
105
|
-
static TEXTURE_BINDING = 0x04;
|
|
106
|
-
static STORAGE_BINDING = 0x08;
|
|
107
|
-
static RENDER_ATTACHMENT = 0x10;
|
|
108
|
-
|
|
109
156
|
override get [Symbol.toStringTag](): string {
|
|
110
157
|
return 'Texture';
|
|
111
158
|
}
|
|
@@ -119,34 +166,136 @@ export abstract class Texture<Props extends TextureProps = TextureProps> extends
|
|
|
119
166
|
/** height in pixels of this texture */
|
|
120
167
|
height: number;
|
|
121
168
|
/** depth of this texture */
|
|
122
|
-
|
|
169
|
+
depth: number;
|
|
170
|
+
/** mip levels in this texture */
|
|
171
|
+
mipLevels: number;
|
|
123
172
|
|
|
124
173
|
/** Default sampler for this texture */
|
|
125
174
|
abstract sampler: Sampler;
|
|
126
|
-
|
|
127
175
|
/** Default view for this texture */
|
|
128
176
|
abstract view: TextureView;
|
|
129
177
|
|
|
130
178
|
/** "Time" of last update. Monotonically increasing timestamp */
|
|
131
179
|
updateTimestamp: number;
|
|
132
180
|
|
|
181
|
+
/** Check if data is an external image */
|
|
182
|
+
static isExternalImage(data: unknown): data is ExternalImage {
|
|
183
|
+
return (
|
|
184
|
+
(typeof ImageData !== 'undefined' && data instanceof ImageData) ||
|
|
185
|
+
(typeof ImageBitmap !== 'undefined' && data instanceof ImageBitmap) ||
|
|
186
|
+
(typeof HTMLImageElement !== 'undefined' && data instanceof HTMLImageElement) ||
|
|
187
|
+
(typeof HTMLCanvasElement !== 'undefined' && data instanceof HTMLCanvasElement) ||
|
|
188
|
+
(typeof HTMLVideoElement !== 'undefined' && data instanceof HTMLVideoElement)
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** Determine size (width and height) of provided image data */
|
|
193
|
+
static getExternalImageSize(data: ExternalImage): {width: number; height: number} | null {
|
|
194
|
+
if (
|
|
195
|
+
(typeof ImageData !== 'undefined' && data instanceof ImageData) ||
|
|
196
|
+
(typeof ImageBitmap !== 'undefined' && data instanceof ImageBitmap) ||
|
|
197
|
+
(typeof HTMLCanvasElement !== 'undefined' && data instanceof HTMLCanvasElement)
|
|
198
|
+
) {
|
|
199
|
+
return {width: data.width, height: data.height};
|
|
200
|
+
}
|
|
201
|
+
if (typeof HTMLImageElement !== 'undefined' && data instanceof HTMLImageElement) {
|
|
202
|
+
return {width: data.naturalWidth, height: data.naturalHeight};
|
|
203
|
+
}
|
|
204
|
+
if (typeof HTMLVideoElement !== 'undefined' && data instanceof HTMLVideoElement) {
|
|
205
|
+
return {width: data.videoWidth, height: data.videoHeight};
|
|
206
|
+
}
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** Check if texture data is a typed array */
|
|
211
|
+
isTextureLevelData(data: TextureData): data is TextureLevelData {
|
|
212
|
+
const typedArray = (data as TextureLevelData)?.data;
|
|
213
|
+
return ArrayBuffer.isView(typedArray);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/** Get the size of the texture described by the provided TextureData */
|
|
217
|
+
getTextureDataSize(
|
|
218
|
+
data: TextureData | TextureCubeData | TextureArrayData | TextureCubeArrayData | TypedArray
|
|
219
|
+
): {width: number; height: number} | null {
|
|
220
|
+
if (!data) {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
if (ArrayBuffer.isView(data)) {
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
// Recurse into arrays (array of miplevels)
|
|
227
|
+
if (Array.isArray(data)) {
|
|
228
|
+
return this.getTextureDataSize(data[0]);
|
|
229
|
+
}
|
|
230
|
+
if (Texture.isExternalImage(data)) {
|
|
231
|
+
return Texture.getExternalImageSize(data);
|
|
232
|
+
}
|
|
233
|
+
if (data && typeof data === 'object' && data.constructor === Object) {
|
|
234
|
+
const untypedData = data as unknown as Record<string, number>;
|
|
235
|
+
return {width: untypedData.width, height: untypedData.height};
|
|
236
|
+
}
|
|
237
|
+
throw new Error('texture size deduction failed');
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** Calculate the number of mip levels for a texture of width and height */
|
|
241
|
+
getMipLevelCount(width: number, height: number): number {
|
|
242
|
+
return Math.floor(Math.log2(Math.max(width, height))) + 1;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** Convert luma.gl cubemap face constants to depth index */
|
|
246
|
+
getCubeFaceDepth(face: TextureCubeFace): number {
|
|
247
|
+
// prettier-ignore
|
|
248
|
+
switch (face) {
|
|
249
|
+
case '+X': return 0;
|
|
250
|
+
case '-X': return 1;
|
|
251
|
+
case '+Y': return 2;
|
|
252
|
+
case '-Y': return 3;
|
|
253
|
+
case '+Z': return 4;
|
|
254
|
+
case '-Z': return 5;
|
|
255
|
+
default: throw new Error(face);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
133
259
|
/** Do not use directly. Create with device.createTexture() */
|
|
134
|
-
constructor(
|
|
135
|
-
device
|
|
136
|
-
props: Props,
|
|
137
|
-
defaultProps = Texture.defaultProps as Required<Props>
|
|
138
|
-
) {
|
|
139
|
-
super(device, props, defaultProps);
|
|
260
|
+
constructor(device: Device, props: TextureProps) {
|
|
261
|
+
super(device, props, Texture.defaultProps);
|
|
140
262
|
this.dimension = this.props.dimension;
|
|
141
263
|
this.format = this.props.format;
|
|
264
|
+
|
|
265
|
+
// Size
|
|
142
266
|
this.width = this.props.width;
|
|
143
267
|
this.height = this.props.height;
|
|
144
268
|
this.depth = this.props.depth;
|
|
145
269
|
|
|
270
|
+
// Calculate size, if not provided
|
|
271
|
+
if (this.props.width === undefined || this.props.height === undefined) {
|
|
272
|
+
// @ts-ignore
|
|
273
|
+
const size = this.getTextureDataSize(this.props.data);
|
|
274
|
+
this.width = size?.width || 1;
|
|
275
|
+
this.height = size?.height || 1;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// mipLevels
|
|
279
|
+
|
|
280
|
+
// If mipmap generation is requested and mipLevels is not provided, initialize a full pyramid
|
|
281
|
+
if (this.props.mipmaps && this.props.mipLevels === undefined) {
|
|
282
|
+
this.props.mipLevels = 'pyramid';
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// Auto-calculate the number of mip levels as a convenience
|
|
286
|
+
// TODO - Should we clamp to 1-getMipLevelCount?
|
|
287
|
+
this.mipLevels =
|
|
288
|
+
this.props.mipLevels === 'pyramid'
|
|
289
|
+
? this.getMipLevelCount(this.width, this.height)
|
|
290
|
+
: this.props.mipLevels || 1;
|
|
291
|
+
|
|
146
292
|
// TODO - perhaps this should be set on async write completion?
|
|
147
293
|
this.updateTimestamp = device.incrementTimestamp();
|
|
148
294
|
}
|
|
149
295
|
|
|
150
296
|
/** Create a texture view for this texture */
|
|
151
|
-
abstract createView(props
|
|
297
|
+
abstract createView(props: TextureViewProps): TextureView;
|
|
298
|
+
|
|
299
|
+
/** Set sampler props associated with this texture */
|
|
300
|
+
abstract setSampler(sampler?: Sampler | SamplerProps): void;
|
|
152
301
|
}
|
|
@@ -35,7 +35,7 @@ export abstract class TransformFeedback extends Resource<TransformFeedbackProps>
|
|
|
35
35
|
return 'TransformFeedback';
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
constructor(device: Device, props
|
|
38
|
+
constructor(device: Device, props: TransformFeedbackProps) {
|
|
39
39
|
super(device, props, TransformFeedback.defaultProps);
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -6,7 +6,7 @@ import type {TypedArray} from '../../types';
|
|
|
6
6
|
import {
|
|
7
7
|
AttributeInfo,
|
|
8
8
|
getAttributeInfosByLocation
|
|
9
|
-
} from '
|
|
9
|
+
} from '../../adapter-utils/get-attribute-from-layouts';
|
|
10
10
|
import type {Device} from '../device';
|
|
11
11
|
import type {Buffer} from './buffer';
|
|
12
12
|
import type {RenderPass} from './render-pass';
|
|
@@ -49,9 +49,13 @@ export abstract class VertexArray extends Resource<VertexArrayProps> {
|
|
|
49
49
|
super(device, props, VertexArray.defaultProps);
|
|
50
50
|
this.maxVertexAttributes = device.limits.maxVertexAttributes;
|
|
51
51
|
this.attributes = new Array(this.maxVertexAttributes).fill(null);
|
|
52
|
+
const {shaderLayout, bufferLayout} = props.renderPipeline || {};
|
|
53
|
+
if (!shaderLayout || !bufferLayout) {
|
|
54
|
+
throw new Error('VertexArray');
|
|
55
|
+
}
|
|
52
56
|
this.attributeInfos = getAttributeInfosByLocation(
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
shaderLayout,
|
|
58
|
+
bufferLayout,
|
|
55
59
|
this.maxVertexAttributes
|
|
56
60
|
);
|
|
57
61
|
}
|
|
@@ -3,20 +3,19 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {NumberArray} from '../../types';
|
|
6
|
-
import type {
|
|
7
|
-
|
|
6
|
+
import type {
|
|
7
|
+
ColorTextureFormat,
|
|
8
|
+
DepthStencilTextureFormat,
|
|
9
|
+
TextureFormat
|
|
10
|
+
} from '../../gpu-type-utils/texture-formats';
|
|
8
11
|
import type {Texture} from '../resources/texture'; // TextureView...
|
|
12
|
+
import type {TextureView} from '../resources/texture-view'; // TextureView...
|
|
9
13
|
|
|
10
14
|
// UNIFORMS
|
|
11
15
|
|
|
12
16
|
/** Valid values for uniforms. @note boolean values get converted to 0 or 1 before setting */
|
|
13
17
|
export type UniformValue = number | boolean | Readonly<NumberArray>; // Float32Array> | Readonly<Int32Array> | Readonly<Uint32Array> | Readonly<number[]>;
|
|
14
18
|
|
|
15
|
-
// BINDINGS
|
|
16
|
-
|
|
17
|
-
/** Buffer bindings */
|
|
18
|
-
export type Binding = Texture | Buffer | {buffer: Buffer; offset?: number; size?: number};
|
|
19
|
-
|
|
20
19
|
// BINDING LAYOUTS
|
|
21
20
|
|
|
22
21
|
/** Describes a buffer binding layout */
|
|
@@ -55,14 +54,6 @@ export type BindingDeclaration =
|
|
|
55
54
|
| TextureBindingLayout
|
|
56
55
|
| StorageTextureBindingLayout;
|
|
57
56
|
|
|
58
|
-
// TEXTURE VIEWS
|
|
59
|
-
|
|
60
|
-
export type TextureView = {
|
|
61
|
-
texture: WebGLTexture;
|
|
62
|
-
layer?: number; // = 0
|
|
63
|
-
level?: number; // = 0
|
|
64
|
-
};
|
|
65
|
-
|
|
66
57
|
// ATTACHMENTS (See Framebuffer)
|
|
67
58
|
|
|
68
59
|
/**
|
|
@@ -71,7 +62,7 @@ export type TextureView = {
|
|
|
71
62
|
*/
|
|
72
63
|
export type ColorAttachment = {
|
|
73
64
|
/** Describes the texture subresource that will be output to for this color attachment. */
|
|
74
|
-
texture?: Texture;
|
|
65
|
+
texture?: TextureView | Texture;
|
|
75
66
|
/** Format of the texture resource. Used to auto create texture if not supplied */
|
|
76
67
|
format?: ColorTextureFormat;
|
|
77
68
|
/* Describes the texture subresource that will receive resolved output for this color attachment if multisampled. */
|
|
@@ -91,7 +82,7 @@ export type ColorAttachment = {
|
|
|
91
82
|
*/
|
|
92
83
|
export type DepthStencilAttachment = {
|
|
93
84
|
/** Describes the texture subresource that will be output to and read from for this depth/stencil attachment. */
|
|
94
|
-
texture?: Texture;
|
|
85
|
+
texture?: TextureView | Texture;
|
|
95
86
|
/** Format of the texture resource. Used to auto create texture if not supplied */
|
|
96
87
|
format?: DepthStencilTextureFormat;
|
|
97
88
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {VertexFormat} from '
|
|
5
|
+
import type {VertexFormat} from '../../gpu-type-utils/vertex-formats';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Provides specific details about the memory layout of the actual buffers
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {DepthStencilTextureFormat} from '
|
|
5
|
+
import {DepthStencilTextureFormat} from '../../gpu-type-utils/texture-formats';
|
|
6
6
|
|
|
7
7
|
export type CompareFunction =
|
|
8
8
|
| 'never'
|
|
@@ -20,12 +20,8 @@ export type PrimitiveTopology =
|
|
|
20
20
|
| 'point-list'
|
|
21
21
|
| 'line-list'
|
|
22
22
|
| 'line-strip'
|
|
23
|
-
/** @deprecated */
|
|
24
|
-
| 'line-loop-webgl'
|
|
25
23
|
| 'triangle-list'
|
|
26
|
-
| 'triangle-strip'
|
|
27
|
-
/** @deprecated */
|
|
28
|
-
| 'triangle-fan-webgl';
|
|
24
|
+
| 'triangle-strip';
|
|
29
25
|
|
|
30
26
|
export type IndexFormat = 'uint16' | 'uint32';
|
|
31
27
|
|
|
@@ -251,12 +247,12 @@ export const DEFAULT_PARAMETERS: Required<Parameters> = {
|
|
|
251
247
|
polygonMode: 'fill',
|
|
252
248
|
polygonOffsetLine: false,
|
|
253
249
|
|
|
254
|
-
clipDistance0: undefined
|
|
255
|
-
clipDistance1: undefined
|
|
256
|
-
clipDistance2: undefined
|
|
257
|
-
clipDistance3: undefined
|
|
258
|
-
clipDistance4: undefined
|
|
259
|
-
clipDistance5: undefined
|
|
260
|
-
clipDistance6: undefined
|
|
261
|
-
clipDistance7: undefined
|
|
250
|
+
clipDistance0: undefined!,
|
|
251
|
+
clipDistance1: undefined!,
|
|
252
|
+
clipDistance2: undefined!,
|
|
253
|
+
clipDistance3: undefined!,
|
|
254
|
+
clipDistance4: undefined!,
|
|
255
|
+
clipDistance5: undefined!,
|
|
256
|
+
clipDistance6: undefined!,
|
|
257
|
+
clipDistance7: undefined!
|
|
262
258
|
};
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {TextureFormat} from '
|
|
6
|
-
import type {ShaderUniformType, ShaderAttributeType} from '
|
|
7
|
-
import {AccessorObject} from '../types/accessor';
|
|
5
|
+
import type {TextureFormat} from '../../gpu-type-utils/texture-formats';
|
|
6
|
+
import type {ShaderUniformType, ShaderAttributeType} from '../../gpu-type-utils/shader-types';
|
|
8
7
|
import type {Buffer} from '../resources/buffer';
|
|
9
8
|
import type {Sampler} from '../resources/sampler';
|
|
10
9
|
import type {Texture} from '../resources/texture';
|
|
@@ -64,32 +63,6 @@ export type AttributeDeclaration = {
|
|
|
64
63
|
|
|
65
64
|
// BINDING LAYOUTS
|
|
66
65
|
|
|
67
|
-
/*
|
|
68
|
-
type Binding = {
|
|
69
|
-
binding: number;
|
|
70
|
-
visibility: number;
|
|
71
|
-
|
|
72
|
-
buffer?: {
|
|
73
|
-
type?: 'uniform' | 'storage' | 'read-only-storage';
|
|
74
|
-
hasDynamicOffset?: false;
|
|
75
|
-
minBindingSize?: number;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// type = sampler
|
|
79
|
-
samplerType?: 'filtering' | 'non-filtering' | 'comparison';
|
|
80
|
-
|
|
81
|
-
// type = texture
|
|
82
|
-
viewDimension?: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';
|
|
83
|
-
sampleType?: 'float' | 'unfilterable-float' | 'depth' | 'sint' | 'uint';
|
|
84
|
-
multisampled?: boolean;
|
|
85
|
-
|
|
86
|
-
// type = storage
|
|
87
|
-
viewDimension?: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';
|
|
88
|
-
access: 'read-only' | 'write-only';
|
|
89
|
-
format: string;
|
|
90
|
-
};
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
66
|
/** ShaderLayout for bindings */
|
|
94
67
|
export type BindingDeclaration =
|
|
95
68
|
| UniformBufferBindingLayout
|
|
@@ -205,3 +178,32 @@ export type AttributeBinding = {
|
|
|
205
178
|
location: number;
|
|
206
179
|
accessor: AccessorObject;
|
|
207
180
|
};
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Attribute descriptor object
|
|
184
|
+
* @deprecated Use ShaderLayout
|
|
185
|
+
*/
|
|
186
|
+
export interface AccessorObject {
|
|
187
|
+
buffer?: Buffer;
|
|
188
|
+
// format: VertexFormat;
|
|
189
|
+
offset?: number;
|
|
190
|
+
// can now be described with single WebGPU-style `format` string
|
|
191
|
+
|
|
192
|
+
//
|
|
193
|
+
stride?: number;
|
|
194
|
+
|
|
195
|
+
/** @deprecated - Use accessor.stepMode */
|
|
196
|
+
divisor?: number;
|
|
197
|
+
|
|
198
|
+
/** @deprecated - Infer from format */
|
|
199
|
+
type?: number;
|
|
200
|
+
/** @deprecated - Infer from format */
|
|
201
|
+
size?: number;
|
|
202
|
+
/** @deprecated - Infer from format */
|
|
203
|
+
normalized?: boolean;
|
|
204
|
+
/** @deprecated - Infer from format */
|
|
205
|
+
integer?: boolean;
|
|
206
|
+
|
|
207
|
+
/** @deprecated */
|
|
208
|
+
index?: number;
|
|
209
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {NumberArray} from '../../types';
|
|
6
|
+
|
|
7
|
+
// UNIFORMS
|
|
8
|
+
|
|
9
|
+
/** Valid values for uniforms. @note boolean values get converted to 0 or 1 before setting */
|
|
10
|
+
export type UniformValue = number | boolean | Readonly<NumberArray>; // Float32Array> | Readonly<Int32Array> | Readonly<Uint32Array> | Readonly<number[]>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {CompilerMessage} from '
|
|
5
|
+
import type {CompilerMessage} from '../adapter/types/compiler-message';
|
|
6
6
|
|
|
7
7
|
/** @returns annotated errors or warnings */
|
|
8
8
|
export function formatCompilerLog(
|