@luma.gl/core 9.0.17 → 9.1.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/dist/adapter/adapter.d.ts +11 -0
  2. package/dist/adapter/adapter.d.ts.map +1 -0
  3. package/dist/adapter/adapter.js +8 -0
  4. package/dist/adapter/canvas-context.d.ts +5 -0
  5. package/dist/adapter/canvas-context.d.ts.map +1 -1
  6. package/dist/adapter/device.d.ts +23 -11
  7. package/dist/adapter/device.d.ts.map +1 -1
  8. package/dist/adapter/device.js +22 -20
  9. package/dist/adapter/luma.d.ts +70 -0
  10. package/dist/adapter/luma.d.ts.map +1 -0
  11. package/dist/adapter/luma.js +159 -0
  12. package/dist/adapter/resources/buffer.js +5 -5
  13. package/dist/adapter/resources/compute-pipeline.d.ts +2 -0
  14. package/dist/adapter/resources/compute-pipeline.d.ts.map +1 -1
  15. package/dist/adapter/resources/compute-pipeline.js +3 -0
  16. package/dist/adapter/resources/external-texture.d.ts +1 -1
  17. package/dist/adapter/resources/external-texture.d.ts.map +1 -1
  18. package/dist/adapter/resources/external-texture.js +1 -1
  19. package/dist/adapter/resources/framebuffer.d.ts +3 -3
  20. package/dist/adapter/resources/framebuffer.d.ts.map +1 -1
  21. package/dist/adapter/resources/framebuffer.js +2 -83
  22. package/dist/adapter/resources/render-pass.d.ts +2 -2
  23. package/dist/adapter/resources/render-pass.d.ts.map +1 -1
  24. package/dist/adapter/resources/render-pipeline.d.ts +2 -5
  25. package/dist/adapter/resources/render-pipeline.d.ts.map +1 -1
  26. package/dist/adapter/resources/resource.d.ts +3 -3
  27. package/dist/adapter/resources/resource.d.ts.map +1 -1
  28. package/dist/adapter/resources/resource.js +1 -1
  29. package/dist/adapter/resources/shader.d.ts +5 -2
  30. package/dist/adapter/resources/shader.d.ts.map +1 -1
  31. package/dist/adapter/resources/shader.js +15 -9
  32. package/dist/adapter/resources/texture-view.d.ts +1 -1
  33. package/dist/adapter/resources/texture-view.d.ts.map +1 -1
  34. package/dist/adapter/resources/texture.d.ts +144 -47
  35. package/dist/adapter/resources/texture.d.ts.map +1 -1
  36. package/dist/adapter/resources/texture.js +120 -12
  37. package/dist/adapter/resources/transform-feedback.d.ts +1 -1
  38. package/dist/adapter/resources/transform-feedback.d.ts.map +1 -1
  39. package/dist/adapter/resources/vertex-array.d.ts +1 -1
  40. package/dist/adapter/resources/vertex-array.d.ts.map +1 -1
  41. package/dist/adapter/resources/vertex-array.js +6 -2
  42. package/dist/adapter/types/{types.d.ts → attachments.d.ts} +7 -17
  43. package/dist/adapter/types/attachments.d.ts.map +1 -0
  44. package/dist/adapter/types/buffer-layout.d.ts +1 -1
  45. package/dist/adapter/types/buffer-layout.d.ts.map +1 -1
  46. package/dist/adapter/types/compiler-message.d.ts.map +1 -0
  47. package/dist/adapter/types/parameters.d.ts +4 -6
  48. package/dist/adapter/types/parameters.d.ts.map +1 -1
  49. package/dist/adapter/types/parameters.js +1 -0
  50. package/dist/adapter/types/shader-layout.d.ts +23 -3
  51. package/dist/adapter/types/shader-layout.d.ts.map +1 -1
  52. package/dist/adapter/types/uniforms.d.ts +4 -0
  53. package/dist/adapter/types/uniforms.d.ts.map +1 -0
  54. package/dist/{lib/compiler-log → adapter-utils}/format-compiler-log.d.ts +1 -1
  55. package/dist/adapter-utils/format-compiler-log.d.ts.map +1 -0
  56. package/dist/{adapter/attribute-utils → adapter-utils}/get-attribute-from-layouts.d.ts +4 -11
  57. package/dist/adapter-utils/get-attribute-from-layouts.d.ts.map +1 -0
  58. package/dist/{adapter/attribute-utils → adapter-utils}/get-attribute-from-layouts.js +10 -30
  59. package/dist/adapter-utils/is-uniform-value.d.ts +3 -0
  60. package/dist/adapter-utils/is-uniform-value.d.ts.map +1 -0
  61. package/dist/adapter-utils/is-uniform-value.js +7 -0
  62. package/dist/dist.dev.js +635 -821
  63. package/dist/dist.min.js +6 -6
  64. package/dist/{adapter/type-utils → gpu-type-utils}/decode-attribute-type.d.ts +3 -3
  65. package/dist/gpu-type-utils/decode-attribute-type.d.ts.map +1 -0
  66. package/dist/{adapter/type-utils → gpu-type-utils}/decode-data-type.d.ts +1 -1
  67. package/dist/gpu-type-utils/decode-data-type.d.ts.map +1 -0
  68. package/dist/{adapter/type-utils → gpu-type-utils}/decode-shader-types.d.ts +1 -1
  69. package/dist/gpu-type-utils/decode-shader-types.d.ts.map +1 -0
  70. package/dist/{adapter/type-utils → gpu-type-utils}/decode-shader-types.js +0 -2
  71. package/dist/gpu-type-utils/decode-texture-format.d.ts +43 -0
  72. package/dist/gpu-type-utils/decode-texture-format.d.ts.map +1 -0
  73. package/dist/{adapter/type-utils → gpu-type-utils}/decode-texture-format.js +67 -31
  74. package/dist/{adapter/type-utils → gpu-type-utils}/decode-vertex-format.d.ts +1 -1
  75. package/dist/gpu-type-utils/decode-vertex-format.d.ts.map +1 -0
  76. package/dist/gpu-type-utils/shader-types.d.ts.map +1 -0
  77. package/dist/{adapter/types → gpu-type-utils}/texture-formats.d.ts +3 -5
  78. package/dist/gpu-type-utils/texture-formats.d.ts.map +1 -0
  79. package/dist/{adapter/type-utils → gpu-type-utils}/vertex-format-from-attribute.d.ts +2 -2
  80. package/dist/gpu-type-utils/vertex-format-from-attribute.d.ts.map +1 -0
  81. package/dist/gpu-type-utils/vertex-formats.d.ts.map +1 -0
  82. package/dist/{adapter/type-utils → gpu-type-utils}/wgsl-utils.d.ts +1 -1
  83. package/dist/gpu-type-utils/wgsl-utils.d.ts.map +1 -0
  84. package/dist/index.cjs +396 -567
  85. package/dist/index.cjs.map +4 -4
  86. package/dist/index.d.ts +28 -44
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +19 -37
  89. package/dist/{lib/uniforms → portable}/uniform-block.d.ts +3 -3
  90. package/dist/portable/uniform-block.d.ts.map +1 -0
  91. package/dist/{lib/uniforms → portable}/uniform-block.js +2 -2
  92. package/dist/{lib/uniforms → portable}/uniform-buffer-layout.d.ts +2 -2
  93. package/dist/portable/uniform-buffer-layout.d.ts.map +1 -0
  94. package/dist/{lib/uniforms → portable}/uniform-buffer-layout.js +6 -7
  95. package/dist/{lib/uniforms → portable}/uniform-store.d.ts +9 -4
  96. package/dist/portable/uniform-store.d.ts.map +1 -0
  97. package/dist/{lib/uniforms → portable}/uniform-store.js +11 -9
  98. package/dist/types.d.ts +0 -10
  99. package/dist/types.d.ts.map +1 -1
  100. package/dist/utils/array-equal.d.ts.map +1 -1
  101. package/dist/utils/array-equal.js +6 -7
  102. package/dist/utils/array-utils-flat.d.ts +1 -7
  103. package/dist/utils/array-utils-flat.d.ts.map +1 -1
  104. package/dist/utils/array-utils-flat.js +0 -23
  105. package/dist/utils/is-array.d.ts +3 -3
  106. package/dist/utils/is-array.d.ts.map +1 -1
  107. package/dist/utils/is-array.js +2 -2
  108. package/dist/utils/uid.d.ts +7 -0
  109. package/dist/utils/uid.d.ts.map +1 -0
  110. package/dist/utils/{utils.js → uid.js} +0 -11
  111. package/package.json +5 -5
  112. package/src/adapter/adapter.ts +16 -0
  113. package/src/adapter/canvas-context.ts +6 -0
  114. package/src/adapter/device.ts +52 -36
  115. package/src/adapter/luma.ts +219 -0
  116. package/src/adapter/resources/buffer.ts +5 -5
  117. package/src/adapter/resources/command-encoder.ts +1 -1
  118. package/src/adapter/resources/compute-pass.ts +3 -3
  119. package/src/adapter/resources/compute-pipeline.ts +6 -3
  120. package/src/adapter/resources/external-texture.ts +2 -2
  121. package/src/adapter/resources/framebuffer.ts +5 -92
  122. package/src/adapter/resources/query-set.ts +2 -2
  123. package/src/adapter/resources/render-pass.ts +11 -7
  124. package/src/adapter/resources/render-pipeline.ts +3 -6
  125. package/src/adapter/resources/resource.ts +7 -7
  126. package/src/adapter/resources/shader.ts +18 -11
  127. package/src/adapter/resources/texture-view.ts +5 -5
  128. package/src/adapter/resources/texture.ts +285 -76
  129. package/src/adapter/resources/transform-feedback.ts +1 -1
  130. package/src/adapter/resources/vertex-array.ts +7 -3
  131. package/src/adapter/types/{types.ts → attachments.ts} +10 -18
  132. package/src/adapter/types/buffer-layout.ts +1 -1
  133. package/src/adapter/types/parameters.ts +14 -14
  134. package/src/adapter/types/shader-layout.ts +31 -29
  135. package/src/adapter/types/uniforms.ts +10 -0
  136. package/src/{lib/compiler-log → adapter-utils}/format-compiler-log.ts +1 -1
  137. package/src/{adapter/attribute-utils → adapter-utils}/get-attribute-from-layouts.ts +18 -42
  138. package/src/adapter-utils/is-uniform-value.ts +10 -0
  139. package/src/{adapter/type-utils → gpu-type-utils}/decode-attribute-type.ts +3 -3
  140. package/src/{adapter/type-utils → gpu-type-utils}/decode-data-type.ts +1 -1
  141. package/src/{adapter/type-utils → gpu-type-utils}/decode-shader-types.ts +1 -3
  142. package/src/{adapter/type-utils → gpu-type-utils}/decode-texture-format.ts +99 -39
  143. package/src/{adapter/type-utils → gpu-type-utils}/decode-vertex-format.ts +1 -1
  144. package/src/{adapter/types → gpu-type-utils}/texture-formats.ts +3 -14
  145. package/src/{adapter/type-utils → gpu-type-utils}/vertex-format-from-attribute.ts +2 -2
  146. package/src/{adapter/type-utils → gpu-type-utils}/wgsl-utils.ts +1 -1
  147. package/src/index.ts +67 -83
  148. package/src/{lib/uniforms → portable}/uniform-block.ts +5 -5
  149. package/src/{lib/uniforms → portable}/uniform-buffer-layout.ts +9 -9
  150. package/src/{lib/uniforms → portable}/uniform-store.ts +20 -12
  151. package/src/types.ts +0 -12
  152. package/src/utils/array-equal.ts +6 -7
  153. package/src/utils/array-utils-flat.ts +1 -31
  154. package/src/utils/is-array.ts +5 -5
  155. package/src/utils/{utils.ts → uid.ts} +0 -12
  156. package/dist/adapter/attribute-utils/get-attribute-from-layouts.d.ts.map +0 -1
  157. package/dist/adapter/type-utils/decode-attribute-type.d.ts.map +0 -1
  158. package/dist/adapter/type-utils/decode-data-type.d.ts.map +0 -1
  159. package/dist/adapter/type-utils/decode-shader-types.d.ts.map +0 -1
  160. package/dist/adapter/type-utils/decode-texture-format.d.ts +0 -23
  161. package/dist/adapter/type-utils/decode-texture-format.d.ts.map +0 -1
  162. package/dist/adapter/type-utils/decode-vertex-format.d.ts.map +0 -1
  163. package/dist/adapter/type-utils/vertex-format-from-attribute.d.ts.map +0 -1
  164. package/dist/adapter/type-utils/wgsl-utils.d.ts.map +0 -1
  165. package/dist/adapter/types/accessor.d.ts +0 -23
  166. package/dist/adapter/types/accessor.d.ts.map +0 -1
  167. package/dist/adapter/types/shader-types.d.ts.map +0 -1
  168. package/dist/adapter/types/texture-formats.d.ts.map +0 -1
  169. package/dist/adapter/types/types.d.ts.map +0 -1
  170. package/dist/adapter/types/vertex-formats.d.ts.map +0 -1
  171. package/dist/init.d.ts +0 -5
  172. package/dist/init.d.ts.map +0 -1
  173. package/dist/init.js +0 -37
  174. package/dist/lib/compiler-log/compiler-message.d.ts.map +0 -1
  175. package/dist/lib/compiler-log/format-compiler-log.d.ts.map +0 -1
  176. package/dist/lib/compiler-log/get-shader-info.d.ts +0 -9
  177. package/dist/lib/compiler-log/get-shader-info.d.ts.map +0 -1
  178. package/dist/lib/compiler-log/get-shader-info.js +0 -29
  179. package/dist/lib/luma.d.ts +0 -38
  180. package/dist/lib/luma.d.ts.map +0 -1
  181. package/dist/lib/luma.js +0 -141
  182. package/dist/lib/uniforms/uniform-block.d.ts.map +0 -1
  183. package/dist/lib/uniforms/uniform-buffer-layout.d.ts.map +0 -1
  184. package/dist/lib/uniforms/uniform-store.d.ts.map +0 -1
  185. package/dist/lib/uniforms/uniform.d.ts +0 -10
  186. package/dist/lib/uniforms/uniform.d.ts.map +0 -1
  187. package/dist/lib/uniforms/uniform.js +0 -20
  188. package/dist/utils/assert.d.ts +0 -2
  189. package/dist/utils/assert.d.ts.map +0 -1
  190. package/dist/utils/assert.js +0 -10
  191. package/dist/utils/cast.d.ts +0 -3
  192. package/dist/utils/cast.d.ts.map +0 -1
  193. package/dist/utils/cast.js +0 -7
  194. package/dist/utils/check-props.d.ts +0 -7
  195. package/dist/utils/check-props.d.ts.map +0 -1
  196. package/dist/utils/check-props.js +0 -36
  197. package/dist/utils/deep-equal.d.ts +0 -9
  198. package/dist/utils/deep-equal.d.ts.map +0 -1
  199. package/dist/utils/deep-equal.js +0 -50
  200. package/dist/utils/format-value.d.ts +0 -7
  201. package/dist/utils/format-value.d.ts.map +0 -1
  202. package/dist/utils/format-value.js +0 -39
  203. package/dist/utils/load-file.d.ts +0 -35
  204. package/dist/utils/load-file.d.ts.map +0 -1
  205. package/dist/utils/load-file.js +0 -74
  206. package/dist/utils/random.d.ts +0 -5
  207. package/dist/utils/random.d.ts.map +0 -1
  208. package/dist/utils/random.js +0 -18
  209. package/dist/utils/request-animation-frame.d.ts +0 -3
  210. package/dist/utils/request-animation-frame.d.ts.map +0 -1
  211. package/dist/utils/request-animation-frame.js +0 -16
  212. package/dist/utils/stub-methods.d.ts +0 -2
  213. package/dist/utils/stub-methods.d.ts.map +0 -1
  214. package/dist/utils/stub-methods.js +0 -19
  215. package/dist/utils/utils.d.ts +0 -9
  216. package/dist/utils/utils.d.ts.map +0 -1
  217. package/src/adapter/types/accessor.ts +0 -37
  218. package/src/init.ts +0 -53
  219. package/src/lib/compiler-log/get-shader-info.ts +0 -42
  220. package/src/lib/luma.ts +0 -190
  221. package/src/lib/uniforms/uniform.ts +0 -31
  222. package/src/utils/assert.ts +0 -11
  223. package/src/utils/cast.ts +0 -8
  224. package/src/utils/check-props.ts +0 -82
  225. package/src/utils/deep-equal.ts +0 -51
  226. package/src/utils/format-value.ts +0 -47
  227. package/src/utils/load-file.ts +0 -91
  228. package/src/utils/random.ts +0 -21
  229. package/src/utils/request-animation-frame.ts +0 -19
  230. package/src/utils/stub-methods.ts +0 -29
  231. /package/dist/adapter/types/{accessor.js → attachments.js} +0 -0
  232. /package/dist/{lib/compiler-log → adapter/types}/compiler-message.d.ts +0 -0
  233. /package/dist/{lib/compiler-log → adapter/types}/compiler-message.js +0 -0
  234. /package/dist/adapter/types/{shader-types.js → uniforms.js} +0 -0
  235. /package/dist/{lib/compiler-log → adapter-utils}/format-compiler-log.js +0 -0
  236. /package/dist/{adapter/type-utils → gpu-type-utils}/decode-attribute-type.js +0 -0
  237. /package/dist/{adapter/type-utils → gpu-type-utils}/decode-data-type.js +0 -0
  238. /package/dist/{adapter/type-utils → gpu-type-utils}/decode-vertex-format.js +0 -0
  239. /package/dist/{adapter/types → gpu-type-utils}/shader-types.d.ts +0 -0
  240. /package/dist/{adapter/types/texture-formats.js → gpu-type-utils/shader-types.js} +0 -0
  241. /package/dist/{adapter/types/types.js → gpu-type-utils/texture-formats.js} +0 -0
  242. /package/dist/{adapter/type-utils → gpu-type-utils}/vertex-format-from-attribute.js +0 -0
  243. /package/dist/{adapter/types → gpu-type-utils}/vertex-formats.d.ts +0 -0
  244. /package/dist/{adapter/types → gpu-type-utils}/vertex-formats.js +0 -0
  245. /package/dist/{adapter/type-utils → gpu-type-utils}/wgsl-utils.js +0 -0
  246. /package/src/{lib/compiler-log → adapter/types}/compiler-message.ts +0 -0
  247. /package/src/{adapter/types → gpu-type-utils}/shader-types.ts +0 -0
  248. /package/src/{adapter/types → gpu-type-utils}/vertex-formats.ts +0 -0
