@luma.gl/graph 10.0.0-beta.2 → 10.0.0-beta.4
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/dist/arrow/gpu/arrow-gpu-analytics-adapters.cjs +22 -9
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.d.ts +11 -2
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.js +27 -10
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.cjs +24 -13
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.d.ts +9 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.js +41 -14
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.cjs +82 -23
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts +16 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js +98 -24
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.cjs +7 -0
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts +2 -0
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js +14 -0
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js.map +1 -1
- package/dist/arrow/index.cjs +2 -0
- package/dist/arrow/index.cjs.map +3 -3
- package/dist/arrow/index.d.ts +1 -1
- package/dist/arrow/index.d.ts.map +1 -1
- package/dist/arrow/index.js +1 -1
- package/dist/arrow/index.js.map +1 -1
- package/dist/arrow/vectors/arrow-temporal-gpu-vector.cjs +1 -2
- package/dist/arrow/vectors/arrow-temporal-gpu-vector.js +2 -2
- package/dist/arrow/vectors/arrow-temporal-gpu-vector.js.map +1 -1
- package/dist/dist.dev.js +62 -27
- package/dist/dist.min.js +48 -47
- package/dist/gpu-core/gpu-bvh-bounds.cjs +63 -0
- package/dist/gpu-core/gpu-bvh-bounds.d.ts +32 -0
- package/dist/gpu-core/gpu-bvh-bounds.d.ts.map +1 -0
- package/dist/gpu-core/gpu-bvh-bounds.js +56 -0
- package/dist/gpu-core/gpu-bvh-bounds.js.map +1 -0
- package/dist/gpu-core/gpu-command-graph-budget-controller.cjs +10 -2
- package/dist/gpu-core/gpu-command-graph-budget-controller.d.ts +4 -0
- package/dist/gpu-core/gpu-command-graph-budget-controller.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph-budget-controller.js +10 -2
- package/dist/gpu-core/gpu-command-graph-budget-controller.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph-submission-pacer.cjs +92 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.d.ts +41 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.d.ts.map +1 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.js +85 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.js.map +1 -0
- package/dist/gpu-core/gpu-group-aggregation.cjs +45 -21
- package/dist/gpu-core/gpu-group-aggregation.d.ts +4 -0
- package/dist/gpu-core/gpu-group-aggregation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-group-aggregation.js +58 -24
- package/dist/gpu-core/gpu-group-aggregation.js.map +1 -1
- package/dist/gpu-core/index.cjs +6 -0
- package/dist/gpu-core/index.cjs.map +3 -3
- package/dist/gpu-core/index.d.ts +4 -0
- package/dist/gpu-core/index.d.ts.map +1 -1
- package/dist/gpu-core/index.js +2 -0
- package/dist/gpu-core/index.js.map +1 -1
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.cjs +6 -6
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.d.ts +1 -1
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.js +6 -6
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.js.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.cjs +55 -14
- package/dist/gpu-dataframe/gpu-data-frame-query.d.ts +13 -2
- package/dist/gpu-dataframe/gpu-data-frame-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.js +58 -17
- package/dist/gpu-dataframe/gpu-data-frame-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame.cjs +1 -3
- package/dist/gpu-dataframe/gpu-data-frame.d.ts +10 -0
- package/dist/gpu-dataframe/gpu-data-frame.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame.js +1 -3
- package/dist/gpu-dataframe/gpu-data-frame.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression-shader.cjs +94 -44
- package/dist/gpu-dataframe/gpu-expression-shader.d.ts +8 -5
- package/dist/gpu-dataframe/gpu-expression-shader.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression-shader.js +110 -47
- package/dist/gpu-dataframe/gpu-expression-shader.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.cjs +14 -8
- package/dist/gpu-dataframe/gpu-expression.d.ts +12 -1
- package/dist/gpu-dataframe/gpu-expression.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.js +11 -6
- package/dist/gpu-dataframe/gpu-expression.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.cjs +8 -4
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.d.ts +2 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js +10 -4
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.cjs +2 -2
- package/dist/gpu-dataframe/gpu-global-aggregation-query.d.ts +5 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.js +6 -2
- package/dist/gpu-dataframe/gpu-global-aggregation-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-sort-compiler.cjs +156 -124
- package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts +12 -2
- package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-sort-compiler.js +160 -128
- package/dist/gpu-dataframe/gpu-global-sort-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.cjs +366 -53
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.d.ts +26 -4
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js +378 -47
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-group-by-query.cjs +20 -9
- package/dist/gpu-dataframe/gpu-group-by-query.d.ts +15 -2
- package/dist/gpu-dataframe/gpu-group-by-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-group-by-query.js +22 -8
- package/dist/gpu-dataframe/gpu-group-by-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-join-compiler.cjs +61 -8
- package/dist/gpu-dataframe/gpu-join-compiler.d.ts +10 -2
- package/dist/gpu-dataframe/gpu-join-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-join-compiler.js +60 -7
- package/dist/gpu-dataframe/gpu-join-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-query-compiler.cjs +61 -11
- package/dist/gpu-dataframe/gpu-query-compiler.d.ts +5 -1
- package/dist/gpu-dataframe/gpu-query-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-query-compiler.js +61 -10
- package/dist/gpu-dataframe/gpu-query-compiler.js.map +1 -1
- package/dist/gpu-dataframe/index.cjs +4 -2
- package/dist/gpu-dataframe/index.cjs.map +3 -3
- package/dist/gpu-dataframe/index.d.ts +1 -1
- package/dist/gpu-dataframe/index.d.ts.map +1 -1
- package/dist/gpu-dataframe/index.js +1 -1
- package/dist/gpu-dataframe/index.js.map +1 -1
- package/dist/gpu-graph/index.cjs.map +1 -1
- package/dist/gpu-graph-algorithms/benchmarks.cjs.map +2 -2
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.cjs +182 -62
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.d.ts +29 -2
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.d.ts.map +1 -1
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.js +200 -64
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.js.map +1 -1
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.cjs +135 -9
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.d.ts +55 -8
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.d.ts.map +1 -1
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.js +145 -14
- package/dist/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.js.map +1 -1
- package/dist/gpu-graph-algorithms/index.cjs.map +3 -3
- package/dist/gpu-physics/articulation-tree-shader.cjs +177 -0
- package/dist/gpu-physics/articulation-tree-shader.d.ts +3 -0
- package/dist/gpu-physics/articulation-tree-shader.d.ts.map +1 -0
- package/dist/gpu-physics/articulation-tree-shader.js +159 -0
- package/dist/gpu-physics/articulation-tree-shader.js.map +1 -0
- package/dist/gpu-physics/gpu-articulation-tree.cjs +203 -0
- package/dist/gpu-physics/gpu-articulation-tree.d.ts +81 -0
- package/dist/gpu-physics/gpu-articulation-tree.d.ts.map +1 -0
- package/dist/gpu-physics/gpu-articulation-tree.js +205 -0
- package/dist/gpu-physics/gpu-articulation-tree.js.map +1 -0
- package/dist/gpu-physics/gpu-physics-batch.cjs +11 -10
- package/dist/gpu-physics/gpu-physics-batch.d.ts +1 -0
- package/dist/gpu-physics/gpu-physics-batch.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-physics-batch.js +14 -10
- package/dist/gpu-physics/gpu-physics-batch.js.map +1 -1
- package/dist/gpu-physics/gpu-physics-ensemble.cjs +9 -4
- package/dist/gpu-physics/gpu-physics-ensemble.d.ts +10 -1
- package/dist/gpu-physics/gpu-physics-ensemble.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-physics-ensemble.js +11 -4
- package/dist/gpu-physics/gpu-physics-ensemble.js.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.cjs +323 -68
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts +59 -2
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.js +400 -75
- package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
- package/dist/gpu-physics/index.cjs +3 -0
- package/dist/gpu-physics/index.cjs.map +3 -3
- package/dist/gpu-physics/index.d.ts +3 -1
- package/dist/gpu-physics/index.d.ts.map +1 -1
- package/dist/gpu-physics/index.js +1 -0
- package/dist/gpu-physics/index.js.map +1 -1
- package/dist/gpu-physics/rigid-body-cache-shaders.cjs +10 -6
- package/dist/gpu-physics/rigid-body-cache-shaders.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-cache-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-cache-shaders.js +15 -6
- package/dist/gpu-physics/rigid-body-cache-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-capacity.cjs +15 -2
- package/dist/gpu-physics/rigid-body-capacity.d.ts +3 -1
- package/dist/gpu-physics/rigid-body-capacity.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-capacity.js +21 -2
- package/dist/gpu-physics/rigid-body-capacity.js.map +1 -1
- package/dist/gpu-physics/rigid-body-cast-index.cjs +192 -0
- package/dist/gpu-physics/rigid-body-cast-index.d.ts +44 -0
- package/dist/gpu-physics/rigid-body-cast-index.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-cast-index.js +194 -0
- package/dist/gpu-physics/rigid-body-cast-index.js.map +1 -0
- package/dist/gpu-physics/rigid-body-ensemble-layout.cjs +4 -2
- package/dist/gpu-physics/rigid-body-ensemble-layout.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-ensemble-layout.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-layout.js +5 -2
- package/dist/gpu-physics/rigid-body-ensemble-layout.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-reset.cjs +11 -9
- package/dist/gpu-physics/rigid-body-ensemble-reset.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-reset.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-reset.js +13 -9
- package/dist/gpu-physics/rigid-body-ensemble-reset.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-shaders.cjs +14 -7
- package/dist/gpu-physics/rigid-body-ensemble-shaders.d.ts +5 -0
- package/dist/gpu-physics/rigid-body-ensemble-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-shaders.js +17 -7
- package/dist/gpu-physics/rigid-body-ensemble-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-transaction.cjs +21 -11
- package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts +2 -2
- package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-transaction.js +28 -12
- package/dist/gpu-physics/rigid-body-ensemble-transaction.js.map +1 -1
- package/dist/gpu-physics/rigid-body-event-compaction.cjs +184 -0
- package/dist/gpu-physics/rigid-body-event-compaction.d.ts +35 -0
- package/dist/gpu-physics/rigid-body-event-compaction.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-event-compaction.js +168 -0
- package/dist/gpu-physics/rigid-body-event-compaction.js.map +1 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.cjs +51 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.d.ts +33 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.js +34 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.js.map +1 -0
- package/dist/gpu-physics/rigid-body-events.cjs +57 -25
- package/dist/gpu-physics/rigid-body-events.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-events.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-events.js +60 -25
- package/dist/gpu-physics/rigid-body-events.js.map +1 -1
- package/dist/gpu-physics/rigid-body-joints.cjs +8 -3
- package/dist/gpu-physics/rigid-body-joints.d.ts +2 -0
- package/dist/gpu-physics/rigid-body-joints.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-joints.js +10 -6
- package/dist/gpu-physics/rigid-body-joints.js.map +1 -1
- package/dist/gpu-physics/rigid-body-queries.cjs +159 -16
- package/dist/gpu-physics/rigid-body-queries.d.ts +24 -1
- package/dist/gpu-physics/rigid-body-queries.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-queries.js +166 -14
- package/dist/gpu-physics/rigid-body-queries.js.map +1 -1
- package/dist/gpu-physics/rigid-body-shaders.cjs +3 -3
- 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 +3 -3
- package/dist/gpu-physics/rigid-body-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-triggers.cjs +53 -15
- package/dist/gpu-physics/rigid-body-triggers.d.ts +1 -0
- package/dist/gpu-physics/rigid-body-triggers.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-triggers.js +55 -15
- package/dist/gpu-physics/rigid-body-triggers.js.map +1 -1
- package/dist/gpu-physics/sphere-world-shaders.cjs +48 -20
- package/dist/gpu-physics/sphere-world-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/sphere-world-shaders.js +51 -21
- package/dist/gpu-physics/sphere-world-shaders.js.map +1 -1
- package/dist/gpu-project/benchmarks.cjs.map +2 -2
- package/dist/gpu-project/crs.cjs.map +2 -2
- package/dist/gpu-project/graph.cjs.map +2 -2
- package/dist/gpu-project/index.cjs.map +2 -2
- package/dist/gpu-project/projection-program.cjs +2 -9
- package/dist/gpu-project/projection-program.d.ts.map +1 -1
- package/dist/gpu-project/projection-program.js +1 -8
- package/dist/gpu-project/projection-program.js.map +1 -1
- package/dist/gpu-simple-graph/index.cjs.map +2 -2
- package/dist/gpu-sql/gpu-sql.cjs +345 -81
- package/dist/gpu-sql/gpu-sql.d.ts +42 -2
- package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
- package/dist/gpu-sql/gpu-sql.js +393 -90
- package/dist/gpu-sql/gpu-sql.js.map +1 -1
- package/dist/gpu-sql/index.cjs.map +3 -3
- package/dist/gpu-sql/index.d.ts +1 -1
- package/dist/gpu-sql/index.d.ts.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/utils/float32.cjs +35 -0
- package/dist/utils/float32.d.ts +3 -0
- package/dist/utils/float32.d.ts.map +1 -0
- package/dist/utils/float32.js +16 -0
- package/dist/utils/float32.js.map +1 -0
- package/package.json +8 -8
- package/src/arrow/gpu/arrow-gpu-analytics-adapters.ts +77 -25
- package/src/arrow/gpu/arrow-gpu-analytics-readback.ts +52 -16
- package/src/arrow/gpu/arrow-gpu-table-conversion.ts +130 -31
- package/src/arrow/gpu/arrow-gpu-vector-conversion.ts +19 -0
- package/src/arrow/index.ts +1 -0
- package/src/arrow/vectors/arrow-temporal-gpu-vector.ts +2 -2
- package/src/gpu-core/gpu-bvh-bounds.ts +84 -0
- package/src/gpu-core/gpu-command-graph-budget-controller.ts +22 -2
- package/src/gpu-core/gpu-command-graph-submission-pacer.ts +102 -0
- package/src/gpu-core/gpu-group-aggregation.ts +68 -30
- package/src/gpu-core/index.ts +5 -0
- package/src/gpu-dataframe/gpu-analytics-compiler-utils.ts +7 -10
- package/src/gpu-dataframe/gpu-data-frame-query.ts +106 -25
- package/src/gpu-dataframe/gpu-data-frame.ts +35 -2
- package/src/gpu-dataframe/gpu-expression-shader.ts +172 -58
- package/src/gpu-dataframe/gpu-expression.ts +62 -9
- package/src/gpu-dataframe/gpu-global-aggregation-compiler.ts +15 -4
- package/src/gpu-dataframe/gpu-global-aggregation-query.ts +12 -3
- package/src/gpu-dataframe/gpu-global-sort-compiler.ts +231 -156
- package/src/gpu-dataframe/gpu-group-aggregation-compiler.ts +645 -61
- package/src/gpu-dataframe/gpu-group-by-query.ts +51 -14
- package/src/gpu-dataframe/gpu-join-compiler.ts +87 -6
- package/src/gpu-dataframe/gpu-query-compiler.ts +100 -18
- package/src/gpu-dataframe/index.ts +1 -1
- package/src/gpu-graph-algorithms/README.md +4 -2
- package/src/gpu-graph-algorithms/gpu-graph-single-source-shortest-path-internals.ts +248 -66
- package/src/gpu-graph-algorithms/gpu-graph-single-source-shortest-path.ts +218 -20
- package/src/gpu-physics/articulation-tree-shader.ts +169 -0
- package/src/gpu-physics/gpu-articulation-tree.ts +279 -0
- package/src/gpu-physics/gpu-physics-batch.ts +19 -13
- package/src/gpu-physics/gpu-physics-ensemble.ts +20 -4
- package/src/gpu-physics/gpu-rigid-body-world.ts +510 -93
- package/src/gpu-physics/index.ts +16 -0
- package/src/gpu-physics/rigid-body-cache-shaders.ts +18 -6
- package/src/gpu-physics/rigid-body-capacity.ts +25 -4
- package/src/gpu-physics/rigid-body-cast-index.ts +277 -0
- package/src/gpu-physics/rigid-body-ensemble-layout.ts +6 -2
- package/src/gpu-physics/rigid-body-ensemble-reset.ts +21 -9
- package/src/gpu-physics/rigid-body-ensemble-shaders.ts +18 -7
- package/src/gpu-physics/rigid-body-ensemble-transaction.ts +31 -13
- package/src/gpu-physics/rigid-body-event-compaction.ts +252 -0
- package/src/gpu-physics/rigid-body-event-snapshot.ts +76 -0
- package/src/gpu-physics/rigid-body-events.ts +63 -25
- package/src/gpu-physics/rigid-body-joints.ts +11 -11
- package/src/gpu-physics/rigid-body-queries.ts +202 -14
- package/src/gpu-physics/rigid-body-shaders.ts +4 -3
- package/src/gpu-physics/rigid-body-triggers.ts +64 -20
- package/src/gpu-physics/sphere-world-shaders.ts +53 -21
- package/src/gpu-project/projection-program.ts +1 -9
- package/src/gpu-sql/gpu-sql.ts +629 -124
- package/src/gpu-sql/index.ts +1 -1
- package/src/utils/float32.ts +16 -0
|
@@ -30,6 +30,7 @@ import type {GPUDataFrameDerivedColumn} from './gpu-data-frame-query';
|
|
|
30
30
|
import type {GPUExpression} from './gpu-expression';
|
|
31
31
|
import {
|
|
32
32
|
compileGPUDataFrameQuery,
|
|
33
|
+
projectGPUDataFrameQueryResult,
|
|
33
34
|
type CompiledGPUDataFrameQueryProps,
|
|
34
35
|
type GPUDataFrameQueryExtensionContext,
|
|
35
36
|
type GPUDataFrameQueryExtensionResult,
|
|
@@ -73,6 +74,12 @@ export class CompiledGPUDataFrameGlobalSort<
|
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
|
|
77
|
+
/** One globally ordered column and its stable sort controls. @internal */
|
|
78
|
+
export type GPUGlobalSortKey<Column extends string = string> = Readonly<{
|
|
79
|
+
column: Column;
|
|
80
|
+
options: GPUDataFrameNormalizedSortOptions;
|
|
81
|
+
}>;
|
|
82
|
+
|
|
76
83
|
/** Adds explicit globally stable ordering while leaving source buffers and batches untouched. */
|
|
77
84
|
export function compileGPUDataFrameGlobalSort<
|
|
78
85
|
Source extends GPUTypeMap,
|
|
@@ -84,9 +91,15 @@ export function compileGPUDataFrameGlobalSort<
|
|
|
84
91
|
derivedColumns: readonly GPUDataFrameDerivedColumn[],
|
|
85
92
|
column: keyof Selection & string,
|
|
86
93
|
options: GPUDataFrameNormalizedSortOptions,
|
|
87
|
-
graph: GPUCommandGraph<GPUDataFrameQueryParameters
|
|
94
|
+
graph: GPUCommandGraph<GPUDataFrameQueryParameters>,
|
|
95
|
+
resultColumns?: readonly (keyof Selection & string)[],
|
|
96
|
+
additionalKeys: readonly GPUGlobalSortKey<keyof Selection & string>[] = []
|
|
88
97
|
): CompiledGPUDataFrameGlobalSort<Selection> {
|
|
89
|
-
|
|
98
|
+
const keys = [{column, options}, ...additionalKeys];
|
|
99
|
+
validateGPUAnalyticsSource(
|
|
100
|
+
source,
|
|
101
|
+
keys.map(key => key.column)
|
|
102
|
+
);
|
|
90
103
|
validateGPUGlobalSortCapacity(source, graph);
|
|
91
104
|
return compileGPUDataFrameQuery<
|
|
92
105
|
Source,
|
|
@@ -94,7 +107,7 @@ export function compileGPUDataFrameGlobalSort<
|
|
|
94
107
|
Selection,
|
|
95
108
|
CompiledGPUDataFrameGlobalSort<Selection>
|
|
96
109
|
>(source, predicates, selectedColumns, graph, derivedColumns, {
|
|
97
|
-
prepare: context => addGPUGlobalSortToGraph(context,
|
|
110
|
+
prepare: context => addGPUGlobalSortToGraph(context, keys, resultColumns)
|
|
98
111
|
});
|
|
99
112
|
}
|
|
100
113
|
|
|
@@ -127,154 +140,208 @@ function validateGPUGlobalSortCapacity<Source extends GPUTypeMap>(
|
|
|
127
140
|
/** Stages keys and identities explicitly, then stably orders numeric values and null/NaN classes. */
|
|
128
141
|
function addGPUGlobalSortToGraph<Selection extends GPUTypeMap>(
|
|
129
142
|
context: GPUDataFrameQueryExtensionContext<Selection>,
|
|
130
|
-
|
|
131
|
-
|
|
143
|
+
keys: readonly GPUGlobalSortKey<keyof Selection & string>[],
|
|
144
|
+
resultColumns?: readonly (keyof Selection & string)[]
|
|
132
145
|
): GPUDataFrameQueryExtensionResult<Selection, CompiledGPUDataFrameGlobalSort<Selection>> {
|
|
133
|
-
const graph = context.graph;
|
|
134
146
|
const prefix = `${context.queryId}-global-sort`;
|
|
135
147
|
const ownedVectors: GPUVector[] = [];
|
|
136
148
|
|
|
137
149
|
try {
|
|
138
|
-
const
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
150
|
+
const {column, options} = keys[0];
|
|
151
|
+
const {globalRowIndices, globalSelectedCount} = addGPUGlobalOrdering(
|
|
152
|
+
context,
|
|
153
|
+
keys,
|
|
154
|
+
ownedVectors,
|
|
155
|
+
prefix
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
const projection = resultColumns && projectGPUDataFrameQueryResult(context, resultColumns);
|
|
159
|
+
return {
|
|
160
|
+
table: projection?.table ?? context.table,
|
|
161
|
+
validity: projection?.validity ?? context.validity,
|
|
162
|
+
dictionaries: projection?.dictionaries ?? context.dictionaries,
|
|
163
|
+
ownedTables: projection ? [projection] : [],
|
|
164
|
+
ownedVectors,
|
|
165
|
+
createCompiled: props =>
|
|
166
|
+
new CompiledGPUDataFrameGlobalSort(
|
|
167
|
+
props,
|
|
168
|
+
column,
|
|
169
|
+
options,
|
|
170
|
+
globalRowIndices,
|
|
171
|
+
globalSelectedCount
|
|
172
|
+
)
|
|
173
|
+
};
|
|
174
|
+
} catch (error) {
|
|
175
|
+
for (const vector of ownedVectors) {
|
|
176
|
+
vector.destroy();
|
|
143
177
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
178
|
+
throw error;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
147
181
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
182
|
+
/** Orders a prepared table and its selection within the caller's open graph. @internal */
|
|
183
|
+
export function addGPUGlobalOrdering<Selection extends GPUTypeMap>(
|
|
184
|
+
context: GPUDataFrameQueryExtensionContext<Selection>,
|
|
185
|
+
keys: readonly GPUGlobalSortKey<keyof Selection & string>[],
|
|
186
|
+
ownedVectors: GPUVector[],
|
|
187
|
+
prefix: string
|
|
188
|
+
): {globalRowIndices: GPUVector<'uint32'>; globalSelectedCount: GPUVector<'uint32'>} {
|
|
189
|
+
const {graph} = context;
|
|
190
|
+
const {options} = keys[0];
|
|
191
|
+
const length = context.table.numRows;
|
|
192
|
+
const globalRowIndices = createGPUAnalyticsOutputVector(
|
|
193
|
+
graph.device,
|
|
194
|
+
`${prefix}-row-indices`,
|
|
195
|
+
'uint32',
|
|
196
|
+
length
|
|
197
|
+
);
|
|
198
|
+
ownedVectors.push(globalRowIndices);
|
|
199
|
+
const globalSelectedCount = createGPUAnalyticsOutputVector(
|
|
200
|
+
graph.device,
|
|
201
|
+
`${prefix}-selected-count`,
|
|
202
|
+
'uint32',
|
|
203
|
+
1
|
|
204
|
+
);
|
|
205
|
+
ownedVectors.push(globalSelectedCount);
|
|
206
|
+
const globalRows = graph.importGPUVector(`${prefix}-row-vector`, globalRowIndices).data[0];
|
|
207
|
+
const selectedCount = graph.importGPUVector(`${prefix}-count-vector`, globalSelectedCount)
|
|
208
|
+
.data[0];
|
|
165
209
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
210
|
+
graph.add(
|
|
211
|
+
new GPUReduction({
|
|
212
|
+
id: `${prefix}-count-selected`,
|
|
213
|
+
input: context.selectedCounts,
|
|
214
|
+
output: selectedCount,
|
|
215
|
+
operation: 'sum'
|
|
216
|
+
})
|
|
217
|
+
);
|
|
174
218
|
|
|
175
|
-
|
|
176
|
-
|
|
219
|
+
if (length > 0) {
|
|
220
|
+
const scratch = createGPUGlobalSortScratch(graph, prefix, length);
|
|
221
|
+
// Stable sorts transfer the ordering of less significant keys through ties.
|
|
222
|
+
for (let index = keys.length - 1; index >= 0; index--) {
|
|
223
|
+
addGPUGlobalSortKeyPasses(
|
|
224
|
+
context,
|
|
225
|
+
`${prefix}-key-${index}`,
|
|
226
|
+
keys[index],
|
|
227
|
+
scratch,
|
|
228
|
+
index === keys.length - 1
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
addGPUGlobalSortPublishPass(graph, `${prefix}-publish`, {
|
|
233
|
+
scratch,
|
|
234
|
+
output: globalRows,
|
|
235
|
+
count: selectedCount,
|
|
236
|
+
offset: options.offset ?? 0,
|
|
237
|
+
limit: options.limit ?? MAXIMUM_UINT32
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
if (options.offset || options.limit !== undefined) {
|
|
177
241
|
let globalOffset = 0;
|
|
178
242
|
let fallbackOffset = 0;
|
|
179
243
|
for (const [batchIndex, batch] of context.table.batches.entries()) {
|
|
180
244
|
if (batch.numRows > 0) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
scratch,
|
|
245
|
+
const selection = context.selectionMask.data[batchIndex];
|
|
246
|
+
addGPUGlobalTopKSelectionPass(graph, `${prefix}-select-batch-${batchIndex}`, {
|
|
247
|
+
ranks: scratch.sourceClasses,
|
|
248
|
+
selection,
|
|
186
249
|
globalOffset,
|
|
187
|
-
|
|
188
|
-
options
|
|
250
|
+
offset: options.offset ?? 0,
|
|
251
|
+
limit: options.limit ?? MAXIMUM_UINT32
|
|
189
252
|
});
|
|
253
|
+
graph.add(
|
|
254
|
+
new GPUVisibilityWorkflow({
|
|
255
|
+
id: `${prefix}-visibility-batch-${batchIndex}`,
|
|
256
|
+
predicates: [{kind: 'selection', mask: selection}],
|
|
257
|
+
outputMask: selection,
|
|
258
|
+
output: context.rowIndices.data[batchIndex],
|
|
259
|
+
count: context.selectedCounts.data[batchIndex],
|
|
260
|
+
firstSourceIndex: batch.sourceInfo?.sourceRowIndexOffset ?? fallbackOffset
|
|
261
|
+
})
|
|
262
|
+
);
|
|
190
263
|
}
|
|
191
264
|
globalOffset += batch.numRows;
|
|
192
265
|
fallbackOffset += batch.numRows;
|
|
193
266
|
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return {globalRowIndices, globalSelectedCount};
|
|
270
|
+
}
|
|
194
271
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
outputKeys: scratch.encodedKeys,
|
|
214
|
-
outputValues: scratch.sourceOrdinals,
|
|
215
|
-
direction: 'ascending',
|
|
216
|
-
algorithm: options.algorithm
|
|
217
|
-
})
|
|
218
|
-
);
|
|
272
|
+
/** Stages and stably sorts one key, starting from the permutation of less significant keys. */
|
|
273
|
+
function addGPUGlobalSortKeyPasses<Selection extends GPUTypeMap>(
|
|
274
|
+
context: GPUDataFrameQueryExtensionContext<Selection>,
|
|
275
|
+
prefix: string,
|
|
276
|
+
{column, options}: GPUGlobalSortKey<keyof Selection & string>,
|
|
277
|
+
scratch: GPUGlobalSortScratch,
|
|
278
|
+
initialize: boolean
|
|
279
|
+
): void {
|
|
280
|
+
const graph = context.graph;
|
|
281
|
+
const input = graph.importGPUVector(`${prefix}-input`, getGPUAnalyticsVector(context, column));
|
|
282
|
+
const field = context.table.schema.fields.find(candidate => candidate.name === column);
|
|
283
|
+
const validityVector = field?.nullable ? context.validity[column] : undefined;
|
|
284
|
+
if (field?.nullable && !validityVector && input.length > 0) {
|
|
285
|
+
throw new Error(`GPUDataFrame nullable global sort column "${column}" requires GPU validity`);
|
|
286
|
+
}
|
|
287
|
+
const validity = validityVector
|
|
288
|
+
? graph.importGPUVector(`${prefix}-source-validity`, validityVector)
|
|
289
|
+
: undefined;
|
|
219
290
|
|
|
220
|
-
|
|
291
|
+
let globalOffset = 0;
|
|
292
|
+
let fallbackOffset = 0;
|
|
293
|
+
for (const [batchIndex, batch] of context.table.batches.entries()) {
|
|
294
|
+
if (batch.numRows > 0) {
|
|
295
|
+
addGPUGlobalSortStagePass(graph, `${prefix}-stage-batch-${batchIndex}`, {
|
|
296
|
+
input: input.data[batchIndex],
|
|
297
|
+
selection: context.selectionMask.data[batchIndex],
|
|
298
|
+
validity: validity?.data[batchIndex],
|
|
221
299
|
scratch,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
300
|
+
globalOffset,
|
|
301
|
+
sourceOffset: batch.sourceInfo?.sourceRowIndexOffset ?? fallbackOffset,
|
|
302
|
+
options,
|
|
303
|
+
initialize
|
|
226
304
|
});
|
|
227
|
-
|
|
228
|
-
if (options.offset || options.limit !== undefined) {
|
|
229
|
-
let globalOffset = 0;
|
|
230
|
-
let fallbackOffset = 0;
|
|
231
|
-
for (const [batchIndex, batch] of context.table.batches.entries()) {
|
|
232
|
-
if (batch.numRows > 0) {
|
|
233
|
-
const selection = context.selectionMask.data[batchIndex];
|
|
234
|
-
addGPUGlobalTopKSelectionPass(graph, `${prefix}-select-batch-${batchIndex}`, {
|
|
235
|
-
ranks: scratch.sourceClasses,
|
|
236
|
-
selection,
|
|
237
|
-
globalOffset,
|
|
238
|
-
offset: options.offset ?? 0,
|
|
239
|
-
limit: options.limit ?? MAXIMUM_UINT32
|
|
240
|
-
});
|
|
241
|
-
graph.add(
|
|
242
|
-
new GPUVisibilityWorkflow({
|
|
243
|
-
id: `${prefix}-visibility-batch-${batchIndex}`,
|
|
244
|
-
predicates: [{kind: 'selection', mask: selection}],
|
|
245
|
-
outputMask: selection,
|
|
246
|
-
output: context.rowIndices.data[batchIndex],
|
|
247
|
-
count: context.selectedCounts.data[batchIndex],
|
|
248
|
-
firstSourceIndex: batch.sourceInfo?.sourceRowIndexOffset ?? fallbackOffset
|
|
249
|
-
})
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
globalOffset += batch.numRows;
|
|
253
|
-
fallbackOffset += batch.numRows;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
305
|
}
|
|
306
|
+
globalOffset += batch.numRows;
|
|
307
|
+
fallbackOffset += batch.numRows;
|
|
308
|
+
}
|
|
257
309
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
new CompiledGPUDataFrameGlobalSort(
|
|
265
|
-
props,
|
|
266
|
-
column,
|
|
267
|
-
options,
|
|
268
|
-
globalRowIndices,
|
|
269
|
-
globalSelectedCount
|
|
270
|
-
)
|
|
271
|
-
};
|
|
272
|
-
} catch (error) {
|
|
273
|
-
for (const vector of ownedVectors) {
|
|
274
|
-
vector.destroy();
|
|
275
|
-
}
|
|
276
|
-
throw error;
|
|
310
|
+
if (!initialize) {
|
|
311
|
+
addGPUGlobalSortGatherPass(graph, `${prefix}-gather-keys`, {
|
|
312
|
+
ordinals: scratch.sourceOrdinals,
|
|
313
|
+
input: scratch.encodedKeys,
|
|
314
|
+
output: scratch.sortedKeys
|
|
315
|
+
});
|
|
277
316
|
}
|
|
317
|
+
graph.add(
|
|
318
|
+
new GPUSort({
|
|
319
|
+
id: `${prefix}-numeric`,
|
|
320
|
+
keys: initialize ? scratch.encodedKeys : scratch.sortedKeys,
|
|
321
|
+
values: scratch.sourceOrdinals,
|
|
322
|
+
outputKeys: initialize ? scratch.sortedKeys : scratch.encodedKeys,
|
|
323
|
+
outputValues: scratch.sortedOrdinals,
|
|
324
|
+
direction: options.direction,
|
|
325
|
+
algorithm: options.algorithm
|
|
326
|
+
})
|
|
327
|
+
);
|
|
328
|
+
|
|
329
|
+
addGPUGlobalSortGatherPass(graph, `${prefix}-gather-classes`, {
|
|
330
|
+
ordinals: scratch.sortedOrdinals,
|
|
331
|
+
input: scratch.sourceClasses,
|
|
332
|
+
output: scratch.sortedKeys
|
|
333
|
+
});
|
|
334
|
+
graph.add(
|
|
335
|
+
new GPUSort({
|
|
336
|
+
id: `${prefix}-classes`,
|
|
337
|
+
keys: scratch.sortedKeys,
|
|
338
|
+
values: scratch.sortedOrdinals,
|
|
339
|
+
outputKeys: scratch.encodedKeys,
|
|
340
|
+
outputValues: scratch.sourceOrdinals,
|
|
341
|
+
direction: 'ascending',
|
|
342
|
+
algorithm: options.algorithm
|
|
343
|
+
})
|
|
344
|
+
);
|
|
278
345
|
}
|
|
279
346
|
|
|
280
347
|
/** Allocates only explicit global permutation scratch; original dataframe vectors remain intact. */
|
|
@@ -304,6 +371,7 @@ function addGPUGlobalSortStagePass(
|
|
|
304
371
|
scratch: GPUGlobalSortScratch;
|
|
305
372
|
globalOffset: number;
|
|
306
373
|
sourceOffset: number;
|
|
374
|
+
initialize: boolean;
|
|
307
375
|
options: GPUDataFrameNormalizedSortOptions;
|
|
308
376
|
}
|
|
309
377
|
): void {
|
|
@@ -350,9 +418,9 @@ const ROW_OFFSET: u32 = ${getViewElementOffset(props.scratch.sourceRows)}u;
|
|
|
350
418
|
@group(0) @binding(1) var<storage, read> selectionMask: array<u32>;
|
|
351
419
|
${validityBinding}
|
|
352
420
|
@group(0) @binding(${outputBinding}) var<storage, read_write> encodedKeys: array<u32>;
|
|
353
|
-
|
|
354
|
-
@group(0) @binding(${outputBinding + 2}) var<storage, read_write> sourceClasses: array<u32>;
|
|
355
|
-
|
|
421
|
+
${props.initialize ? `@group(0) @binding(${outputBinding + 1}) var<storage, read_write> sourceOrdinals: array<u32>;` : ''}
|
|
422
|
+
@group(0) @binding(${outputBinding + (props.initialize ? 2 : 1)}) var<storage, read_write> sourceClasses: array<u32>;
|
|
423
|
+
${props.initialize ? `@group(0) @binding(${outputBinding + 3}) var<storage, read_write> sourceRows: array<u32>;` : ''}
|
|
356
424
|
|
|
357
425
|
@compute @workgroup_size(${LU_ANALYTICS_WORKGROUP_SIZE})
|
|
358
426
|
fn main(
|
|
@@ -370,9 +438,9 @@ fn main(
|
|
|
370
438
|
if (isNull) { rank = ${nullRank}u; }
|
|
371
439
|
if (selectionMask[SELECTION_OFFSET + index] == 0u) { rank = 3u; }
|
|
372
440
|
encodedKeys[KEY_OFFSET + ordinal] = select(${keyExpression}, 0u, isNull || isNaN);
|
|
373
|
-
sourceOrdinals[ORDINAL_OFFSET + ordinal] = ordinal;
|
|
441
|
+
${props.initialize ? 'sourceOrdinals[ORDINAL_OFFSET + ordinal] = ordinal;' : ''}
|
|
374
442
|
sourceClasses[CLASS_OFFSET + ordinal] = rank;
|
|
375
|
-
sourceRows[ROW_OFFSET + ordinal] = SOURCE_OFFSET + index;
|
|
443
|
+
${props.initialize ? 'sourceRows[ROW_OFFSET + ordinal] = SOURCE_OFFSET + index;' : ''}
|
|
376
444
|
}`;
|
|
377
445
|
const resources: GraphBufferUse[] = [
|
|
378
446
|
{buffer: props.input, usage: 'storage-read'},
|
|
@@ -386,12 +454,11 @@ fn main(
|
|
|
386
454
|
resources.push({buffer: props.validity, usage: 'storage-read'});
|
|
387
455
|
bindings['validityValues'] = props.validity;
|
|
388
456
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
] as const) {
|
|
457
|
+
const outputs: [string, GraphDataView][] = [['encodedKeys', props.scratch.encodedKeys]];
|
|
458
|
+
if (props.initialize) outputs.push(['sourceOrdinals', props.scratch.sourceOrdinals]);
|
|
459
|
+
outputs.push(['sourceClasses', props.scratch.sourceClasses]);
|
|
460
|
+
if (props.initialize) outputs.push(['sourceRows', props.scratch.sourceRows]);
|
|
461
|
+
for (const [name, view] of outputs) {
|
|
395
462
|
resources.push({buffer: view, usage: 'storage-write'});
|
|
396
463
|
bindings[name] = view;
|
|
397
464
|
}
|
|
@@ -410,46 +477,54 @@ function getGPUGlobalSortNumericKeyExpression(format: GPUAnalyticsScalarFormat):
|
|
|
410
477
|
}
|
|
411
478
|
}
|
|
412
479
|
|
|
413
|
-
/** Gathers
|
|
414
|
-
function
|
|
480
|
+
/** Gathers keys or classes by their current source ordinal permutation. */
|
|
481
|
+
function addGPUGlobalSortGatherPass(
|
|
415
482
|
graph: GPUCommandGraph<GPUDataFrameQueryParameters>,
|
|
416
483
|
id: string,
|
|
417
|
-
|
|
484
|
+
{
|
|
485
|
+
ordinals,
|
|
486
|
+
input,
|
|
487
|
+
output
|
|
488
|
+
}: {
|
|
489
|
+
ordinals: GraphDataView<'uint32'>;
|
|
490
|
+
input: GraphDataView<'uint32'>;
|
|
491
|
+
output: GraphDataView<'uint32'>;
|
|
492
|
+
}
|
|
418
493
|
): void {
|
|
419
494
|
const source = /* wgsl */ `
|
|
420
|
-
const ELEMENT_COUNT: u32 = ${
|
|
421
|
-
const ORDINAL_OFFSET: u32 = ${getViewElementOffset(
|
|
422
|
-
const
|
|
423
|
-
const OUTPUT_OFFSET: u32 = ${getViewElementOffset(
|
|
424
|
-
@group(0) @binding(0) var<storage, read>
|
|
425
|
-
@group(0) @binding(1) var<storage, read>
|
|
426
|
-
@group(0) @binding(2) var<storage, read_write>
|
|
495
|
+
const ELEMENT_COUNT: u32 = ${ordinals.length}u;
|
|
496
|
+
const ORDINAL_OFFSET: u32 = ${getViewElementOffset(ordinals)}u;
|
|
497
|
+
const INPUT_OFFSET: u32 = ${getViewElementOffset(input)}u;
|
|
498
|
+
const OUTPUT_OFFSET: u32 = ${getViewElementOffset(output)}u;
|
|
499
|
+
@group(0) @binding(0) var<storage, read> sourceOrdinals: array<u32>;
|
|
500
|
+
@group(0) @binding(1) var<storage, read> sourceValues: array<u32>;
|
|
501
|
+
@group(0) @binding(2) var<storage, read_write> gatheredValues: array<u32>;
|
|
427
502
|
|
|
428
503
|
@compute @workgroup_size(${LU_ANALYTICS_WORKGROUP_SIZE})
|
|
429
504
|
fn main(
|
|
430
505
|
@builtin(local_invocation_index) localInvocationIndex: u32,
|
|
431
506
|
@builtin(workgroup_id) workgroupId: vec3<u32>
|
|
432
507
|
) {
|
|
433
|
-
${getGPUAnalyticsInvocationIndexSource(graph,
|
|
508
|
+
${getGPUAnalyticsInvocationIndexSource(graph, ordinals.length)}
|
|
434
509
|
if (index < ELEMENT_COUNT) {
|
|
435
|
-
|
|
436
|
-
|
|
510
|
+
gatheredValues[OUTPUT_OFFSET + index] =
|
|
511
|
+
sourceValues[INPUT_OFFSET + sourceOrdinals[ORDINAL_OFFSET + index]];
|
|
437
512
|
}
|
|
438
513
|
}`;
|
|
439
514
|
addGPUAnalyticsComputePass(graph, {
|
|
440
515
|
id,
|
|
441
516
|
source,
|
|
442
517
|
resources: [
|
|
443
|
-
{buffer:
|
|
444
|
-
{buffer:
|
|
445
|
-
{buffer:
|
|
518
|
+
{buffer: ordinals, usage: 'storage-read'},
|
|
519
|
+
{buffer: input, usage: 'storage-read'},
|
|
520
|
+
{buffer: output, usage: 'storage-write'}
|
|
446
521
|
],
|
|
447
522
|
bindings: {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
523
|
+
sourceOrdinals: ordinals,
|
|
524
|
+
sourceValues: input,
|
|
525
|
+
gatheredValues: output
|
|
451
526
|
},
|
|
452
|
-
length:
|
|
527
|
+
length: ordinals.length
|
|
453
528
|
});
|
|
454
529
|
}
|
|
455
530
|
|