@luma.gl/graph 10.0.0-alpha.14 → 10.0.0-alpha.15
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-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/index.cjs +2 -0
- package/dist/arrow/index.cjs.map +1 -1
- 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/dist.dev.js +79 -39
- package/dist/dist.min.js +61 -61
- 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/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 +6 -4
- package/dist/gpu-core/gpu-command-graph.d.ts +4 -4
- package/dist/gpu-core/gpu-command-graph.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph.js +6 -4
- package/dist/gpu-core/gpu-command-graph.js.map +1 -1
- 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-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-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/index.cjs +18 -0
- package/dist/gpu-core/index.cjs.map +3 -3
- package/dist/gpu-core/index.d.ts +13 -1
- package/dist/gpu-core/index.d.ts.map +1 -1
- package/dist/gpu-core/index.js +6 -0
- package/dist/gpu-core/index.js.map +1 -1
- 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 +3 -0
- package/dist/gpu-data/index.cjs.map +2 -2
- package/dist/gpu-data/index.d.ts +1 -0
- package/dist/gpu-data/index.d.ts.map +1 -1
- package/dist/gpu-data/index.js +1 -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.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 +3 -1
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts +4 -0
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.js +3 -1
- package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
- package/dist/gpu-physics/index.cjs.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-pointcloud/index.cjs.map +1 -1
- package/dist/gpu-project/graph.cjs.map +1 -1
- package/dist/gpu-simple-graph/index.cjs.map +1 -1
- package/dist/gpu-sql/gpu-sql.cjs +97 -4
- package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
- package/dist/gpu-sql/gpu-sql.js +100 -5
- package/dist/gpu-sql/gpu-sql.js.map +1 -1
- package/dist/gpu-sql/index.cjs.map +2 -2
- package/dist/gpu-timeseries/index.cjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/arrow/gpu/arrow-column-gpu-vector.ts +67 -14
- package/src/arrow/index.ts +2 -0
- package/src/geospatial/gpu-point-spatial-query.ts +2 -15
- 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 +11 -4
- package/src/gpu-core/gpu-dispatch-utils.ts +13 -1
- 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-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/index.ts +21 -0
- package/src/gpu-data/gpu-vector-wgsl-layout.ts +79 -0
- package/src/gpu-data/index.ts +7 -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-algorithms/gpu-graph-spatial-force-layout-internals.ts +2 -15
- package/src/gpu-physics/gpu-rigid-body-world.ts +8 -1
- package/src/gpu-physics/rigid-body-parallel-shaders.ts +32 -9
- package/src/gpu-physics/rigid-body-shaders.ts +3 -2
- package/src/gpu-sql/gpu-sql.ts +105 -5
- package/src/index.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { GPUCommandGraph, CompiledGPUCommandGraph, GPUCommandGraphEncoding, GPUCommandGraphExecution, getGPUCommandGraphExecutionPlan, GraphBufferHandle, GraphDataView, GraphExternalTextureHandle, GraphTextureHandle, GraphTextureView, GraphVectorView, composite, GPUGraph, GPUGraphScalar, GPUGraphVector, GPUGraphTexture, GPUGraphTextureView, type GPUGraphScalarFormat, type GPUGraphVectorFormat, type GPUGraphTextureProps, GPUGraphCompiler, type GPUGraphBindings, type GPUGraphCompilation, type GPUGraphLoweredNode, type GPUGraphLoweringReport, type GPUOperationLowering, type GPUOperationLowerer, type GPUOperationLoweringContext, type GPUOperationLoweringDecision, type GPUGraphBackendCapabilities, inspectGPUGraphCompilation, type GPUGraphCompilationSummary, validateGPUGraph, type GPUGraphValidationIssue, type GPUGraphValidationReport, type GPUCommandGraphCompileContext, type GPUCommandGraphCapabilities, type GPUCommandGraphCPUCondition, type GPUCommandGraphComputeExecutable, type GPUCommandGraphComputeNode, type GPUCommandGraphCopyExecutable, type GPUCommandGraphCopyNode, type GPUCommandGraphEncodeContext, type GPUCommandGraphEncodeOptions, type GPUCommandGraphGPUIndirectCondition, type GPUCommandGraphNode, type GPUCommandGraphNodeCondition, type GPUCommandGraphNodeConditionPreflight, type GPUCommandGraphNodeEncodingStats, type GPUCommandGraphNodePreflight, type GPUCommandGraphResourceSummary, type GPUCommandGraphNodePublication, type GPUCommandGraphNodeTiming, type GPUCommandGraphNodeType, type GPUCommandGraphNodeWorkloadEstimate, type GPUCommandGraphPreflightReport, type GPUCommandGraphRenderExecutable, type GPUCommandGraphRenderNode, type GPUCommandGraphStats, type GPUCommandGraphEncodingStats, type GPUCommandGraphTimingReport, type GraphBufferDescriptor, type GraphBufferUsage, type GraphBufferUse, type GraphExternalTextureBinding, type GraphExternalTextureDescriptor, type GraphExternalTextureUse, type GraphFrameTextureBinding, type GraphImportedBuffer, type GraphImportedTexture, type GraphRenderPassAttachments, type GraphResourceUse, type GraphTextureAspect, type GraphTextureDescriptor, type GraphTextureDimension, type GraphTextureUsage, type GraphTextureUse, type GraphTextureViewProps, type GPUCommandGraphExecutionBudget, type GPUCommandGraphExecutionLatencyPriority, type GPUCommandGraphExecutionPublicationPolicy, type GPUCommandGraphExecutionOptions, type GPUCommandGraphExecutionPlanStep, type GPUCommandGraphExecutionPlan, type GPUCommandGraphExecutionStep } from "./gpu-graph/index.js";
|
|
1
|
+
export { GPUCommandGraph, CompiledGPUCommandGraph, GPUCommandGraphEncoding, GPUCommandGraphExecution, getGPUCommandGraphExecutionPlan, GraphBufferHandle, GraphDataView, GraphExternalTextureHandle, GraphTextureHandle, GraphTextureView, GraphVectorView, composite, GPUGraph, GPUGraphScalar, GPUGraphVector, GPUGraphTexture, GPUGraphTextureView, type GPUGraphScalarFormat, type GPUGraphVectorFormat, type GPUGraphTextureProps, GPUGraphCompiler, type GPUGraphBindings, type GPUGraphCompilation, type GPUGraphLoweredNode, type GPUGraphLoweringReport, type GPUOperationLowering, type GPUOperationLowerer, type GPUOperationLoweringContext, type GPUOperationLoweringDecision, type GPUGraphBackendCapabilities, inspectGPUGraphCompilation, type GPUGraphCompilationSummary, validateGPUGraph, type GPUGraphValidationIssue, type GPUGraphValidationReport, type GPUCommandGraphCompileContext, type GPUCommandGraphCapabilities, type GPUCommandGraphCPUCondition, type GPUCommandGraphComputeExecutable, type GPUCommandGraphComputeNode, type GPUCommandGraphCopyExecutable, type GPUCommandGraphCopyNode, type GPUCommandGraphEncodeContext, type GPUCommandGraphEncodeOptions, type GPUCommandGraphGPUIndirectCondition, type GPUCommandGraphNode, type GPUCommandGraphNodeCondition, type GPUCommandGraphNodeConditionPreflight, type GPUCommandGraphNodeEncodingStats, type GPUCommandGraphNodePreflight, type GPUCommandGraphCompileOptions, type GPUCommandGraphKernelMetadata, type GPUCommandGraphResourceSummary, type GPUCommandGraphNodePublication, type GPUCommandGraphNodeTiming, type GPUCommandGraphNodeType, type GPUCommandGraphNodeWorkloadEstimate, type GPUCommandGraphPreflightReport, type GPUCommandGraphRenderExecutable, type GPUCommandGraphRenderNode, type GPUCommandGraphStats, type GPUCommandGraphEncodingStats, type GPUCommandGraphTimingReport, type GraphBufferDescriptor, type GraphBufferUsage, type GraphBufferUse, type GraphExternalTextureBinding, type GraphExternalTextureDescriptor, type GraphExternalTextureUse, type GraphFrameTextureBinding, type GraphImportedBuffer, type GraphImportedTexture, type GraphRenderPassAttachments, type GraphResourceUse, type GraphTextureAspect, type GraphTextureDescriptor, type GraphTextureDimension, type GraphTextureUsage, type GraphTextureUse, type GraphTextureViewProps, type GPUCommandGraphExecutionBudget, type GPUCommandGraphExecutionLatencyPriority, type GPUCommandGraphExecutionPublicationPolicy, type GPUCommandGraphExecutionOptions, type GPUCommandGraphExecutionPlanStep, type GPUCommandGraphExecutionPlan, type GPUCommandGraphExecutionStep } from "./gpu-graph/index.js";
|
|
2
2
|
export { getGPUCommandGraphAdapterIdentity, type GPUCommandGraphAdapterIdentity, type GPUCommandGraphKernelCandidate, type GPUCommandGraphKernelCalibration, type GPUCommandGraphAutotuningProfile, type GPUCommandGraphAutotunerProps, type GPUCommandGraphKernelSelectionRequest, type GPUCommandGraphKernelSelection, type GPUCommandGraphKernelObservation, GPUCommandGraphAutotuner } from "./gpu-core/gpu-command-graph-autotuner.js";
|
|
3
3
|
export { type GPUCommandGraphExecutionBudgetControllerProps, type GPUCommandGraphExecutionBudgetObservation, GPUCommandGraphExecutionBudgetController } from "./gpu-core/gpu-command-graph-budget-controller.js";
|
|
4
4
|
export { type GPUCommandGraphInspectorGraph, type GPUCommandGraphInspectorEncoding, type GPUCommandGraphInspectorObservableGraph, type GPUCommandGraphInspectorObservation, type GPUCommandGraphInspectorNodeIdentity, type GPUCommandGraphInspectorProps, type GPUCommandGraphInspectorDurationSnapshot, type GPUCommandGraphInspectorCounterSnapshot, type GPUCommandGraphInspectorNodeSnapshot, type GPUCommandGraphInspectorStatsSnapshot, type GPUCommandGraphInspectorGraphSnapshot, type GPUCommandGraphInspectorSnapshot, GPUCommandGraphInspector } from "./gpu-core/gpu-command-graph-inspector.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,iBAAiB,EACjB,aAAa,EACb,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,cAAc,EACd,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,0BAA0B,EAC1B,KAAK,0BAA0B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Y,EACV,sBAAsB,EACtB,cAAc,EACd,eAAe,EAChB,uCAAoC;AAErC,OAAO,EAAC,eAAe,EAAC,wCAAqC;AAC7D,YAAY,EACV,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,YAAY,EACb,wCAAqC;AAEtC,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EAClB,yDAAsD;AACvD,YAAY,EACV,6BAA6B,EAC7B,sBAAsB,EACvB,yDAAsD"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,iBAAiB,EACjB,aAAa,EACb,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,cAAc,EACd,cAAc,EACd,eAAe,EACf,mBAAmB,EAInB,gBAAgB,EAUhB,0BAA0B,EAE1B,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,iBAAiB,EACjB,aAAa,EACb,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,cAAc,EACd,cAAc,EACd,eAAe,EACf,mBAAmB,EAInB,gBAAgB,EAUhB,0BAA0B,EAE1B,gBAAgB,EAuDjB,6BAA0B;AAC3B,OAAO,EACL,iCAAiC,EASjC,wBAAwB,EACzB,kDAA+C;AAChD,OAAO,EAGL,wCAAwC,EACzC,0DAAuD;AACxD,OAAO,EAaL,wBAAwB,EACzB,kDAA+C;AAchD,OAAO,EAAC,cAAc,EAAC,uDAAoD;AAU3E,OAAO,EAAC,aAAa,EAAC,qDAAkD;AACxE,OAAO,EAAC,eAAe,EAAC,+CAA4C;AAMpE,OAAO,EAAC,MAAM,EAAC,sCAAmC;AAClD,OAAO,EAAC,YAAY,EAAC,6CAA0C;AAO/D,OAAO,EAAC,sBAAsB,EAAC,+CAA4C;AAK3E,OAAO,EAAC,gBAAgB,EAAE,yBAAyB,EAAC,yCAAsC;AAe1F,OAAO,EAAC,QAAQ,EAAC,sCAAmC;AAapD,OAAO,EAAC,kBAAkB,EAAE,gBAAgB,EAAC,6CAA0C;AACvF,OAAO,EAAC,sBAAsB,EAAC,gDAA6C;AAM5E,OAAO,EAAC,sBAAsB,EAAC,+CAA4C;AAU3E,OAAO,EAAC,eAAe,EAAC,wCAAqC;AAQ7D,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EAClB,yDAAsD"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "10.0.0-alpha.
|
|
6
|
+
"version": "10.0.0-alpha.15",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"repository": {
|
|
@@ -242,8 +242,8 @@
|
|
|
242
242
|
}
|
|
243
243
|
},
|
|
244
244
|
"peerDependencies": {
|
|
245
|
-
"@luma.gl/core": "~10.0.0-alpha.
|
|
246
|
-
"@luma.gl/shaders": "~10.0.0-alpha.
|
|
245
|
+
"@luma.gl/core": "~10.0.0-alpha.15",
|
|
246
|
+
"@luma.gl/shaders": "~10.0.0-alpha.15",
|
|
247
247
|
"apache-arrow": ">=17.0.0"
|
|
248
248
|
},
|
|
249
249
|
"peerDependenciesMeta": {
|
|
@@ -252,11 +252,11 @@
|
|
|
252
252
|
}
|
|
253
253
|
},
|
|
254
254
|
"dependencies": {
|
|
255
|
-
"@math.gl/arrow": "~5.0.0-beta.
|
|
256
|
-
"@math.gl/core": "~5.0.0-beta.
|
|
257
|
-
"@math.gl/expressions": "~5.0.0-beta.
|
|
258
|
-
"@math.gl/geospatial": "~5.0.0-beta.
|
|
255
|
+
"@math.gl/arrow": "~5.0.0-beta.10",
|
|
256
|
+
"@math.gl/core": "~5.0.0-beta.10",
|
|
257
|
+
"@math.gl/expressions": "~5.0.0-beta.10",
|
|
258
|
+
"@math.gl/geospatial": "~5.0.0-beta.10",
|
|
259
259
|
"probe.gl": "^5.0.0"
|
|
260
260
|
},
|
|
261
|
-
"gitHead": "
|
|
261
|
+
"gitHead": "2a5a732d5fab9f90c6d3646f956e1304a6a22c2e"
|
|
262
262
|
}
|
|
@@ -36,29 +36,82 @@ export type ArrowColumnGPUVectorOptions = {
|
|
|
36
36
|
transform?: (value: number[]) => readonly number[];
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
/**
|
|
40
|
-
export
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
/** Options for selecting an output format from Arrow type metadata. */
|
|
40
|
+
export type ArrowColumnFormatOptions = Pick<
|
|
41
|
+
Partial<ArrowColumnGPUVectorOptions>,
|
|
42
|
+
'format' | 'transform'
|
|
43
|
+
> & {
|
|
44
|
+
/** Selects numeric, XY/XYZ position, scalar, or normalized RGBA conversion. */
|
|
45
|
+
semantic?: 'auto' | 'numeric' | 'position' | 'scalar' | 'color';
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Infers and validates a GPU format for an Arrow column without reading rows or uploading data.
|
|
50
|
+
* Conversion still validates nulls and transformed row widths.
|
|
51
|
+
*/
|
|
52
|
+
export function getArrowConversionFormat(
|
|
53
|
+
type: DataType,
|
|
54
|
+
{semantic = 'auto', format, transform}: ArrowColumnFormatOptions = {}
|
|
55
|
+
): GPUVectorFormat {
|
|
56
|
+
const listWidth = DataType.isFixedSizeList(type) ? type.listSize : undefined;
|
|
57
|
+
if (semantic === 'position' && listWidth !== 2 && listWidth !== 3) {
|
|
58
|
+
throw new Error('Arrow positions must be FixedSizeList[2] or FixedSizeList[3]');
|
|
59
|
+
}
|
|
60
|
+
if (semantic === 'scalar' && !DataType.isInt(type) && !DataType.isFloat(type)) {
|
|
61
|
+
throw new Error('Arrow scalar input must be numeric');
|
|
62
|
+
}
|
|
63
|
+
const width = listWidth ?? 1;
|
|
64
|
+
const outputFormat =
|
|
65
|
+
format ??
|
|
66
|
+
(semantic === 'color'
|
|
67
|
+
? 'unorm8x4'
|
|
68
|
+
: width === 1
|
|
69
|
+
? 'float32'
|
|
70
|
+
: (`float32x${width}` as GPUVectorFormat));
|
|
71
|
+
validateArrowColumnFormat(
|
|
72
|
+
type,
|
|
73
|
+
outputFormat,
|
|
74
|
+
semantic === 'color' || outputFormat === 'unorm8x4',
|
|
75
|
+
transform
|
|
76
|
+
);
|
|
77
|
+
return outputFormat;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function validateArrowColumnFormat(
|
|
81
|
+
sourceType: DataType,
|
|
82
|
+
format: GPUVectorFormat,
|
|
83
|
+
color: boolean,
|
|
84
|
+
transform: ArrowColumnGPUVectorOptions['transform']
|
|
85
|
+
) {
|
|
46
86
|
const width = format === 'float32' ? 1 : Number(/x([234])$/.exec(format)?.[1]);
|
|
47
87
|
if (!width || (color ? format !== 'unorm8x4' : !format.startsWith('float32'))) {
|
|
48
88
|
throw new Error(`Unsupported Arrow output format: ${format}`);
|
|
49
89
|
}
|
|
50
|
-
const list = DataType.isFixedSizeList(
|
|
51
|
-
const sourceWidth = list ?
|
|
52
|
-
const type = list ?
|
|
90
|
+
const list = DataType.isFixedSizeList(sourceType);
|
|
91
|
+
const sourceWidth = list ? sourceType.listSize : 1;
|
|
92
|
+
const type = list ? sourceType.children[0].type : sourceType;
|
|
53
93
|
if (!DataType.isInt(type) && !DataType.isFloat(type)) {
|
|
54
94
|
throw new Error('Arrow input must contain numeric values');
|
|
55
95
|
}
|
|
56
|
-
if (
|
|
57
|
-
(!color && !options.transform && sourceWidth > width) ||
|
|
58
|
-
(color && ![3, 4].includes(sourceWidth))
|
|
59
|
-
) {
|
|
96
|
+
if ((!color && !transform && sourceWidth > width) || (color && ![3, 4].includes(sourceWidth))) {
|
|
60
97
|
throw new Error('Arrow input width does not match the requested output format');
|
|
61
98
|
}
|
|
99
|
+
return {width, sourceWidth, type, list};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Converts fixed-width numeric Arrow chunks to owned GPU vectors with optional row transforms and validity. */
|
|
103
|
+
export function convertArrowColumnToGPUVector(
|
|
104
|
+
device: Device,
|
|
105
|
+
vector: Vector,
|
|
106
|
+
options: ArrowColumnGPUVectorOptions
|
|
107
|
+
): PreparedArrowColumnGPUVector {
|
|
108
|
+
const {name = 'arrow-column', format, color, preserveNulls} = options;
|
|
109
|
+
const {width, sourceWidth, type, list} = validateArrowColumnFormat(
|
|
110
|
+
vector.type,
|
|
111
|
+
format,
|
|
112
|
+
color,
|
|
113
|
+
options.transform
|
|
114
|
+
);
|
|
62
115
|
const parts: GPUVector[] = [];
|
|
63
116
|
const residuals: GPUVector[] = [];
|
|
64
117
|
const validity: GPUVector[] = [];
|
package/src/arrow/index.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
// SPDX-FileComment: Independently implemented for WebGPU; inspired by NVIDIA RAPIDS cuSpatial.
|
|
5
5
|
|
|
6
|
+
import {GPU_GRID_COORDINATE_WGSL} from '../gpu-core/gpu-grid-coordinate';
|
|
6
7
|
import {type Binding, Buffer} from '@luma.gl/core';
|
|
7
8
|
import {assembleComputeKernel} from '../utils/assemble-compute-kernel';
|
|
8
9
|
import {Kernel} from '../execution/compute/kernel';
|
|
@@ -277,21 +278,7 @@ fn finite(value: f32) -> bool {
|
|
|
277
278
|
return value == value && abs(value) <= 3.402823466e+38;
|
|
278
279
|
}
|
|
279
280
|
|
|
280
|
-
|
|
281
|
-
if (maximum == minimum || value <= minimum) { return 0u; }
|
|
282
|
-
if (value >= maximum) { return size - 1u; }
|
|
283
|
-
if (minimum < 0.0 && maximum > 0.0) {
|
|
284
|
-
let scale = max(abs(minimum), abs(maximum));
|
|
285
|
-
let scaledValue = value / scale;
|
|
286
|
-
let scaledMinimum = minimum / scale;
|
|
287
|
-
let scaledMaximum = maximum / scale;
|
|
288
|
-
return min(
|
|
289
|
-
u32((scaledValue - scaledMinimum) / (scaledMaximum - scaledMinimum) * f32(size)),
|
|
290
|
-
size - 1u
|
|
291
|
-
);
|
|
292
|
-
}
|
|
293
|
-
return min(u32((value - minimum) / (maximum - minimum) * f32(size)), size - 1u);
|
|
294
|
-
}
|
|
281
|
+
${GPU_GRID_COORDINATE_WGSL}
|
|
295
282
|
|
|
296
283
|
fn getCell(position: vec3<f32>) -> vec3<u32> {
|
|
297
284
|
return vec3<u32>(
|
|
@@ -10,6 +10,7 @@ import type {
|
|
|
10
10
|
GPUCommandGraphCopyExecutable,
|
|
11
11
|
GPUCommandGraphNode,
|
|
12
12
|
GPUCommandGraphPreflightReport,
|
|
13
|
+
GPUCommandGraphCompileOptions,
|
|
13
14
|
GPUCommandGraphRenderExecutable,
|
|
14
15
|
GPUCommandGraphStats,
|
|
15
16
|
GPUCommandGraphResourceSummary,
|
|
@@ -113,6 +114,7 @@ type GPUCommandGraphCompilerProps<Parameters> = {
|
|
|
113
114
|
textures: Map<string, GraphTextureHandle>;
|
|
114
115
|
externalTextures: Map<string, GraphExternalTextureHandle>;
|
|
115
116
|
nodes: GPUCommandGraphNode<Parameters>[];
|
|
117
|
+
kernelMetadata?: GPUCommandGraphCompileOptions['kernelMetadata'];
|
|
116
118
|
};
|
|
117
119
|
|
|
118
120
|
/**
|
|
@@ -363,7 +365,12 @@ function finishGPUCommandGraphCompilation<Parameters>(
|
|
|
363
365
|
'physical transient resource estimates'
|
|
364
366
|
)
|
|
365
367
|
};
|
|
366
|
-
const preflight = getGPUCommandGraphPreflightReport(
|
|
368
|
+
const preflight = getGPUCommandGraphPreflightReport(
|
|
369
|
+
props.device,
|
|
370
|
+
logicalBuffers,
|
|
371
|
+
nodeOrder,
|
|
372
|
+
props.kernelMetadata
|
|
373
|
+
);
|
|
367
374
|
|
|
368
375
|
return {
|
|
369
376
|
device: props.device,
|
|
@@ -421,14 +428,30 @@ function summarizeResource(resource: GraphResourceUse): GPUCommandGraphResourceS
|
|
|
421
428
|
function getGPUCommandGraphPreflightReport<Parameters>(
|
|
422
429
|
device: Device,
|
|
423
430
|
buffers: GraphBufferHandle[],
|
|
424
|
-
nodes: GPUCommandGraphNode<Parameters>[]
|
|
431
|
+
nodes: GPUCommandGraphNode<Parameters>[],
|
|
432
|
+
kernelMetadata: GPUCommandGraphCompileOptions['kernelMetadata']
|
|
425
433
|
): GPUCommandGraphPreflightReport {
|
|
426
434
|
const nodeReports = nodes.map(node => {
|
|
427
435
|
const workload = node.workload ?? {};
|
|
436
|
+
const kernel = kernelMetadata && node.type === 'compute' ? node.kernel : undefined;
|
|
428
437
|
return Object.freeze({
|
|
429
438
|
id: node.id,
|
|
430
439
|
...(node.description === undefined ? {} : {description: node.description}),
|
|
431
440
|
type: node.type,
|
|
441
|
+
...(kernel && {
|
|
442
|
+
kernel: Object.freeze({
|
|
443
|
+
entryPoint: kernel.entryPoint,
|
|
444
|
+
workgroupSize: Object.freeze([...kernel.workgroupSize] as const),
|
|
445
|
+
bindings: Object.freeze(
|
|
446
|
+
kernel.bindings.map(({name, type, group, location}) =>
|
|
447
|
+
Object.freeze({name, type, group, location})
|
|
448
|
+
)
|
|
449
|
+
),
|
|
450
|
+
...(kernelMetadata === 'source' && kernel.source !== undefined
|
|
451
|
+
? {source: kernel.source}
|
|
452
|
+
: {})
|
|
453
|
+
})
|
|
454
|
+
}),
|
|
432
455
|
resources: Object.freeze((node.resources ?? []).map(summarizeResource)),
|
|
433
456
|
...(workload.operation ? {operation: workload.operation} : {}),
|
|
434
457
|
...(workload.variant ? {variant: workload.variant} : {}),
|
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
ExternalTexture,
|
|
15
15
|
RenderPass,
|
|
16
16
|
RenderPassProps,
|
|
17
|
+
ComputeShaderLayout,
|
|
17
18
|
Texture,
|
|
18
19
|
TextureFormat,
|
|
19
20
|
TextureView
|
|
@@ -612,6 +613,22 @@ export type GPUCommandGraphResourceSummary = Readonly<{
|
|
|
612
613
|
depth?: number;
|
|
613
614
|
}>;
|
|
614
615
|
|
|
616
|
+
/** Static description of a compute kernel supplied by a command node. */
|
|
617
|
+
export type GPUCommandGraphKernelMetadata = Readonly<{
|
|
618
|
+
entryPoint: string;
|
|
619
|
+
workgroupSize: readonly [number, number, number];
|
|
620
|
+
bindings: readonly Readonly<
|
|
621
|
+
Pick<ComputeShaderLayout['bindings'][number], 'name' | 'type' | 'group' | 'location'>
|
|
622
|
+
>[];
|
|
623
|
+
source?: string;
|
|
624
|
+
}>;
|
|
625
|
+
|
|
626
|
+
/** Controls which kernel details a compiled graph exposes to inspectors. */
|
|
627
|
+
export type GPUCommandGraphCompileOptions = {
|
|
628
|
+
/** Collect declared kernel metadata. Use 'source' to also include WGSL text. */
|
|
629
|
+
kernelMetadata?: 'layout' | 'source';
|
|
630
|
+
};
|
|
631
|
+
|
|
615
632
|
/** Immutable per-node workload entry in a compiled graph preflight report. */
|
|
616
633
|
export type GPUCommandGraphNodePreflight = Readonly<
|
|
617
634
|
Required<Omit<GPUCommandGraphNodeWorkloadEstimate, 'operation' | 'variant'>> & {
|
|
@@ -619,6 +636,7 @@ export type GPUCommandGraphNodePreflight = Readonly<
|
|
|
619
636
|
type: GPUCommandGraphNodeType;
|
|
620
637
|
description?: string;
|
|
621
638
|
resources?: readonly GPUCommandGraphResourceSummary[];
|
|
639
|
+
kernel?: GPUCommandGraphKernelMetadata;
|
|
622
640
|
operation?: string;
|
|
623
641
|
variant?: string;
|
|
624
642
|
publication?: Readonly<GPUCommandGraphNodePublication>;
|
|
@@ -651,6 +669,8 @@ export type GPUCommandGraphComputeNode<Parameters> = GPUCommandGraphNodeBase<
|
|
|
651
669
|
> & {
|
|
652
670
|
/** Node discriminator. */
|
|
653
671
|
type: 'compute';
|
|
672
|
+
/** Optional kernel details for graph inspection. */
|
|
673
|
+
kernel?: GPUCommandGraphKernelMetadata;
|
|
654
674
|
/** Creates reusable node resources and the encode callback. */
|
|
655
675
|
compile: (context: GPUCommandGraphCompileContext) => GPUCommandGraphComputeExecutable<Parameters>;
|
|
656
676
|
/** Creates reusable node resources through asynchronous backend compilation when available. */
|
|
@@ -61,6 +61,7 @@ import type {
|
|
|
61
61
|
GPUCommandGraphNodeEncodingStats,
|
|
62
62
|
GPUCommandGraphNodeTiming,
|
|
63
63
|
GPUCommandGraphNodePreflight,
|
|
64
|
+
GPUCommandGraphCompileOptions,
|
|
64
65
|
GPUCommandGraphNodePublication,
|
|
65
66
|
GPUCommandGraphPreflightReport,
|
|
66
67
|
GPUCommandGraphRenderExecutable,
|
|
@@ -108,6 +109,8 @@ export type {
|
|
|
108
109
|
GPUCommandGraphNodeConditionPreflight,
|
|
109
110
|
GPUCommandGraphNodeEncodingStats,
|
|
110
111
|
GPUCommandGraphNodePreflight,
|
|
112
|
+
GPUCommandGraphCompileOptions,
|
|
113
|
+
GPUCommandGraphKernelMetadata,
|
|
111
114
|
GPUCommandGraphResourceSummary,
|
|
112
115
|
GPUCommandGraphNodePublication,
|
|
113
116
|
GPUCommandGraphNodeTiming,
|
|
@@ -987,7 +990,7 @@ export class GPUCommandGraphBuilder<Parameters = void> {
|
|
|
987
990
|
*
|
|
988
991
|
* @returns An executable graph that owns compiled node state and transient allocations.
|
|
989
992
|
*/
|
|
990
|
-
compile(): CompiledGPUCommandGraph<Parameters> {
|
|
993
|
+
compile(options: GPUCommandGraphCompileOptions = {}): CompiledGPUCommandGraph<Parameters> {
|
|
991
994
|
this.assertMutable();
|
|
992
995
|
assertDeviceAvailable(this.device, 'compilation');
|
|
993
996
|
this.compiled = true;
|
|
@@ -998,7 +1001,8 @@ export class GPUCommandGraphBuilder<Parameters = void> {
|
|
|
998
1001
|
buffers: this.buffers,
|
|
999
1002
|
textures: this.textures,
|
|
1000
1003
|
externalTextures: this.externalTextures,
|
|
1001
|
-
nodes: this.nodes
|
|
1004
|
+
nodes: this.nodes,
|
|
1005
|
+
kernelMetadata: options.kernelMetadata
|
|
1002
1006
|
})
|
|
1003
1007
|
);
|
|
1004
1008
|
}
|
|
@@ -1015,7 +1019,9 @@ export class GPUCommandGraphBuilder<Parameters = void> {
|
|
|
1015
1019
|
*
|
|
1016
1020
|
* @returns An executable graph whose pipelines are ready before the promise resolves.
|
|
1017
1021
|
*/
|
|
1018
|
-
async compileAsync(
|
|
1022
|
+
async compileAsync(
|
|
1023
|
+
options: GPUCommandGraphCompileOptions = {}
|
|
1024
|
+
): Promise<CompiledGPUCommandGraph<Parameters>> {
|
|
1019
1025
|
this.assertMutable();
|
|
1020
1026
|
assertDeviceAvailable(this.device, 'compilation');
|
|
1021
1027
|
this.compiled = true;
|
|
@@ -1026,7 +1032,8 @@ export class GPUCommandGraphBuilder<Parameters = void> {
|
|
|
1026
1032
|
buffers: this.buffers,
|
|
1027
1033
|
textures: this.textures,
|
|
1028
1034
|
externalTextures: this.externalTextures,
|
|
1029
|
-
nodes: this.nodes
|
|
1035
|
+
nodes: this.nodes,
|
|
1036
|
+
kernelMetadata: options.kernelMetadata
|
|
1030
1037
|
})
|
|
1031
1038
|
);
|
|
1032
1039
|
}
|
|
@@ -23,12 +23,24 @@ export function getBoundedDispatchLayout(
|
|
|
23
23
|
throw new Error(`${operationName} element count must be a non-negative uint32`);
|
|
24
24
|
}
|
|
25
25
|
validateWorkgroupSize(operationName, workgroupSize);
|
|
26
|
+
return getBoundedWorkgroupLayout(
|
|
27
|
+
operationName,
|
|
28
|
+
Math.max(1, Math.ceil(elementCount / workgroupSize)),
|
|
29
|
+
maxComputeWorkgroupsPerDimension
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Plans a bounded dispatch for kernels that index their work directly by workgroup. Requires a positive count. @internal */
|
|
34
|
+
export function getBoundedWorkgroupLayout(
|
|
35
|
+
operationName: string,
|
|
36
|
+
workgroupCount: number,
|
|
37
|
+
maxComputeWorkgroupsPerDimension: number
|
|
38
|
+
): GPUBoundedDispatchLayout {
|
|
26
39
|
const maximum = Math.floor(maxComputeWorkgroupsPerDimension);
|
|
27
40
|
if (!Number.isSafeInteger(maximum) || maximum < 1) {
|
|
28
41
|
throw new Error('maxComputeWorkgroupsPerDimension must be a positive integer');
|
|
29
42
|
}
|
|
30
43
|
|
|
31
|
-
const workgroupCount = Math.max(1, Math.ceil(elementCount / workgroupSize));
|
|
32
44
|
const x = Math.min(workgroupCount, maximum);
|
|
33
45
|
const y = Math.min(Math.ceil(workgroupCount / x), maximum);
|
|
34
46
|
const z = Math.ceil(workgroupCount / x / y);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
import {GPU_GRID_COORDINATE_WGSL} from './gpu-grid-coordinate';
|
|
5
6
|
import type {GPUCommandNode} from './gpu-command-node';
|
|
6
7
|
import {
|
|
7
8
|
GPUCommandGraph,
|
|
@@ -346,11 +347,7 @@ ${boundsBinding}
|
|
|
346
347
|
@group(0) @binding(${outputBinding}) var<storage, read_write> outputValues: array<atomic<u32>>;
|
|
347
348
|
${countsBinding}
|
|
348
349
|
|
|
349
|
-
|
|
350
|
-
if (maximum == minimum || value == minimum) { return 0u; }
|
|
351
|
-
if (value == maximum) { return size - 1u; }
|
|
352
|
-
return min(u32((value - minimum) / (maximum - minimum) * f32(size)), size - 1u);
|
|
353
|
-
}
|
|
350
|
+
${GPU_GRID_COORDINATE_WGSL}
|
|
354
351
|
|
|
355
352
|
${getAggregationFunction(aggregation.operation)}
|
|
356
353
|
${useSubgroups ? getSubgroupBallotHelpersWGSL() : ''}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
import {GPU_GRID_COORDINATE_WGSL} from './gpu-grid-coordinate';
|
|
5
6
|
import type {GPUCommandNode} from './gpu-command-node';
|
|
6
7
|
import {
|
|
7
8
|
GPUCommandGraph,
|
|
@@ -291,11 +292,7 @@ ${boundsBinding}
|
|
|
291
292
|
${local ? `var<workgroup> localCounts: array<atomic<u32>, ${binning.output.length}>;` : ''}
|
|
292
293
|
${useSubgroups ? getSubgroupBallotHelpersWGSL() : ''}
|
|
293
294
|
|
|
294
|
-
|
|
295
|
-
if (maximum == minimum || value == minimum) { return 0u; }
|
|
296
|
-
if (value == maximum) { return size - 1u; }
|
|
297
|
-
return min(u32((value - minimum) / (maximum - minimum) * f32(size)), size - 1u);
|
|
298
|
-
}
|
|
295
|
+
${GPU_GRID_COORDINATE_WGSL}
|
|
299
296
|
|
|
300
297
|
@compute @workgroup_size(${GRID_WORKGROUP_SIZE}) fn main(
|
|
301
298
|
@builtin(workgroup_id) workgroupId: vec3<u32>,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* WGSL `getCoordinate(value, minimum, maximum, size)` for grids.
|
|
7
|
+
* Supply a finite value, inclusive bounds, and a positive cell count.
|
|
8
|
+
* Coordinates outside the bounds clamp to the first or last cell.
|
|
9
|
+
*/
|
|
10
|
+
export const GPU_GRID_COORDINATE_WGSL = `fn getCoordinate(value: f32, minimum: f32, maximum: f32, size: u32) -> u32 {
|
|
11
|
+
if (maximum == minimum || value <= minimum) { return 0u; }
|
|
12
|
+
if (value >= maximum) { return size - 1u; }
|
|
13
|
+
if (minimum < 0.0 && maximum > 3.402823466e+38 + minimum) {
|
|
14
|
+
let scale = max(abs(minimum), abs(maximum));
|
|
15
|
+
let scaledValue = value / scale;
|
|
16
|
+
let scaledMinimum = minimum / scale;
|
|
17
|
+
let scaledMaximum = maximum / scale;
|
|
18
|
+
return min(
|
|
19
|
+
u32((scaledValue - scaledMinimum) / (scaledMaximum - scaledMinimum) * f32(size)),
|
|
20
|
+
size - 1u
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
return min(u32((value - minimum) / (maximum - minimum) * f32(size)), size - 1u);
|
|
24
|
+
}`;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
import {GPU_GRID_COORDINATE_WGSL} from './gpu-grid-coordinate';
|
|
5
6
|
import {type GPUCommandNode} from './gpu-command-node';
|
|
6
7
|
import {type GPUCommandGraph, type GraphDataView} from './gpu-command-graph';
|
|
7
8
|
import {
|
|
@@ -246,21 +247,7 @@ const DEPTH: u32 = ${depth}u;
|
|
|
246
247
|
@group(0) @binding(0) var<storage, read> positions: array<f32>;
|
|
247
248
|
${bindings}
|
|
248
249
|
|
|
249
|
-
|
|
250
|
-
if (maximum == minimum || value == minimum) { return 0u; }
|
|
251
|
-
if (value == maximum) { return size - 1u; }
|
|
252
|
-
if (minimum < 0.0 && maximum > 0.0) {
|
|
253
|
-
let scale = max(abs(minimum), abs(maximum));
|
|
254
|
-
let scaledValue = value / scale;
|
|
255
|
-
let scaledMinimum = minimum / scale;
|
|
256
|
-
let scaledMaximum = maximum / scale;
|
|
257
|
-
return min(
|
|
258
|
-
u32((scaledValue - scaledMinimum) / (scaledMaximum - scaledMinimum) * f32(size)),
|
|
259
|
-
size - 1u
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
return min(u32((value - minimum) / (maximum - minimum) * f32(size)), size - 1u);
|
|
263
|
-
}
|
|
250
|
+
${GPU_GRID_COORDINATE_WGSL}
|
|
264
251
|
|
|
265
252
|
@compute @workgroup_size(256)
|
|
266
253
|
fn main(@builtin(workgroup_id) workgroupId: vec3u, @builtin(local_invocation_index) localInvocationIndex: u32) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
import {GPU_GRID_COORDINATE_WGSL} from './gpu-grid-coordinate';
|
|
5
6
|
import {type GPUCommandNode} from './gpu-command-node';
|
|
6
7
|
import {GPUCommandGraph, type GraphDataView, type GraphVectorView} from './gpu-command-graph';
|
|
7
8
|
import type {GPUGridIndexBounds, GPUGridIndexSize} from './gpu-grid-index';
|
|
@@ -223,22 +224,7 @@ fn finite(value: f32) -> bool {
|
|
|
223
224
|
return value == value && abs(value) <= 3.402823466e+38;
|
|
224
225
|
}
|
|
225
226
|
|
|
226
|
-
|
|
227
|
-
if (!finite(value)) { return 0u; }
|
|
228
|
-
if (maximum == minimum || value == minimum) { return 0u; }
|
|
229
|
-
if (value == maximum) { return size - 1u; }
|
|
230
|
-
if (minimum < 0.0 && maximum > 0.0) {
|
|
231
|
-
let scale = max(abs(minimum), abs(maximum));
|
|
232
|
-
let scaledValue = value / scale;
|
|
233
|
-
let scaledMinimum = minimum / scale;
|
|
234
|
-
let scaledMaximum = maximum / scale;
|
|
235
|
-
return min(
|
|
236
|
-
u32((scaledValue - scaledMinimum) / (scaledMaximum - scaledMinimum) * f32(size)),
|
|
237
|
-
size - 1u
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
return min(u32((value - minimum) / (maximum - minimum) * f32(size)), size - 1u);
|
|
241
|
-
}
|
|
227
|
+
${GPU_GRID_COORDINATE_WGSL}
|
|
242
228
|
fn cellMinimum(coordinate: u32, size: u32, minimum: f32, maximum: f32) -> f32 {
|
|
243
229
|
let ratio = f32(coordinate) / f32(size);
|
|
244
230
|
return minimum * (1.0 - ratio) + maximum * ratio;
|