@@ -2,19 +2,19 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import type {ColorTextureFormat, DepthStencilTextureFormat, TextureFormat} from './texture-formats';
6
- import type {Buffer} from '../resources/buffer';
5
+ import {NumberArray} from '../../types';
6
+ import type {
7
+ ColorTextureFormat,
8
+ DepthStencilTextureFormat,
9
+ TextureFormat
10
+ } from '../../gpu-type-utils/texture-formats';
7
11
  import type {Texture} from '../resources/texture'; // TextureView...
12
+ import type {TextureView} from '../resources/texture-view'; // TextureView...
8
13
 
9
14
  // UNIFORMS
10
15
 
11
16
  /** Valid values for uniforms. @note boolean values get converted to 0 or 1 before setting */
12
- export type UniformValue = number | boolean | Readonly<number[]>;
13
-
14
- // BINDINGS
15
-
16
- /** Buffer bindings */
17
- export type Binding = Texture | Buffer | {buffer: Buffer; offset?: number; size?: number};
17
+ export type UniformValue = number | boolean | Readonly<NumberArray>; // Float32Array> | Readonly<Int32Array> | Readonly<Uint32Array> | Readonly<number[]>;
18
18
 
19
19
  // BINDING LAYOUTS
20
20
 
@@ -54,14 +54,6 @@ export type BindingDeclaration =
54
54
  | TextureBindingLayout
