Integrate all aggregation layers with AttributeManager#3777
Conversation
8575a6b to
9c4390c
Compare
e8878cd to
ecb418d
Compare
| 'filterTransformColor' | ||
| ]; | ||
|
|
||
| export default class AggregationLayer extends CompositeLayer { |
There was a problem hiding this comment.
Not using Layer as base class, doing so I have to copy _renderLayers method.
| dataChanged = true; | ||
| // Clear countsData cache | ||
| const dataChanged = this._isAggregationDirty(opts); | ||
| const cellSizeChanged = opts.oldProps.cellSize !== opts.props.cellSize; |
There was a problem hiding this comment.
Aggregator needs dataChanged and cellSIzeChanged flags seperately, so in CPU aggregation path, projection is not performed when only cell size is changed, cellSize can be added to aggregationProps, once CPU Aggregation is moved out of aggregator.
c588a1c to
3560917
Compare
| const {compareProps} = experimental; | ||
|
|
||
| // props when changed results in new uniforms that requires re-aggregation | ||
| const UNIFORM_PROPS = [ |
There was a problem hiding this comment.
Layers should not be aware of the implementation detail of extensions. This is not going to scale when we support other extensions.
There was a problem hiding this comment.
Yeah, thought about it, ideal solution for this would be the extension itself expose these props and our existing prop diffing, differentiate these prop changes with existing changeFlags.propsChanged, so that aggregation is only run when these props are changed (not when any prop changed).
We don't need this for non composite layers, because we render the layers any time a prop is changed, but that is un-necessary and expensive for aggregation layers. I can create a task for this.
There was a problem hiding this comment.
Maybe you can add a LayerExtension.needsRedraw() method for this purpose?
|
|
||
| // viewport is needed only when performing screen space aggregation (projectPoints is true) | ||
| log.assert(!(changeFlags.viewportChanged && projectPoints) || opts.viewport); | ||
| log.assert(!(changeFlags.viewportChanged && projectPoints) || opts.moduleSettings.viewport); |
There was a problem hiding this comment.
Do not use assert unless checking for user error. GPUGridAggregator is considered an internal component.
There was a problem hiding this comment.
validateProps props method is validating various parameter combinations, once CPU aggregation is moved out and other refactors done, I can remove it altogether, till then this is handy to catch errors. For now commenting out.
|
|
||
| const shaders = mergeShaders( | ||
| { | ||
| vs: fp64 ? AGGREGATE_TO_GRID_VS_FP64 : AGGREGATE_TO_GRID_VS, |
There was a problem hiding this comment.
Drop legacy fp64 support
There was a problem hiding this comment.
I had issues enabling fp64 extension, I have todo item in the issue.
Aggregation only needs fp64 module not the project64, will cleanup this code in a seperate PR.
| } | ||
| } | ||
|
|
||
| setupAggregationModel(fp64 = false) { |
There was a problem hiding this comment.
Why create a (public) method for a function that is only 3 lines? Same for getAggregationModel and getAllAggregationModel - these negatively impact the bundle size. Either merge them or make them utility functions outside of this class.
There was a problem hiding this comment.
Took pass on class methods, moved several into helper methods, will make more deeper look in future aggregator specific PRs.
| } | ||
|
|
||
| _setModelAttributes(model, changedAttributes) { | ||
| _getShaderAttributes(attributes, excludeAttributes = {}) { |
There was a problem hiding this comment.
Move to AttributeManager
* Aggregation-layers: GPUAggregation: Integrate with AttributeManager * Clear HeatmapLayer debounce timer
* Aggregation-layers: GPUAggregation: Integrate with AttributeManager * Clear HeatmapLayer debounce timer
For #3583
Background
Integrate all aggregation layers (except
HexagonLayerandCPUGridLayer) withAttributeManagerso that :AttributeManagerdata-filterextension.At a high level these changes include
updateState, so all aggregation layers can re-run aggregation with latest attributes during update cycle. (regularCompositelayers don't do this)Compositelayers only.data-filterprops change.Remaining items:
AttributeManagerfor CPU aggregation, which includesHexagonLayer,CPUGridLayerand CPU Aggregation path ofScreenGridLayer.data-filterextension for above CPU aggregation paths.Change List