@luma.gl/graph 10.0.0-alpha.8 → 10.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (493) hide show
  1. package/LICENSE +4 -4
  2. package/THIRD-PARTY-NOTICES.md +19 -0
  3. package/dist/arrow/arrow-colors.cjs +99 -18
  4. package/dist/arrow/arrow-colors.d.ts +27 -10
  5. package/dist/arrow/arrow-colors.d.ts.map +1 -1
  6. package/dist/arrow/arrow-colors.js +107 -24
  7. package/dist/arrow/arrow-colors.js.map +1 -1
  8. package/dist/arrow/arrow-utils/arrow-paths.cjs +4 -3
  9. package/dist/arrow/arrow-utils/arrow-paths.d.ts.map +1 -1
  10. package/dist/arrow/arrow-utils/arrow-paths.js +5 -4
  11. package/dist/arrow/arrow-utils/arrow-paths.js.map +1 -1
  12. package/dist/arrow/cpu/arrow-coordinate-projection.cjs +30 -0
  13. package/dist/arrow/cpu/arrow-coordinate-projection.d.ts +5 -0
  14. package/dist/arrow/cpu/arrow-coordinate-projection.d.ts.map +1 -0
  15. package/dist/arrow/cpu/arrow-coordinate-projection.js +9 -0
  16. package/dist/arrow/cpu/arrow-coordinate-projection.js.map +1 -0
  17. package/dist/arrow/cpu/arrow-cpu-pipelines.cjs +31 -0
  18. package/dist/arrow/cpu/arrow-cpu-pipelines.d.ts +2 -0
  19. package/dist/arrow/cpu/arrow-cpu-pipelines.d.ts.map +1 -0
  20. package/dist/arrow/cpu/arrow-cpu-pipelines.js +5 -0
  21. package/dist/arrow/cpu/arrow-cpu-pipelines.js.map +1 -0
  22. package/dist/arrow/cpu/arrow-cpu-vector-adapters.cjs +99 -0
  23. package/dist/arrow/cpu/arrow-cpu-vector-adapters.d.ts +9 -0
  24. package/dist/arrow/cpu/arrow-cpu-vector-adapters.d.ts.map +1 -0
  25. package/dist/arrow/cpu/arrow-cpu-vector-adapters.js +100 -0
  26. package/dist/arrow/cpu/arrow-cpu-vector-adapters.js.map +1 -0
  27. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.cjs +9 -371
  28. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts +8 -28
  29. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts.map +1 -1
  30. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js +4 -381
  31. package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js.map +1 -1
  32. package/dist/arrow/geoarrow/arrow-geoarrow-conversion.cjs +11 -11
  33. package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts +2 -0
  34. package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts.map +1 -1
  35. package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js +4 -4
  36. package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js.map +1 -1
  37. package/dist/arrow/geoarrow/arrow-polygon-tessellation.cjs +2 -2
  38. package/dist/arrow/geoarrow/arrow-polygon-tessellation.js +1 -1
  39. package/dist/arrow/geoarrow/arrow-polygon-tessellation.js.map +1 -1
  40. package/dist/arrow/gpu/arrow-column-gpu-vector.cjs +27 -8
  41. package/dist/arrow/gpu/arrow-column-gpu-vector.d.ts +11 -1
  42. package/dist/arrow/gpu/arrow-column-gpu-vector.d.ts.map +1 -1
  43. package/dist/arrow/gpu/arrow-column-gpu-vector.js +33 -8
  44. package/dist/arrow/gpu/arrow-column-gpu-vector.js.map +1 -1
  45. package/dist/arrow/gpu/arrow-gpu-table-conversion.cjs +68 -3
  46. package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts +9 -2
  47. package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts.map +1 -1
  48. package/dist/arrow/gpu/arrow-gpu-table-conversion.js +76 -3
  49. package/dist/arrow/gpu/arrow-gpu-table-conversion.js.map +1 -1
  50. package/dist/arrow/gpu/arrow-gpu-vector-adapters.cjs +8 -6
  51. package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts +1 -0
  52. package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts.map +1 -1
  53. package/dist/arrow/gpu/arrow-gpu-vector-adapters.js +17 -7
  54. package/dist/arrow/gpu/arrow-gpu-vector-adapters.js.map +1 -1
  55. package/dist/arrow/gpu/arrow-gpu-vector-conversion.cjs +35 -5
  56. package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts +6 -1
  57. package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts.map +1 -1
  58. package/dist/arrow/gpu/arrow-gpu-vector-conversion.js +40 -5
  59. package/dist/arrow/gpu/arrow-gpu-vector-conversion.js.map +1 -1
  60. package/dist/arrow/index.cjs +19 -2
  61. package/dist/arrow/index.cjs.map +3 -3
  62. package/dist/arrow/index.d.ts +5 -2
  63. package/dist/arrow/index.d.ts.map +1 -1
  64. package/dist/arrow/index.js +4 -1
  65. package/dist/arrow/index.js.map +1 -1
  66. package/dist/arrow/internal.cjs.map +2 -2
  67. package/dist/dist.dev.js +3820 -1646
  68. package/dist/dist.min.js +450 -136
  69. package/dist/experimental/index.cjs.map +1 -1
  70. package/dist/experimental/simulation/index.cjs.map +1 -1
  71. package/dist/geospatial/gpu-point-spatial-query.cjs +2 -15
  72. package/dist/geospatial/gpu-point-spatial-query.d.ts.map +1 -1
  73. package/dist/geospatial/gpu-point-spatial-query.js +2 -15
  74. package/dist/geospatial/gpu-point-spatial-query.js.map +1 -1
  75. package/dist/geospatial/index.cjs.map +2 -2
  76. package/dist/gpu-a5/index.cjs.map +1 -1
  77. package/dist/gpu-core/compiled-gpu-graph.cjs +47 -0
  78. package/dist/gpu-core/compiled-gpu-graph.d.ts +5 -0
  79. package/dist/gpu-core/compiled-gpu-graph.d.ts.map +1 -1
  80. package/dist/gpu-core/compiled-gpu-graph.js +54 -1
  81. package/dist/gpu-core/compiled-gpu-graph.js.map +1 -1
  82. package/dist/gpu-core/gpu-command-graph-compiler.cjs +11 -2
  83. package/dist/gpu-core/gpu-command-graph-compiler.d.ts +2 -1
  84. package/dist/gpu-core/gpu-command-graph-compiler.d.ts.map +1 -1
  85. package/dist/gpu-core/gpu-command-graph-compiler.js +13 -2
  86. package/dist/gpu-core/gpu-command-graph-compiler.js.map +1 -1
  87. package/dist/gpu-core/gpu-command-graph-types.d.ts +16 -1
  88. package/dist/gpu-core/gpu-command-graph-types.d.ts.map +1 -1
  89. package/dist/gpu-core/gpu-command-graph-types.js.map +1 -1
  90. package/dist/gpu-core/gpu-command-graph.cjs +34 -11
  91. package/dist/gpu-core/gpu-command-graph.d.ts +17 -8
  92. package/dist/gpu-core/gpu-command-graph.d.ts.map +1 -1
  93. package/dist/gpu-core/gpu-command-graph.js +39 -11
  94. package/dist/gpu-core/gpu-command-graph.js.map +1 -1
  95. package/dist/gpu-core/gpu-cpu-execution.cjs +279 -0
  96. package/dist/gpu-core/gpu-cpu-execution.d.ts +22 -0
  97. package/dist/gpu-core/gpu-cpu-execution.d.ts.map +1 -0
  98. package/dist/gpu-core/gpu-cpu-execution.js +294 -0
  99. package/dist/gpu-core/gpu-cpu-execution.js.map +1 -0
  100. package/dist/gpu-core/gpu-cpu-operation.cjs +54 -0
  101. package/dist/gpu-core/gpu-cpu-operation.d.ts +40 -0
  102. package/dist/gpu-core/gpu-cpu-operation.d.ts.map +1 -0
  103. package/dist/gpu-core/gpu-cpu-operation.js +35 -0
  104. package/dist/gpu-core/gpu-cpu-operation.js.map +1 -0
  105. package/dist/gpu-core/gpu-dispatch-utils.cjs +7 -3
  106. package/dist/gpu-core/gpu-dispatch-utils.d.ts +2 -0
  107. package/dist/gpu-core/gpu-dispatch-utils.d.ts.map +1 -1
  108. package/dist/gpu-core/gpu-dispatch-utils.js +4 -1
  109. package/dist/gpu-core/gpu-dispatch-utils.js.map +1 -1
  110. package/dist/gpu-core/gpu-expression-operation.cjs +2 -2
  111. package/dist/gpu-core/gpu-expression-operation.d.ts +1 -1
  112. package/dist/gpu-core/gpu-expression-operation.d.ts.map +1 -1
  113. package/dist/gpu-core/gpu-expression-operation.js +1 -1
  114. package/dist/gpu-core/gpu-expression-operation.js.map +1 -1
  115. package/dist/gpu-core/gpu-expression-plan.cjs +5 -1
  116. package/dist/gpu-core/gpu-expression-plan.d.ts +3 -2
  117. package/dist/gpu-core/gpu-expression-plan.d.ts.map +1 -1
  118. package/dist/gpu-core/gpu-expression-plan.js +7 -1
  119. package/dist/gpu-core/gpu-expression-plan.js.map +1 -1
  120. package/dist/gpu-core/gpu-graph-compiler.cjs +48 -0
  121. package/dist/gpu-core/gpu-graph-compiler.d.ts +1 -0
  122. package/dist/gpu-core/gpu-graph-compiler.d.ts.map +1 -1
  123. package/dist/gpu-core/gpu-graph-compiler.js +50 -0
  124. package/dist/gpu-core/gpu-graph-compiler.js.map +1 -1
  125. package/dist/gpu-core/gpu-graph.d.ts +2 -2
  126. package/dist/gpu-core/gpu-graph.d.ts.map +1 -1
  127. package/dist/gpu-core/gpu-graph.js.map +1 -1
  128. package/dist/gpu-core/gpu-grid-aggregation.cjs +2 -5
  129. package/dist/gpu-core/gpu-grid-aggregation.d.ts.map +1 -1
  130. package/dist/gpu-core/gpu-grid-aggregation.js +2 -5
  131. package/dist/gpu-core/gpu-grid-aggregation.js.map +1 -1
  132. package/dist/gpu-core/gpu-grid-binning.cjs +2 -5
  133. package/dist/gpu-core/gpu-grid-binning.d.ts.map +1 -1
  134. package/dist/gpu-core/gpu-grid-binning.js +2 -5
  135. package/dist/gpu-core/gpu-grid-binning.js.map +1 -1
  136. package/dist/gpu-core/gpu-grid-coordinate.cjs +41 -0
  137. package/dist/gpu-core/gpu-grid-coordinate.d.ts +7 -0
  138. package/dist/gpu-core/gpu-grid-coordinate.d.ts.map +1 -0
  139. package/dist/gpu-core/gpu-grid-coordinate.js +24 -0
  140. package/dist/gpu-core/gpu-grid-coordinate.js.map +1 -0
  141. package/dist/gpu-core/gpu-grid-index-internals.cjs +2 -15
  142. package/dist/gpu-core/gpu-grid-index-internals.d.ts.map +1 -1
  143. package/dist/gpu-core/gpu-grid-index-internals.js +2 -15
  144. package/dist/gpu-core/gpu-grid-index-internals.js.map +1 -1
  145. package/dist/gpu-core/gpu-grid-index-query.cjs +2 -16
  146. package/dist/gpu-core/gpu-grid-index-query.d.ts.map +1 -1
  147. package/dist/gpu-core/gpu-grid-index-query.js +2 -16
  148. package/dist/gpu-core/gpu-grid-index-query.js.map +1 -1
  149. package/dist/gpu-core/gpu-group-aggregation.cjs +7 -15
  150. package/dist/gpu-core/gpu-group-aggregation.d.ts.map +1 -1
  151. package/dist/gpu-core/gpu-group-aggregation.js +7 -18
  152. package/dist/gpu-core/gpu-group-aggregation.js.map +1 -1
  153. package/dist/gpu-core/gpu-operation.d.ts +4 -4
  154. package/dist/gpu-core/gpu-operation.d.ts.map +1 -1
  155. package/dist/gpu-core/gpu-operation.js.map +1 -1
  156. package/dist/gpu-core/gpu-reduction.cjs +6 -14
  157. package/dist/gpu-core/gpu-reduction.d.ts.map +1 -1
  158. package/dist/gpu-core/gpu-reduction.js +6 -15
  159. package/dist/gpu-core/gpu-reduction.js.map +1 -1
  160. package/dist/gpu-core/gpu-render-operation.cjs +39 -0
  161. package/dist/gpu-core/gpu-render-operation.d.ts +21 -0
  162. package/dist/gpu-core/gpu-render-operation.d.ts.map +1 -0
  163. package/dist/gpu-core/gpu-render-operation.js +22 -0
  164. package/dist/gpu-core/gpu-render-operation.js.map +1 -0
  165. package/dist/gpu-core/gpu-scan.cjs +46 -32
  166. package/dist/gpu-core/gpu-scan.d.ts.map +1 -1
  167. package/dist/gpu-core/gpu-scan.js +56 -44
  168. package/dist/gpu-core/gpu-scan.js.map +1 -1
  169. package/dist/gpu-core/gpu-segmented-reduction.cjs +12 -9
  170. package/dist/gpu-core/gpu-segmented-reduction.d.ts +1 -1
  171. package/dist/gpu-core/gpu-segmented-reduction.d.ts.map +1 -1
  172. package/dist/gpu-core/gpu-segmented-reduction.js +12 -9
  173. package/dist/gpu-core/gpu-segmented-reduction.js.map +1 -1
  174. package/dist/gpu-core/gpu-segmented-scan.cjs +73 -16
  175. package/dist/gpu-core/gpu-segmented-scan.d.ts.map +1 -1
  176. package/dist/gpu-core/gpu-segmented-scan.js +73 -16
  177. package/dist/gpu-core/gpu-segmented-scan.js.map +1 -1
  178. package/dist/gpu-core/gpu-semantic-aggregation-operation.cjs +112 -0
  179. package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts +71 -0
  180. package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts.map +1 -0
  181. package/dist/gpu-core/gpu-semantic-aggregation-operation.js +92 -0
  182. package/dist/gpu-core/gpu-semantic-aggregation-operation.js.map +1 -0
  183. package/dist/gpu-core/gpu-shader-pass-kernel.cjs +267 -0
  184. package/dist/gpu-core/gpu-shader-pass-kernel.d.ts +29 -0
  185. package/dist/gpu-core/gpu-shader-pass-kernel.d.ts.map +1 -0
  186. package/dist/gpu-core/gpu-shader-pass-kernel.js +260 -0
  187. package/dist/gpu-core/gpu-shader-pass-kernel.js.map +1 -0
  188. package/dist/gpu-core/gpu-shader-pass-operation.cjs +85 -0
  189. package/dist/gpu-core/gpu-shader-pass-operation.d.ts +32 -0
  190. package/dist/gpu-core/gpu-shader-pass-operation.d.ts.map +1 -0
  191. package/dist/gpu-core/gpu-shader-pass-operation.js +74 -0
  192. package/dist/gpu-core/gpu-shader-pass-operation.js.map +1 -0
  193. package/dist/gpu-core/gpu-texture-plan.d.ts +3 -2
  194. package/dist/gpu-core/gpu-texture-plan.d.ts.map +1 -1
  195. package/dist/gpu-core/gpu-texture-plan.js.map +1 -1
  196. package/dist/gpu-core/index.cjs +32 -0
  197. package/dist/gpu-core/index.cjs.map +3 -3
  198. package/dist/gpu-core/index.d.ts +21 -1
  199. package/dist/gpu-core/index.d.ts.map +1 -1
  200. package/dist/gpu-core/index.js +10 -0
  201. package/dist/gpu-core/index.js.map +1 -1
  202. package/dist/gpu-data/color-conversion.cjs +105 -0
  203. package/dist/gpu-data/color-conversion.d.ts +30 -0
  204. package/dist/gpu-data/color-conversion.d.ts.map +1 -0
  205. package/dist/gpu-data/color-conversion.js +109 -0
  206. package/dist/gpu-data/color-conversion.js.map +1 -0
  207. package/dist/gpu-data/cpu-data.cjs +60 -0
  208. package/dist/gpu-data/cpu-data.d.ts +28 -0
  209. package/dist/gpu-data/cpu-data.d.ts.map +1 -0
  210. package/dist/gpu-data/cpu-data.js +41 -0
  211. package/dist/gpu-data/cpu-data.js.map +1 -0
  212. package/dist/gpu-data/cpu-gpu-vector-transfer.cjs +98 -0
  213. package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts +9 -0
  214. package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts.map +1 -0
  215. package/dist/gpu-data/cpu-gpu-vector-transfer.js +85 -0
  216. package/dist/gpu-data/cpu-gpu-vector-transfer.js.map +1 -0
  217. package/dist/gpu-data/cpu-vector.cjs +42 -0
  218. package/dist/gpu-data/cpu-vector.d.ts +17 -0
  219. package/dist/gpu-data/cpu-vector.d.ts.map +1 -0
  220. package/dist/gpu-data/cpu-vector.js +21 -0
  221. package/dist/gpu-data/cpu-vector.js.map +1 -0
  222. package/dist/gpu-data/gpu-data-buffer-props.cjs +41 -0
  223. package/dist/gpu-data/gpu-data-buffer-props.d.ts +5 -0
  224. package/dist/gpu-data/gpu-data-buffer-props.d.ts.map +1 -0
  225. package/dist/gpu-data/gpu-data-buffer-props.js +19 -0
  226. package/dist/gpu-data/gpu-data-buffer-props.js.map +1 -0
  227. package/dist/gpu-data/gpu-vector-wgsl-layout.cjs +50 -0
  228. package/dist/gpu-data/gpu-vector-wgsl-layout.d.ts +41 -0
  229. package/dist/gpu-data/gpu-vector-wgsl-layout.d.ts.map +1 -0
  230. package/dist/gpu-data/gpu-vector-wgsl-layout.js +45 -0
  231. package/dist/gpu-data/gpu-vector-wgsl-layout.js.map +1 -0
  232. package/dist/gpu-data/index.cjs +21 -2
  233. package/dist/gpu-data/index.cjs.map +3 -3
  234. package/dist/gpu-data/index.d.ts +6 -0
  235. package/dist/gpu-data/index.d.ts.map +1 -1
  236. package/dist/gpu-data/index.js +5 -0
  237. package/dist/gpu-data/index.js.map +1 -1
  238. package/dist/gpu-dataframe/gpu-data-frame-query.cjs +1 -16
  239. package/dist/gpu-dataframe/gpu-data-frame-query.d.ts.map +1 -1
  240. package/dist/gpu-dataframe/gpu-data-frame-query.js +1 -23
  241. package/dist/gpu-dataframe/gpu-data-frame-query.js.map +1 -1
  242. package/dist/gpu-dataframe/gpu-expression.cjs +91 -2
  243. package/dist/gpu-dataframe/gpu-expression.d.ts +37 -0
  244. package/dist/gpu-dataframe/gpu-expression.d.ts.map +1 -1
  245. package/dist/gpu-dataframe/gpu-expression.js +106 -0
  246. package/dist/gpu-dataframe/gpu-expression.js.map +1 -1
  247. package/dist/gpu-dataframe/index.cjs +12 -2
  248. package/dist/gpu-dataframe/index.cjs.map +3 -3
  249. package/dist/gpu-dataframe/index.d.ts +4 -0
  250. package/dist/gpu-dataframe/index.d.ts.map +1 -1
  251. package/dist/gpu-dataframe/index.js +2 -0
  252. package/dist/gpu-dataframe/index.js.map +1 -1
  253. package/dist/gpu-dataframe/portable-expression.cjs +103 -0
  254. package/dist/gpu-dataframe/portable-expression.d.ts +19 -0
  255. package/dist/gpu-dataframe/portable-expression.d.ts.map +1 -0
  256. package/dist/gpu-dataframe/portable-expression.js +98 -0
  257. package/dist/gpu-dataframe/portable-expression.js.map +1 -0
  258. package/dist/gpu-dggs/benchmarks.cjs.map +1 -1
  259. package/dist/gpu-dggs/index.cjs.map +1 -1
  260. package/dist/gpu-geometry/index.cjs.map +1 -1
  261. package/dist/gpu-graph/index.cjs +8 -0
  262. package/dist/gpu-graph/index.cjs.map +3 -3
  263. package/dist/gpu-graph/index.d.ts +4 -0
  264. package/dist/gpu-graph/index.d.ts.map +1 -1
  265. package/dist/gpu-graph/index.js +2 -0
  266. package/dist/gpu-graph/index.js.map +1 -1
  267. package/dist/gpu-graph-algorithms/benchmarks.cjs.map +2 -2
  268. package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.cjs +2 -15
  269. package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.d.ts.map +1 -1
  270. package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.js +2 -15
  271. package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.js.map +1 -1
  272. package/dist/gpu-graph-algorithms/index.cjs.map +2 -2
  273. package/dist/gpu-h3/index.cjs.map +1 -1
  274. package/dist/gpu-physics/gpu-rigid-body-world.cjs +162 -2
  275. package/dist/gpu-physics/gpu-rigid-body-world.d.ts +25 -0
  276. package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
  277. package/dist/gpu-physics/gpu-rigid-body-world.js +181 -2
  278. package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
  279. package/dist/gpu-physics/index.cjs.map +2 -2
  280. package/dist/gpu-physics/index.d.ts +1 -0
  281. package/dist/gpu-physics/index.d.ts.map +1 -1
  282. package/dist/gpu-physics/rigid-body-parallel-shaders.cjs +24 -9
  283. package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts +1 -1
  284. package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts.map +1 -1
  285. package/dist/gpu-physics/rigid-body-parallel-shaders.js +28 -9
  286. package/dist/gpu-physics/rigid-body-parallel-shaders.js.map +1 -1
  287. package/dist/gpu-physics/rigid-body-shaders.cjs +2 -2
  288. package/dist/gpu-physics/rigid-body-shaders.d.ts +1 -1
  289. package/dist/gpu-physics/rigid-body-shaders.d.ts.map +1 -1
  290. package/dist/gpu-physics/rigid-body-shaders.js +2 -2
  291. package/dist/gpu-physics/rigid-body-shaders.js.map +1 -1
  292. package/dist/gpu-physics/rigid-body-vehicle.cjs +90 -0
  293. package/dist/gpu-physics/rigid-body-vehicle.d.ts +35 -0
  294. package/dist/gpu-physics/rigid-body-vehicle.d.ts.map +1 -0
  295. package/dist/gpu-physics/rigid-body-vehicle.js +66 -0
  296. package/dist/gpu-physics/rigid-body-vehicle.js.map +1 -0
  297. package/dist/gpu-pointcloud/index.cjs.map +1 -1
  298. package/dist/gpu-project/benchmarks.cjs.map +2 -2
  299. package/dist/gpu-project/coordinate-projection-graph.cjs +59 -0
  300. package/dist/gpu-project/coordinate-projection-graph.d.ts +23 -0
  301. package/dist/gpu-project/coordinate-projection-graph.d.ts.map +1 -0
  302. package/dist/gpu-project/coordinate-projection-graph.js +40 -0
  303. package/dist/gpu-project/coordinate-projection-graph.js.map +1 -0
  304. package/dist/gpu-project/cpu-geoarrow.cjs +112 -0
  305. package/dist/gpu-project/cpu-geoarrow.d.ts +10 -0
  306. package/dist/gpu-project/cpu-geoarrow.d.ts.map +1 -0
  307. package/dist/gpu-project/cpu-geoarrow.js +103 -0
  308. package/dist/gpu-project/cpu-geoarrow.js.map +1 -0
  309. package/dist/gpu-project/cpu-geometry-pipelines.cjs +134 -0
  310. package/dist/gpu-project/cpu-geometry-pipelines.d.ts +19 -0
  311. package/dist/gpu-project/cpu-geometry-pipelines.d.ts.map +1 -0
  312. package/dist/gpu-project/cpu-geometry-pipelines.js +114 -0
  313. package/dist/gpu-project/cpu-geometry-pipelines.js.map +1 -0
  314. package/dist/gpu-project/cpu-projection-operation.cjs +54 -0
  315. package/dist/gpu-project/cpu-projection-operation.d.ts +14 -0
  316. package/dist/gpu-project/cpu-projection-operation.d.ts.map +1 -0
  317. package/dist/gpu-project/cpu-projection-operation.js +37 -0
  318. package/dist/gpu-project/cpu-projection-operation.js.map +1 -0
  319. package/dist/gpu-project/crs.cjs.map +2 -2
  320. package/dist/gpu-project/geoarrow.cjs +36 -0
  321. package/dist/gpu-project/geoarrow.cjs.map +6 -0
  322. package/dist/gpu-project/geoarrow.d.ts +3 -0
  323. package/dist/gpu-project/geoarrow.d.ts.map +1 -0
  324. package/dist/gpu-project/geoarrow.js +7 -0
  325. package/dist/gpu-project/geoarrow.js.map +1 -0
  326. package/dist/gpu-project/graph.cjs +27 -0
  327. package/dist/gpu-project/graph.cjs.map +6 -0
  328. package/dist/gpu-project/graph.d.ts +2 -0
  329. package/dist/gpu-project/graph.d.ts.map +1 -0
  330. package/dist/gpu-project/graph.js +6 -0
  331. package/dist/gpu-project/graph.js.map +1 -0
  332. package/dist/gpu-project/index.cjs +3 -0
  333. package/dist/gpu-project/index.cjs.map +3 -3
  334. package/dist/gpu-project/index.d.ts +1 -0
  335. package/dist/gpu-project/index.d.ts.map +1 -1
  336. package/dist/gpu-project/index.js +1 -0
  337. package/dist/gpu-project/index.js.map +1 -1
  338. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.cjs +75 -5
  339. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts +5 -1
  340. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts.map +1 -1
  341. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js +86 -6
  342. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js.map +1 -1
  343. package/dist/gpu-simple-graph/gpu-simple-graph-lowering.cjs +9 -0
  344. package/dist/gpu-simple-graph/gpu-simple-graph-lowering.d.ts +2 -0
  345. package/dist/gpu-simple-graph/gpu-simple-graph-lowering.d.ts.map +1 -1
  346. package/dist/gpu-simple-graph/gpu-simple-graph-lowering.js +10 -0
  347. package/dist/gpu-simple-graph/gpu-simple-graph-lowering.js.map +1 -1
  348. package/dist/gpu-simple-graph/gpu-simple-graph.cjs +126 -10
  349. package/dist/gpu-simple-graph/gpu-simple-graph.d.ts +36 -11
  350. package/dist/gpu-simple-graph/gpu-simple-graph.d.ts.map +1 -1
  351. package/dist/gpu-simple-graph/gpu-simple-graph.js +137 -12
  352. package/dist/gpu-simple-graph/gpu-simple-graph.js.map +1 -1
  353. package/dist/gpu-simple-graph/index.cjs.map +3 -3
  354. package/dist/gpu-simple-graph/index.d.ts +1 -1
  355. package/dist/gpu-simple-graph/index.d.ts.map +1 -1
  356. package/dist/gpu-simple-graph/index.js.map +1 -1
  357. package/dist/gpu-simple-graph/operation/gpu-data-evaluator.cjs +25 -0
  358. package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts +6 -0
  359. package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts.map +1 -1
  360. package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js +28 -0
  361. package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js.map +1 -1
  362. package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.cjs +7 -0
  363. package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.d.ts +2 -0
  364. package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.d.ts.map +1 -1
  365. package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.js +7 -0
  366. package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.js.map +1 -1
  367. package/dist/gpu-simple-graph/operations/convert-colors.cjs +6 -6
  368. package/dist/gpu-simple-graph/operations/convert-colors.d.ts +5 -1
  369. package/dist/gpu-simple-graph/operations/convert-colors.d.ts.map +1 -1
  370. package/dist/gpu-simple-graph/operations/convert-colors.js +12 -7
  371. package/dist/gpu-simple-graph/operations/convert-colors.js.map +1 -1
  372. package/dist/gpu-simple-graph/operations/cpu/convert-colors.cjs +16 -33
  373. package/dist/gpu-simple-graph/operations/cpu/convert-colors.d.ts.map +1 -1
  374. package/dist/gpu-simple-graph/operations/cpu/convert-colors.js +22 -35
  375. package/dist/gpu-simple-graph/operations/cpu/convert-colors.js.map +1 -1
  376. package/dist/gpu-simple-graph/operations/cpu/index.cjs.map +3 -3
  377. package/dist/gpu-simple-graph/operations/webgl/index.cjs.map +3 -3
  378. package/dist/gpu-simple-graph/operations/webgpu/convert-colors.cjs +31 -13
  379. package/dist/gpu-simple-graph/operations/webgpu/convert-colors.d.ts.map +1 -1
  380. package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js +42 -13
  381. package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js.map +1 -1
  382. package/dist/gpu-simple-graph/operations/webgpu/index.cjs.map +1 -1
  383. package/dist/gpu-sql/gpu-sql.cjs +376 -0
  384. package/dist/gpu-sql/gpu-sql.d.ts +36 -0
  385. package/dist/gpu-sql/gpu-sql.d.ts.map +1 -0
  386. package/dist/gpu-sql/gpu-sql.js +374 -0
  387. package/dist/gpu-sql/gpu-sql.js.map +1 -0
  388. package/dist/gpu-sql/index.cjs +5 -5
  389. package/dist/gpu-sql/index.cjs.map +3 -3
  390. package/dist/gpu-sql/index.d.ts +2 -2
  391. package/dist/gpu-sql/index.d.ts.map +1 -1
  392. package/dist/gpu-sql/index.js +1 -1
  393. package/dist/gpu-sql/index.js.map +1 -1
  394. package/dist/gpu-tables/index.cjs.map +2 -2
  395. package/dist/gpu-tables/table/gpu-table.cjs +2 -2
  396. package/dist/gpu-tables/table/gpu-table.d.ts.map +1 -1
  397. package/dist/gpu-tables/table/gpu-table.js +2 -2
  398. package/dist/gpu-tables/table/gpu-table.js.map +1 -1
  399. package/dist/gpu-timeseries/index.cjs.map +1 -1
  400. package/dist/index.cjs +11 -0
  401. package/dist/index.cjs.map +3 -3
  402. package/dist/index.d.ts +7 -1
  403. package/dist/index.d.ts.map +1 -1
  404. package/dist/index.js +3 -0
  405. package/dist/index.js.map +1 -1
  406. package/package.json +21 -7
  407. package/src/arrow/arrow-colors.ts +194 -33
  408. package/src/arrow/arrow-utils/arrow-paths.ts +5 -3
  409. package/src/arrow/cpu/arrow-coordinate-projection.ts +18 -0
  410. package/src/arrow/cpu/arrow-cpu-pipelines.ts +9 -0
  411. package/src/arrow/cpu/arrow-cpu-vector-adapters.ts +153 -0
  412. package/src/arrow/geoarrow/arrow-geoarrow-adapter.ts +21 -493
  413. package/src/arrow/geoarrow/arrow-geoarrow-conversion.ts +7 -5
  414. package/src/arrow/geoarrow/arrow-polygon-tessellation.ts +1 -1
  415. package/src/arrow/gpu/arrow-column-gpu-vector.ts +67 -14
  416. package/src/arrow/gpu/arrow-gpu-table-conversion.ts +96 -4
  417. package/src/arrow/gpu/arrow-gpu-vector-adapters.ts +20 -7
  418. package/src/arrow/gpu/arrow-gpu-vector-conversion.ts +49 -6
  419. package/src/arrow/index.ts +14 -0
  420. package/src/geospatial/gpu-point-spatial-query.ts +2 -15
  421. package/src/gpu-core/compiled-gpu-graph.ts +73 -1
  422. package/src/gpu-core/gpu-command-graph-compiler.ts +25 -2
  423. package/src/gpu-core/gpu-command-graph-types.ts +20 -0
  424. package/src/gpu-core/gpu-command-graph.ts +48 -11
  425. package/src/gpu-core/gpu-cpu-execution.ts +345 -0
  426. package/src/gpu-core/gpu-cpu-operation.ts +65 -0
  427. package/src/gpu-core/gpu-dispatch-utils.ts +13 -1
  428. package/src/gpu-core/gpu-expression-operation.ts +1 -1
  429. package/src/gpu-core/gpu-expression-plan.ts +11 -3
  430. package/src/gpu-core/gpu-graph-compiler.ts +61 -0
  431. package/src/gpu-core/gpu-graph.ts +3 -3
  432. package/src/gpu-core/gpu-grid-aggregation.ts +2 -5
  433. package/src/gpu-core/gpu-grid-binning.ts +2 -5
  434. package/src/gpu-core/gpu-grid-coordinate.ts +24 -0
  435. package/src/gpu-core/gpu-grid-index-internals.ts +2 -15
  436. package/src/gpu-core/gpu-grid-index-query.ts +2 -16
  437. package/src/gpu-core/gpu-group-aggregation.ts +38 -50
  438. package/src/gpu-core/gpu-operation.ts +9 -7
  439. package/src/gpu-core/gpu-reduction.ts +32 -42
  440. package/src/gpu-core/gpu-render-operation.ts +42 -0
  441. package/src/gpu-core/gpu-scan.ts +59 -45
  442. package/src/gpu-core/gpu-segmented-reduction.ts +20 -10
  443. package/src/gpu-core/gpu-segmented-scan.ts +82 -17
  444. package/src/gpu-core/gpu-semantic-aggregation-operation.ts +150 -0
  445. package/src/gpu-core/gpu-shader-pass-kernel.ts +307 -0
  446. package/src/gpu-core/gpu-shader-pass-operation.ts +103 -0
  447. package/src/gpu-core/gpu-texture-plan.ts +3 -2
  448. package/src/gpu-core/index.ts +39 -0
  449. package/src/gpu-data/color-conversion.ts +158 -0
  450. package/src/gpu-data/cpu-data.ts +62 -0
  451. package/src/gpu-data/cpu-gpu-vector-transfer.ts +110 -0
  452. package/src/gpu-data/cpu-vector.ts +31 -0
  453. package/src/gpu-data/gpu-data-buffer-props.ts +25 -0
  454. package/src/gpu-data/gpu-vector-wgsl-layout.ts +79 -0
  455. package/src/gpu-data/index.ts +15 -0
  456. package/src/gpu-dataframe/gpu-data-frame-query.ts +6 -26
  457. package/src/gpu-dataframe/gpu-expression.ts +135 -0
  458. package/src/gpu-dataframe/index.ts +11 -0
  459. package/src/gpu-dataframe/portable-expression.ts +117 -0
  460. package/src/gpu-graph/index.ts +17 -0
  461. package/src/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.ts +2 -15
  462. package/src/gpu-physics/gpu-rigid-body-world.ts +227 -2
  463. package/src/gpu-physics/index.ts +1 -0
  464. package/src/gpu-physics/rigid-body-parallel-shaders.ts +32 -9
  465. package/src/gpu-physics/rigid-body-shaders.ts +3 -2
  466. package/src/gpu-physics/rigid-body-vehicle.ts +99 -0
  467. package/src/gpu-project/README.md +4 -4
  468. package/src/gpu-project/coordinate-projection-graph.ts +59 -0
  469. package/src/gpu-project/cpu-geoarrow.ts +135 -0
  470. package/src/gpu-project/cpu-geometry-pipelines.ts +159 -0
  471. package/src/gpu-project/cpu-projection-operation.ts +49 -0
  472. package/src/gpu-project/geoarrow.ts +11 -0
  473. package/src/gpu-project/graph.ts +10 -0
  474. package/src/gpu-project/index.ts +2 -0
  475. package/src/gpu-simple-graph/compiled-gpu-expression-graph.ts +97 -6
  476. package/src/gpu-simple-graph/gpu-simple-graph-lowering.ts +11 -0
  477. package/src/gpu-simple-graph/gpu-simple-graph.ts +163 -19
  478. package/src/gpu-simple-graph/index.ts +1 -0
  479. package/src/gpu-simple-graph/operation/gpu-data-evaluator.ts +24 -0
  480. package/src/gpu-simple-graph/operation/gpu-vector-evaluator.ts +7 -0
  481. package/src/gpu-simple-graph/operations/convert-colors.ts +22 -7
  482. package/src/gpu-simple-graph/operations/cpu/convert-colors.ts +31 -48
  483. package/src/gpu-simple-graph/operations/webgpu/convert-colors.ts +47 -13
  484. package/src/gpu-sql/gpu-sql.ts +494 -0
  485. package/src/gpu-sql/index.ts +2 -2
  486. package/src/gpu-tables/table/gpu-table.ts +2 -1
  487. package/src/index.ts +21 -0
  488. package/dist/gpu-sql/lu-sql.cjs +0 -499
  489. package/dist/gpu-sql/lu-sql.d.ts +0 -36
  490. package/dist/gpu-sql/lu-sql.d.ts.map +0 -1
  491. package/dist/gpu-sql/lu-sql.js +0 -497
  492. package/dist/gpu-sql/lu-sql.js.map +0 -1
  493. package/src/gpu-sql/lu-sql.ts +0 -599
