Skip to content

Commit

Permalink
chore: gpuAggregation set to true (#9301)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixpalmer authored Dec 22, 2024
1 parent 5a41ddd commit 05f8c95
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 12 deletions.
4 changes: 2 additions & 2 deletions examples/layer-browser/src/examples/aggregation-layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const ContourLayerExample = {
id: 'contourLayer',
cellSize: 200,
getPosition: d => d.COORDINATES,
gpuAggregation: false, // TODO(v9): Re-enable GPU aggregation.
gpuAggregation: true,
contours: [
{threshold: 1, color: [255, 0, 0], strokeWidth: 4},
{threshold: 5, color: [0, 255, 0], strokeWidth: 2},
Expand All @@ -47,7 +47,7 @@ const ContourLayerBandsExample = {
id: 'contourLayer',
cellSize: 200,
getPosition: d => d.COORDINATES,
gpuAggregation: false, // TODO(v9): Re-enable GPU aggregation.
gpuAggregation: true,
contours: [
{threshold: [1, 5], color: [255, 0, 0]},
{threshold: [5, 15], color: [0, 255, 0]},
Expand Down
2 changes: 1 addition & 1 deletion examples/website/3d-heatmap/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function App({
const layers = [
new HexagonLayer<DataPoint>({
id: 'heatmap',
// gpuAggregation: true,
gpuAggregation: true,
colorRange,
coverage,
data,
Expand Down
2 changes: 1 addition & 1 deletion examples/website/screen-grid/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type DataPoint = [longitude: number, latitude: number, count: number];
export default function App({
data = DATA_URL,
cellSize = 20,
gpuAggregation = false, // TODO(v9): Re-enable GPU aggregation.
gpuAggregation = true,
aggregation = 'SUM',
mapStyle = MAP_STYLE
}: {
Expand Down
4 changes: 2 additions & 2 deletions modules/aggregation-layers/src/grid-layer/grid-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {BinOptions, binOptionsUniforms} from './bin-options-uniforms';
function noop() {}

const defaultProps: DefaultProps<GridLayerProps> = {
gpuAggregation: false,
gpuAggregation: true,

// color
colorDomain: null,
Expand Down Expand Up @@ -239,7 +239,7 @@ type _GridLayerProps<DataT> = {

/**
* When set to true, aggregation is performed on GPU, provided other conditions are met.
* @default false
* @default true
*/
gpuAggregation?: boolean;
};
Expand Down
4 changes: 2 additions & 2 deletions modules/aggregation-layers/src/hexagon-layer/hexagon-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {BinOptions, binOptionsUniforms} from './bin-options-uniforms';
function noop() {}

const defaultProps: DefaultProps<HexagonLayerProps> = {
gpuAggregation: false,
gpuAggregation: true,

// color
colorDomain: null,
Expand Down Expand Up @@ -241,7 +241,7 @@ type _HexagonLayerProps<DataT> = {

/**
* When set to true, aggregation is performed on GPU, provided other conditions are met.
* @default false
* @default true
*/
gpuAggregation?: boolean;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const defaultProps: DefaultProps<ScreenGridLayerProps> = {
getPosition: {type: 'accessor', value: (d: any) => d.position},
getWeight: {type: 'accessor', value: 1},

gpuAggregation: false,
gpuAggregation: true,
aggregation: 'SUM'
};

Expand Down
14 changes: 13 additions & 1 deletion test/modules/aggregation-layers/grid-layer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,22 @@ test('GridLayer#getAggregatorType', t => {
{
title: 'Default',
props: SAMPLE_PROPS,
onAfterUpdate({layer}) {
t.ok(
layer.state.aggregator instanceof WebGLAggregator,
'By default should use GPU Aggregation'
);
}
},
{
title: 'Disable gpuAggregation',
updateProps: {
gpuAggregation: false
},
onAfterUpdate({layer}) {
t.ok(
layer.state.aggregator instanceof CPUAggregator,
'By default should use CPU Aggregation'
'Should use CPU Aggregation (gpuAggregation: false)'
);
}
},
Expand Down
14 changes: 13 additions & 1 deletion test/modules/aggregation-layers/hexagon-layer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,22 @@ test('HexagonLayer#getAggregatorType', t => {
{
title: 'Default',
props: SAMPLE_PROPS,
onAfterUpdate({layer}) {
t.ok(
layer.state.aggregator instanceof WebGLAggregator,
'By default should use GPU Aggregation'
);
}
},
{
title: 'Disable gpuAggregation',
updateProps: {
gpuAggregation: false
},
onAfterUpdate({layer}) {
t.ok(
layer.state.aggregator instanceof CPUAggregator,
'By default should use CPU Aggregation'
'Should use CPU Aggregation (gpuAggregation: false)'
);
}
},
Expand Down
2 changes: 1 addition & 1 deletion website/src/examples/screen-grid-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ScreenGridDemo extends Component {
};

static parameters = {
gpuAggregation: {displayName: 'GPU Acceleration', type: 'checkbox', value: false},
gpuAggregation: {displayName: 'GPU Acceleration', type: 'checkbox', value: true},
cellSize: {displayName: 'Cell Size', type: 'range', value: 5, step: 1, min: 1, max: 20}
};

Expand Down

0 comments on commit 05f8c95

Please sign in to comment.