55
55
  | StorageTextureBindingLayout;
56
56
 
57
- // TEXTURE VIEWS
58
-
59
- export type TextureView = {
60
- texture: WebGLTexture;
61
- layer?: number; // = 0
62
- level?: number; // = 0
63
- };
64
-
65
57
  // ATTACHMENTS (See Framebuffer)
66
58
 
67
59
  /**
@@ -70,7 +62,7 @@ export type TextureView = {
70
62
  */
71
63
  export type ColorAttachment = {
72
64
  /** Describes the texture subresource that will be output to for this color attachment. */
73
- texture?: Texture;
65
+ texture?: TextureView | Texture;
74
66
  /** Format of the texture resource. Used to auto create texture if not supplied */
75
67
  format?: ColorTextureFormat;
76
68
  /* Describes the texture subresource that will receive resolved output for this color attachment if multisampled. */
@@ -90,7 +82,7 @@ export type ColorAttachment = {
90
82
  */
91
83
  export type DepthStencilAttachment = {
92
84
  /** Describes the texture subresource that will be output to and read from for this depth/stencil attachment. */
93
- texture?: Texture;
85
+ texture?: TextureView | Texture;
94
86
  /** Format of the texture resource. Used to auto create texture if not supplied */
95
87
  format?: DepthStencilTextureFormat;
96
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 './vertex-formats';
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 './texture-formats';
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
 
@@ -146,6 +142,9 @@ export type BlendOperation = 'add' | 'subtract' | 'reverse-subtract' | 'min' | '
146
142
 
147
143
  /* Color parameters are set on the RenderPipeline */
148
144
  export type ColorParameters = {
145
+ /** Enable blending */
146
+ blend?: boolean;
147
+
149
148
  /** Defines the operation used to calculate the values written to the target attachment components. */
150
149
  blendColorOperation?: BlendOperation;
151
150
  /** Defines the operation to be performed on values from the fragment shader. */
@@ -233,6 +232,7 @@ export const DEFAULT_PARAMETERS: Required<Parameters> = {
233
232
  sampleAlphaToCoverageEnabled: false,
234
233
 
235
234
  // Color and blend parameters
235
+ blend: false,
236
236
 
237
237
  blendColorOperation: 'add',
238
238
  blendColorSrcFactor: 'one',
@@ -251,12 +251,12 @@ export const DEFAULT_PARAMETERS: Required<Parameters> = {
251
251
  polygonMode: 'fill',
252
252
  polygonOffsetLine: false,
253
253
 
254
- clipDistance0: undefined,
255
- clipDistance1: undefined,
256
- clipDistance2: undefined,
257
- clipDistance3: undefined,
258
- clipDistance4: undefined,
259
- clipDistance5: undefined,
260
- clipDistance6: undefined,
261
- clipDistance7: undefined
254
+ clipDistance0: undefined!,
255
+ clipDistance1: undefined!,
256
+ clipDistance2: undefined!,
257
+ clipDistance3: undefined!,
258
+ clipDistance4: undefined!,
259
+ clipDistance5: undefined!,
260
+ clipDistance6: undefined!,
261
+ clipDistance7: undefined!
262
262
  };
@@ -2,9 +2,8 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import type {TextureFormat} from '../types/texture-formats';
6
- import type {ShaderUniformType, ShaderAttributeType} from './shader-types';
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 './compiler-message';
5
+ import type {CompilerMessage} from '../adapter/types/compiler-message';
6
6
 
7
7
  /** @returns annotated errors or warnings */
8
8
  export function formatCompilerLog(
@@ -2,13 +2,13 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {log} from '../../utils/log';
6
- import type {ShaderLayout, AttributeDeclaration} from '../types/shader-layout';
7
- import type {BufferLayout} from '../types/buffer-layout';
8
- import type {ShaderDataType, ShaderAttributeType} from '../types/shader-types';
9
- import {decodeShaderAttributeType} from '../type-utils/decode-attribute-type';
10
- import type {VertexFormat, VertexType} from '../types/vertex-formats';
11
- import {decodeVertexFormat} from '../type-utils/decode-vertex-format';
5
+ import {log} from '../utils/log';
6
+ import type {ShaderLayout, AttributeDeclaration} from '../adapter/types/shader-layout';
7
+ import type {BufferLayout} from '../adapter/types/buffer-layout';
8
+ import type {ShaderDataType, ShaderAttributeType} from '../gpu-type-utils/shader-types';
9
+ import {decodeShaderAttributeType} from '../gpu-type-utils/decode-attribute-type';
10
+ import type {VertexFormat, VertexType} from '../gpu-type-utils/vertex-formats';
11
+ import {decodeVertexFormat} from '../gpu-type-utils/decode-vertex-format';
12
12
 
13
13
  /** Resolved info for a buffer / attribute combination to help backend configure it correctly */
14
14
  export type AttributeInfo = {
@@ -64,11 +64,10 @@ export function getAttributeInfosFromLayouts(
64
64
  ): Record<string, AttributeInfo> {
65
65
  const attributeInfos: Record<string, AttributeInfo> = {};
66
66
  for (const attribute of shaderLayout.attributes) {
67
- attributeInfos[attribute.name] = getAttributeInfoFromLayouts(
68
- shaderLayout,
69
- bufferLayout,
70
- attribute.name
71
- );
67
+ const attributeInfo = getAttributeInfoFromLayouts(shaderLayout, bufferLayout, attribute.name);
68
+ if (attributeInfo) {
69
+ attributeInfos[attribute.name] = attributeInfo;
70
+ }
72
71
  }
73
72
  return attributeInfos;
74
73
  }
@@ -98,7 +97,10 @@ function getAttributeInfoFromLayouts(
98
97
  name: string
99
98
  ): AttributeInfo | null {
100
99
  const shaderDeclaration = getAttributeFromShaderLayout(shaderLayout, name);
101
- const bufferMapping: BufferAttributeInfo = getAttributeFromBufferLayout(bufferLayout, name);
100
+ const bufferMapping: BufferAttributeInfo | null = getAttributeFromBufferLayout(
101
+ bufferLayout,
102
+ name
103
+ );
102
104
 
103
105
  // TODO should no longer happen
104
106
  if (!shaderDeclaration) {
@@ -124,7 +126,7 @@ function getAttributeInfoFromLayouts(
124
126
  normalized: vertexFormatInfo.normalized,
125
127
  // integer is a property of the shader declaration
126
128
  integer: attributeTypeInfo.integer,
127
- stepMode: bufferMapping?.stepMode || shaderDeclaration.stepMode,
129
+ stepMode: bufferMapping?.stepMode || shaderDeclaration.stepMode || 'vertex',
128
130
  byteOffset: bufferMapping?.byteOffset || 0,
129
131
  byteStride: bufferMapping?.byteStride || 0
130
132
  };
@@ -211,6 +213,7 @@ function getAttributeFromAttributesList(
211
213
  if (typeof bufferLayout.byteStride !== 'number') {
212
214
  for (const attributeMapping of bufferLayout.attributes || []) {
213
215
  const info = decodeVertexFormat(attributeMapping.format);
216
+ // @ts-ignore
214
217
  byteStride += info.byteLength;
215
218
  }
216
219
  }
@@ -223,6 +226,7 @@ function getAttributeFromAttributesList(
223
226
  stepMode: bufferLayout.stepMode,
224
227
  vertexFormat: attributeMapping.format,
225
228
  byteOffset: attributeMapping.byteOffset,
229
+ // @ts-ignore
226
230
  byteStride
227
231
  };
228
232
  }
@@ -230,31 +234,3 @@ function getAttributeFromAttributesList(
230
234
 
231
235
  return null;
232
236
  }
233
-
234
- /**
235
- * Merges an provided shader layout into a base shader layout
236
- * In WebGL, this allows the auto generated shader layout to be overridden by the application
237
- * Typically to change the format of the vertex attributes (from float32x4 to uint8x4 etc).
238
- * @todo Drop this? Aren't all use cases covered by mergeBufferLayout()?
239
- */
240
- export function mergeShaderLayout(
241
- baseLayout: ShaderLayout,
242
- overrideLayout: ShaderLayout
243
- ): ShaderLayout {
244
- // Deep clone the base layout
245
- const mergedLayout: ShaderLayout = {
246
- ...baseLayout,
247
- attributes: baseLayout.attributes.map(attribute => ({...attribute}))
248
- };
249
- // Merge the attributes
250
- for (const attribute of overrideLayout?.attributes || []) {
251
- const baseAttribute = mergedLayout.attributes.find(attr => attr.name === attribute.name);
252
- if (!baseAttribute) {
253
- log.warn(`shader layout attribute ${attribute.name} not present in shader`);
254
- } else {
255
- baseAttribute.type = attribute.type || baseAttribute.type;
256
- baseAttribute.stepMode = attribute.stepMode || baseAttribute.stepMode;
257
- }
258
- }
259
- return mergedLayout;
260
- }
@@ -0,0 +1,10 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import {isNumberArray} from '../utils/is-array';
6
+ import {UniformValue} from '../adapter/types/uniforms';
7
+
8
+ export function isUniformValue(value: unknown): value is UniformValue {
9
+ return isNumberArray(value) || typeof value === 'number' || typeof value === 'boolean';
10
+ }
@@ -2,8 +2,8 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {ShaderDataType, ShaderAttributeType} from '../types/shader-types';
6
- import {VertexFormat, VertexType} from '../types/vertex-formats';
5
+ import {ShaderDataType, ShaderAttributeType} from './shader-types';
6
+ import {VertexFormat, VertexType} from './vertex-formats';
7
7
 
8
8
  /** Information extracted from a ShaderAttributeInfo constant */
9
9
  export type ShaderAttributeTypeInfo = {
@@ -18,7 +18,7 @@ export type ShaderAttributeTypeInfo = {
18
18
  /** Whether this data type is signed */
19
19
  signed: boolean;
20
20
  /** The simplest vertex format that matches the shader attribute's data type */
21
- defaultVertexFormat?: VertexFormat;
21
+ defaultVertexFormat: VertexFormat;
22
22
  };
23
23
 
24
24
  /** Decodes a vertex type, returning byte length and flags (integer, signed, normalized) */
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {DataType, NormalizedDataType} from '../types/vertex-formats';
5
+ import {DataType, NormalizedDataType} from './vertex-formats';
6
6
 
7
7
  export type DecodedVertexType = {
8
8
  /** WebGPU data type */
@@ -2,8 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {assert} from '../../utils/assert';
6
- import {ShaderUniformType, ShaderDataType} from '../types/shader-types';
5
+ import {ShaderUniformType, ShaderDataType} from './shader-types';
7
6
 
8
7
  const UNIFORM_FORMATS: Record<ShaderUniformType, {type: ShaderDataType; components: number}> = {
9
8
  f32: {type: 'f32', components: 1},
@@ -36,7 +35,6 @@ export function decodeShaderUniformType(format: ShaderUniformType): {
36
35
  components: number;
37
36
  } {
38
37
  const decoded = UNIFORM_FORMATS[format];
39
- assert(format);
40
38
  return decoded;
41
39
  }
42
40
 
@@ -2,8 +2,8 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {TextureFormat} from '../types/texture-formats';
6
- import {VertexType} from '../types/vertex-formats';
5
+ import {TextureFormat} from './texture-formats';
6
+ import {VertexType} from './vertex-formats';
7
7
  import {decodeVertexType} from './decode-data-type';
8
8
 
9
9
  // prettier-ignore
@@ -11,19 +11,40 @@ const COMPRESSED_TEXTURE_FORMAT_PREFIXES = [
11
11
  'bc1', 'bc2', 'bc3', 'bc4', 'bc5', 'bc6', 'bc7', 'etc1', 'etc2', 'eac', 'atc', 'astc', 'pvrtc'
12
12
  ];
13
13
 
14
- const REGEX = /^(rg?b?a?)([0-9]*)([a-z]*)(-srgb)?(-webgl|-unsized)?$/;
14
+ const REGEX = /^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/;
15
15
 
16
16
  export type DecodedTextureFormat = {
17
- format: 'r' | 'rg' | 'rgb' | 'rgba';
17
+ /** String describing which channels this texture has */
18
+ channels: 'r' | 'rg' | 'rgb' | 'rgba' | 'bgra';
19
+ /** Number of components (corresponds to channels string) */
18
20
  components: 1 | 2 | 3 | 4;
21
+ /** What is the data type of each component */
19
22
  dataType?: VertexType;
20
- srgb: boolean;
21
- webgl: boolean;
22
- unsized: boolean;
23
- byteLength: number;
23
+ /** If this is a packed data type */
24
+ packed?: boolean;
25
+ /** Number of bytes per pixel */
26
+ bytesPerPixel?: number;
27
+ /** Number of bits per channel (may be unreliable for packed formats) */
28
+ bitsPerChannel: number;
29
+ /** Depth stencil formats */
30
+ a?: 'depth' | 'stencil' | 'depth-stencil';
31
+ /** SRGB texture format? */
32
+ srgb?: boolean;
33
+ /** WebGL specific texture format? */
34
+ webgl?: boolean;
35
+ /** Is this an integer or floating point format? */
24
36
  integer: boolean;
37
+ /** Is this a signed or unsigned format? */
25
38
  signed: boolean;
39
+ /** Is this a normalized integer format? */
26
40
  normalized: boolean;
41
+ /** Is this a compressed texture format */
42
+ compressed?: boolean;
43
+ /** Block size for ASTC formats (texture must be a multiple) */
44
+ blockWidth?: number;
45
+ /** Block size for ASTC formats (texture must be a multiple) */
46
+ blockHeight?: number;
47
+ /** */
27
48
  };
28
49
 
29
50
  /**
@@ -39,19 +60,28 @@ export function isTextureFormatCompressed(textureFormat: TextureFormat): boolean
39
60
  export function decodeTextureFormat(format: TextureFormat): DecodedTextureFormat {
40
61
  const matches = REGEX.exec(format as string);
41
62
  if (matches) {
42
- const [, format, length, type, srgb, suffix] = matches;
63
+ const [, channels, length, type, srgb, suffix] = matches;
43
64
  if (format) {
44
65
  const dataType = `${type}${length}` as VertexType;
45
66
  const decodedType = decodeVertexType(dataType);
46
- return {
47
- format: format as 'r' | 'rg' | 'rgb' | 'rgba',
48
- components: format.length as 1 | 2 | 3 | 4,
49
- // dataType - overwritten by decodedType
50
- srgb: srgb === '-srgb',
51
- unsized: suffix === '-unsized',
52
- webgl: suffix === '-webgl',
53
- ...decodedType
67
+ const info: DecodedTextureFormat = {
68
+ channels: channels as 'r' | 'rg' | 'rgb' | 'rgba',
69
+ components: channels.length as 1 | 2 | 3 | 4,
70
+ bitsPerChannel: decodedType.byteLength * 8,
71
+ bytesPerPixel: decodedType.byteLength * channels.length,
72
+ dataType: decodedType.dataType,
73
+ integer: decodedType.integer,
74
+ signed: decodedType.signed,
75
+ normalized: decodedType.normalized
54
76
  };
77
+ if (suffix === '-webgl') {
78
+ info.webgl = true;
79
+ }
80
+ // dataType - overwritten by decodedType
81
+ if (srgb === '-srgb') {
82
+ info.srgb = true;
83
+ }
84
+ return info;
55
85
  }
56
86
  }
57
87
 
@@ -60,40 +90,70 @@ export function decodeTextureFormat(format: TextureFormat): DecodedTextureFormat
60
90
 
61
91
  // https://www.w3.org/TR/webgpu/#texture-format-caps
62
92
 
63
- const EXCEPTIONS: Partial<Record<TextureFormat, any>> = {
93
+ const EXCEPTIONS: Partial<Record<TextureFormat, Partial<DecodedTextureFormat>>> = {
64
94
  // Packed 16 bit formats
65
- 'rgba4unorm-webgl': {format: 'rgba', bpp: 2},
66
- 'rgb565unorm-webgl': {format: 'rgb', bpp: 2},
67
- 'rgb5a1unorm-webgl': {format: 'rgba', bbp: 2},
95
+ 'rgba4unorm-webgl': {channels: 'rgba', bytesPerPixel: 2, packed: true},
96
+ 'rgb565unorm-webgl': {channels: 'rgb', bytesPerPixel: 2, packed: true},
97
+ 'rgb5a1unorm-webgl': {channels: 'rgba', bytesPerPixel: 2, packed: true},
68
98
  // Packed 32 bit formats
69
- rgb9e5ufloat: {format: 'rgb', bbp: 4},
70
- rg11b10ufloat: {format: 'rgb', bbp: 4},
71
- rgb10a2unorm: {format: 'rgba', bbp: 4},
72
- 'rgb10a2uint-webgl': {format: 'rgba', bbp: 4},
99
+ rgb9e5ufloat: {channels: 'rgb', bytesPerPixel: 4, packed: true},
100
+ rg11b10ufloat: {channels: 'rgb', bytesPerPixel: 4, packed: true},
101
+ rgb10a2unorm: {channels: 'rgba', bytesPerPixel: 4, packed: true},
102
+ 'rgb10a2uint-webgl': {channels: 'rgba', bytesPerPixel: 4, packed: true},
73
103
  // Depth/stencil
74
- stencil8: {components: 1, bpp: 1, a: 'stencil'},
75
- depth16unorm: {components: 1, bpp: 2, a: 'depth'},
76
- depth24plus: {components: 1, bpp: 3, a: 'depth'},
77
- depth32float: {components: 1, bpp: 4, a: 'depth'},
78
- 'depth24plus-stencil8': {components: 2, bpp: 4, a: 'depth-stencil'},
79
- // "depth24unorm-stencil8" feature
80
- 'depth24unorm-stencil8': {components: 2, bpp: 4, a: 'depth-stencil'},
104
+ stencil8: {components: 1, bytesPerPixel: 1, a: 'stencil', dataType: 'uint8'},
105
+ depth16unorm: {components: 1, bytesPerPixel: 2, a: 'depth', dataType: 'uint16'},
106
+ depth24plus: {components: 1, bytesPerPixel: 3, a: 'depth', dataType: 'uint32'},
107
+ depth32float: {components: 1, bytesPerPixel: 4, a: 'depth', dataType: 'float32'},
108
+ 'depth24plus-stencil8': {components: 2, bytesPerPixel: 4, a: 'depth-stencil', packed: true},
81
109
  // "depth32float-stencil8" feature
82
- 'depth32float-stencil8': {components: 2, bpp: 4, a: 'depth-stencil'}
110
+ 'depth32float-stencil8': {components: 2, bytesPerPixel: 4, a: 'depth-stencil', packed: true}
83
111
  };
84
112
 
85
113
  function decodeNonStandardFormat(format: TextureFormat): DecodedTextureFormat {
114
+ if (isTextureFormatCompressed(format)) {
115
+ const info: DecodedTextureFormat = {
116
+ channels: 'rgb',
117
+ components: 3,
118
+ bytesPerPixel: 1,
119
+ srgb: false,
120
+ compressed: true
121
+ } as DecodedTextureFormat;
122
+ const blockSize = getCompressedTextureBlockSize(format);
123
+ if (blockSize) {
124
+ info.blockWidth = blockSize.blockWidth;
125
+ info.blockHeight = blockSize.blockHeight;
126
+ }
127
+ return info;
128
+ }
86
129
  const data = EXCEPTIONS[format];
87
130
  if (!data) {
88
131
  throw new Error(`Unknown format ${format}`);
89
132
  }
90
- return {
91
- format: data.format || '',
92
- components: data.components || data.format?.length || 1,
93
- byteLength: data.bpp || 1,
94
- srgb: false,
95
- unsized: false
133
+ const info: DecodedTextureFormat = {
134
+ ...data,
135
+ channels: data.channels || '',
136
+ components: data.components || data.channels?.length || 1,
137
+ bytesPerPixel: data.bytesPerPixel || 1,
138
+ srgb: false
96
139
  } as DecodedTextureFormat;
140
+ if (data.packed) {
141
+ info.packed = data.packed;
142
+ }
143
+ return info;
144
+ }
145
+
146
+ /** Parses ASTC block widths from format string */
147
+ function getCompressedTextureBlockSize(
148
+ format: string
149
+ ): {blockWidth: number; blockHeight: number} | null {
150
+ const REGEX = /.*-(\d+)x(\d+)-.*/;
151
+ const matches = REGEX.exec(format);
152
+ if (matches) {
153
+ const [, blockWidth, blockHeight] = matches;
154
+ return {blockWidth: Number(blockWidth), blockHeight: Number(blockHeight)};
155
+ }
156
+ return null;
97
157
  }
98
158
 
99
159
  /*
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {VertexFormat, VertexType} from '../types/vertex-formats';
5
+ import {VertexFormat, VertexType} from './vertex-formats';
6
6
  import {decodeVertexType} from './decode-data-type';
7
7
 
8
8
  export type VertexFormatInfo = {
@@ -12,16 +12,11 @@ export type DepthStencilTextureFormat =
12
12
  | 'depth24plus'
13
13
  | 'depth24plus-stencil8'
14
14
  | 'depth32float'
15
- // device.features.has('depth24unorm-stencil8')
16
- | 'depth24unorm-stencil8'
17
15
  // device.features.has('depth32float-stencil8')
18
16
  | 'depth32float-stencil8';
19
17
 
20
18
  /** Texture formats for color attachments */
21
- export type ColorTextureFormat =
22
- | WebGPUColorTextureFormat
23
- | WebGL2ColorTextureFormat
24
- | UnsizedColorTextureFormat;
19
+ export type ColorTextureFormat = WebGPUColorTextureFormat | WebGL2ColorTextureFormat;
25
20
 
26
21
  export type WebGPUColorTextureFormat =
27
22
  // 8-bit formats
@@ -103,6 +98,7 @@ export type WebGPUColorTextureFormat =
103
98
 
104
99
  // ASTC compressed formats usable if "texture-compression-astc" is both
105
100
  // supported by the device/user agent and enabled in requestDevice.
101
+ // Textures must be multiple of block size (encoded in format string).
106
102
  | 'astc-4x4-unorm'
107
103
  | 'astc-4x4-unorm-srgb'
108
104
  | 'astc-5x4-unorm'
@@ -132,14 +128,7 @@ export type WebGPUColorTextureFormat =
132
128
  | 'astc-12x12-unorm'
133
129
  | 'astc-12x12-unorm-srgb';
134
130
 
135
- /** Unsized texture formats (the only formats supported by WebGL1) */
136
- export type UnsizedColorTextureFormat = 'rgb8unorm-unsized' | 'rgba8unorm-unsized';
137
- // 'r8unorm-unsized' |
138
- // 'ra8unorm-unsized' |
139
- // 'rgb8unorm-srgb-unsized' |
140
- // 'rgba8unorm-srgb-unsized'
141
-
142
- /** Sized formats unique to WebGL 2. Some will perhaps be added to WebGPU standard? */
131
+ /** Sized formats in WebGL 2 that are not (yet?) supported by WebGPU */
143
132
  export type WebGL2ColorTextureFormat =
144
133
  | 'r16unorm-webgl'
145
134
  | 'r16snorm-webgl'
@@ -2,8 +2,8 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {TypedArray, TypedArrayConstructor} from '../../types';
6
- import {VertexFormat} from '../types/vertex-formats';
5
+ import {TypedArray, TypedArrayConstructor} from '../types';
6
+ import {VertexFormat} from './vertex-formats';
7
7
 
8
8
  // import {DataType} from '../types/vertex-formats';
9
9
  // type Omit<DataType, 'float16'> unfortunately breaks Typescript inferance
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {ShaderAttributeType} from '../types/shader-types';
5
+ import {ShaderAttributeType} from './shader-types';
6
6
 
7
7
  /** Predeclared aliases @see https://www.w3.org/TR/WGSL/#vector-types */
8
8
  export const WGSL_TYPE_ALIAS_MAP: Record<string, ShaderAttributeType> = {