@luma.gl/graph 10.0.0-alpha.9 → 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.
- package/LICENSE +4 -4
- package/THIRD-PARTY-NOTICES.md +19 -0
- package/dist/arrow/arrow-colors.cjs +99 -18
- package/dist/arrow/arrow-colors.d.ts +27 -10
- package/dist/arrow/arrow-colors.d.ts.map +1 -1
- package/dist/arrow/arrow-colors.js +107 -24
- package/dist/arrow/arrow-colors.js.map +1 -1
- package/dist/arrow/arrow-utils/arrow-paths.cjs +4 -3
- package/dist/arrow/arrow-utils/arrow-paths.d.ts.map +1 -1
- package/dist/arrow/arrow-utils/arrow-paths.js +5 -4
- package/dist/arrow/arrow-utils/arrow-paths.js.map +1 -1
- package/dist/arrow/cpu/arrow-coordinate-projection.cjs +30 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.d.ts +5 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.js +9 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.js.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.cjs +31 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.d.ts +2 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.js +5 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.js.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.cjs +99 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.d.ts +9 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.js +100 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.js.map +1 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.cjs +9 -371
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts +8 -28
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js +4 -381
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.cjs +11 -11
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts +2 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js +4 -4
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js.map +1 -1
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.cjs +2 -2
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.js +1 -1
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.js.map +1 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.cjs +27 -8
- package/dist/arrow/gpu/arrow-column-gpu-vector.d.ts +11 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.js +33 -8
- package/dist/arrow/gpu/arrow-column-gpu-vector.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.cjs +68 -3
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts +9 -2
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js +76 -3
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.cjs +8 -6
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts +1 -0
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.js +17 -7
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.cjs +35 -5
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts +6 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js +40 -5
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js.map +1 -1
- package/dist/arrow/index.cjs +19 -2
- package/dist/arrow/index.cjs.map +3 -3
- package/dist/arrow/index.d.ts +5 -2
- package/dist/arrow/index.d.ts.map +1 -1
- package/dist/arrow/index.js +4 -1
- package/dist/arrow/index.js.map +1 -1
- package/dist/arrow/internal.cjs.map +2 -2
- package/dist/dist.dev.js +3820 -1646
- package/dist/dist.min.js +450 -136
- package/dist/experimental/index.cjs.map +1 -1
- package/dist/experimental/simulation/index.cjs.map +1 -1
- package/dist/geospatial/gpu-point-spatial-query.cjs +2 -15
- package/dist/geospatial/gpu-point-spatial-query.d.ts.map +1 -1
- package/dist/geospatial/gpu-point-spatial-query.js +2 -15
- package/dist/geospatial/gpu-point-spatial-query.js.map +1 -1
- package/dist/geospatial/index.cjs.map +2 -2
- package/dist/gpu-a5/index.cjs.map +1 -1
- package/dist/gpu-core/compiled-gpu-graph.cjs +47 -0
- package/dist/gpu-core/compiled-gpu-graph.d.ts +5 -0
- package/dist/gpu-core/compiled-gpu-graph.d.ts.map +1 -1
- package/dist/gpu-core/compiled-gpu-graph.js +54 -1
- package/dist/gpu-core/compiled-gpu-graph.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph-compiler.cjs +11 -2
- package/dist/gpu-core/gpu-command-graph-compiler.d.ts +2 -1
- package/dist/gpu-core/gpu-command-graph-compiler.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph-compiler.js +13 -2
- package/dist/gpu-core/gpu-command-graph-compiler.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph-types.d.ts +16 -1
- package/dist/gpu-core/gpu-command-graph-types.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph-types.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph.cjs +34 -11
- package/dist/gpu-core/gpu-command-graph.d.ts +17 -8
- package/dist/gpu-core/gpu-command-graph.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph.js +39 -11
- package/dist/gpu-core/gpu-command-graph.js.map +1 -1
- package/dist/gpu-core/gpu-cpu-execution.cjs +279 -0
- package/dist/gpu-core/gpu-cpu-execution.d.ts +22 -0
- package/dist/gpu-core/gpu-cpu-execution.d.ts.map +1 -0
- package/dist/gpu-core/gpu-cpu-execution.js +294 -0
- package/dist/gpu-core/gpu-cpu-execution.js.map +1 -0
- package/dist/gpu-core/gpu-cpu-operation.cjs +54 -0
- package/dist/gpu-core/gpu-cpu-operation.d.ts +40 -0
- package/dist/gpu-core/gpu-cpu-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-cpu-operation.js +35 -0
- package/dist/gpu-core/gpu-cpu-operation.js.map +1 -0
- package/dist/gpu-core/gpu-dispatch-utils.cjs +7 -3
- package/dist/gpu-core/gpu-dispatch-utils.d.ts +2 -0
- package/dist/gpu-core/gpu-dispatch-utils.d.ts.map +1 -1
- package/dist/gpu-core/gpu-dispatch-utils.js +4 -1
- package/dist/gpu-core/gpu-dispatch-utils.js.map +1 -1
- package/dist/gpu-core/gpu-expression-operation.cjs +2 -2
- package/dist/gpu-core/gpu-expression-operation.d.ts +1 -1
- package/dist/gpu-core/gpu-expression-operation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-expression-operation.js +1 -1
- package/dist/gpu-core/gpu-expression-operation.js.map +1 -1
- package/dist/gpu-core/gpu-expression-plan.cjs +5 -1
- package/dist/gpu-core/gpu-expression-plan.d.ts +3 -2
- package/dist/gpu-core/gpu-expression-plan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-expression-plan.js +7 -1
- package/dist/gpu-core/gpu-expression-plan.js.map +1 -1
- package/dist/gpu-core/gpu-graph-compiler.cjs +48 -0
- package/dist/gpu-core/gpu-graph-compiler.d.ts +1 -0
- package/dist/gpu-core/gpu-graph-compiler.d.ts.map +1 -1
- package/dist/gpu-core/gpu-graph-compiler.js +50 -0
- package/dist/gpu-core/gpu-graph-compiler.js.map +1 -1
- package/dist/gpu-core/gpu-graph.d.ts +2 -2
- package/dist/gpu-core/gpu-graph.d.ts.map +1 -1
- package/dist/gpu-core/gpu-graph.js.map +1 -1
- package/dist/gpu-core/gpu-grid-aggregation.cjs +2 -5
- package/dist/gpu-core/gpu-grid-aggregation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-aggregation.js +2 -5
- package/dist/gpu-core/gpu-grid-aggregation.js.map +1 -1
- package/dist/gpu-core/gpu-grid-binning.cjs +2 -5
- package/dist/gpu-core/gpu-grid-binning.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-binning.js +2 -5
- package/dist/gpu-core/gpu-grid-binning.js.map +1 -1
- package/dist/gpu-core/gpu-grid-coordinate.cjs +41 -0
- package/dist/gpu-core/gpu-grid-coordinate.d.ts +7 -0
- package/dist/gpu-core/gpu-grid-coordinate.d.ts.map +1 -0
- package/dist/gpu-core/gpu-grid-coordinate.js +24 -0
- package/dist/gpu-core/gpu-grid-coordinate.js.map +1 -0
- package/dist/gpu-core/gpu-grid-index-internals.cjs +2 -15
- package/dist/gpu-core/gpu-grid-index-internals.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-index-internals.js +2 -15
- package/dist/gpu-core/gpu-grid-index-internals.js.map +1 -1
- package/dist/gpu-core/gpu-grid-index-query.cjs +2 -16
- package/dist/gpu-core/gpu-grid-index-query.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-index-query.js +2 -16
- package/dist/gpu-core/gpu-grid-index-query.js.map +1 -1
- package/dist/gpu-core/gpu-group-aggregation.cjs +7 -15
- package/dist/gpu-core/gpu-group-aggregation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-group-aggregation.js +7 -18
- package/dist/gpu-core/gpu-group-aggregation.js.map +1 -1
- package/dist/gpu-core/gpu-operation.d.ts +4 -4
- package/dist/gpu-core/gpu-operation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-operation.js.map +1 -1
- package/dist/gpu-core/gpu-reduction.cjs +6 -14
- package/dist/gpu-core/gpu-reduction.d.ts.map +1 -1
- package/dist/gpu-core/gpu-reduction.js +6 -15
- package/dist/gpu-core/gpu-reduction.js.map +1 -1
- package/dist/gpu-core/gpu-render-operation.cjs +39 -0
- package/dist/gpu-core/gpu-render-operation.d.ts +21 -0
- package/dist/gpu-core/gpu-render-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-render-operation.js +22 -0
- package/dist/gpu-core/gpu-render-operation.js.map +1 -0
- package/dist/gpu-core/gpu-scan.cjs +46 -32
- package/dist/gpu-core/gpu-scan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-scan.js +56 -44
- package/dist/gpu-core/gpu-scan.js.map +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.cjs +12 -9
- package/dist/gpu-core/gpu-segmented-reduction.d.ts +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.d.ts.map +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.js +12 -9
- package/dist/gpu-core/gpu-segmented-reduction.js.map +1 -1
- package/dist/gpu-core/gpu-segmented-scan.cjs +73 -16
- package/dist/gpu-core/gpu-segmented-scan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-segmented-scan.js +73 -16
- package/dist/gpu-core/gpu-segmented-scan.js.map +1 -1
- package/dist/gpu-core/gpu-semantic-aggregation-operation.cjs +112 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts +71 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.js +92 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.js.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.cjs +267 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.d.ts +29 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.d.ts.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.js +260 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.js.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-operation.cjs +85 -0
- package/dist/gpu-core/gpu-shader-pass-operation.d.ts +32 -0
- package/dist/gpu-core/gpu-shader-pass-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-operation.js +74 -0
- package/dist/gpu-core/gpu-shader-pass-operation.js.map +1 -0
- package/dist/gpu-core/gpu-texture-plan.d.ts +3 -2
- package/dist/gpu-core/gpu-texture-plan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-texture-plan.js.map +1 -1
- package/dist/gpu-core/index.cjs +32 -0
- package/dist/gpu-core/index.cjs.map +3 -3
- package/dist/gpu-core/index.d.ts +21 -1
- package/dist/gpu-core/index.d.ts.map +1 -1
- package/dist/gpu-core/index.js +10 -0
- package/dist/gpu-core/index.js.map +1 -1
- package/dist/gpu-data/color-conversion.cjs +105 -0
- package/dist/gpu-data/color-conversion.d.ts +30 -0
- package/dist/gpu-data/color-conversion.d.ts.map +1 -0
- package/dist/gpu-data/color-conversion.js +109 -0
- package/dist/gpu-data/color-conversion.js.map +1 -0
- package/dist/gpu-data/cpu-data.cjs +60 -0
- package/dist/gpu-data/cpu-data.d.ts +28 -0
- package/dist/gpu-data/cpu-data.d.ts.map +1 -0
- package/dist/gpu-data/cpu-data.js +41 -0
- package/dist/gpu-data/cpu-data.js.map +1 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.cjs +98 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts +9 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts.map +1 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.js +85 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.js.map +1 -0
- package/dist/gpu-data/cpu-vector.cjs +42 -0
- package/dist/gpu-data/cpu-vector.d.ts +17 -0
- package/dist/gpu-data/cpu-vector.d.ts.map +1 -0
- package/dist/gpu-data/cpu-vector.js +21 -0
- package/dist/gpu-data/cpu-vector.js.map +1 -0
- package/dist/gpu-data/gpu-data-buffer-props.cjs +41 -0
- package/dist/gpu-data/gpu-data-buffer-props.d.ts +5 -0
- package/dist/gpu-data/gpu-data-buffer-props.d.ts.map +1 -0
- package/dist/gpu-data/gpu-data-buffer-props.js +19 -0
- package/dist/gpu-data/gpu-data-buffer-props.js.map +1 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.cjs +50 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.d.ts +41 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.d.ts.map +1 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.js +45 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.js.map +1 -0
- package/dist/gpu-data/index.cjs +21 -2
- package/dist/gpu-data/index.cjs.map +3 -3
- package/dist/gpu-data/index.d.ts +6 -0
- package/dist/gpu-data/index.d.ts.map +1 -1
- package/dist/gpu-data/index.js +5 -0
- package/dist/gpu-data/index.js.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.cjs +1 -16
- package/dist/gpu-dataframe/gpu-data-frame-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.js +1 -23
- package/dist/gpu-dataframe/gpu-data-frame-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.cjs +91 -2
- package/dist/gpu-dataframe/gpu-expression.d.ts +37 -0
- package/dist/gpu-dataframe/gpu-expression.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.js +106 -0
- package/dist/gpu-dataframe/gpu-expression.js.map +1 -1
- package/dist/gpu-dataframe/index.cjs +12 -2
- package/dist/gpu-dataframe/index.cjs.map +3 -3
- package/dist/gpu-dataframe/index.d.ts +4 -0
- package/dist/gpu-dataframe/index.d.ts.map +1 -1
- package/dist/gpu-dataframe/index.js +2 -0
- package/dist/gpu-dataframe/index.js.map +1 -1
- package/dist/gpu-dataframe/portable-expression.cjs +103 -0
- package/dist/gpu-dataframe/portable-expression.d.ts +19 -0
- package/dist/gpu-dataframe/portable-expression.d.ts.map +1 -0
- package/dist/gpu-dataframe/portable-expression.js +98 -0
- package/dist/gpu-dataframe/portable-expression.js.map +1 -0
- package/dist/gpu-dggs/benchmarks.cjs.map +1 -1
- package/dist/gpu-dggs/index.cjs.map +1 -1
- package/dist/gpu-geometry/index.cjs.map +1 -1
- package/dist/gpu-graph/index.cjs +8 -0
- package/dist/gpu-graph/index.cjs.map +3 -3
- package/dist/gpu-graph/index.d.ts +4 -0
- package/dist/gpu-graph/index.d.ts.map +1 -1
- package/dist/gpu-graph/index.js +2 -0
- package/dist/gpu-graph/index.js.map +1 -1
- package/dist/gpu-graph-algorithms/benchmarks.cjs.map +2 -2
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.cjs +2 -15
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.d.ts.map +1 -1
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.js +2 -15
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.js.map +1 -1
- package/dist/gpu-graph-algorithms/index.cjs.map +2 -2
- package/dist/gpu-h3/index.cjs.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.cjs +162 -2
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts +25 -0
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.js +181 -2
- package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
- package/dist/gpu-physics/index.cjs.map +2 -2
- package/dist/gpu-physics/index.d.ts +1 -0
- package/dist/gpu-physics/index.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-parallel-shaders.cjs +24 -9
- package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-parallel-shaders.js +28 -9
- package/dist/gpu-physics/rigid-body-parallel-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-shaders.cjs +2 -2
- package/dist/gpu-physics/rigid-body-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-shaders.js +2 -2
- package/dist/gpu-physics/rigid-body-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-vehicle.cjs +90 -0
- package/dist/gpu-physics/rigid-body-vehicle.d.ts +35 -0
- package/dist/gpu-physics/rigid-body-vehicle.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-vehicle.js +66 -0
- package/dist/gpu-physics/rigid-body-vehicle.js.map +1 -0
- package/dist/gpu-pointcloud/index.cjs.map +1 -1
- package/dist/gpu-project/benchmarks.cjs.map +2 -2
- package/dist/gpu-project/coordinate-projection-graph.cjs +59 -0
- package/dist/gpu-project/coordinate-projection-graph.d.ts +23 -0
- package/dist/gpu-project/coordinate-projection-graph.d.ts.map +1 -0
- package/dist/gpu-project/coordinate-projection-graph.js +40 -0
- package/dist/gpu-project/coordinate-projection-graph.js.map +1 -0
- package/dist/gpu-project/cpu-geoarrow.cjs +112 -0
- package/dist/gpu-project/cpu-geoarrow.d.ts +10 -0
- package/dist/gpu-project/cpu-geoarrow.d.ts.map +1 -0
- package/dist/gpu-project/cpu-geoarrow.js +103 -0
- package/dist/gpu-project/cpu-geoarrow.js.map +1 -0
- package/dist/gpu-project/cpu-geometry-pipelines.cjs +134 -0
- package/dist/gpu-project/cpu-geometry-pipelines.d.ts +19 -0
- package/dist/gpu-project/cpu-geometry-pipelines.d.ts.map +1 -0
- package/dist/gpu-project/cpu-geometry-pipelines.js +114 -0
- package/dist/gpu-project/cpu-geometry-pipelines.js.map +1 -0
- package/dist/gpu-project/cpu-projection-operation.cjs +54 -0
- package/dist/gpu-project/cpu-projection-operation.d.ts +14 -0
- package/dist/gpu-project/cpu-projection-operation.d.ts.map +1 -0
- package/dist/gpu-project/cpu-projection-operation.js +37 -0
- package/dist/gpu-project/cpu-projection-operation.js.map +1 -0
- package/dist/gpu-project/crs.cjs.map +2 -2
- package/dist/gpu-project/geoarrow.cjs +36 -0
- package/dist/gpu-project/geoarrow.cjs.map +6 -0
- package/dist/gpu-project/geoarrow.d.ts +3 -0
- package/dist/gpu-project/geoarrow.d.ts.map +1 -0
- package/dist/gpu-project/geoarrow.js +7 -0
- package/dist/gpu-project/geoarrow.js.map +1 -0
- package/dist/gpu-project/graph.cjs +27 -0
- package/dist/gpu-project/graph.cjs.map +6 -0
- package/dist/gpu-project/graph.d.ts +2 -0
- package/dist/gpu-project/graph.d.ts.map +1 -0
- package/dist/gpu-project/graph.js +6 -0
- package/dist/gpu-project/graph.js.map +1 -0
- package/dist/gpu-project/index.cjs +3 -0
- package/dist/gpu-project/index.cjs.map +3 -3
- package/dist/gpu-project/index.d.ts +1 -0
- package/dist/gpu-project/index.d.ts.map +1 -1
- package/dist/gpu-project/index.js +1 -0
- package/dist/gpu-project/index.js.map +1 -1
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.cjs +75 -5
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts +5 -1
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts.map +1 -1
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js +86 -6
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.cjs +9 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.d.ts +2 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.d.ts.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.js +10 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.js.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph.cjs +126 -10
- package/dist/gpu-simple-graph/gpu-simple-graph.d.ts +36 -11
- package/dist/gpu-simple-graph/gpu-simple-graph.d.ts.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph.js +137 -12
- package/dist/gpu-simple-graph/gpu-simple-graph.js.map +1 -1
- package/dist/gpu-simple-graph/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/index.d.ts +1 -1
- package/dist/gpu-simple-graph/index.d.ts.map +1 -1
- package/dist/gpu-simple-graph/index.js.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.cjs +25 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts +6 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js +28 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.cjs +7 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.d.ts +2 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.js +7 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.js.map +1 -1
- package/dist/gpu-simple-graph/operations/convert-colors.cjs +6 -6
- package/dist/gpu-simple-graph/operations/convert-colors.d.ts +5 -1
- package/dist/gpu-simple-graph/operations/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/convert-colors.js +12 -7
- package/dist/gpu-simple-graph/operations/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.cjs +16 -33
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.js +22 -35
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/operations/webgl/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.cjs +31 -13
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js +42 -13
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/webgpu/index.cjs.map +1 -1
- package/dist/gpu-sql/gpu-sql.cjs +157 -280
- package/dist/gpu-sql/gpu-sql.d.ts +1 -1
- package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
- package/dist/gpu-sql/gpu-sql.js +168 -291
- package/dist/gpu-sql/gpu-sql.js.map +1 -1
- package/dist/gpu-sql/index.cjs.map +3 -3
- package/dist/gpu-tables/index.cjs.map +2 -2
- package/dist/gpu-tables/table/gpu-table.cjs +2 -2
- package/dist/gpu-tables/table/gpu-table.d.ts.map +1 -1
- package/dist/gpu-tables/table/gpu-table.js +2 -2
- package/dist/gpu-tables/table/gpu-table.js.map +1 -1
- package/dist/gpu-timeseries/index.cjs.map +1 -1
- package/dist/index.cjs +11 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +21 -7
- package/src/arrow/arrow-colors.ts +194 -33
- package/src/arrow/arrow-utils/arrow-paths.ts +5 -3
- package/src/arrow/cpu/arrow-coordinate-projection.ts +18 -0
- package/src/arrow/cpu/arrow-cpu-pipelines.ts +9 -0
- package/src/arrow/cpu/arrow-cpu-vector-adapters.ts +153 -0
- package/src/arrow/geoarrow/arrow-geoarrow-adapter.ts +21 -493
- package/src/arrow/geoarrow/arrow-geoarrow-conversion.ts +7 -5
- package/src/arrow/geoarrow/arrow-polygon-tessellation.ts +1 -1
- package/src/arrow/gpu/arrow-column-gpu-vector.ts +67 -14
- package/src/arrow/gpu/arrow-gpu-table-conversion.ts +96 -4
- package/src/arrow/gpu/arrow-gpu-vector-adapters.ts +20 -7
- package/src/arrow/gpu/arrow-gpu-vector-conversion.ts +49 -6
- package/src/arrow/index.ts +14 -0
- package/src/geospatial/gpu-point-spatial-query.ts +2 -15
- package/src/gpu-core/compiled-gpu-graph.ts +73 -1
- package/src/gpu-core/gpu-command-graph-compiler.ts +25 -2
- package/src/gpu-core/gpu-command-graph-types.ts +20 -0
- package/src/gpu-core/gpu-command-graph.ts +48 -11
- package/src/gpu-core/gpu-cpu-execution.ts +345 -0
- package/src/gpu-core/gpu-cpu-operation.ts +65 -0
- package/src/gpu-core/gpu-dispatch-utils.ts +13 -1
- package/src/gpu-core/gpu-expression-operation.ts +1 -1
- package/src/gpu-core/gpu-expression-plan.ts +11 -3
- package/src/gpu-core/gpu-graph-compiler.ts +61 -0
- package/src/gpu-core/gpu-graph.ts +3 -3
- package/src/gpu-core/gpu-grid-aggregation.ts +2 -5
- package/src/gpu-core/gpu-grid-binning.ts +2 -5
- package/src/gpu-core/gpu-grid-coordinate.ts +24 -0
- package/src/gpu-core/gpu-grid-index-internals.ts +2 -15
- package/src/gpu-core/gpu-grid-index-query.ts +2 -16
- package/src/gpu-core/gpu-group-aggregation.ts +38 -50
- package/src/gpu-core/gpu-operation.ts +9 -7
- package/src/gpu-core/gpu-reduction.ts +32 -42
- package/src/gpu-core/gpu-render-operation.ts +42 -0
- package/src/gpu-core/gpu-scan.ts +59 -45
- package/src/gpu-core/gpu-segmented-reduction.ts +20 -10
- package/src/gpu-core/gpu-segmented-scan.ts +82 -17
- package/src/gpu-core/gpu-semantic-aggregation-operation.ts +150 -0
- package/src/gpu-core/gpu-shader-pass-kernel.ts +307 -0
- package/src/gpu-core/gpu-shader-pass-operation.ts +103 -0
- package/src/gpu-core/gpu-texture-plan.ts +3 -2
- package/src/gpu-core/index.ts +39 -0
- package/src/gpu-data/color-conversion.ts +158 -0
- package/src/gpu-data/cpu-data.ts +62 -0
- package/src/gpu-data/cpu-gpu-vector-transfer.ts +110 -0
- package/src/gpu-data/cpu-vector.ts +31 -0
- package/src/gpu-data/gpu-data-buffer-props.ts +25 -0
- package/src/gpu-data/gpu-vector-wgsl-layout.ts +79 -0
- package/src/gpu-data/index.ts +15 -0
- package/src/gpu-dataframe/gpu-data-frame-query.ts +6 -26
- package/src/gpu-dataframe/gpu-expression.ts +135 -0
- package/src/gpu-dataframe/index.ts +11 -0
- package/src/gpu-dataframe/portable-expression.ts +117 -0
- package/src/gpu-graph/index.ts +17 -0
- package/src/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.ts +2 -15
- package/src/gpu-physics/gpu-rigid-body-world.ts +227 -2
- package/src/gpu-physics/index.ts +1 -0
- package/src/gpu-physics/rigid-body-parallel-shaders.ts +32 -9
- package/src/gpu-physics/rigid-body-shaders.ts +3 -2
- package/src/gpu-physics/rigid-body-vehicle.ts +99 -0
- package/src/gpu-project/coordinate-projection-graph.ts +59 -0
- package/src/gpu-project/cpu-geoarrow.ts +135 -0
- package/src/gpu-project/cpu-geometry-pipelines.ts +159 -0
- package/src/gpu-project/cpu-projection-operation.ts +49 -0
- package/src/gpu-project/geoarrow.ts +11 -0
- package/src/gpu-project/graph.ts +10 -0
- package/src/gpu-project/index.ts +2 -0
- package/src/gpu-simple-graph/compiled-gpu-expression-graph.ts +97 -6
- package/src/gpu-simple-graph/gpu-simple-graph-lowering.ts +11 -0
- package/src/gpu-simple-graph/gpu-simple-graph.ts +163 -19
- package/src/gpu-simple-graph/index.ts +1 -0
- package/src/gpu-simple-graph/operation/gpu-data-evaluator.ts +24 -0
- package/src/gpu-simple-graph/operation/gpu-vector-evaluator.ts +7 -0
- package/src/gpu-simple-graph/operations/convert-colors.ts +22 -7
- package/src/gpu-simple-graph/operations/cpu/convert-colors.ts +31 -48
- package/src/gpu-simple-graph/operations/webgpu/convert-colors.ts +47 -13
- package/src/gpu-sql/gpu-sql.ts +179 -293
- package/src/gpu-tables/table/gpu-table.ts +2 -1
- package/src/index.ts +21 -0
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {type GPUCommandNode, createGPUComputeCommandNode} from './gpu-command-node';
|
|
6
|
-
import type {Binding} from '@luma.gl/core';
|
|
6
|
+
import type {Binding, ComputeShaderLayout} from '@luma.gl/core';
|
|
7
7
|
import {Kernel} from '../execution/compute/kernel';
|
|
8
8
|
import {GPUCommandGraph, type GraphDataView} from './gpu-command-graph';
|
|
9
|
+
import {getBoundedWorkgroupLayout, type GPUBoundedDispatchLayout} from './gpu-dispatch-utils';
|
|
9
10
|
import {
|
|
10
11
|
getViewBinding,
|
|
11
12
|
getViewElementOffset,
|
|
@@ -66,16 +67,35 @@ export class GPUSegmentedScan {
|
|
|
66
67
|
throw new Error(`${this.id} views must belong to target graph`);
|
|
67
68
|
}
|
|
68
69
|
const segmentCount = this.segmentOffsets.length - 1;
|
|
69
|
-
if (segmentCount === 0) return nodes;
|
|
70
|
-
const
|
|
70
|
+
if (segmentCount === 0 || this.input.length === 0) return nodes;
|
|
71
|
+
const dispatch = getBoundedWorkgroupLayout(
|
|
72
|
+
this.id,
|
|
73
|
+
segmentCount,
|
|
74
|
+
graph.device.limits.maxComputeWorkgroupsPerDimension
|
|
75
|
+
);
|
|
76
|
+
const workgroupCount = dispatch.x * dispatch.y * dispatch.z;
|
|
77
|
+
const source = makeShaderSource(this, dispatch, segmentCount);
|
|
78
|
+
const shaderLayout: ComputeShaderLayout = {
|
|
79
|
+
bindings: [
|
|
80
|
+
{name: 'inputValues', type: 'read-only-storage', group: 0, location: 0},
|
|
81
|
+
{name: 'segmentOffsets', type: 'read-only-storage', group: 0, location: 1},
|
|
82
|
+
{name: 'outputValues', type: 'storage', group: 0, location: 2}
|
|
83
|
+
]
|
|
84
|
+
};
|
|
71
85
|
nodes.push(
|
|
72
86
|
createGPUComputeCommandNode<Parameters>({
|
|
73
87
|
id: this.id,
|
|
88
|
+
kernel: {
|
|
89
|
+
entryPoint: 'main',
|
|
90
|
+
workgroupSize: [WORKGROUP_SIZE, 1, 1],
|
|
91
|
+
bindings: shaderLayout.bindings,
|
|
92
|
+
source
|
|
93
|
+
},
|
|
74
94
|
workload: {
|
|
75
95
|
operation: 'GPUSegmentedScan',
|
|
76
96
|
commandCount: 1,
|
|
77
|
-
maximumWorkgroupCount:
|
|
78
|
-
maximumInvocationCount:
|
|
97
|
+
maximumWorkgroupCount: workgroupCount,
|
|
98
|
+
maximumInvocationCount: workgroupCount * WORKGROUP_SIZE,
|
|
79
99
|
readByteLength: this.input.length * 4 + this.segmentOffsets.length * 4,
|
|
80
100
|
writeByteLength: this.output.length * 4
|
|
81
101
|
},
|
|
@@ -88,13 +108,7 @@ export class GPUSegmentedScan {
|
|
|
88
108
|
const kernel = new Kernel(device, {
|
|
89
109
|
id: this.id,
|
|
90
110
|
source,
|
|
91
|
-
shaderLayout
|
|
92
|
-
bindings: [
|
|
93
|
-
{name: 'inputValues', type: 'read-only-storage', group: 0, location: 0},
|
|
94
|
-
{name: 'segmentOffsets', type: 'read-only-storage', group: 0, location: 1},
|
|
95
|
-
{name: 'outputValues', type: 'storage', group: 0, location: 2}
|
|
96
|
-
]
|
|
97
|
-
}
|
|
111
|
+
shaderLayout
|
|
98
112
|
});
|
|
99
113
|
return {
|
|
100
114
|
encode: ({computePass, getBuffer}) => {
|
|
@@ -104,7 +118,7 @@ export class GPUSegmentedScan {
|
|
|
104
118
|
outputValues: getViewBinding(this.output, getBuffer)
|
|
105
119
|
};
|
|
106
120
|
|
|
107
|
-
kernel.dispatch(computePass, {bindings,
|
|
121
|
+
kernel.dispatch(computePass, {bindings, ...dispatch});
|
|
108
122
|
},
|
|
109
123
|
destroy: () => kernel.destroy()
|
|
110
124
|
};
|
|
@@ -116,8 +130,59 @@ export class GPUSegmentedScan {
|
|
|
116
130
|
}
|
|
117
131
|
}
|
|
118
132
|
|
|
119
|
-
function makeShaderSource(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
133
|
+
function makeShaderSource(
|
|
134
|
+
scan: GPUSegmentedScan,
|
|
135
|
+
dispatch: GPUBoundedDispatchLayout,
|
|
136
|
+
segmentCount: number
|
|
137
|
+
): string {
|
|
138
|
+
return `const INPUT_OFFSET: u32 = ${getViewElementOffset(scan.input)}u;
|
|
139
|
+
const SEGMENT_OFFSET: u32 = ${getViewElementOffset(scan.segmentOffsets)}u;
|
|
140
|
+
const OUTPUT_OFFSET: u32 = ${getViewElementOffset(scan.output)}u;
|
|
141
|
+
const INPUT_LENGTH: u32 = ${scan.input.length}u;
|
|
142
|
+
@group(0) @binding(0) var<storage, read> inputValues: array<u32>;
|
|
143
|
+
@group(0) @binding(1) var<storage, read> segmentOffsets: array<u32>;
|
|
144
|
+
@group(0) @binding(2) var<storage, read_write> outputValues: array<u32>;
|
|
145
|
+
var<workgroup> prefixes: array<u32, ${WORKGROUP_SIZE}>;
|
|
146
|
+
var<workgroup> segmentBounds: array<u32, 2>;
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
@compute @workgroup_size(${WORKGROUP_SIZE})
|
|
150
|
+
fn main(
|
|
151
|
+
@builtin(workgroup_id) workgroup: vec3u,
|
|
152
|
+
@builtin(local_invocation_index) lane: u32
|
|
153
|
+
) {
|
|
154
|
+
let segment = (workgroup.z * ${dispatch.y}u + workgroup.y) * ${dispatch.x}u + workgroup.x;
|
|
155
|
+
if (segment >= ${segmentCount}u) { return; }
|
|
156
|
+
if (lane == 0u) {
|
|
157
|
+
segmentBounds[0] = min(segmentOffsets[SEGMENT_OFFSET + segment], INPUT_LENGTH);
|
|
158
|
+
segmentBounds[1] = min(segmentOffsets[SEGMENT_OFFSET + segment + 1u], INPUT_LENGTH);
|
|
159
|
+
}
|
|
160
|
+
let begin = workgroupUniformLoad(&segmentBounds[0]);
|
|
161
|
+
let end = workgroupUniformLoad(&segmentBounds[1]);
|
|
162
|
+
var carry = 0u;
|
|
163
|
+
for (var tile = begin; tile < end;) {
|
|
164
|
+
let tileLength = min(end - tile, ${WORKGROUP_SIZE}u);
|
|
165
|
+
var value = 0u;
|
|
166
|
+
if (lane < tileLength) {
|
|
167
|
+
value = inputValues[INPUT_OFFSET + tile + lane];
|
|
168
|
+
}
|
|
169
|
+
prefixes[lane] = value;
|
|
170
|
+
workgroupBarrier();
|
|
171
|
+
|
|
172
|
+
for (var stride = 1u; stride < ${WORKGROUP_SIZE}u; stride *= 2u) {
|
|
173
|
+
var previous = 0u;
|
|
174
|
+
if (lane >= stride) { previous = prefixes[lane - stride]; }
|
|
175
|
+
workgroupBarrier();
|
|
176
|
+
prefixes[lane] += previous;
|
|
177
|
+
workgroupBarrier();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (lane < tileLength) {
|
|
181
|
+
outputValues[OUTPUT_OFFSET + tile + lane] = carry + prefixes[lane]${scan.mode === 'exclusive' ? ' - value' : ''};
|
|
182
|
+
}
|
|
183
|
+
carry += prefixes[${WORKGROUP_SIZE - 1}u];
|
|
184
|
+
workgroupBarrier();
|
|
185
|
+
tile += tileLength;
|
|
186
|
+
}
|
|
187
|
+
}`;
|
|
123
188
|
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {assert} from '@luma.gl/core';
|
|
6
|
+
import {gpuGraph, type GPUGraphVector} from './gpu-graph-value';
|
|
7
|
+
import type {GPUOperation} from './gpu-operation';
|
|
8
|
+
import {getGPUOperationValueName, type GPUOperationContract} from './gpu-operation-contract';
|
|
9
|
+
import type {GPUGroupAggregationOperation} from './gpu-group-aggregation';
|
|
10
|
+
import type {GPUReductionOperation} from './gpu-reduction';
|
|
11
|
+
|
|
12
|
+
type ScalarFormat = 'uint32' | 'sint32' | 'float32';
|
|
13
|
+
|
|
14
|
+
/** Logical inputs and destination for dense grouped statistics. */
|
|
15
|
+
export type GPUGraphGroupAggregationProps = {
|
|
16
|
+
/** Stable operation identifier. Defaults to the output name plus a suffix. */
|
|
17
|
+
id?: string;
|
|
18
|
+
/** Dense unsigned group keys; out-of-range keys are ignored. */
|
|
19
|
+
keys: string | GPUGraphVector<'uint32'>;
|
|
20
|
+
/** Optional row selection: zero rejects, nonzero accepts. */
|
|
21
|
+
mask?: string | GPUGraphVector<'uint32'>;
|
|
22
|
+
/** Output cardinality. May be omitted when output storage/shape is declared separately. */
|
|
23
|
+
groupCount?: number;
|
|
24
|
+
} & (
|
|
25
|
+
| {
|
|
26
|
+
/** Count accepted rows per group. */
|
|
27
|
+
operation: 'count';
|
|
28
|
+
/** Logical unsigned count destination. */
|
|
29
|
+
output: string | GPUGraphVector<'uint32'>;
|
|
30
|
+
values?: never;
|
|
31
|
+
}
|
|
32
|
+
| {
|
|
33
|
+
/** Statistic computed over finite float32 contributions. */
|
|
34
|
+
operation: Exclude<GPUGroupAggregationOperation, 'count'>;
|
|
35
|
+
/** One float32 contribution per key. */
|
|
36
|
+
values: string | GPUGraphVector<'float32'>;
|
|
37
|
+
/** Logical float32 statistic destination. */
|
|
38
|
+
output: string | GPUGraphVector<'float32'>;
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
/** Dense grouped statistics lowered to GPUGroupAggregation by GPUGraphCompiler. */
|
|
43
|
+
export class GPUGraphGroupAggregation implements GPUOperation {
|
|
44
|
+
/** Semantic operation discriminator. */
|
|
45
|
+
readonly type = 'group-aggregation';
|
|
46
|
+
/** Stable operation identifier. */
|
|
47
|
+
readonly id: string;
|
|
48
|
+
/** Immutable logical operation arguments. */
|
|
49
|
+
readonly props: Readonly<GPUGraphGroupAggregationProps>;
|
|
50
|
+
|
|
51
|
+
/** Describe grouped reduction without allocating or reading GPU storage. */
|
|
52
|
+
constructor(props: GPUGraphGroupAggregationProps) {
|
|
53
|
+
// Dense group destinations must have positive integer cardinality.
|
|
54
|
+
assert(
|
|
55
|
+
props.groupCount === undefined ||
|
|
56
|
+
(Number.isSafeInteger(props.groupCount) && props.groupCount > 0)
|
|
57
|
+
);
|
|
58
|
+
this.id = props.id ?? `${getGPUOperationValueName(props.output)}-group-aggregation`;
|
|
59
|
+
this.props = Object.freeze({...props});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Logical dependencies and optional inferred output shape. */
|
|
63
|
+
get contract(): GPUOperationContract {
|
|
64
|
+
const {keys, mask, output, groupCount} = this.props;
|
|
65
|
+
const values = this.props.operation === 'count' ? undefined : this.props.values;
|
|
66
|
+
return {
|
|
67
|
+
outputs: ({getValue}) => {
|
|
68
|
+
for (const input of [keys, mask]) {
|
|
69
|
+
if (input) {
|
|
70
|
+
const descriptor = getValue(getGPUOperationValueName(input));
|
|
71
|
+
assert(descriptor.type === 'vector' && descriptor.format === 'uint32');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (values) {
|
|
75
|
+
const descriptor = getValue(getGPUOperationValueName(values));
|
|
76
|
+
assert(descriptor.type === 'vector' && descriptor.format === 'float32');
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
[getGPUOperationValueName(output)]: gpuGraph.vector(
|
|
80
|
+
this.props.operation === 'count' ? 'uint32' : 'float32',
|
|
81
|
+
{length: groupCount}
|
|
82
|
+
)
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
values: [
|
|
86
|
+
{value: keys, access: 'read'},
|
|
87
|
+
...(values ? [{value: values, access: 'read' as const}] : []),
|
|
88
|
+
...(mask ? [{value: mask, access: 'read' as const}] : []),
|
|
89
|
+
{value: output, access: 'write'}
|
|
90
|
+
]
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Logical scalar reduction inputs and destination. */
|
|
96
|
+
export type GPUGraphReductionProps = {
|
|
97
|
+
/** Stable operation identifier. Defaults to the output name plus a suffix. */
|
|
98
|
+
id?: string;
|
|
99
|
+
/** Scalar uint32, sint32, or float32 input. */
|
|
100
|
+
input: string | GPUGraphVector<ScalarFormat>;
|
|
101
|
+
/** Optional nonzero/zero row selection. */
|
|
102
|
+
mask?: string | GPUGraphVector<'uint32'>;
|
|
103
|
+
/** Statistic to compute; extent produces minimum followed by maximum. */
|
|
104
|
+
operation: GPUReductionOperation;
|
|
105
|
+
/** Logical result destination, with the same format as input. */
|
|
106
|
+
output: string | GPUGraphVector<ScalarFormat>;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/** Scalar statistics lowered to GPUReduction by GPUGraphCompiler. */
|
|
110
|
+
export class GPUGraphReduction implements GPUOperation {
|
|
111
|
+
/** Semantic operation discriminator. */
|
|
112
|
+
readonly type = 'reduction';
|
|
113
|
+
/** Stable operation identifier. */
|
|
114
|
+
readonly id: string;
|
|
115
|
+
/** Immutable logical operation arguments. */
|
|
116
|
+
readonly props: Readonly<GPUGraphReductionProps>;
|
|
117
|
+
|
|
118
|
+
/** Describe a scalar reduction without allocating or reading GPU storage. */
|
|
119
|
+
constructor(props: GPUGraphReductionProps) {
|
|
120
|
+
this.id = props.id ?? `${getGPUOperationValueName(props.output)}-reduction`;
|
|
121
|
+
this.props = Object.freeze({...props});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** Infer a packed one-row result, or two rows for extent. */
|
|
125
|
+
get contract(): GPUOperationContract {
|
|
126
|
+
const {input, mask, output, operation} = this.props;
|
|
127
|
+
return {
|
|
128
|
+
outputs: ({getValue}) => {
|
|
129
|
+
const descriptor = getValue(getGPUOperationValueName(input));
|
|
130
|
+
assert(descriptor.type === 'vector');
|
|
131
|
+
const {format} = descriptor;
|
|
132
|
+
assert(format === 'uint32' || format === 'sint32' || format === 'float32');
|
|
133
|
+
if (mask) {
|
|
134
|
+
const selection = getValue(getGPUOperationValueName(mask));
|
|
135
|
+
assert(selection.type === 'vector' && selection.format === 'uint32');
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
[getGPUOperationValueName(output)]: gpuGraph.vector(format, {
|
|
139
|
+
length: operation === 'extent' ? 2 : 1
|
|
140
|
+
})
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
values: [
|
|
144
|
+
{value: input, access: 'read'},
|
|
145
|
+
...(mask ? [{value: mask, access: 'read' as const}] : []),
|
|
146
|
+
{value: output, access: 'write'}
|
|
147
|
+
]
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
assert,
|
|
7
|
+
Buffer,
|
|
8
|
+
type Binding,
|
|
9
|
+
type CommandEncoder,
|
|
10
|
+
type Device,
|
|
11
|
+
type RenderPass,
|
|
12
|
+
type Sampler,
|
|
13
|
+
type VertexArray
|
|
14
|
+
} from '@luma.gl/core';
|
|
15
|
+
import {GPUVector} from '@luma.gl/graph/gpu-data';
|
|
16
|
+
import {RenderKernel} from '../execution/compute/render-kernel';
|
|
17
|
+
import type {GPUShaderPassOperation} from './gpu-shader-pass-operation';
|
|
18
|
+
import type {GPUExpressionProgram} from './gpu-expression-plan';
|
|
19
|
+
import type {GPUOperationLoweringContext} from './gpu-graph-lowering';
|
|
20
|
+
import {getGPUScalarWGSLType} from './gpu-scalar';
|
|
21
|
+
import {getTextureBindingInfo, type GPUGraphTextureBinding} from './gpu-texture-plan';
|
|
22
|
+
|
|
23
|
+
const VERTEX_SOURCE = `
|
|
24
|
+
struct GraphShaderPassVertex {
|
|
25
|
+
@builtin(position) position: vec4<f32>,
|
|
26
|
+
@location(0) textureCoordinates: vec2<f32>
|
|
27
|
+
};
|
|
28
|
+
@vertex fn vertexMain(@builtin(vertex_index) index: u32) -> GraphShaderPassVertex {
|
|
29
|
+
let position = vec2<f32>(f32((index << 1u) & 2u), f32(index & 2u));
|
|
30
|
+
var result: GraphShaderPassVertex;
|
|
31
|
+
result.position = vec4<f32>(position * 2.0 - 1.0, 0.0, 1.0);
|
|
32
|
+
result.textureCoordinates = vec2<f32>(position.x, 1.0 - position.y);
|
|
33
|
+
return result;
|
|
34
|
+
}`;
|
|
35
|
+
|
|
36
|
+
/** One immutable pipeline; resources and uniforms are supplied independently for each draw. @internal */
|
|
37
|
+
export class GPUShaderPassKernel {
|
|
38
|
+
private kernel!: RenderKernel;
|
|
39
|
+
private vertexArray!: VertexArray;
|
|
40
|
+
private readonly samplers: Record<string, Sampler> = Object.create(null);
|
|
41
|
+
private readonly parameterFormats: readonly ('float32' | 'uint32' | 'sint32')[];
|
|
42
|
+
private readonly parameterByteLength: number;
|
|
43
|
+
|
|
44
|
+
constructor(
|
|
45
|
+
readonly device: Device,
|
|
46
|
+
readonly operation: GPUShaderPassOperation,
|
|
47
|
+
program: Pick<GPUExpressionProgram, 'textures' | 'scalars'>
|
|
48
|
+
) {
|
|
49
|
+
assert(device.type === 'webgpu');
|
|
50
|
+
this.parameterFormats = Object.values(operation.parameters).map(name => {
|
|
51
|
+
const scalar = program.scalars.find(value => value.id === name);
|
|
52
|
+
assert(scalar);
|
|
53
|
+
return scalar.format;
|
|
54
|
+
});
|
|
55
|
+
this.parameterByteLength = Math.ceil(this.parameterFormats.length / 4) * 16;
|
|
56
|
+
// This first shader-pass contract samples filterable float color and writes float color.
|
|
57
|
+
for (const name of Object.values(operation.inputs)) {
|
|
58
|
+
const input = program.textures.find(texture => texture.id === name)!;
|
|
59
|
+
const info = device.getTextureFormatInfo(input.format);
|
|
60
|
+
assert(
|
|
61
|
+
!info.integer &&
|
|
62
|
+
info.attachment !== 'depth' &&
|
|
63
|
+
info.attachment !== 'depth-stencil' &&
|
|
64
|
+
device.getTextureFormatCapabilities(input.format).filter
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
const outputInfo = device.getTextureFormatInfo(operation.outputDescriptor.format);
|
|
68
|
+
assert(
|
|
69
|
+
!outputInfo.integer &&
|
|
70
|
+
device.getTextureFormatCapabilities(operation.outputDescriptor.format).render
|
|
71
|
+
);
|
|
72
|
+
const shaderBindings: import('@luma.gl/core').ShaderLayout['bindings'] = [
|
|
73
|
+
...Object.keys(operation.inputs).map((name, location) => ({
|
|
74
|
+
name,
|
|
75
|
+
location,
|
|
76
|
+
group: 0,
|
|
77
|
+
type: 'texture' as const,
|
|
78
|
+
viewDimension: '2d' as const,
|
|
79
|
+
sampleType: 'float' as const
|
|
80
|
+
})),
|
|
81
|
+
...Object.keys(operation.samplers).map((name, index) => ({
|
|
82
|
+
name,
|
|
83
|
+
location: Object.keys(operation.inputs).length + index,
|
|
84
|
+
group: 0,
|
|
85
|
+
type: 'sampler' as const
|
|
86
|
+
}))
|
|
87
|
+
];
|
|
88
|
+
let binding = 0;
|
|
89
|
+
const declarations = [
|
|
90
|
+
...Object.keys(operation.inputs).map(
|
|
91
|
+
name => `@group(0) @binding(${binding++}) var ${name}: texture_2d<f32>;`
|
|
92
|
+
),
|
|
93
|
+
...Object.keys(operation.samplers).map(
|
|
94
|
+
name => `@group(0) @binding(${binding++}) var ${name}: sampler;`
|
|
95
|
+
)
|
|
96
|
+
];
|
|
97
|
+
if (this.parameterFormats.length) {
|
|
98
|
+
shaderBindings.push({name: 'parameters', location: binding, group: 0, type: 'uniform'});
|
|
99
|
+
declarations.push(
|
|
100
|
+
`struct GraphShaderPassParameters {${Object.keys(operation.parameters)
|
|
101
|
+
.map((name, index) => `${name}: ${getGPUScalarWGSLType(this.parameterFormats[index])}`)
|
|
102
|
+
.join(
|
|
103
|
+
','
|
|
104
|
+
)}};\n@group(0) @binding(${binding}) var<uniform> parameters: GraphShaderPassParameters;`
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
this.kernel = new RenderKernel(device, {
|
|
109
|
+
id: operation.id,
|
|
110
|
+
vertexSource: VERTEX_SOURCE,
|
|
111
|
+
fragmentSource: `${declarations.join('\n')}\n${operation.fragmentSource}\n
|
|
112
|
+
@fragment fn fragmentMain(@location(0) textureCoordinates: vec2<f32>) -> @location(0) vec4<f32> {
|
|
113
|
+
return shade(textureCoordinates);
|
|
114
|
+
}`,
|
|
115
|
+
vertexEntryPoint: 'vertexMain',
|
|
116
|
+
fragmentEntryPoint: 'fragmentMain',
|
|
117
|
+
topology: 'triangle-list',
|
|
118
|
+
shaderLayout: {attributes: [], bindings: shaderBindings},
|
|
119
|
+
colorAttachmentFormats: [operation.outputDescriptor.format],
|
|
120
|
+
parameters: {depthWriteEnabled: false}
|
|
121
|
+
});
|
|
122
|
+
this.vertexArray = device.createVertexArray({
|
|
123
|
+
shaderLayout: this.kernel.pipeline.shaderLayout,
|
|
124
|
+
bufferLayout: []
|
|
125
|
+
});
|
|
126
|
+
for (const [name, props] of Object.entries(operation.samplers))
|
|
127
|
+
this.samplers[name] = device.createSampler(props);
|
|
128
|
+
} catch (error) {
|
|
129
|
+
this.destroy();
|
|
130
|
+
throw error;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** Validate selected view geometry before either executor records commands. */
|
|
135
|
+
validateTextures(textures: ReadonlyMap<string, GPUGraphTextureBinding>): void {
|
|
136
|
+
for (const name of [...Object.values(this.operation.inputs), this.operation.output]) {
|
|
137
|
+
const binding = textures.get(name);
|
|
138
|
+
assert(binding);
|
|
139
|
+
const info = getTextureBindingInfo(binding);
|
|
140
|
+
assert(
|
|
141
|
+
info.texture.device === this.device &&
|
|
142
|
+
info.dimension === '2d' &&
|
|
143
|
+
info.depth === 1 &&
|
|
144
|
+
info.samples === 1
|
|
145
|
+
);
|
|
146
|
+
if (name === this.operation.output) assert(info.mipLevels === 1);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Full graph lowers to ordinary resource-tracked copy and render nodes. */
|
|
151
|
+
lower<Parameters>(context: GPUOperationLoweringContext<Parameters>): void {
|
|
152
|
+
const operation = this.operation;
|
|
153
|
+
const inputs = Object.fromEntries(
|
|
154
|
+
Object.entries(operation.inputs).map(([name, value]) => [
|
|
155
|
+
name,
|
|
156
|
+
context.resolveTextureView(value)
|
|
157
|
+
])
|
|
158
|
+
);
|
|
159
|
+
const output = context.resolveTextureView(operation.output);
|
|
160
|
+
const parameters = this.parameterFormats.length
|
|
161
|
+
? context.graph.createTransientBuffer({
|
|
162
|
+
id: context.graph.getUniqueResourceId(`${operation.id}-parameters`),
|
|
163
|
+
byteLength: this.parameterByteLength,
|
|
164
|
+
usage: Buffer.UNIFORM | Buffer.COPY_DST
|
|
165
|
+
})
|
|
166
|
+
: undefined;
|
|
167
|
+
if (parameters) {
|
|
168
|
+
const sources = Object.values(operation.parameters).map(
|
|
169
|
+
name => context.resolveScalar(name).view
|
|
170
|
+
);
|
|
171
|
+
context.graph.addCopyPass({
|
|
172
|
+
id: `${operation.id}-parameters`,
|
|
173
|
+
resources: [
|
|
174
|
+
...sources.map(buffer => ({buffer, usage: 'copy-source' as const})),
|
|
175
|
+
{buffer: parameters, usage: 'copy-destination'}
|
|
176
|
+
],
|
|
177
|
+
compile: () => ({
|
|
178
|
+
encode: ({commandEncoder, getBuffer}) => {
|
|
179
|
+
sources.forEach((source, index) =>
|
|
180
|
+
commandEncoder.copyBufferToBuffer({
|
|
181
|
+
sourceBuffer: getBuffer(source),
|
|
182
|
+
sourceOffset: source.byteOffset,
|
|
183
|
+
destinationBuffer: getBuffer(parameters),
|
|
184
|
+
destinationOffset: index * 4,
|
|
185
|
+
size: 4
|
|
186
|
+
})
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
})
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
context.graph.addRenderPass({
|
|
193
|
+
id: operation.id,
|
|
194
|
+
resources: [
|
|
195
|
+
...Object.values(inputs).map(texture => ({texture, usage: 'sampled' as const})),
|
|
196
|
+
...(parameters ? [{buffer: parameters, usage: 'uniform' as const}] : [])
|
|
197
|
+
],
|
|
198
|
+
attachments: {colorAttachments: [output]},
|
|
199
|
+
compile: () => ({
|
|
200
|
+
getRenderPassProps: () => ({clearColor: [0, 0, 0, 0], clearDepth: false}),
|
|
201
|
+
encode: ({renderPass, getTextureView, getBuffer}) =>
|
|
202
|
+
this.draw(
|
|
203
|
+
renderPass,
|
|
204
|
+
Object.fromEntries(
|
|
205
|
+
Object.entries(inputs).map(([name, view]) => [name, getTextureView(view)])
|
|
206
|
+
),
|
|
207
|
+
parameters ? getBuffer(parameters) : undefined
|
|
208
|
+
)
|
|
209
|
+
})
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** SimpleGraph owns only per-invocation framebuffer/uniform wrappers, never bound textures. */
|
|
214
|
+
prepare(
|
|
215
|
+
textures: ReadonlyMap<string, GPUGraphTextureBinding>,
|
|
216
|
+
values: ReadonlyMap<string, GPUVector | number>
|
|
217
|
+
) {
|
|
218
|
+
this.validateTextures(textures);
|
|
219
|
+
const inputs = Object.fromEntries(
|
|
220
|
+
Object.entries(this.operation.inputs).map(([name, value]) => [name, textures.get(value)!])
|
|
221
|
+
);
|
|
222
|
+
const output = textures.get(this.operation.output)!;
|
|
223
|
+
const info = getTextureBindingInfo(output);
|
|
224
|
+
const data = new Uint8Array(this.parameterByteLength);
|
|
225
|
+
const view = new DataView(data.buffer);
|
|
226
|
+
const parameterValues = Object.values(this.operation.parameters).map((name, index) => {
|
|
227
|
+
const value = values.get(name);
|
|
228
|
+
assert(value !== undefined);
|
|
229
|
+
if (typeof value === 'number') {
|
|
230
|
+
switch (this.parameterFormats[index]) {
|
|
231
|
+
case 'float32':
|
|
232
|
+
view.setFloat32(index * 4, value, true);
|
|
233
|
+
break;
|
|
234
|
+
case 'sint32':
|
|
235
|
+
view.setInt32(index * 4, value, true);
|
|
236
|
+
break;
|
|
237
|
+
case 'uint32':
|
|
238
|
+
view.setUint32(index * 4, value, true);
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
} else assert(value.length === 1 && value.data.length === 1);
|
|
242
|
+
return value;
|
|
243
|
+
});
|
|
244
|
+
const parameters = data.byteLength
|
|
245
|
+
? this.device.createBuffer({data, usage: Buffer.UNIFORM | Buffer.COPY_DST})
|
|
246
|
+
: undefined;
|
|
247
|
+
let framebuffer;
|
|
248
|
+
try {
|
|
249
|
+
framebuffer = this.device.createFramebuffer({
|
|
250
|
+
width: info.width,
|
|
251
|
+
height: info.height,
|
|
252
|
+
colorAttachments: [output]
|
|
253
|
+
});
|
|
254
|
+
} catch (error) {
|
|
255
|
+
parameters?.destroy();
|
|
256
|
+
throw error;
|
|
257
|
+
}
|
|
258
|
+
return {
|
|
259
|
+
encode: (commandEncoder: CommandEncoder) => {
|
|
260
|
+
this.validateTextures(textures);
|
|
261
|
+
if (parameters)
|
|
262
|
+
parameterValues.forEach((value, index) => {
|
|
263
|
+
if (!(value instanceof GPUVector)) return;
|
|
264
|
+
const chunk = value.data[0];
|
|
265
|
+
const buffer = chunk.buffer instanceof Buffer ? chunk.buffer : chunk.buffer.buffer;
|
|
266
|
+
commandEncoder.copyBufferToBuffer({
|
|
267
|
+
sourceBuffer: buffer,
|
|
268
|
+
sourceOffset: chunk.byteOffset,
|
|
269
|
+
destinationBuffer: parameters,
|
|
270
|
+
destinationOffset: index * 4,
|
|
271
|
+
size: 4
|
|
272
|
+
});
|
|
273
|
+
});
|
|
274
|
+
const pass = commandEncoder.beginRenderPass({
|
|
275
|
+
framebuffer,
|
|
276
|
+
clearColor: [0, 0, 0, 0],
|
|
277
|
+
clearDepth: false
|
|
278
|
+
});
|
|
279
|
+
try {
|
|
280
|
+
this.draw(pass, inputs, parameters);
|
|
281
|
+
} finally {
|
|
282
|
+
pass.end();
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
destroy: () => {
|
|
286
|
+
framebuffer.destroy();
|
|
287
|
+
parameters?.destroy();
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
destroy(): void {
|
|
293
|
+
for (const sampler of Object.values(this.samplers)) sampler.destroy();
|
|
294
|
+
this.vertexArray?.destroy();
|
|
295
|
+
this.kernel?.destroy();
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
private draw(
|
|
299
|
+
renderPass: RenderPass,
|
|
300
|
+
inputs: Record<string, GPUGraphTextureBinding>,
|
|
301
|
+
parameters?: Buffer
|
|
302
|
+
): void {
|
|
303
|
+
const bindings: Record<string, Binding> = {...inputs, ...this.samplers};
|
|
304
|
+
if (parameters) bindings['parameters'] = parameters;
|
|
305
|
+
this.kernel.draw(renderPass, {vertexArray: this.vertexArray, vertexCount: 3, bindings});
|
|
306
|
+
}
|
|
307
|
+
}
|