@@ -0,0 +1,98 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var cpu_gpu_vector_transfer_exports = {};
19
+ __export(cpu_gpu_vector_transfer_exports, {
20
+ makeCPUVectorFromGPUVector: () => makeCPUVectorFromGPUVector,
21
+ makeGPUVectorFromCPUVector: () => makeGPUVectorFromCPUVector
22
+ });
23
+ module.exports = __toCommonJS(cpu_gpu_vector_transfer_exports);
24
+ var import_core = require("@luma.gl/core");
25
+ var import_cpu_data = require("./cpu-data.cjs");
26
+ var import_cpu_vector = require("./cpu-vector.cjs");
27
+ var import_gpu_data = require("./gpu-data.cjs");
28
+ var import_gpu_data_buffer_props = require("./gpu-data-buffer-props.cjs");
29
+ var import_gpu_vector = require("./gpu-vector.cjs");
30
+ var import_gpu_vector_format = require("./gpu-vector-format.cjs");
31
+ function makeGPUVectorFromCPUVector(device, vector, options = {}) {
32
+ var _a, _b;
33
+ const data = [];
34
+ try {
35
+ for (const chunk of vector.data) {
36
+ const info = (0, import_gpu_vector_format.getGPUVectorFormatInfo)(vector.format);
37
+ const inferredIndexType = info.elementFormat === "uint32" ? "uint32" : info.elementFormat === "uint16" ? "uint16" : void 0;
38
+ if ((options.usage ?? 0) & import_core.Buffer.INDEX)
39
+ (0, import_core.assert)(inferredIndexType && (!options.indexType || options.indexType === inferredIndexType));
40
+ const defaults = options.usage === void 0 ? (0, import_gpu_data_buffer_props.getGPUDataBufferProps)(device, inferredIndexType) : {
41
+ usage: import_gpu_data_buffer_props.PORTABLE_GPU_DATA_USAGE,
42
+ indexType: void 0
43
+ };
44
+ const count = info.vertexList || info.valueList ? chunk.valueLength : chunk.length;
45
+ const bytes = new Uint8Array(count * info.byteLength);
46
+ for (let index = 0; index < count; index++)
47
+ bytes.set(new Uint8Array(chunk.buffer, chunk.byteOffset + index * chunk.byteStride, info.byteLength), index * info.byteLength);
48
+ data.push(new import_gpu_data.GPUData({
49
+ buffer: device.createBuffer({
50
+ data: bytes.length ? bytes : new Uint8Array(4),
51
+ usage: (defaults.usage ?? 0) | (options.usage ?? 0),
52
+ indexType: options.indexType ?? ((options.usage ?? 0) & import_core.Buffer.INDEX ? inferredIndexType : defaults.indexType)
53
+ }),
54
+ format: vector.format,
55
+ length: chunk.length,
56
+ valueLength: chunk.valueLength,
57
+ valueOffsets: (_a = chunk.valueOffsets) == null ? void 0 : _a.slice(),
58
+ nullBitmap: (_b = chunk.nullBitmap) == null ? void 0 : _b.slice(),
59
+ ownsBuffer: true
60
+ }));
61
+ }
62
+ return new import_gpu_vector.GPUVector({
63
+ type: "data",
64
+ name: vector.name,
65
+ format: vector.format,
66
+ data,
67
+ ownsData: true
68
+ });
69
+ } catch (error) {
70
+ for (const chunk of data)
71
+ chunk.destroy();
72
+ throw error;
73
+ }
74
+ }
75
+ async function makeCPUVectorFromGPUVector(vector) {
76
+ var _a, _b;
77
+ const data = [];
78
+ for (const chunk of vector.data) {
79
+ const info = (0, import_gpu_vector_format.getGPUVectorFormatInfo)(vector.format);
80
+ const count = info.vertexList || info.valueList ? chunk.valueLength : chunk.length;
81
+ const bytes = count ? await chunk.buffer.readAsync(chunk.byteOffset, (count - 1) * chunk.byteStride + info.byteLength) : new Uint8Array(0);
82
+ data.push(new import_cpu_data.CPUData({
83
+ buffer: bytes,
84
+ format: vector.format,
85
+ length: chunk.length,
86
+ valueLength: chunk.valueLength,
87
+ byteStride: chunk.byteStride,
88
+ valueOffsets: (_a = chunk.valueOffsets) == null ? void 0 : _a.slice(),
89
+ nullBitmap: (_b = chunk.nullBitmap) == null ? void 0 : _b.slice()
90
+ }));
91
+ }
92
+ return new import_cpu_vector.CPUVector({ name: vector.name, format: vector.format, data });
93
+ }
94
+ // Annotate the CommonJS export names for ESM import in node:
95
+ 0 && (module.exports = {
96
+ makeCPUVectorFromGPUVector,
97
+ makeGPUVectorFromCPUVector
98
+ });
@@ -0,0 +1,9 @@
1
+ import { type Device, type BufferProps } from '@luma.gl/core';
2
+ import { CPUVector } from "./cpu-vector.js";
3
+ import { GPUVector } from "./gpu-vector.js";
4
+ import { type GPUVectorFormat } from "./gpu-vector-format.js";
5
+ /** Explicit upload preserving chunk-local list offsets and validity metadata. */
6
+ export declare function makeGPUVectorFromCPUVector<T extends GPUVectorFormat>(device: Device, vector: CPUVector<T>, options?: Pick<BufferProps, 'usage' | 'indexType'>): GPUVector<T>;
7
+ /** Explicit asynchronous readback preserving physical formats, chunks, lists and parent validity. */
8
+ export declare function makeCPUVectorFromGPUVector<T extends GPUVectorFormat>(vector: GPUVector<T>): Promise<CPUVector<T>>;
9
+ //# sourceMappingURL=cpu-gpu-vector-transfer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpu-gpu-vector-transfer.d.ts","sourceRoot":"","sources":["../../src/gpu-data/cpu-gpu-vector-transfer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiB,KAAK,MAAM,EAAE,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AAE5E,OAAO,EAAC,SAAS,EAAC,wBAAqB;AAGvC,OAAO,EAAC,SAAS,EAAC,wBAAqB;AACvC,OAAO,EAAyB,KAAK,eAAe,EAAC,+BAA4B;AAEjF,iFAAiF;AACjF,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,eAAe,EAClE,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EACpB,OAAO,GAAE,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,WAAW,CAAM,GACrD,SAAS,CAAC,CAAC,CAAC,CA+Dd;AAED,qGAAqG;AACrG,wBAAsB,0BAA0B,CAAC,CAAC,SAAS,eAAe,EACxE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAwBvB"}
@@ -0,0 +1,85 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { assert, Buffer } from '@luma.gl/core';
5
+ import { CPUData } from "./cpu-data.js";
6
+ import { CPUVector } from "./cpu-vector.js";
7
+ import { GPUData } from "./gpu-data.js";
8
+ import { getGPUDataBufferProps, PORTABLE_GPU_DATA_USAGE } from "./gpu-data-buffer-props.js";
9
+ import { GPUVector } from "./gpu-vector.js";
10
+ import { getGPUVectorFormatInfo } from "./gpu-vector-format.js";
11
+ /** Explicit upload preserving chunk-local list offsets and validity metadata. */
12
+ export function makeGPUVectorFromCPUVector(device, vector, options = {}) {
13
+ const data = [];
14
+ try {
15
+ for (const chunk of vector.data) {
16
+ const info = getGPUVectorFormatInfo(vector.format);
17
+ const inferredIndexType = info.elementFormat === 'uint32'
18
+ ? 'uint32'
19
+ : info.elementFormat === 'uint16'
20
+ ? 'uint16'
21
+ : undefined;
22
+ // Index usage must match stored elements; raw bytes must never trigger device conversion.
23
+ if ((options.usage ?? 0) & Buffer.INDEX)
24
+ assert(inferredIndexType && (!options.indexType || options.indexType === inferredIndexType));
25
+ const defaults = options.usage === undefined
26
+ ? getGPUDataBufferProps(device, inferredIndexType)
27
+ : {
28
+ usage: PORTABLE_GPU_DATA_USAGE,
29
+ indexType: undefined
30
+ };
31
+ const count = info.vertexList || info.valueList ? chunk.valueLength : chunk.length;
32
+ const bytes = new Uint8Array(count * info.byteLength);
33
+ for (let index = 0; index < count; index++)
34
+ bytes.set(new Uint8Array(chunk.buffer, chunk.byteOffset + index * chunk.byteStride, info.byteLength), index * info.byteLength);
35
+ data.push(new GPUData({
36
+ buffer: device.createBuffer({
37
+ data: bytes.length ? bytes : new Uint8Array(4),
38
+ usage: (defaults.usage ?? 0) | (options.usage ?? 0),
39
+ indexType: options.indexType ??
40
+ ((options.usage ?? 0) & Buffer.INDEX ? inferredIndexType : defaults.indexType)
41
+ }),
42
+ format: vector.format,
43
+ length: chunk.length,
44
+ valueLength: chunk.valueLength,
45
+ valueOffsets: chunk.valueOffsets?.slice(),
46
+ nullBitmap: chunk.nullBitmap?.slice(),
47
+ ownsBuffer: true
48
+ }));
49
+ }
50
+ return new GPUVector({
51
+ type: 'data',
52
+ name: vector.name,
53
+ format: vector.format,
54
+ data,
55
+ ownsData: true
56
+ });
57
+ }
58
+ catch (error) {
59
+ for (const chunk of data)
60
+ chunk.destroy();
61
+ throw error;
62
+ }
63
+ }
64
+ /** Explicit asynchronous readback preserving physical formats, chunks, lists and parent validity. */
65
+ export async function makeCPUVectorFromGPUVector(vector) {
66
+ const data = [];
67
+ for (const chunk of vector.data) {
68
+ const info = getGPUVectorFormatInfo(vector.format);
69
+ const count = info.vertexList || info.valueList ? chunk.valueLength : chunk.length;
70
+ const bytes = count
71
+ ? await chunk.buffer.readAsync(chunk.byteOffset, (count - 1) * chunk.byteStride + info.byteLength)
72
+ : new Uint8Array(0);
73
+ data.push(new CPUData({
74
+ buffer: bytes,
75
+ format: vector.format,
76
+ length: chunk.length,
77
+ valueLength: chunk.valueLength,
78
+ byteStride: chunk.byteStride,
79
+ valueOffsets: chunk.valueOffsets?.slice(),
80
+ nullBitmap: chunk.nullBitmap?.slice()
81
+ }));
82
+ }
83
+ return new CPUVector({ name: vector.name, format: vector.format, data });
84
+ }
85
+ //# sourceMappingURL=cpu-gpu-vector-transfer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpu-gpu-vector-transfer.js","sourceRoot":"","sources":["../../src/gpu-data/cpu-gpu-vector-transfer.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,42 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var cpu_vector_exports = {};
19
+ __export(cpu_vector_exports, {
20
+ CPUVector: () => CPUVector
21
+ });
22
+ module.exports = __toCommonJS(cpu_vector_exports);
23
+ var import_core = require("@luma.gl/core");
24
+ class CPUVector {
25
+ name;
26
+ format;
27
+ data;
28
+ length;
29
+ valueLength;
30
+ constructor(props) {
31
+ (0, import_core.assert)(props.data.every((chunk) => chunk.format === props.format));
32
+ this.name = props.name ?? "";
33
+ this.format = props.format;
34
+ this.data = Object.freeze([...props.data]);
35
+ this.length = this.data.reduce((total, chunk) => total + chunk.length, 0);
36
+ this.valueLength = this.data.reduce((total, chunk) => total + chunk.valueLength, 0);
37
+ }
38
+ }
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ CPUVector
42
+ });
@@ -0,0 +1,17 @@
1
+ import { CPUData } from "./cpu-data.js";
2
+ import type { GPUVectorFormat } from "./gpu-vector-format.js";
3
+ export type CPUVectorProps<T extends GPUVectorFormat = GPUVectorFormat> = {
4
+ name?: string;
5
+ format: T;
6
+ data: readonly CPUData<T>[];
7
+ };
8
+ /** Ordered borrowed CPU chunks. Construction preserves buffers and chunk boundaries. */
9
+ export declare class CPUVector<T extends GPUVectorFormat = GPUVectorFormat> {
10
+ readonly name: string;
11
+ readonly format: T;
12
+ readonly data: readonly CPUData<T>[];
13
+ readonly length: number;
14
+ readonly valueLength: number;
15
+ constructor(props: CPUVectorProps<T>);
16
+ }
17
+ //# sourceMappingURL=cpu-vector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpu-vector.d.ts","sourceRoot":"","sources":["../../src/gpu-data/cpu-vector.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,OAAO,EAAC,sBAAmB;AACnC,OAAO,KAAK,EAAC,eAAe,EAAC,+BAA4B;AAEzD,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,IAAI;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,CAAC,CAAC;IACV,IAAI,EAAE,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;CAC7B,CAAC;AAEF,wFAAwF;AACxF,qBAAa,SAAS,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBAEjB,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC;CAQrC"}
@@ -0,0 +1,21 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { assert } from '@luma.gl/core';
5
+ /** Ordered borrowed CPU chunks. Construction preserves buffers and chunk boundaries. */
6
+ export class CPUVector {
7
+ name;
8
+ format;
9
+ data;
10
+ length;
11
+ valueLength;
12
+ constructor(props) {
13
+ assert(props.data.every(chunk => chunk.format === props.format));
14
+ this.name = props.name ?? '';
15
+ this.format = props.format;
16
+ this.data = Object.freeze([...props.data]);
17
+ this.length = this.data.reduce((total, chunk) => total + chunk.length, 0);
18
+ this.valueLength = this.data.reduce((total, chunk) => total + chunk.valueLength, 0);
19
+ }
20
+ }
21
+ //# sourceMappingURL=cpu-vector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpu-vector.js","sourceRoot":"","sources":["../../src/gpu-data/cpu-vector.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AAUrC,wFAAwF;AACxF,MAAM,OAAO,SAAS;IACX,IAAI,CAAS;IACb,MAAM,CAAI;IACV,IAAI,CAAwB;IAC5B,MAAM,CAAS;IACf,WAAW,CAAS;IAE7B,YAAY,KAAwB;QAClC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QACjE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC1E,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IACtF,CAAC;CACF"}
@@ -0,0 +1,41 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var gpu_data_buffer_props_exports = {};
19
+ __export(gpu_data_buffer_props_exports, {
20
+ PORTABLE_GPU_DATA_USAGE: () => PORTABLE_GPU_DATA_USAGE,
21
+ getGPUDataBufferProps: () => getGPUDataBufferProps
22
+ });
23
+ module.exports = __toCommonJS(gpu_data_buffer_props_exports);
24
+ var import_core = require("@luma.gl/core");
25
+ const PORTABLE_GPU_DATA_USAGE = import_core.Buffer.STORAGE | import_core.Buffer.VERTEX | import_core.Buffer.COPY_SRC | import_core.Buffer.COPY_DST;
26
+ function getGPUDataBufferProps(device, indexType = "uint32") {
27
+ const usage = PORTABLE_GPU_DATA_USAGE;
28
+ if (device.type !== "webgpu") {
29
+ return { usage };
30
+ }
31
+ return {
32
+ usage: usage | import_core.Buffer.INDEX | import_core.Buffer.UNIFORM | import_core.Buffer.INDIRECT | import_core.Buffer.QUERY_RESOLVE,
33
+ // Explicit index metadata prevents Device from widening raw Uint8Array uploads.
34
+ indexType
35
+ };
36
+ }
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ PORTABLE_GPU_DATA_USAGE,
40
+ getGPUDataBufferProps
41
+ });
@@ -0,0 +1,5 @@
1
+ import { type BufferProps, type Device } from '@luma.gl/core';
2
+ export declare const PORTABLE_GPU_DATA_USAGE: number;
3
+ /** Usage defaults for general-purpose GPUData backing storage. */
4
+ export declare function getGPUDataBufferProps(device: Device, indexType?: BufferProps['indexType']): Pick<BufferProps, 'usage' | 'indexType'>;
5
+ //# sourceMappingURL=gpu-data-buffer-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpu-data-buffer-props.d.ts","sourceRoot":"","sources":["../../src/gpu-data/gpu-data-buffer-props.ts"],"names":[],"mappings":"AAIA,OAAO,EAAS,KAAK,WAAW,EAAE,KAAK,MAAM,EAAC,MAAM,eAAe,CAAC;AAEpE,eAAO,MAAM,uBAAuB,QACgC,CAAC;AAErE,kEAAkE;AAClE,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,SAAS,GAAE,WAAW,CAAC,WAAW,CAAY,GAC7C,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,WAAW,CAAC,CAW1C"}
@@ -0,0 +1,19 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { Buffer } from '@luma.gl/core';
5
+ export const PORTABLE_GPU_DATA_USAGE = Buffer.STORAGE | Buffer.VERTEX | Buffer.COPY_SRC | Buffer.COPY_DST;
6
+ /** Usage defaults for general-purpose GPUData backing storage. */
7
+ export function getGPUDataBufferProps(device, indexType = 'uint32') {
8
+ const usage = PORTABLE_GPU_DATA_USAGE;
9
+ if (device.type !== 'webgpu') {
10
+ // WebGL fixes the buffer target on first bind, so INDEX would prevent vertex use.
11
+ return { usage };
12
+ }
13
+ return {
14
+ usage: usage | Buffer.INDEX | Buffer.UNIFORM | Buffer.INDIRECT | Buffer.QUERY_RESOLVE,
15
+ // Explicit index metadata prevents Device from widening raw Uint8Array uploads.
16
+ indexType
17
+ };
18
+ }
19
+ //# sourceMappingURL=gpu-data-buffer-props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpu-data-buffer-props.js","sourceRoot":"","sources":["../../src/gpu-data/gpu-data-buffer-props.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EAAC,MAAM,EAAgC,MAAM,eAAe,CAAC;AAEpE,MAAM,CAAC,MAAM,uBAAuB,GAClC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAErE,kEAAkE;AAClE,MAAM,UAAU,qBAAqB,CACnC,MAAc,EACd,YAAsC,QAAQ;IAE9C,MAAM,KAAK,GAAG,uBAAuB,CAAC;IACtC,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,kFAAkF;QAClF,OAAO,EAAC,KAAK,EAAC,CAAC;IACjB,CAAC;IACD,OAAO;QACL,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,aAAa;QACrF,gFAAgF;QAChF,SAAS;KACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,50 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var gpu_vector_wgsl_layout_exports = {};
19
+ __export(gpu_vector_wgsl_layout_exports, {
20
+ getGPUVectorWGSLLayout: () => getGPUVectorWGSLLayout
21
+ });
22
+ module.exports = __toCommonJS(gpu_vector_wgsl_layout_exports);
23
+ var import_types = require("@luma.gl/shaders/types");
24
+ var import_gpu_vector_format = require("./gpu-vector-format.cjs");
25
+ function getGPUVectorWGSLLayout(format) {
26
+ const { components, signedDataType, primitiveType, byteLength, elementFormat, normalized } = (0, import_gpu_vector_format.getGPUVectorFormatInfo)(format);
27
+ if (normalized || elementFormat !== format || signedDataType !== "float32" && signedDataType !== "sint32" && signedDataType !== "uint32" || primitiveType === "f16") {
28
+ throw new Error("Expected a packed 32-bit numeric vector format");
29
+ }
30
+ const scalarType = primitiveType;
31
+ const shaderType = components === 1 ? scalarType : `vec${components}<${scalarType}>`;
32
+ const layout = "wgsl-storage";
33
+ const { alignment } = (0, import_types.getLeafLayoutInfo)(shaderType, layout);
34
+ const arrayLayout = (0, import_types.makeShaderBlockLayout)({ values: [shaderType, 2] }, { layout });
35
+ return {
36
+ format,
37
+ components,
38
+ componentType: signedDataType,
39
+ scalarType,
40
+ shaderType,
41
+ byteLength,
42
+ packedByteStride: byteLength,
43
+ storageAlignment: alignment * Uint32Array.BYTES_PER_ELEMENT,
44
+ nativeArrayByteStride: arrayLayout.byteLength / 2
45
+ };
46
+ }
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ getGPUVectorWGSLLayout
50
+ });
@@ -0,0 +1,41 @@
1
+ /** Scalar formats with matching 32-bit WGSL component representations. */
2
+ export type GPUVectorWGSLScalarFormat = 'float32' | 'sint32' | 'uint32';
3
+ /** Packed 32-bit numeric formats with a corresponding WGSL value type. */
4
+ export type GPUVectorWGSLFormat = GPUVectorWGSLScalarFormat | `${GPUVectorWGSLScalarFormat}x${2 | 3 | 4}`;
5
+ /** Packed row metadata and the layout of the corresponding native WGSL storage value. */
6
+ export type GPUVectorWGSLLayout = {
7
+ /** The packed GPUVector format. */
8
+ format: GPUVectorWGSLFormat;
9
+ /** Number of scalar components in a row. */
10
+ components: 1 | 2 | 3 | 4;
11
+ /** GPUVector format of an individual component. */
12
+ componentType: GPUVectorWGSLScalarFormat;
13
+ /** WGSL type of an individual component. */
14
+ scalarType: 'f32' | 'i32' | 'u32';
15
+ /** WGSL scalar or vector type for one row. */
16
+ shaderType: 'f32' | 'i32' | 'u32' | `vec${2 | 3 | 4}<${'f32' | 'i32' | 'u32'}>`;
17
+ /** Number of bytes occupied by the components of one row. */
18
+ byteLength: number;
19
+ /** Distance in bytes between rows in a tightly packed GPUVector. */
20
+ packedByteStride: number;
21
+ /** Required byte alignment of the value in a native WGSL storage buffer. */
22
+ storageAlignment: number;
23
+ /** Distance in bytes between elements in a native WGSL storage array of this value type. */
24
+ nativeArrayByteStride: number;
25
+ };
26
+ /**
27
+ * Describes packed GPUVector rows and the corresponding native WGSL storage array.
28
+ *
29
+ * @param format - Packed 32-bit scalar or vector format.
30
+ * @returns Layout metadata in bytes. The helper does not allocate or modify storage.
31
+ * @throws If the format has no supported 32-bit WGSL representation.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const layout = getGPUVectorWGSLLayout('float32x3');
36
+ * layout.packedByteStride; // 12
37
+ * layout.nativeArrayByteStride; // 16
38
+ * ```
39
+ */
40
+ export declare function getGPUVectorWGSLLayout(format: GPUVectorWGSLFormat): GPUVectorWGSLLayout;
41
+ //# sourceMappingURL=gpu-vector-wgsl-layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpu-vector-wgsl-layout.d.ts","sourceRoot":"","sources":["../../src/gpu-data/gpu-vector-wgsl-layout.ts"],"names":[],"mappings":"AAOA,0EAA0E;AAC1E,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAExE,0EAA0E;AAC1E,MAAM,MAAM,mBAAmB,GAC3B,yBAAyB,GACzB,GAAG,yBAAyB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;AAEhD,yFAAyF;AACzF,MAAM,MAAM,mBAAmB,GAAG;IAChC,mCAAmC;IACnC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,4CAA4C;IAC5C,UAAU,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,mDAAmD;IACnD,aAAa,EAAE,yBAAyB,CAAC;IACzC,4CAA4C;IAC5C,UAAU,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IAClC,8CAA8C;IAC9C,UAAU,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,CAAC;IAChF,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,gBAAgB,EAAE,MAAM,CAAC;IACzB,4EAA4E;IAC5E,gBAAgB,EAAE,MAAM,CAAC;IACzB,4FAA4F;IAC5F,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,mBAAmB,GAAG,mBAAmB,CA2BvF"}
@@ -0,0 +1,45 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { getLeafLayoutInfo, makeShaderBlockLayout } from '@luma.gl/shaders/types';
5
+ import { getGPUVectorFormatInfo } from "./gpu-vector-format.js";
6
+ /**
7
+ * Describes packed GPUVector rows and the corresponding native WGSL storage array.
8
+ *
9
+ * @param format - Packed 32-bit scalar or vector format.
10
+ * @returns Layout metadata in bytes. The helper does not allocate or modify storage.
11
+ * @throws If the format has no supported 32-bit WGSL representation.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const layout = getGPUVectorWGSLLayout('float32x3');
16
+ * layout.packedByteStride; // 12
17
+ * layout.nativeArrayByteStride; // 16
18
+ * ```
19
+ */
20
+ export function getGPUVectorWGSLLayout(format) {
21
+ const { components, signedDataType, primitiveType, byteLength, elementFormat, normalized } = getGPUVectorFormatInfo(format);
22
+ if (normalized ||
23
+ elementFormat !== format ||
24
+ (signedDataType !== 'float32' && signedDataType !== 'sint32' && signedDataType !== 'uint32') ||
25
+ primitiveType === 'f16') {
26
+ throw new Error('Expected a packed 32-bit numeric vector format');
27
+ }
28
+ const scalarType = primitiveType;
29
+ const shaderType = components === 1 ? scalarType : `vec${components}<${scalarType}>`;
30
+ const layout = 'wgsl-storage';
31
+ const { alignment } = getLeafLayoutInfo(shaderType, layout);
32
+ const arrayLayout = makeShaderBlockLayout({ values: [shaderType, 2] }, { layout });
33
+ return {
34
+ format,
35
+ components,
36
+ componentType: signedDataType,
37
+ scalarType,
38
+ shaderType,
39
+ byteLength,
40
+ packedByteStride: byteLength,
41
+ storageAlignment: alignment * Uint32Array.BYTES_PER_ELEMENT,
42
+ nativeArrayByteStride: arrayLayout.byteLength / 2
43
+ };
44
+ }
45
+ //# sourceMappingURL=gpu-vector-wgsl-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpu-vector-wgsl-layout.js","sourceRoot":"","sources":["../../src/gpu-data/gpu-vector-wgsl-layout.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EAAC,iBAAiB,EAAE,qBAAqB,EAAC,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAC,sBAAsB,EAAC,+BAA4B;AAgC3D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAA2B;IAChE,MAAM,EAAC,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAC,GACtF,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACjC,IACE,UAAU;QACV,aAAa,KAAK,MAAM;QACxB,CAAC,cAAc,KAAK,SAAS,IAAI,cAAc,KAAK,QAAQ,IAAI,cAAc,KAAK,QAAQ,CAAC;QAC5F,aAAa,KAAK,KAAK,EACvB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,MAAM,UAAU,GAAG,aAAa,CAAC;IACjC,MAAM,UAAU,GAAG,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAE,MAAM,UAAU,IAAI,UAAU,GAAa,CAAC;IAChG,MAAM,MAAM,GAAG,cAAc,CAAC;IAC9B,MAAM,EAAC,SAAS,EAAC,GAAG,iBAAiB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG,qBAAqB,CAAC,EAAC,MAAM,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,EAAC,EAAE,EAAC,MAAM,EAAC,CAAC,CAAC;IAC/E,OAAO;QACL,MAAM;QACN,UAAU;QACV,aAAa,EAAE,cAAc;QAC7B,UAAU;QACV,UAAU;QACV,UAAU;QACV,gBAAgB,EAAE,UAAU;QAC5B,gBAAgB,EAAE,SAAS,GAAG,WAAW,CAAC,iBAAiB;QAC3D,qBAAqB,EAAE,WAAW,CAAC,UAAU,GAAG,CAAC;KAClD,CAAC;AACJ,CAAC"}
@@ -17,10 +17,13 @@ var __copyProps = (to, from, except, desc) => {
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
  var gpu_data_exports = {};
19
19
  __export(gpu_data_exports, {
20
+ CPUData: () => import_cpu_data.CPUData,
21
+ CPUVector: () => import_cpu_vector.CPUVector,
20
22
  GPUConstant: () => import_gpu_constant.GPUConstant,
21
23
  GPUData: () => import_gpu_data.GPUData,
22
24
  GPUDataView: () => import_gpu_data_view.GPUDataView,
23
25
  GPUVector: () => import_gpu_vector.GPUVector,
26
+ convertCPUColors: () => import_color_conversion.convertCPUColors,
24
27
  getBufferLayoutFromGPUDataStructFormat: () => import_gpu_data_format.getBufferLayoutFromGPUDataStructFormat,
25
28
  getDataTypeByteLength: () => import_core.getDataTypeByteLength,
26
29
  getDataTypeFromTypedArray: () => import_core.getDataTypeFromTypedArray,
@@ -32,6 +35,7 @@ __export(gpu_data_exports, {
32
35
  getGPUVectorData: () => import_gpu_vector_utils.getGPUVectorData,
33
36
  getGPUVectorElementFormat: () => import_gpu_vector_format.getGPUVectorElementFormat,
34
37
  getGPUVectorFormatInfo: () => import_gpu_vector_format.getGPUVectorFormatInfo,
38
+ getGPUVectorWGSLLayout: () => import_gpu_vector_wgsl_layout.getGPUVectorWGSLLayout,
35
39
  getRequiredGPUVector: () => import_gpu_vector_utils.getRequiredGPUVector,
36
40
  getTypedArrayFromDataType: () => import_core.getTypedArrayFromDataType,
37
41
  isFixedSizeListGPUVectorFormat: () => import_gpu_vector_format.isFixedSizeListGPUVectorFormat,
@@ -39,7 +43,10 @@ __export(gpu_data_exports, {
39
43
  isGPUVectorFormatCompatibleWithShaderType: () => import_gpu_vector_format.isGPUVectorFormatCompatibleWithShaderType,
40
44
  isValueListGPUVectorFormat: () => import_gpu_vector_format.isValueListGPUVectorFormat,
41
45
  isVertexListGPUVectorFormat: () => import_gpu_vector_format.isVertexListGPUVectorFormat,
42
- makeGPUDataViewFromAttribute: () => import_gpu_data_view.makeGPUDataViewFromAttribute
46
+ makeCPUVectorFromGPUVector: () => import_cpu_gpu_vector_transfer.makeCPUVectorFromGPUVector,
47
+ makeGPUDataViewFromAttribute: () => import_gpu_data_view.makeGPUDataViewFromAttribute,
48
+ makeGPUVectorFromCPUVector: () => import_cpu_gpu_vector_transfer.makeGPUVectorFromCPUVector,
49
+ resolveColorOutputFormat: () => import_color_conversion.resolveColorOutputFormat
43
50
  });
44
51
  module.exports = __toCommonJS(gpu_data_exports);
45
52
  var import_gpu_constant = require("./gpu-constant.cjs");
@@ -51,12 +58,20 @@ var import_gpu_vector_utils = require("./gpu-vector-utils.cjs");
51
58
  var import_gpu_vector_format = require("./gpu-vector-format.cjs");
52
59
  var import_core = require("@luma.gl/core");
53
60
  var import_gpu_vector_chunks = require("./gpu-vector-chunks.cjs");
61
+ var import_cpu_data = require("./cpu-data.cjs");
62
+ var import_cpu_vector = require("./cpu-vector.cjs");
63
+ var import_cpu_gpu_vector_transfer = require("./cpu-gpu-vector-transfer.cjs");
64
+ var import_gpu_vector_wgsl_layout = require("./gpu-vector-wgsl-layout.cjs");
65
+ var import_color_conversion = require("./color-conversion.cjs");
54
66
  // Annotate the CommonJS export names for ESM import in node:
55
67
  0 && (module.exports = {
68
+ CPUData,
69
+ CPUVector,
56
70
  GPUConstant,
57
71
  GPUData,
58
72
  GPUDataView,
59
73
  GPUVector,
74
+ convertCPUColors,
60
75
  getBufferLayoutFromGPUDataStructFormat,
61
76
  getDataTypeByteLength,
62
77
  getDataTypeFromTypedArray,
@@ -68,6 +83,7 @@ var import_gpu_vector_chunks = require("./gpu-vector-chunks.cjs");
68
83
  getGPUVectorData,
69
84
  getGPUVectorElementFormat,
70
85
  getGPUVectorFormatInfo,
86
+ getGPUVectorWGSLLayout,
71
87
  getRequiredGPUVector,
72
88
  getTypedArrayFromDataType,
73
89
  isFixedSizeListGPUVectorFormat,
@@ -75,5 +91,8 @@ var import_gpu_vector_chunks = require("./gpu-vector-chunks.cjs");
75
91
  isGPUVectorFormatCompatibleWithShaderType,
76
92
  isValueListGPUVectorFormat,
77
93
  isVertexListGPUVectorFormat,
78
- makeGPUDataViewFromAttribute
94
+ makeCPUVectorFromGPUVector,
95
+ makeGPUDataViewFromAttribute,
96
+ makeGPUVectorFromCPUVector,
97
+ resolveColorOutputFormat
79
98
  });