Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PART-3] CPUAggregation Refactor : Remove CPU Aggregation from GPUGri…
…dAggregator (#3953) * GPUAggregator: Remove CPU Aggregation support * Consolidate CPU Aggregation * ContourLayer: only perform shallow compare for contours prop, individual triggers not needed anymore * Conver matrix multiply to translation/scaling * Remove fp64 flag and dependency on project64 module * Unify screenspace projections, remove usage of gridTransformMatrix * Use 3D position for CPU and GPU aggregation * GPUAggregation: use 64 bit position attribute
- Loading branch information
Showing
34 changed files
with
1,302 additions
and
1,640 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# AggregationLayer | ||
|
||
All of the layers in `@deck.gl/aggregation-layers` module perform some sort of data aggregation. All these layers perform aggregation with different parameters (CPU vs GPU, aggregation to rectangular bins vs hexagon bins, world space vs screen space, aggregation of single weight vs multiple weights etc). | ||
|
||
`AggregationLayer` and `GridAggregationLayer` perform most of the common tasks for aggregation with flexibility of customizations. This document describes what `AggregationLayer` does and how to use it in other aggregation layers. | ||
|
||
|
||
`AggregationLayer` is subclassed form `CompositeLayer` and all layers in `@deck.gl/aggregation-layers` are subclassed from this Layer. | ||
|
||
### Integration with `AttributeManager` | ||
|
||
This layer creates `AttributeManager` and makes it available for its subclasses. Any aggregation layer can add attributes to the `AttributeManager` and retrieve them using `getAttributes` method. This enables using `AttributeManager`'s features and optimization for using attributes. Also manual iteration of `data` prop can be removed and attributes can be directly set on GPU aggregation models or accessed directly for CPU aggregation. | ||
|
||
Example: Adding attributes to an aggregation layer | ||
|
||
``` | ||
const attributeManager = this.getAttributeManager(); | ||
attributeManager.add({ | ||
positions: {size: 3, accessor: 'getPosition'}, | ||
color: {size: 3, accessor: 'getColorWeight'}, | ||
elevation: {size: 3, accessor: 'getElevationWeight'} | ||
}); | ||
``` | ||
|
||
### updateState() | ||
|
||
During update state, Subclasses of `AggregationLayer` must first call 'super.updateState()', which calls | ||
|
||
- `updateShaders(shaders)` : Subclasses can override this if they need to update shaders, for example, when performing GPU aggregation, aggregation shaders must be merged with argument of this function to correctly apply `extensions`. | ||
|
||
- `_updateAttributes`: This checks and updates attributes based on updated props. | ||
|
||
### Checking if aggregation is dirty | ||
|
||
Constructor, takes an array of props, `aggregationProps`, and a private method `isAggregationDirty()` is provided that returns `true` when any of the props in `aggregationProps` are changed. Subclasses can customize this to desired props by providing `aggregatinProps` array. |
Oops, something went wrong.