@luma.gl/core 9.0.0-alpha.9 → 9.0.0-beta.2
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 +3 -1
- package/README.md +4 -4
- package/dist/adapter/attribute-utils/get-attribute-from-layouts.d.ts +52 -0
- package/dist/adapter/attribute-utils/get-attribute-from-layouts.d.ts.map +1 -0
- package/dist/adapter/attribute-utils/get-attribute-from-layouts.js +130 -0
- package/dist/adapter/attribute-utils/get-attribute-from-layouts.js.map +1 -0
- package/dist/adapter/canvas-context.d.ts +109 -0
- package/dist/adapter/canvas-context.d.ts.map +1 -0
- package/dist/adapter/canvas-context.js +254 -0
- package/dist/adapter/canvas-context.js.map +1 -0
- package/dist/adapter/device.d.ts +219 -0
- package/dist/adapter/device.d.ts.map +1 -0
- package/dist/adapter/device.js +99 -0
- package/dist/adapter/device.js.map +1 -0
- package/dist/adapter/resources/buffer.d.ts +56 -0
- package/dist/adapter/resources/buffer.d.ts.map +1 -0
- package/dist/adapter/resources/buffer.js +62 -0
- package/dist/adapter/resources/buffer.js.map +1 -0
- package/dist/adapter/resources/command-buffer.d.ts +12 -0
- package/dist/adapter/resources/command-buffer.d.ts.map +1 -0
- package/dist/adapter/resources/command-buffer.js +15 -0
- package/dist/adapter/resources/command-buffer.js.map +1 -0
- package/dist/adapter/resources/command-encoder.d.ts +113 -0
- package/dist/adapter/resources/command-encoder.d.ts.map +1 -0
- package/dist/adapter/resources/command-encoder.js +19 -0
- package/dist/adapter/resources/command-encoder.js.map +1 -0
- package/dist/adapter/resources/compute-pass.d.ts +31 -0
- package/dist/adapter/resources/compute-pass.d.ts.map +1 -0
- package/dist/adapter/resources/compute-pass.js +15 -0
- package/dist/adapter/resources/compute-pass.js.map +1 -0
- package/dist/adapter/resources/compute-pipeline.d.ts +24 -0
- package/dist/adapter/resources/compute-pipeline.d.ts.map +1 -0
- package/dist/adapter/resources/compute-pipeline.js +20 -0
- package/dist/adapter/resources/compute-pipeline.js.map +1 -0
- package/dist/adapter/resources/external-texture.d.ts +12 -0
- package/dist/adapter/resources/external-texture.d.ts.map +1 -0
- package/dist/adapter/resources/external-texture.js +17 -0
- package/dist/adapter/resources/external-texture.js.map +1 -0
- package/dist/adapter/resources/framebuffer.d.ts +50 -0
- package/dist/adapter/resources/framebuffer.d.ts.map +1 -0
- package/dist/adapter/resources/framebuffer.js +102 -0
- package/dist/adapter/resources/framebuffer.js.map +1 -0
- package/dist/adapter/resources/render-pass.d.ts +51 -0
- package/dist/adapter/resources/render-pass.d.ts.map +1 -0
- package/dist/adapter/resources/render-pass.js +23 -0
- package/dist/adapter/resources/render-pass.js.map +1 -0
- package/dist/adapter/resources/render-pipeline.d.ts +89 -0
- package/dist/adapter/resources/render-pipeline.d.ts.map +1 -0
- package/dist/adapter/resources/render-pipeline.js +36 -0
- package/dist/adapter/resources/render-pipeline.js.map +1 -0
- package/dist/adapter/resources/resource.d.ts +73 -0
- package/dist/adapter/resources/resource.d.ts.map +1 -0
- package/dist/adapter/resources/resource.js +101 -0
- package/dist/adapter/resources/resource.js.map +1 -0
- package/dist/adapter/resources/sampler.d.ts +42 -0
- package/dist/adapter/resources/sampler.d.ts.map +1 -0
- package/dist/adapter/resources/sampler.js +26 -0
- package/dist/adapter/resources/sampler.js.map +1 -0
- package/dist/adapter/resources/shader.d.ts +45 -0
- package/dist/adapter/resources/shader.d.ts.map +1 -0
- package/dist/adapter/resources/shader.js +90 -0
- package/dist/adapter/resources/shader.js.map +1 -0
- package/dist/adapter/resources/texture.d.ts +90 -0
- package/dist/adapter/resources/texture.d.ts.map +1 -0
- package/dist/adapter/resources/texture.js +45 -0
- package/dist/adapter/resources/texture.js.map +1 -0
- package/dist/adapter/resources/transform-feedback.d.ts +30 -0
- package/dist/adapter/resources/transform-feedback.d.ts.map +1 -0
- package/dist/adapter/resources/transform-feedback.js +17 -0
- package/dist/adapter/resources/transform-feedback.js.map +1 -0
- package/dist/adapter/resources/vertex-array.d.ts +40 -0
- package/dist/adapter/resources/vertex-array.d.ts.map +1 -0
- package/dist/adapter/resources/vertex-array.js +24 -0
- package/dist/adapter/resources/vertex-array.js.map +1 -0
- package/dist/adapter/type-utils/decode-attribute-type.d.ts +20 -0
- package/dist/adapter/type-utils/decode-attribute-type.d.ts.map +1 -0
- package/dist/adapter/type-utils/decode-attribute-type.js +60 -0
- package/dist/adapter/type-utils/decode-attribute-type.js.map +1 -0
- package/dist/adapter/type-utils/decode-data-type.d.ts +16 -0
- package/dist/adapter/type-utils/decode-data-type.d.ts.map +1 -0
- package/dist/adapter/type-utils/decode-data-type.js +43 -0
- package/dist/adapter/type-utils/decode-data-type.js.map +1 -0
- package/dist/adapter/type-utils/decode-shader-types.d.ts +9 -0
- package/dist/adapter/type-utils/decode-shader-types.d.ts.map +1 -0
- package/dist/adapter/type-utils/decode-shader-types.js +103 -0
- package/dist/adapter/type-utils/decode-shader-types.js.map +1 -0
- package/dist/adapter/type-utils/decode-texture-format.d.ts +19 -0
- package/dist/adapter/type-utils/decode-texture-format.d.ts.map +1 -0
- package/dist/adapter/type-utils/decode-texture-format.js +101 -0
- package/dist/adapter/type-utils/decode-texture-format.js.map +1 -0
- package/dist/adapter/type-utils/decode-vertex-format.d.ts +22 -0
- package/dist/adapter/type-utils/decode-vertex-format.d.ts.map +1 -0
- package/dist/adapter/type-utils/decode-vertex-format.js +25 -0
- package/dist/adapter/type-utils/decode-vertex-format.js.map +1 -0
- package/dist/adapter/type-utils/vertex-format-from-attribute.d.ts +10 -0
- package/dist/adapter/type-utils/vertex-format-from-attribute.d.ts.map +1 -0
- package/dist/adapter/type-utils/vertex-format-from-attribute.js +76 -0
- package/dist/adapter/type-utils/vertex-format-from-attribute.js.map +1 -0
- package/dist/adapter/type-utils/wgsl-utils.d.ts +4 -0
- package/dist/adapter/type-utils/wgsl-utils.d.ts.map +1 -0
- package/dist/adapter/type-utils/wgsl-utils.js +15 -0
- package/dist/adapter/type-utils/wgsl-utils.js.map +1 -0
- package/dist/adapter/types/accessor.d.ts +23 -0
- package/dist/adapter/types/accessor.d.ts.map +1 -0
- package/dist/adapter/types/accessor.js +2 -0
- package/dist/adapter/types/accessor.js.map +1 -0
- package/dist/adapter/types/buffer-layout.d.ts +59 -0
- package/dist/adapter/types/buffer-layout.d.ts.map +1 -0
- package/dist/adapter/types/buffer-layout.js +2 -0
- package/dist/adapter/types/buffer-layout.js.map +1 -0
- package/dist/adapter/types/parameters.d.ts +97 -0
- package/dist/adapter/types/parameters.d.ts.map +1 -0
- package/dist/adapter/types/parameters.js +28 -0
- package/dist/adapter/types/parameters.js.map +1 -0
- package/dist/adapter/types/shader-layout.d.ts +145 -0
- package/dist/adapter/types/shader-layout.d.ts.map +1 -0
- package/dist/adapter/types/shader-layout.js +2 -0
- package/dist/adapter/types/shader-layout.js.map +1 -0
- package/dist/adapter/types/shader-types.d.ts +21 -0
- package/dist/adapter/types/shader-types.d.ts.map +1 -0
- package/dist/adapter/types/shader-types.js +2 -0
- package/dist/adapter/types/shader-types.js.map +1 -0
- package/dist/adapter/types/texture-formats.d.ts +12 -0
- package/dist/adapter/types/texture-formats.d.ts.map +1 -0
- package/dist/adapter/types/texture-formats.js +2 -0
- package/dist/adapter/types/texture-formats.js.map +1 -0
- package/dist/adapter/types/types.d.ts +90 -0
- package/dist/adapter/types/types.d.ts.map +1 -0
- package/dist/adapter/types/types.js +2 -0
- package/dist/adapter/types/types.js.map +1 -0
- package/dist/adapter/types/vertex-formats.d.ts +14 -0
- package/dist/adapter/types/vertex-formats.d.ts.map +1 -0
- package/dist/adapter/types/vertex-formats.js +2 -0
- package/dist/adapter/types/vertex-formats.js.map +1 -0
- package/dist/dist.dev.js +2976 -0
- package/dist/index.cjs +2445 -0
- package/dist/index.d.ts +81 -128
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -18
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +5 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +24 -0
- package/dist/init.js.map +1 -0
- package/dist/lib/compiler-log/compiler-message.d.ts +8 -0
- package/dist/lib/compiler-log/compiler-message.d.ts.map +1 -0
- package/dist/lib/compiler-log/compiler-message.js +2 -0
- package/dist/lib/compiler-log/compiler-message.js.map +1 -0
- package/dist/lib/compiler-log/format-compiler-log.d.ts +8 -0
- package/dist/lib/compiler-log/format-compiler-log.d.ts.map +1 -0
- package/dist/lib/compiler-log/format-compiler-log.js +64 -0
- package/dist/lib/compiler-log/format-compiler-log.js.map +1 -0
- package/dist/lib/compiler-log/get-shader-info.d.ts +9 -0
- package/dist/lib/compiler-log/get-shader-info.d.ts.map +1 -0
- package/dist/lib/compiler-log/get-shader-info.js +25 -0
- package/dist/lib/compiler-log/get-shader-info.js.map +1 -0
- package/dist/lib/luma.d.ts +22 -0
- package/dist/lib/luma.d.ts.map +1 -0
- package/dist/lib/luma.js +63 -0
- package/dist/lib/luma.js.map +1 -0
- package/dist/lib/uniforms/uniform-block.d.ts +29 -0
- package/dist/lib/uniforms/uniform-block.d.ts.map +1 -0
- package/dist/lib/uniforms/uniform-block.js +48 -0
- package/dist/lib/uniforms/uniform-block.js.map +1 -0
- package/dist/lib/uniforms/uniform-buffer-layout.d.ts +27 -0
- package/dist/lib/uniforms/uniform-buffer-layout.d.ts.map +1 -0
- package/dist/lib/uniforms/uniform-buffer-layout.js +76 -0
- package/dist/lib/uniforms/uniform-buffer-layout.js.map +1 -0
- package/dist/lib/uniforms/uniform-store.d.ts +62 -0
- package/dist/lib/uniforms/uniform-store.d.ts.map +1 -0
- package/dist/lib/uniforms/uniform-store.js +89 -0
- package/dist/lib/uniforms/uniform-store.js.map +1 -0
- package/dist/lib/uniforms/uniform.d.ts +10 -0
- package/dist/lib/uniforms/uniform.d.ts.map +1 -0
- package/dist/lib/uniforms/uniform.js +20 -0
- package/dist/lib/uniforms/uniform.js.map +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/array-equal.d.ts +5 -0
- package/dist/utils/array-equal.d.ts.map +1 -0
- package/dist/utils/array-equal.js +28 -0
- package/dist/utils/array-equal.js.map +1 -0
- package/dist/utils/array-utils-flat.d.ts +10 -0
- package/dist/utils/array-utils-flat.d.ts.map +1 -0
- package/dist/utils/array-utils-flat.js +36 -0
- package/dist/utils/array-utils-flat.js.map +1 -0
- package/dist/utils/assert.d.ts +2 -0
- package/dist/utils/assert.d.ts.map +1 -0
- package/dist/utils/assert.js +6 -0
- package/dist/utils/assert.js.map +1 -0
- package/dist/utils/cast.d.ts +3 -0
- package/dist/utils/cast.d.ts.map +1 -0
- package/dist/utils/cast.js +4 -0
- package/dist/utils/cast.js.map +1 -0
- package/dist/utils/check-props.d.ts +7 -0
- package/dist/utils/check-props.d.ts.map +1 -0
- package/dist/utils/check-props.js +32 -0
- package/dist/utils/check-props.js.map +1 -0
- package/dist/utils/deep-equal.d.ts +9 -0
- package/dist/utils/deep-equal.d.ts.map +1 -0
- package/dist/utils/deep-equal.js +40 -0
- package/dist/utils/deep-equal.js.map +1 -0
- package/dist/utils/format-value.d.ts +7 -0
- package/dist/utils/format-value.d.ts.map +1 -0
- package/dist/utils/format-value.js +42 -0
- package/dist/utils/format-value.js.map +1 -0
- package/dist/utils/is-array.d.ts +16 -0
- package/dist/utils/is-array.d.ts.map +1 -0
- package/dist/utils/is-array.js +10 -0
- package/dist/utils/is-array.js.map +1 -0
- package/dist/utils/load-file.d.ts +35 -0
- package/dist/utils/load-file.d.ts.map +1 -0
- package/dist/utils/load-file.js +48 -0
- package/dist/utils/load-file.js.map +1 -0
- package/dist/utils/log.d.ts +4 -0
- package/dist/utils/log.d.ts.map +1 -0
- package/dist/utils/log.js +5 -0
- package/dist/utils/log.js.map +1 -0
- package/dist/utils/random.d.ts +5 -0
- package/dist/utils/random.d.ts.map +1 -0
- package/dist/utils/random.js +14 -0
- package/dist/utils/random.js.map +1 -0
- package/dist/utils/request-animation-frame.d.ts +3 -0
- package/dist/utils/request-animation-frame.d.ts.map +1 -0
- package/dist/utils/request-animation-frame.js +7 -0
- package/dist/utils/request-animation-frame.js.map +1 -0
- package/dist/utils/stats-manager.d.ts +12 -0
- package/dist/utils/stats-manager.d.ts.map +1 -0
- package/dist/utils/stats-manager.js +19 -0
- package/dist/utils/stats-manager.js.map +1 -0
- package/dist/utils/stub-methods.d.ts +2 -0
- package/dist/utils/stub-methods.d.ts.map +1 -0
- package/dist/utils/stub-methods.js +16 -0
- package/dist/utils/stub-methods.js.map +1 -0
- package/dist/utils/utils.d.ts +15 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +19 -0
- package/dist/utils/utils.js.map +1 -0
- package/dist.min.js +33 -0
- package/package.json +17 -12
- package/src/adapter/attribute-utils/get-attribute-from-layouts.ts +259 -0
- package/src/adapter/canvas-context.ts +433 -0
- package/src/adapter/device.ts +435 -0
- package/src/adapter/resources/buffer.ts +106 -0
- package/src/adapter/resources/command-buffer.ts +38 -0
- package/src/adapter/resources/command-encoder.ts +172 -0
- package/src/adapter/resources/compute-pass.ts +52 -0
- package/src/adapter/resources/compute-pipeline.ts +39 -0
- package/src/adapter/resources/external-texture.ts +20 -0
- package/src/adapter/resources/framebuffer.ts +230 -0
- package/src/adapter/resources/render-pass.ts +117 -0
- package/src/adapter/resources/render-pipeline.ts +133 -0
- package/src/adapter/resources/resource.ts +176 -0
- package/src/adapter/resources/sampler.ts +69 -0
- package/src/adapter/resources/shader.ts +143 -0
- package/src/adapter/resources/texture.ts +140 -0
- package/src/adapter/resources/transform-feedback.ts +45 -0
- package/src/adapter/resources/vertex-array.ts +65 -0
- package/src/adapter/type-utils/decode-attribute-type.ts +82 -0
- package/src/adapter/type-utils/decode-data-type.ts +62 -0
- package/src/adapter/type-utils/decode-shader-types.ts +48 -0
- package/src/adapter/type-utils/decode-texture-format.ts +190 -0
- package/src/adapter/type-utils/decode-vertex-format.ts +49 -0
- package/src/adapter/type-utils/vertex-format-from-attribute.ts +103 -0
- package/src/adapter/type-utils/wgsl-utils.ts +18 -0
- package/src/adapter/types/accessor.ts +34 -0
- package/src/adapter/types/buffer-layout.ts +62 -0
- package/src/adapter/types/parameters.ts +250 -0
- package/src/adapter/types/shader-layout.ts +193 -0
- package/src/adapter/types/shader-types.ts +77 -0
- package/src/adapter/types/texture-formats.ts +168 -0
- package/src/adapter/types/types.ts +109 -0
- package/src/adapter/types/vertex-formats.ts +91 -0
- package/src/index.ts +160 -92
- package/src/init.ts +47 -0
- package/src/lib/compiler-log/compiler-message.ts +10 -0
- package/src/lib/compiler-log/format-compiler-log.ts +113 -0
- package/src/lib/compiler-log/get-shader-info.ts +41 -0
- package/src/lib/luma.ts +84 -0
- package/src/lib/uniforms/uniform-block.ts +80 -0
- package/src/lib/uniforms/uniform-buffer-layout.ts +109 -0
- package/src/lib/uniforms/uniform-store.ts +173 -0
- package/src/lib/uniforms/uniform.ts +25 -0
- package/src/types.ts +33 -0
- package/src/utils/array-equal.ts +33 -0
- package/src/utils/array-utils-flat.ts +43 -0
- package/src/utils/assert.ts +7 -0
- package/src/utils/cast.ts +4 -0
- package/src/utils/check-props.ts +74 -0
- package/src/utils/deep-equal.ts +47 -0
- package/src/utils/format-value.ts +40 -0
- package/src/utils/is-array.ts +24 -0
- package/src/utils/load-file.ts +89 -0
- package/src/utils/log.ts +4 -0
- package/src/utils/random.ts +17 -0
- package/src/utils/request-animation-frame.ts +15 -0
- package/src/utils/stats-manager.ts +23 -0
- package/src/utils/stub-methods.ts +20 -0
- package/src/utils/utils.ts +36 -0
- package/dist/bundle.d.ts +0 -2
- package/dist/bundle.d.ts.map +0 -1
- package/dist/bundle.js +0 -5
- package/dist/bundle.js.map +0 -1
- package/src/bundle.ts +0 -4
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { TextureFormat } from '../types/texture-formats';
|
|
2
|
+
import type { ShaderUniformType, ShaderAttributeType } from './shader-types';
|
|
3
|
+
import { AccessorObject } from '../types/accessor';
|
|
4
|
+
import type { Buffer } from '../resources/buffer';
|
|
5
|
+
import type { Sampler } from '../resources/sampler';
|
|
6
|
+
import type { Texture } from '../resources/texture';
|
|
7
|
+
/**
|
|
8
|
+
* Describes all shader binding points for a `RenderPipeline` or `ComputePipeline`
|
|
9
|
+
* A ShaderLayout describes the static structure of a shader pipeline.
|
|
10
|
+
* It also allows the numeric locations in the shader to accessed with the same variable names
|
|
11
|
+
* used in the shader.
|
|
12
|
+
* @note A ShaderLayout needs to be complemented by a BufferLayout that describes
|
|
13
|
+
* the actual memory layout of the buffers that will be used with the pipeline.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```
|
|
17
|
+
device.createRenderPipeline({
|
|
18
|
+
shaderLayout: [
|
|
19
|
+
attributes: [
|
|
20
|
+
{name: 'instancePositions', location: 0, format: 'vec3<f32>', stepMode: 'instance'},
|
|
21
|
+
{name: 'instanceVelocities', location: 1, format: 'vec3<f32>', stepMode: 'instance'},
|
|
22
|
+
{name: 'vertexPositions', location: 2, format: 'vec3<f32>', stepMode: 'vertex'}
|
|
23
|
+
],
|
|
24
|
+
bindings: [...]
|
|
25
|
+
]
|
|
26
|
+
})
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export type ShaderLayout = {
|
|
30
|
+
/** All attributes, their locations, and basic type information. Also an auto-deduced step mode */
|
|
31
|
+
attributes: AttributeDeclaration[];
|
|
32
|
+
/** All bidning points (textures, samplers, uniform buffers) with their locations and type */
|
|
33
|
+
bindings: BindingDeclaration[];
|
|
34
|
+
/** WebGL only (WebGPU use bindings and uniform buffers) */
|
|
35
|
+
uniforms?: any[];
|
|
36
|
+
/** WebGL2 only (WebGPU use compute shaders) */
|
|
37
|
+
varyings?: VaryingBinding[];
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Declares one for attributes
|
|
41
|
+
*/
|
|
42
|
+
export type AttributeDeclaration = {
|
|
43
|
+
/** The name of this attribute in the shader */
|
|
44
|
+
name: string;
|
|
45
|
+
/** The index into the GPU's vertex array buffer bank (usually between 0-15) */
|
|
46
|
+
location: number;
|
|
47
|
+
/** WebGPU-style shader type. The declared format of the attribute in the shader code. Buffer's vertex format needs to map to this. */
|
|
48
|
+
type: ShaderAttributeType;
|
|
49
|
+
/** Inferred from attribute name. @note Technically not part of static structure of shader */
|
|
50
|
+
stepMode?: 'vertex' | 'instance';
|
|
51
|
+
};
|
|
52
|
+
/** ShaderLayout for bindings */
|
|
53
|
+
export type BindingDeclaration = UniformBufferBindingLayout | BufferBindingLayout | TextureBindingLayout | SamplerBindingLayout | StorageTextureBindingLayout;
|
|
54
|
+
export type UniformBufferBindingLayout = {
|
|
55
|
+
type: 'uniform';
|
|
56
|
+
name: string;
|
|
57
|
+
location: number;
|
|
58
|
+
visibility?: number;
|
|
59
|
+
hasDynamicOffset?: boolean;
|
|
60
|
+
minBindingSize?: number;
|
|
61
|
+
uniforms?: UniformInfo[];
|
|
62
|
+
};
|
|
63
|
+
export type UniformInfo = {
|
|
64
|
+
name: string;
|
|
65
|
+
format: ShaderUniformType;
|
|
66
|
+
type?: string;
|
|
67
|
+
arrayLength: number;
|
|
68
|
+
byteOffset: number;
|
|
69
|
+
byteStride: number;
|
|
70
|
+
};
|
|
71
|
+
export type BufferBindingLayout = {
|
|
72
|
+
type: 'uniform' | 'storage' | 'read-only-storage';
|
|
73
|
+
name: string;
|
|
74
|
+
location: number;
|
|
75
|
+
visibility?: number;
|
|
76
|
+
hasDynamicOffset?: boolean;
|
|
77
|
+
minBindingSize?: number;
|
|
78
|
+
};
|
|
79
|
+
type TextureBindingLayout = {
|
|
80
|
+
type: 'texture';
|
|
81
|
+
name: string;
|
|
82
|
+
location: number;
|
|
83
|
+
visibility?: number;
|
|
84
|
+
viewDimension?: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';
|
|
85
|
+
sampleType?: 'float' | 'unfilterable-float' | 'depth' | 'sint' | 'uint';
|
|
86
|
+
multisampled?: boolean;
|
|
87
|
+
};
|
|
88
|
+
type SamplerBindingLayout = {
|
|
89
|
+
type: 'sampler';
|
|
90
|
+
name: string;
|
|
91
|
+
location: number;
|
|
92
|
+
visibility?: number;
|
|
93
|
+
samplerType?: 'filtering' | 'non-filtering' | 'comparison';
|
|
94
|
+
};
|
|
95
|
+
type StorageTextureBindingLayout = {
|
|
96
|
+
type: 'storage';
|
|
97
|
+
name: string;
|
|
98
|
+
location: number;
|
|
99
|
+
visibility?: number;
|
|
100
|
+
access?: 'write-only';
|
|
101
|
+
format: TextureFormat;
|
|
102
|
+
viewDimension?: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';
|
|
103
|
+
};
|
|
104
|
+
/** Binding value */
|
|
105
|
+
export type Binding = Texture | Sampler | Buffer | {
|
|
106
|
+
buffer: Buffer;
|
|
107
|
+
offset?: number;
|
|
108
|
+
size?: number;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Describes a varying binding for a program
|
|
112
|
+
* @deprecated Varyings are WebGL-only
|
|
113
|
+
*/
|
|
114
|
+
export type VaryingBinding = {
|
|
115
|
+
location: number;
|
|
116
|
+
name: string;
|
|
117
|
+
accessor: AccessorObject;
|
|
118
|
+
};
|
|
119
|
+
/** Describes a uniform block binding for a program */
|
|
120
|
+
export type UniformBlockBinding = {
|
|
121
|
+
location: number;
|
|
122
|
+
name: string;
|
|
123
|
+
byteLength: number;
|
|
124
|
+
vertex: boolean;
|
|
125
|
+
fragment: boolean;
|
|
126
|
+
uniformCount: number;
|
|
127
|
+
uniformIndices?: number[];
|
|
128
|
+
uniforms: UniformInfo[];
|
|
129
|
+
};
|
|
130
|
+
/** Describes a uniform (sampler etc) binding for a program */
|
|
131
|
+
export type UniformBinding = {
|
|
132
|
+
location: number;
|
|
133
|
+
name: string;
|
|
134
|
+
size: number;
|
|
135
|
+
type: number;
|
|
136
|
+
isArray: boolean;
|
|
137
|
+
};
|
|
138
|
+
/** @deprecated */
|
|
139
|
+
export type AttributeBinding = {
|
|
140
|
+
name: string;
|
|
141
|
+
location: number;
|
|
142
|
+
accessor: AccessorObject;
|
|
143
|
+
};
|
|
144
|
+
export {};
|
|
145
|
+
//# sourceMappingURL=shader-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shader-layout.d.ts","sourceRoot":"","sources":["../../../src/adapter/types/shader-layout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAC,iBAAiB,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,kGAAkG;IAClG,UAAU,EAAE,oBAAoB,EAAE,CAAC;IACnC,6FAA6F;IAC7F,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;IACjB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IACjB,sIAAsI;IACtI,IAAI,EAAE,mBAAmB,CAAC;IAC1B,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;CAClC,CAAC;AA8BF,gCAAgC;AAChC,MAAM,MAAM,kBAAkB,GAC1B,0BAA0B,GAC1B,mBAAmB,GACnB,o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,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,kBAAkB;AAClB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,cAAc,CAAC;CAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shader-layout.js","names":[],"sources":["../../../src/adapter/types/shader-layout.ts"],"sourcesContent":["// luma.gl, MIT license\nimport type {TextureFormat} from '../types/texture-formats';\nimport type {ShaderUniformType, ShaderAttributeType} from './shader-types';\nimport {AccessorObject} from '../types/accessor';\nimport type {Buffer} from '../resources/buffer';\nimport type {Sampler} from '../resources/sampler';\nimport type {Texture} from '../resources/texture';\n\n/**\n * Describes all shader binding points for a `RenderPipeline` or `ComputePipeline`\n * A ShaderLayout describes the static structure of a shader pipeline.\n * It also allows the numeric locations in the shader to accessed with the same variable names\n * used in the shader.\n * @note A ShaderLayout needs to be complemented by a BufferLayout that describes \n * the actual memory layout of the buffers that will be used with the pipeline.\n * \n * @example\n * ```\n device.createRenderPipeline({\n shaderLayout: [\n attributes: [\n {name: 'instancePositions', location: 0, format: 'vec3<f32>', stepMode: 'instance'},\n {name: 'instanceVelocities', location: 1, format: 'vec3<f32>', stepMode: 'instance'},\n {name: 'vertexPositions', location: 2, format: 'vec3<f32>', stepMode: 'vertex'}\n ],\n bindings: [...]\n ]\n })\n * ```\n */\nexport type ShaderLayout = {\n /** All attributes, their locations, and basic type information. Also an auto-deduced step mode */\n attributes: AttributeDeclaration[];\n /** All bidning points (textures, samplers, uniform buffers) with their locations and type */\n bindings: BindingDeclaration[];\n /** WebGL only (WebGPU use bindings and uniform buffers) */\n uniforms?: any[];\n /** WebGL2 only (WebGPU use compute shaders) */\n varyings?: VaryingBinding[];\n};\n\n/**\n * Declares one for attributes\n */\nexport type AttributeDeclaration = {\n /** The name of this attribute in the shader */\n name: string;\n /** The index into the GPU's vertex array buffer bank (usually between 0-15) */\n location: number;\n /** WebGPU-style shader type. The declared format of the attribute in the shader code. Buffer's vertex format needs to map to this. */\n type: ShaderAttributeType;\n /** Inferred from attribute name. @note Technically not part of static structure of shader */\n stepMode?: 'vertex' | 'instance';\n};\n\n// BINDING LAYOUTS\n\n/*\ntype Binding = {\n binding: number;\n visibility: number;\n\n buffer?: {\n type?: 'uniform' | 'storage' | 'read-only-storage';\n hasDynamicOffset?: false;\n minBindingSize?: number;\n };\n\n // type = sampler\n samplerType?: 'filtering' | 'non-filtering' | 'comparison';\n\n // type = texture\n viewDimension?: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';\n sampleType?: 'float' | 'unfilterable-float' | 'depth' | 'sint' | 'uint';\n multisampled?: boolean;\n\n // type = storage\n viewDimension?: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';\n access: 'read-only' | 'write-only';\n format: string;\n};\n*/\n\n/** ShaderLayout for bindings */\nexport type BindingDeclaration =\n | UniformBufferBindingLayout\n | BufferBindingLayout\n | TextureBindingLayout\n | SamplerBindingLayout\n | StorageTextureBindingLayout;\n\nexport type UniformBufferBindingLayout = {\n type: 'uniform';\n name: string;\n location: number;\n visibility?: number;\n hasDynamicOffset?: boolean;\n minBindingSize?: number;\n uniforms?: UniformInfo[];\n};\n\nexport type UniformInfo = {\n name: string;\n format: ShaderUniformType;\n type?: string;\n arrayLength: number;\n byteOffset: number;\n byteStride: number;\n};\n\nexport type BufferBindingLayout = {\n type: 'uniform' | 'storage' | 'read-only-storage';\n name: string;\n location: number;\n visibility?: number;\n hasDynamicOffset?: boolean;\n minBindingSize?: number;\n};\n\ntype TextureBindingLayout = {\n type: 'texture';\n name: string;\n location: number;\n visibility?: number;\n viewDimension?: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d'; // default: '2d'\n sampleType?: 'float' | 'unfilterable-float' | 'depth' | 'sint' | 'uint'; // default: 'float'\n multisampled?: boolean;\n};\n\ntype SamplerBindingLayout = {\n type: 'sampler';\n name: string;\n location: number;\n visibility?: number;\n samplerType?: 'filtering' | 'non-filtering' | 'comparison'; // default: filtering\n};\n\ntype StorageTextureBindingLayout = {\n type: 'storage';\n name: string;\n location: number;\n visibility?: number;\n access?: 'write-only';\n format: TextureFormat;\n viewDimension?: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';\n};\n\n// BINDINGS\n\n/** Binding value */\nexport type Binding = Texture | Sampler | Buffer | {buffer: Buffer; offset?: number; size?: number};\n\n// SHADER LAYOUTS\n\n/**\n * Describes a varying binding for a program\n * @deprecated Varyings are WebGL-only\n */\nexport type VaryingBinding = {\n location: number;\n name: string;\n accessor: AccessorObject;\n};\n\n// Uniform bindings\n\n/** Describes a uniform block binding for a program */\nexport type UniformBlockBinding = {\n location: number;\n name: string;\n byteLength: number;\n vertex: boolean;\n fragment: boolean;\n uniformCount: number;\n uniformIndices?: number[];\n uniforms: UniformInfo[];\n};\n\n/** Describes a uniform (sampler etc) binding for a program */\nexport type UniformBinding = {\n location: number;\n name: string;\n size: number;\n type: number;\n isArray: boolean;\n};\n\n/** @deprecated */\nexport type AttributeBinding = {\n name: string;\n location: number;\n accessor: AccessorObject;\n};\n"],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Primitive data types understood by shaders
|
|
3
|
+
* @note These types describe the type used in shader calculations, but for attribute inputs these can be populated from a different in-memory type.
|
|
4
|
+
* @note bindings (like textures, samplers, and uniform buffers) are considered "bindings", not types
|
|
5
|
+
* @note `f16` requires the `f16` extension
|
|
6
|
+
*/
|
|
7
|
+
export type ShaderDataType = 'u32' | 'i32' | 'f32' | 'f16';
|
|
8
|
+
/**
|
|
9
|
+
* Describes the type of an attribute as defined in the shader source code.
|
|
10
|
+
* @note Buffers with various `VertexFormat`s can be supplied for each type, and the GPU will convert them at runtime,
|
|
11
|
+
* but there are limitations, see documentation for details.
|
|
12
|
+
*/
|
|
13
|
+
export type ShaderAttributeType = 'f32' | 'vec2<f32>' | 'vec3<f32>' | 'vec4<f32>' | 'i32' | 'vec2<i32>' | 'vec3<i32>' | 'vec4<i32>' | 'u32' | 'vec2<u32>' | 'vec3<u32>' | 'vec4<u32>' | 'f16' | 'vec2<f16>' | 'vec3<f16>' | 'vec4<f16>';
|
|
14
|
+
/**
|
|
15
|
+
* Describes the type of a uniform as described in the shader source code.
|
|
16
|
+
* Uniforms can be of a wider range of types than attributes.
|
|
17
|
+
*/
|
|
18
|
+
export type ShaderUniformType = 'f32' | 'i32' | 'u32' | 'vec2<f32>' | 'vec3<f32>' | 'vec4<f32>' | 'vec2<i32>' | 'vec3<i32>' | 'vec4<i32>' | 'vec2<u32>' | 'vec3<u32>' | 'vec4<u32>' | 'mat2x2<f32>' | 'mat2x3<f32>' | 'mat2x4<f32>' | 'mat3x2<f32>' | 'mat3x3<f32>' | 'mat3x4<f32>' | 'mat4x2<f32>' | 'mat4x3<f32>' | 'mat4x4<f32>';
|
|
19
|
+
/** Shorthand type aliases recognized by WGSL */
|
|
20
|
+
export type ShaderTypeAlias = 'vec2i' | 'vec3i' | 'vec4i' | 'vec2u' | 'vec3u' | 'vec4u' | 'vec2f' | 'vec3f' | 'vec4f' | 'vec2h' | 'vec3h' | 'vec4h';
|
|
21
|
+
//# sourceMappingURL=shader-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shader-types.d.ts","sourceRoot":"","sources":["../../../src/adapter/types/shader-types.ts"],"names":[],"mappings":"AAGA;;;;;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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shader-types.js","names":[],"sources":["../../../src/adapter/types/shader-types.ts"],"sourcesContent":["// luma.gl, MIT license\n// Copyright (c) vis.gl contributors\n\n/**\n * Primitive data types understood by shaders\n * @note These types describe the type used in shader calculations, but for attribute inputs these can be populated from a different in-memory type.\n * @note bindings (like textures, samplers, and uniform buffers) are considered \"bindings\", not types\n * @note `f16` requires the `f16` extension\n */\nexport type ShaderDataType = 'u32' | 'i32' | 'f32' | 'f16';\n\n/**\n * Describes the type of an attribute as defined in the shader source code.\n * @note Buffers with various `VertexFormat`s can be supplied for each type, and the GPU will convert them at runtime,\n * but there are limitations, see documentation for details.\n */\nexport type ShaderAttributeType =\n | 'f32'\n | 'vec2<f32>'\n | 'vec3<f32>'\n | 'vec4<f32>'\n | 'i32'\n | 'vec2<i32>'\n | 'vec3<i32>'\n | 'vec4<i32>'\n | 'u32'\n | 'vec2<u32>'\n | 'vec3<u32>'\n | 'vec4<u32>'\n // requires `f16` extension\n | 'f16'\n | 'vec2<f16>'\n | 'vec3<f16>'\n | 'vec4<f16>';\n\n/**\n * Describes the type of a uniform as described in the shader source code.\n * Uniforms can be of a wider range of types than attributes.\n */\nexport type ShaderUniformType =\n | 'f32'\n | 'i32'\n | 'u32'\n | 'vec2<f32>'\n | 'vec3<f32>'\n | 'vec4<f32>'\n | 'vec2<i32>'\n | 'vec3<i32>'\n | 'vec4<i32>'\n | 'vec2<u32>'\n | 'vec3<u32>'\n | 'vec4<u32>'\n | 'mat2x2<f32>'\n | 'mat2x3<f32>'\n | 'mat2x4<f32>'\n | 'mat3x2<f32>'\n | 'mat3x3<f32>'\n | 'mat3x4<f32>'\n | 'mat4x2<f32>'\n | 'mat4x3<f32>'\n | 'mat4x4<f32>';\n\n/** Shorthand type aliases recognized by WGSL */\nexport type ShaderTypeAlias =\n | 'vec2i'\n | 'vec3i'\n | 'vec4i'\n | 'vec2u'\n | 'vec3u'\n | 'vec4u'\n | 'vec2f'\n | 'vec3f'\n | 'vec4f'\n // Requires the f16 extension.\n | 'vec2h'\n | 'vec3h'\n | 'vec4h';\n"],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Texture formats */
|
|
2
|
+
export type TextureFormat = ColorTextureFormat | DepthStencilTextureFormat;
|
|
3
|
+
/** Depth and stencil texture formats */
|
|
4
|
+
export type DepthStencilTextureFormat = 'stencil8' | 'depth16unorm' | 'depth24plus' | 'depth24plus-stencil8' | 'depth32float' | 'depth24unorm-stencil8' | 'depth32float-stencil8';
|
|
5
|
+
/** Texture formats for color attachments */
|
|
6
|
+
export type ColorTextureFormat = WebGPUColorTextureFormat | WebGL2ColorTextureFormat | UnsizedColorTextureFormat;
|
|
7
|
+
export type WebGPUColorTextureFormat = 'r8unorm' | 'r8snorm' | 'r8uint' | 'r8sint' | 'r16uint' | 'r16sint' | 'r16float' | 'rg8unorm' | 'rg8snorm' | 'rg8uint' | 'rg8sint' | 'r32uint' | 'r32sint' | 'r32float' | 'rg16uint' | 'rg16sint' | 'rg16float' | 'rgba8unorm' | 'rgba8unorm-srgb' | 'rgba8snorm' | 'rgba8uint' | 'rgba8sint' | 'bgra8unorm' | 'bgra8unorm-srgb' | 'rgb9e5ufloat' | 'rgb10a2unorm' | 'rg11b10ufloat' | 'rg32uint' | 'rg32sint' | 'rg32float' | 'rgba16uint' | 'rgba16sint' | 'rgba16float' | 'rgba32uint' | 'rgba32sint' | 'rgba32float' | 'bc1-rgba-unorm' | 'bc1-rgba-unorm-srgb' | 'bc2-rgba-unorm' | 'bc2-rgba-unorm-srgb' | 'bc3-rgba-unorm' | 'bc3-rgba-unorm-srgb' | 'bc4-r-unorm' | 'bc4-r-snorm' | 'bc5-rg-unorm' | 'bc5-rg-snorm' | 'bc6h-rgb-ufloat' | 'bc6h-rgb-float' | 'bc7-rgba-unorm' | 'bc7-rgba-unorm-srgb' | 'etc2-rgb8unorm' | 'etc2-rgb8unorm-srgb' | 'etc2-rgb8a1unorm' | 'etc2-rgb8a1unorm-srgb' | 'etc2-rgba8unorm' | 'etc2-rgba8unorm-srgb' | 'eac-r11unorm' | 'eac-r11snorm' | 'eac-rg11unorm' | 'eac-rg11snorm' | 'astc-4x4-unorm' | 'astc-4x4-unorm-srgb' | 'astc-5x4-unorm' | 'astc-5x4-unorm-srgb' | 'astc-5x5-unorm' | 'astc-5x5-unorm-srgb' | 'astc-6x5-unorm' | 'astc-6x5-unorm-srgb' | 'astc-6x6-unorm' | 'astc-6x6-unorm-srgb' | 'astc-8x5-unorm' | 'astc-8x5-unorm-srgb' | 'astc-8x6-unorm' | 'astc-8x6-unorm-srgb' | 'astc-8x8-unorm' | 'astc-8x8-unorm-srgb' | 'astc-10x5-unorm' | 'astc-10x5-unorm-srgb' | 'astc-10x6-unorm' | 'astc-10x6-unorm-srgb' | 'astc-10x8-unorm' | 'astc-10x8-unorm-srgb' | 'astc-10x10-unorm' | 'astc-10x10-unorm-srgb' | 'astc-12x10-unorm' | 'astc-12x10-unorm-srgb' | 'astc-12x12-unorm' | 'astc-12x12-unorm-srgb';
|
|
8
|
+
/** Unsized texture formats (the only formats supported by WebGL1) */
|
|
9
|
+
export type UnsizedColorTextureFormat = 'rgb8unorm-unsized' | 'rgba8unorm-unsized';
|
|
10
|
+
/** Sized formats unique to WebGL 2. Will perhaps be added to WebGPU? */
|
|
11
|
+
export type WebGL2ColorTextureFormat = 'r16unorm-webgl' | 'r16snorm-webgl' | 'rgba4unorm-webgl' | 'rgb565unorm-webgl' | 'rgb5a1unorm-webgl' | 'rgb8unorm-webgl' | 'rgb8snorm-webgl' | 'rg16unorm-webgl' | 'rg16snorm-webgl' | 'rgb10a2unorm-webgl' | 'rgb16unorm-webgl' | 'rgb16snorm-webgl' | 'rgba16unorm-webgl' | 'rgba16snorm-webgl' | 'rgb32float-webgl' | 'bc1-rgb-unorm-webgl' | 'bc1-rgb-unorm-srgb-webgl' | 'pvrtc-rgb4unorm-webgl' | 'pvrtc-rgba4unorm-webgl' | 'pvrtc-rbg2unorm-webgl' | 'pvrtc-rgba2unorm-webgl' | 'etc1-rbg-unorm-webgl' | 'atc-rgb-unorm-webgl' | 'atc-rgba-unorm-webgl' | 'atc-rgbai-unorm-webgl';
|
|
12
|
+
//# sourceMappingURL=texture-formats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture-formats.d.ts","sourceRoot":"","sources":["../../../src/adapter/types/texture-formats.ts"],"names":[],"mappings":"AAGA,sBAAsB;AACtB,MAAM,MAAM,aAAa,GAAG,kBAAkB,GAAG,yBAAyB,CAAC;AAE3E,wCAAwC;AACxC,MAAM,MAAM,yBAAyB,GACnC,UAAU,GACV,cAAc,GACd,aAAa,GACb,sBAAsB,GACtB,cAAc,GAEd,uBAAuB,GAEvB,uBAAuB,CAAC;AAE1B,4CAA4C;AAC5C,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,GAAG,wBAAwB,GAAG,yBAAyB,CAAC;AAEjH,M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oB,CAGnB;AAEH,wEAAwE;AACxE,MAAM,MAAM,wBAAwB,GAClC,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,mBAAmB,GACnB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,oBAAoB,GACpB,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture-formats.js","names":[],"sources":["../../../src/adapter/types/texture-formats.ts"],"sourcesContent":["// luma.gl, MIT license\n// Copyright (c) vis.gl contributors\n\n/** Texture formats */\nexport type TextureFormat = ColorTextureFormat | DepthStencilTextureFormat;\n\n/** Depth and stencil texture formats */\nexport type DepthStencilTextureFormat =\n 'stencil8' |\n 'depth16unorm' |\n 'depth24plus' |\n 'depth24plus-stencil8' |\n 'depth32float' |\n // device.features.has('depth24unorm-stencil8')\n 'depth24unorm-stencil8' |\n // device.features.has('depth32float-stencil8')\n 'depth32float-stencil8';\n\n/** Texture formats for color attachments */\nexport type ColorTextureFormat = WebGPUColorTextureFormat | WebGL2ColorTextureFormat | UnsizedColorTextureFormat;\n\nexport type WebGPUColorTextureFormat =\n // 8-bit formats\n 'r8unorm' |\n 'r8snorm' |\n 'r8uint' |\n 'r8sint' |\n\n // 16-bit formats\n 'r16uint' |\n 'r16sint' |\n 'r16float' |\n 'rg8unorm' |\n 'rg8snorm' |\n 'rg8uint' |\n 'rg8sint' |\n\n // 32-bit formats\n 'r32uint' |\n 'r32sint' |\n 'r32float' |\n 'rg16uint' |\n 'rg16sint' |\n 'rg16float' |\n 'rgba8unorm' |\n 'rgba8unorm-srgb' |\n 'rgba8snorm' |\n 'rgba8uint' |\n 'rgba8sint' |\n 'bgra8unorm' |\n 'bgra8unorm-srgb' |\n // Packed 32-bit formats\n 'rgb9e5ufloat' |\n 'rgb10a2unorm' |\n 'rg11b10ufloat' |\n\n // 64-bit formats\n 'rg32uint' |\n 'rg32sint' |\n 'rg32float' |\n 'rgba16uint' |\n 'rgba16sint' |\n 'rgba16float' |\n\n // 128-bit formats\n 'rgba32uint' |\n 'rgba32sint' |\n 'rgba32float' |\n\n // BC compressed formats usable if 'texture-compression-bc' is both\n // supported by the device/user agent and enabled in requestDevice.\n 'bc1-rgba-unorm' |\n 'bc1-rgba-unorm-srgb' |\n 'bc2-rgba-unorm' |\n 'bc2-rgba-unorm-srgb' |\n 'bc3-rgba-unorm' |\n 'bc3-rgba-unorm-srgb' |\n 'bc4-r-unorm' |\n 'bc4-r-snorm' |\n 'bc5-rg-unorm' |\n 'bc5-rg-snorm' |\n 'bc6h-rgb-ufloat' |\n 'bc6h-rgb-float' |\n 'bc7-rgba-unorm' |\n 'bc7-rgba-unorm-srgb' |\n\n // ETC2 compressed formats usable if \"texture-compression-etc2\" is both\n // supported by the device/user agent and enabled in requestDevice.\n 'etc2-rgb8unorm' |\n 'etc2-rgb8unorm-srgb' |\n 'etc2-rgb8a1unorm' |\n 'etc2-rgb8a1unorm-srgb' |\n 'etc2-rgba8unorm' |\n 'etc2-rgba8unorm-srgb' |\n 'eac-r11unorm' |\n 'eac-r11snorm' |\n 'eac-rg11unorm' |\n 'eac-rg11snorm' |\n\n // ASTC compressed formats usable if \"texture-compression-astc\" is both\n // supported by the device/user agent and enabled in requestDevice.\n 'astc-4x4-unorm' |\n 'astc-4x4-unorm-srgb' |\n 'astc-5x4-unorm' |\n 'astc-5x4-unorm-srgb' |\n 'astc-5x5-unorm' |\n 'astc-5x5-unorm-srgb' |\n 'astc-6x5-unorm' |\n 'astc-6x5-unorm-srgb' |\n 'astc-6x6-unorm' |\n 'astc-6x6-unorm-srgb' |\n 'astc-8x5-unorm' |\n 'astc-8x5-unorm-srgb' |\n 'astc-8x6-unorm' |\n 'astc-8x6-unorm-srgb' |\n 'astc-8x8-unorm' |\n 'astc-8x8-unorm-srgb' |\n 'astc-10x5-unorm' |\n 'astc-10x5-unorm-srgb' |\n 'astc-10x6-unorm' |\n 'astc-10x6-unorm-srgb' |\n 'astc-10x8-unorm' |\n 'astc-10x8-unorm-srgb' |\n 'astc-10x10-unorm' |\n 'astc-10x10-unorm-srgb' |\n 'astc-12x10-unorm' |\n 'astc-12x10-unorm-srgb' |\n 'astc-12x12-unorm' |\n 'astc-12x12-unorm-srgb'\n ;\n\n/** Unsized texture formats (the only formats supported by WebGL1) */\nexport type UnsizedColorTextureFormat =\n // 'r8unorm-unsized' |\n // 'ra8unorm-unsized' |\n 'rgb8unorm-unsized' |\n 'rgba8unorm-unsized'\n // 'rgb8unorm-srgb-unsized' |\n // 'rgba8unorm-srgb-unsized'\n ;\n\n/** Sized formats unique to WebGL 2. Will perhaps be added to WebGPU? */\nexport type WebGL2ColorTextureFormat =\n 'r16unorm-webgl' |\n 'r16snorm-webgl' |\n 'rgba4unorm-webgl' |\n 'rgb565unorm-webgl' |\n 'rgb5a1unorm-webgl' |\n 'rgb8unorm-webgl' |\n 'rgb8snorm-webgl' |\n 'rg16unorm-webgl' |\n 'rg16snorm-webgl' |\n 'rgb10a2unorm-webgl' |\n 'rgb16unorm-webgl' |\n 'rgb16snorm-webgl' |\n 'rgba16unorm-webgl' |\n 'rgba16snorm-webgl' |\n 'rgb32float-webgl' |\n 'bc1-rgb-unorm-webgl' |\n 'bc1-rgb-unorm-srgb-webgl' |\n 'pvrtc-rgb4unorm-webgl' |\n 'pvrtc-rgba4unorm-webgl' |\n 'pvrtc-rbg2unorm-webgl' |\n 'pvrtc-rgba2unorm-webgl' |\n 'etc1-rbg-unorm-webgl' |\n 'atc-rgb-unorm-webgl' |\n 'atc-rgba-unorm-webgl' |\n 'atc-rgbai-unorm-webgl';\n"],"mappings":""}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { NumberArray } from '../../types';
|
|
2
|
+
import type { ColorTextureFormat, DepthStencilTextureFormat, TextureFormat } from './texture-formats';
|
|
3
|
+
import type { Buffer } from '../resources/buffer';
|
|
4
|
+
import type { Texture } from '../resources/texture';
|
|
5
|
+
/** Valid values for uniforms. @note boolean values get converted to 0 or 1 before setting */
|
|
6
|
+
export type UniformValue = number | boolean | Readonly<NumberArray>;
|
|
7
|
+
/** Buffer bindings */
|
|
8
|
+
export type Binding = Texture | Buffer | {
|
|
9
|
+
buffer: Buffer;
|
|
10
|
+
offset?: number;
|
|
11
|
+
size?: number;
|
|
12
|
+
};
|
|
13
|
+
/** Describes a buffer binding layout */
|
|
14
|
+
type BufferBindingLayout = {
|
|
15
|
+
/** The index of the binding point in the compiled and linked shader */
|
|
16
|
+
location?: number;
|
|
17
|
+
visibility: number;
|
|
18
|
+
/** type of buffer */
|
|
19
|
+
type: 'uniform' | 'storage' | 'read-only-storage';
|
|
20
|
+
hasDynamicOffset?: boolean;
|
|
21
|
+
minBindingSize?: number;
|
|
22
|
+
};
|
|
23
|
+
/** Describes a texture binding */
|
|
24
|
+
type TextureBindingLayout = {
|
|
25
|
+
/** The index of the binding point in the compiled and linked shader */
|
|
26
|
+
location?: number;
|
|
27
|
+
visibility: number;
|
|
28
|
+
viewDimension?: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';
|
|
29
|
+
sampleType?: 'float' | 'unfilterable-float' | 'depth' | 'sint' | 'uint';
|
|
30
|
+
multisampled?: boolean;
|
|
31
|
+
};
|
|
32
|
+
/** Describes a storage texture binding */
|
|
33
|
+
type StorageTextureBindingLayout = {
|
|
34
|
+
/** The index of the binding point in the compiled and linked shader */
|
|
35
|
+
location?: number;
|
|
36
|
+
visibility: number;
|
|
37
|
+
access?: 'write-only';
|
|
38
|
+
format: TextureFormat;
|
|
39
|
+
viewDimension?: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';
|
|
40
|
+
};
|
|
41
|
+
export type BindingDeclaration = BufferBindingLayout | TextureBindingLayout | StorageTextureBindingLayout;
|
|
42
|
+
export type TextureView = {
|
|
43
|
+
texture: WebGLTexture;
|
|
44
|
+
layer?: number;
|
|
45
|
+
level?: number;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Framebuffer attachments lets the user specify the textures that will be used for a RenderPass,
|
|
49
|
+
* together with some additional options for how to clear.
|
|
50
|
+
*/
|
|
51
|
+
export type ColorAttachment = {
|
|
52
|
+
/** Describes the texture subresource that will be output to for this color attachment. */
|
|
53
|
+
texture?: Texture;
|
|
54
|
+
/** Format of the texture resource. Used to auto create texture if not supplied */
|
|
55
|
+
format?: ColorTextureFormat;
|
|
56
|
+
/** Value to clear to prior to executing the render pass. Default: [0, 0, 0, 0]. Ignored if loadOp is not "clear". */
|
|
57
|
+
clearValue?: number[];
|
|
58
|
+
/** load operation to perform on texture prior to executing the render pass. Default: 'clear'. */
|
|
59
|
+
loadOp?: 'load' | 'clear';
|
|
60
|
+
/** The store operation to perform on texture after executing the render pass. Default: 'store'. */
|
|
61
|
+
storeOp?: 'store' | 'discard';
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Framebuffer attachments lets the user specify the depth stencil texture that will be used for a RenderPass,
|
|
65
|
+
* together with some additional options for how to clear.
|
|
66
|
+
*/
|
|
67
|
+
export type DepthStencilAttachment = {
|
|
68
|
+
/** Describes the texture subresource that will be output to and read from for this depth/stencil attachment. */
|
|
69
|
+
texture?: Texture;
|
|
70
|
+
/** Format of the texture resource. Used to auto create texture if not supplied */
|
|
71
|
+
format?: DepthStencilTextureFormat;
|
|
72
|
+
/** Value to clear depth component to prior to executing the render pass, if depthLoadOp is "clear". 0.0-1.0. */
|
|
73
|
+
depthClearValue?: number;
|
|
74
|
+
/** Indicates load operation to perform on depth component prior to executing the render pass. Default 'clear'. */
|
|
75
|
+
depthLoadOp?: 'load' | 'clear';
|
|
76
|
+
/** Store operation to perform on depth component after executing the render pass. Default: 'store'. */
|
|
77
|
+
depthStoreOp?: 'store' | 'discard';
|
|
78
|
+
/** Indicates that the depth component is read only. */
|
|
79
|
+
depthReadOnly?: boolean;
|
|
80
|
+
/** Indicates value to clear stencil component to prior to executing the render pass, if stencilLoadOp is "clear". */
|
|
81
|
+
stencilClearValue?: number;
|
|
82
|
+
/** Indicates load operation to perform on stencil component prior to executing the render pass. Prefer clearing. */
|
|
83
|
+
stencilLoadOp?: 'load' | 'clear';
|
|
84
|
+
/** Store operation to perform on stencil component after executing the render pass. */
|
|
85
|
+
stencilStoreOp?: 'store' | 'discard';
|
|
86
|
+
/** Indicates that the stencil component is read only. */
|
|
87
|
+
stencilReadOnly?: boolean;
|
|
88
|
+
};
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapter/types/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAC,kBAAkB,EAAE,yBAAyB,EAAE,aAAa,EAAC,MAAM,mBAAmB,CAAC;AACpG,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAIlD,6FAA6F;AAC7F,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;AAIpE,sBAAsB;AACtB,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG;IAAC,MAAM,EAAE,MAAM,CAAC;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAI3F,wCAAwC;AACxC,KAAK,mBAAmB,GAAG;IACzB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,M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AqH;IACrH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,iGAAiG;IACjG,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,mGAAmG;IACnG,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,gHAAgH;IAChH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kFAAkF;IAClF,MAAM,CAAC,EAAE,yBAAyB,CAAC;IAEnC,gHAAgH;IAChH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kHAAkH;IAClH,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,uGAAuG;IACvG,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,uDAAuD;IACvD,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,qHAAqH;IACrH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qHAAqH;IACrH,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,uFAAuF;IACvF,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,yDAAyD;IACzD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/adapter/types/types.ts"],"sourcesContent":["// luma.gl, MIT license\nimport {NumberArray} from '../../types';\nimport type {ColorTextureFormat, DepthStencilTextureFormat, TextureFormat} from './texture-formats';\nimport type {Buffer} from '../resources/buffer';\nimport type {Texture} from '../resources/texture'; // TextureView...\n\n// UNIFORMS\n\n/** Valid values for uniforms. @note boolean values get converted to 0 or 1 before setting */\nexport type UniformValue = number | boolean | Readonly<NumberArray>; // Float32Array> | Readonly<Int32Array> | Readonly<Uint32Array> | Readonly<number[]>;\n\n// BINDINGS\n\n/** Buffer bindings */\nexport type Binding = Texture | Buffer | {buffer: Buffer, offset?: number, size?: number};\n\n// BINDING LAYOUTS\n\n/** Describes a buffer binding layout */\ntype BufferBindingLayout = {\n /** The index of the binding point in the compiled and linked shader */\n location?: number;\n visibility: number;\n /** type of buffer */\n type: 'uniform' | 'storage' | 'read-only-storage';\n hasDynamicOffset?: boolean;\n minBindingSize?: number;\n}\n\n/** Describes a texture binding */\ntype TextureBindingLayout = {\n /** The index of the binding point in the compiled and linked shader */\n location?: number;\n visibility: number;\n viewDimension?: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';\n sampleType?: 'float' | 'unfilterable-float' | 'depth' | 'sint' | 'uint';\n multisampled?: boolean;\n};\n\n/** Describes a storage texture binding */\ntype StorageTextureBindingLayout = {\n /** The index of the binding point in the compiled and linked shader */\n location?: number;\n visibility: number;\n access?: 'write-only';\n format: TextureFormat;\n viewDimension?: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';\n};\n\nexport type BindingDeclaration = BufferBindingLayout | TextureBindingLayout | StorageTextureBindingLayout;\n\n// TEXTURE VIEWS\n\nexport type TextureView = {\n texture: WebGLTexture;\n layer?: number; // = 0\n level?: number; // = 0\n};\n\n// ATTACHMENTS (See Framebuffer)\n\n/**\n * Framebuffer attachments lets the user specify the textures that will be used for a RenderPass, \n * together with some additional options for how to clear.\n */\nexport type ColorAttachment = {\n /** Describes the texture subresource that will be output to for this color attachment. */\n texture?: Texture;\n /** Format of the texture resource. Used to auto create texture if not supplied */\n format?: ColorTextureFormat;\n /* Describes the texture subresource that will receive resolved output for this color attachment if multisampled. */\n // resolveTarget?: GPUTextureView;\n\n /** Value to clear to prior to executing the render pass. Default: [0, 0, 0, 0]. Ignored if loadOp is not \"clear\". */\n clearValue?: number[];\n /** load operation to perform on texture prior to executing the render pass. Default: 'clear'. */\n loadOp?: 'load' | 'clear';\n /** The store operation to perform on texture after executing the render pass. Default: 'store'. */\n storeOp?: 'store' | 'discard';\n};\n\n/**\n * Framebuffer attachments lets the user specify the depth stencil texture that will be used for a RenderPass, \n * together with some additional options for how to clear.\n */\nexport type DepthStencilAttachment = {\n /** Describes the texture subresource that will be output to and read from for this depth/stencil attachment. */\n texture?: Texture;\n /** Format of the texture resource. Used to auto create texture if not supplied */\n format?: DepthStencilTextureFormat;\n\n /** Value to clear depth component to prior to executing the render pass, if depthLoadOp is \"clear\". 0.0-1.0. */\n depthClearValue?: number;\n /** Indicates load operation to perform on depth component prior to executing the render pass. Default 'clear'. */\n depthLoadOp?: 'load' | 'clear';\n /** Store operation to perform on depth component after executing the render pass. Default: 'store'. */\n depthStoreOp?: 'store' | 'discard';\n /** Indicates that the depth component is read only. */\n depthReadOnly?: boolean;\n\n /** Indicates value to clear stencil component to prior to executing the render pass, if stencilLoadOp is \"clear\". */\n stencilClearValue?: number;\n /** Indicates load operation to perform on stencil component prior to executing the render pass. Prefer clearing. */\n stencilLoadOp?: 'load' | 'clear';\n /** Store operation to perform on stencil component after executing the render pass. */\n stencilStoreOp?: 'store' | 'discard';\n /** Indicates that the stencil component is read only. */\n stencilReadOnly?: boolean;\n};\n"],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Basic data types signed and unsigned integers, and floats, of varying sizes */
|
|
2
|
+
export type DataType = 'uint8' | 'sint8' | 'uint16' | 'sint16' | 'uint32' | 'sint32' | 'float16' | 'float32';
|
|
3
|
+
/** Vertex and Pixel data types. Include normalized integers */
|
|
4
|
+
export type NormalizedDataType = 'uint8' | 'sint8' | 'unorm8' | 'snorm8' | 'uint16' | 'sint16' | 'unorm16' | 'snorm16' | 'uint32' | 'sint32' | 'float32' | 'float16';
|
|
5
|
+
/** Describes the type (without number of components) of a vertex format */
|
|
6
|
+
export type VertexType = NormalizedDataType;
|
|
7
|
+
/**
|
|
8
|
+
* Describes the memory format of a buffer that will be supplied to vertex attributes
|
|
9
|
+
* @note Must be compatible with the ShaderAttributeType of the shaders, see documentation.
|
|
10
|
+
* @note This is a superset of WebGPU vertex formats to allow foe some flexibility for WebGL only applications
|
|
11
|
+
* @todo Add device.isTextureFormatSupported() method?
|
|
12
|
+
*/
|
|
13
|
+
export type VertexFormat = 'uint8x2' | 'uint8x4' | 'sint8x2' | 'sint8x4' | 'unorm8-webgl' | 'unorm8x2' | 'unorm8x3-webgl' | 'unorm8x4' | 'snorm8-webgl' | 'snorm8x2' | 'snorm8x3-webgl' | 'snorm8x4' | 'uint16x2' | 'uint16x4' | 'sint16x2' | 'sint16x4' | 'unorm16x2' | 'unorm16x4' | 'snorm16x2' | 'snorm16x4' | 'uint32' | 'uint32x2' | 'uint32x3' | 'uint32x4' | 'sint32' | 'sint32x2' | 'sint32x3' | 'sint32x4' | 'float16x2' | 'float16x4' | 'float32' | 'float32x2' | 'float32x3' | 'float32x4';
|
|
14
|
+
//# sourceMappingURL=vertex-formats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertex-formats.d.ts","sourceRoot":"","sources":["../../../src/adapter/types/vertex-formats.ts"],"names":[],"mappings":"AAGA,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,CACV;AAEH,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,CACZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertex-formats.js","names":[],"sources":["../../../src/adapter/types/vertex-formats.ts"],"sourcesContent":["// luma.gl, MIT license\n// Copyright (c) vis.gl contributors\n\n/** Basic data types signed and unsigned integers, and floats, of varying sizes */\nexport type DataType =\n | 'uint8'\n | 'sint8'\n | 'uint16'\n | 'sint16'\n | 'uint32'\n | 'sint32'\n | 'float16'\n | 'float32';\n\n/** Vertex and Pixel data types. Include normalized integers */\nexport type NormalizedDataType =\n | 'uint8'\n | 'sint8'\n | 'unorm8'\n | 'snorm8'\n | 'uint16'\n | 'sint16'\n | 'unorm16'\n | 'snorm16'\n | 'uint32'\n | 'sint32'\n // WebGPU does not support normalized 32 bit integer attributes...\n // | 'unorm32'\n // | 'snorm32'\n | 'float32'\n | 'float16'\n ;\n\n/** Describes the type (without number of components) of a vertex format */\nexport type VertexType = NormalizedDataType;\n\n/**\n * Describes the memory format of a buffer that will be supplied to vertex attributes\n * @note Must be compatible with the ShaderAttributeType of the shaders, see documentation.\n * @note This is a superset of WebGPU vertex formats to allow foe some flexibility for WebGL only applications\n * @todo Add device.isTextureFormatSupported() method?\n */\nexport type VertexFormat =\n // 8 bit integers, note that only 16 bit aligned formats are supported in WebGPU (x2 and x4)\n | 'uint8x2'\n | 'uint8x4'\n | 'sint8x2'\n | 'sint8x4'\n | 'unorm8-webgl'\n | 'unorm8x2'\n | 'unorm8x3-webgl'\n | 'unorm8x4'\n | 'snorm8-webgl'\n | 'snorm8x2'\n | 'snorm8x3-webgl'\n | 'snorm8x4'\n // 16 bit integers, note that only 32 bit aligned formats are supported in WebGPU (x2 and x4)\n | 'uint16x2'\n | 'uint16x4'\n | 'sint16x2'\n | 'sint16x4'\n | 'unorm16x2'\n | 'unorm16x4'\n | 'snorm16x2'\n | 'snorm16x4'\n // 32 bit integers\n | 'uint32'\n | 'uint32x2'\n | 'uint32x3'\n | 'uint32x4'\n | 'sint32'\n | 'sint32x2'\n | 'sint32x3'\n | 'sint32x4'\n // No normalized 32 bit integers in WebGPU...\n // | 'unorm32'\n // | 'unorm32x2'\n // | 'unorm32x3'\n // | 'unorm32x4'\n // | 'snorm32'\n // | 'snorm32x2'\n // | 'snorm32x3'\n // | 'snorm32x4'\n // floats\n | 'float16x2'\n | 'float16x4'\n | 'float32'\n | 'float32x2'\n | 'float32x3'\n | 'float32x4'\n ;\n"],"mappings":""}
|