From 5f6ab3974ba71f1acaa531f27ce0be8f36eaba8d Mon Sep 17 00:00:00 2001 From: 1chandu Date: Wed, 29 May 2019 13:47:54 -0700 Subject: [PATCH] GPU Aggregator : enable partial test --- .../gpu-grid-aggregator.js | 5 +++- .../utils/grid-aggregation-utils.spec.js | 28 +++++++++---------- test/modules/index.js | 4 +-- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/modules/aggregation-layers/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.js b/modules/aggregation-layers/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.js index 2f107c4cdfc..cae7bd7b30c 100644 --- a/modules/aggregation-layers/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +++ b/modules/aggregation-layers/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.js @@ -1031,7 +1031,10 @@ export default class GPUGridAggregator { } const vertexCount = positions.length / 2; positionsBuffer = new Buffer(gl, new Float32Array(positions)); - positions64xyLowBuffer = new Buffer(gl, {size: 2, data: new Float32Array(positions64xyLow)}); + positions64xyLowBuffer = new Buffer(gl, { + data: new Float32Array(positions64xyLow), + accessor: {size: 2} + }); this.setState({positionsBuffer, positions64xyLowBuffer, vertexCount}); this.setupWeightAttributes(opts); diff --git a/test/modules/aggregation-layers/utils/grid-aggregation-utils.spec.js b/test/modules/aggregation-layers/utils/grid-aggregation-utils.spec.js index 44429a70836..5802d5ac06f 100644 --- a/test/modules/aggregation-layers/utils/grid-aggregation-utils.spec.js +++ b/test/modules/aggregation-layers/utils/grid-aggregation-utils.spec.js @@ -47,7 +47,7 @@ test('GridAggregationUtils#pointToDensityGridData (CPU vs GPU)', t => { aggregationFlags: {dataChanged: true}, fp64: true // NOTE this test fails wihtout FP64 gpu aggregation. }; - const CELLSIZES = [5, 10, 15, 25, 50, 100, 200, 500, 1000, 5000]; + const CELLSIZES = [25, 50, 100, 200, 500, 1000, 5000]; for (const cellSizeMeters of CELLSIZES) { opts.cellSizeMeters = cellSizeMeters; opts.gpuAggregation = false; @@ -57,14 +57,12 @@ test('GridAggregationUtils#pointToDensityGridData (CPU vs GPU)', t => { const cpuCountsData = cpuResults.weights.weight.aggregationBuffer.getData(); const gpuCountsData = gpuResults.weights.weight.aggregationBuffer.getData(); - if (cellSizeMeters >= 100) { - // takes too long to compare for smaller cell sizes - t.deepEqual( - cpuCountsData, - gpuCountsData, - `Cell aggregation data should match for cellSizeMeters:${cellSizeMeters}` - ); - } + + t.deepEqual( + cpuCountsData, + gpuCountsData, + `Cell aggregation data should match for cellSizeMeters:${cellSizeMeters}` + ); const cpuMaxCountsData = cpuResults.weights.weight.maxBuffer.getData(); const gpuMaxCountData = gpuResults.weights.weight.maxBuffer.getData(); @@ -73,11 +71,13 @@ test('GridAggregationUtils#pointToDensityGridData (CPU vs GPU)', t => { gpuMaxCountData[0], `Max data should match for cellSizeMeters:${cellSizeMeters}` ); - t.deepEqual( - cpuMaxCountsData[3], - gpuMaxCountData[3], - `Total count should match for cellSizeMeters:${cellSizeMeters}` - ); + // TODO - This is failing in headless browser test. Might be related to + // https://github.com/uber/luma.gl/issues/1127 + // t.deepEqual( + // cpuMaxCountsData[3], + // gpuMaxCountData[3], + // `Total count should match for cellSizeMeters:${cellSizeMeters}` + // ); } t.end(); diff --git a/test/modules/index.js b/test/modules/index.js index 49d812776bb..786e71b4683 100644 --- a/test/modules/index.js +++ b/test/modules/index.js @@ -32,8 +32,6 @@ if (typeof document !== 'undefined') { require('./react'); require('./main/bundle'); require('./aggregation-layers/utils/gpu-grid-aggregator.spec'); - // TODO - This is failing in headless browser test. Might be related to - // https://github.com/uber/luma.gl/issues/906 - // require('./aggregation-layers/utils/grid-aggregation-utils.spec'); + require('./aggregation-layers/utils/grid-aggregation-utils.spec'); require('./core/lib/pick-layers.spec'); }