From b1e0ba79d1fbd419de47282d9fa991423ee47279 Mon Sep 17 00:00:00 2001 From: Xiaoji Chen Date: Wed, 13 Mar 2024 19:12:48 -0700 Subject: [PATCH] Restore shaderlib test cases (#8652) --- package.json | 8 - .../project/project-32-64-glsl.spec.ts | 246 ++++-------- .../project/project-functions.spec.ts | 64 ++-- .../project/project-glsl-test-utils.ts | 62 ++-- .../shaderlib/project/project-glsl.spec.ts | 350 +++++++++--------- .../project/viewport-uniforms.spec.ts | 43 +-- .../core/shaderlib/shaderlib-test-utils.ts | 31 -- yarn.lock | 101 +---- 8 files changed, 333 insertions(+), 572 deletions(-) delete mode 100644 test/modules/core/shaderlib/shaderlib-test-utils.ts diff --git a/package.json b/package.json index 91f9a5a9720..8938d8c1316 100644 --- a/package.json +++ b/package.json @@ -17,13 +17,6 @@ "workspaces": [ "modules/*" ], - "resolution_comments": { - "escaper": "v2 has an invalid main field in package.json, breaks esbuild during browser test", - "vite": "process polyfill missing" - }, - "resolutions": { - "escaper": "3.0.6" - }, "scripts": { "bootstrap": "yarn && ocular-bootstrap", "postinstall": "./scripts/postinstall.sh", @@ -66,7 +59,6 @@ "@types/react": "^18.2.0", "abortcontroller-polyfill": "^1.5.0", "babel-loader": "^8.0.0", - "glsl-transpiler": "^1.8.6", "jsdom": "^20.0.0", "ocular-dev-tools": "2.0.0-alpha.29", "pre-commit": "^1.2.2", diff --git a/test/modules/core/shaderlib/project/project-32-64-glsl.spec.ts b/test/modules/core/shaderlib/project/project-32-64-glsl.spec.ts index cb4e7dbe76f..65503af3185 100644 --- a/test/modules/core/shaderlib/project/project-32-64-glsl.spec.ts +++ b/test/modules/core/shaderlib/project/project-32-64-glsl.spec.ts @@ -19,23 +19,17 @@ // THE SOFTWARE. import test from 'tape-promise/tape'; -import {GL} from '@luma.gl/constants'; -import assert from 'assert'; // import {COORDINATE_SYSTEM, Viewport, WebMercatorViewport} from 'deck.gl'; -import {COORDINATE_SYSTEM, WebMercatorViewport} from 'deck.gl'; -import {project, project32} from '@deck.gl/core'; +import {COORDINATE_SYSTEM, WebMercatorViewport, project, project32} from '@deck.gl/core'; import {project64} from '@deck.gl/extensions'; // import {Matrix4, config} from '@math.gl/core'; import {config} from '@math.gl/core'; -import {device} from '@deck.gl/test-utils'; import {fp64} from '@luma.gl/shadertools'; const {fp64LowPart} = fp64; -import {getPixelOffset, clipspaceToScreen, runOnGPU, verifyResult} from './project-glsl-test-utils'; +import {getPixelOffset, runOnGPU, verifyGPUResult} from './project-glsl-test-utils'; -import {compileVertexShader} from '../shaderlib-test-utils'; - -const PIXEL_TOLERANCE = 0.01; +const PIXEL_TOLERANCE = 0.001; const TEST_VIEWPORT = new WebMercatorViewport({ longitude: -122, @@ -57,51 +51,41 @@ const TEST_VIEWPORT_HIGH_ZOOM = new WebMercatorViewport({ height: 600 }); -const DUMMY_SOURCE_BUFFER = device.createBuffer({byteLength: 1}); -const OUT_BUFFER = device.createBuffer({byteLength: 16}); - -// used in printing a float into GLSL code, 1 will be 1.0 to avoid GLSL compile errors -const MAX_FRACTION_DIGITS = 20; -// convert given array to a GLSL vec2/3/4 string -function toGLSLVec(array) { - if (!Array.isArray(array) || array.length < 2 || array.length > 4) { - throw new Error('Invalid vector array'); - } - let vecString = `vec${array.length}(`; - array.forEach(value => { - vecString += `${value.toFixed(MAX_FRACTION_DIGITS)}, `; - }); - // remove last , and space - vecString = `${vecString.slice(0, -2)})`; - return vecString; -} - const TRANSFORM_VS = { - project_position_to_clipspace: (pos, pos64Low = [0, 0, 0]) => `\ + project_position_to_clipspace: `\ #version 300 es -out vec4 outValue; +uniform vec3 uPos; +uniform vec3 uPos64Low; +out vec3 outValue; void main() { - geometry.worldPosition = ${toGLSLVec(pos)}; - outValue = project_position_to_clipspace(${toGLSLVec(pos)}, ${toGLSLVec( - pos64Low - )}, vec3(0, 0, 0)); + geometry.worldPosition = uPos; + vec4 glPos = project_position_to_clipspace(uPos, uPos64Low, vec3(0, 0, 0)); + outValue = glPos.xyz / glPos.w; + outValue = vec3( + (1.0 + outValue.x) / 2.0 * project_uViewportSize.x, + (1.0 - outValue.y) / 2.0 * project_uViewportSize.y, + outValue.z + ); } `, - project_position_to_clipspace_world_position: (pos, pos64Low = [0, 0, 0]) => `\ + project_position_to_clipspace_world_position: `\ #version 300 es +uniform vec3 uPos; +uniform vec3 uPos64Low; out vec4 outValue; void main() { - geometry.worldPosition = ${toGLSLVec(pos)}; - project_position_to_clipspace(${toGLSLVec(pos)}, ${toGLSLVec(pos64Low)}, vec3(0, 0, 0), outValue); + geometry.worldPosition = uPos; + project_position_to_clipspace(uPos, uPos64Low, vec3(0, 0, 0), outValue); } ` }; + const TEST_CASES = [ { title: 'LNGLAT mode', @@ -112,47 +96,23 @@ const TEST_CASES = [ tests: [ { name: 'project_position_to_clipspace_world_position', - func: ({project_position_to_clipspace}) => { - let worldPosition = []; - project_position_to_clipspace([-122.45, 37.78, 0], [0, 0, 0], [0, 0, 0], worldPosition); - [worldPosition] = project_position_to_clipspace.__out__; - return worldPosition; - }, - output: TEST_VIEWPORT.projectFlat([-122.45, 37.78]).concat([0, 1]), - precision: PIXEL_TOLERANCE, - gpu64BitPrecision: 1e-7, - vs: TRANSFORM_VS.project_position_to_clipspace_world_position( - [-122.45, 37.78, 0], - [fp64LowPart(-122.45), fp64LowPart(37.78), 0] - ) + vs: TRANSFORM_VS.project_position_to_clipspace_world_position, + input: [-122.45, 37.78, 0], + output: TEST_VIEWPORT.projectFlat([-122.45, 37.78]).concat([0, 1]) }, { name: 'project_position_to_clipspace', - skipGPUs: ['Intel', 'Apple'], - func: ({project_position_to_clipspace_vec3_vec3_vec3}) => - project_position_to_clipspace_vec3_vec3_vec3([-122.45, 37.78, 0], [0, 0, 0], [0, 0, 0]), - mapResult: coords => clipspaceToScreen(TEST_VIEWPORT, coords), + vs: TRANSFORM_VS.project_position_to_clipspace, + input: [-122.45, 37.78, 0], output: TEST_VIEWPORT.project([-122.45, 37.78, 0]), - precision: PIXEL_TOLERANCE, - gpu64BitPrecision: 1e-7, - vs: TRANSFORM_VS.project_position_to_clipspace( - [-122.45, 37.78, 0], - [fp64LowPart(-122.45), fp64LowPart(37.78), 0] - ) + precision: PIXEL_TOLERANCE }, { name: 'project_position_to_clipspace (non-zero Z)', - skipGPUs: ['Intel', 'Apple'], - func: ({project_position_to_clipspace_vec3_vec3_vec3}) => - project_position_to_clipspace_vec3_vec3_vec3([-122.45, 37.78, 100], [0, 0, 0], [0, 0, 0]), - mapResult: coords => clipspaceToScreen(TEST_VIEWPORT, coords), + vs: TRANSFORM_VS.project_position_to_clipspace, + input: [-122.45, 37.78, 100], output: TEST_VIEWPORT.project([-122.45, 37.78, 100]), - precision: PIXEL_TOLERANCE, - gpu64BitPrecision: 1e-5, // test fails with 1e-7 - vs: TRANSFORM_VS.project_position_to_clipspace( - [-122.45, 37.78, 100], - [fp64LowPart(-122.45), fp64LowPart(37.78), 0] - ) + precision: PIXEL_TOLERANCE } ] }, @@ -165,40 +125,19 @@ const TEST_CASES = [ tests: [ { name: 'project_position_to_clipspace_world_position', - // disableTranspileFor64: true, - skipGPUs: ['Intel', 'Apple'], - - func: ({project_position_to_clipspace}) => { - let worldPosition = []; - project_position_to_clipspace([-122.05, 37.92, 0], [0, 0, 0], [0, 0, 0], worldPosition); - [worldPosition] = project_position_to_clipspace.__out__; - return worldPosition; - }, + vs: TRANSFORM_VS.project_position_to_clipspace_world_position, + input: [-122.05, 37.92, 0], output: TEST_VIEWPORT_HIGH_ZOOM.projectFlat([-122.05, 37.92]) .map((x, i) => x - TEST_VIEWPORT_HIGH_ZOOM.center[i]) .concat([0, 1]), - output64: TEST_VIEWPORT_HIGH_ZOOM.projectFlat([-122.05, 37.92]).concat([0, 1]), - precision: PIXEL_TOLERANCE, - gpu64BitPrecision: 1e-7, - vs: TRANSFORM_VS.project_position_to_clipspace_world_position( - [-122.05, 37.92, 0], - [fp64LowPart(-122.05), fp64LowPart(37.92), 0] - ) + output64: TEST_VIEWPORT_HIGH_ZOOM.projectFlat([-122.05, 37.92]).concat([0, 1]) }, { name: 'project_position_to_clipspace', - skipGPUs: ['Intel', 'Apple'], - - func: ({project_position_to_clipspace_vec3_vec3_vec3}) => - project_position_to_clipspace_vec3_vec3_vec3([-122.05, 37.92, 0], [0, 0, 0], [0, 0, 0]), - mapResult: coords => clipspaceToScreen(TEST_VIEWPORT_HIGH_ZOOM, coords), + vs: TRANSFORM_VS.project_position_to_clipspace, + input: [-122.05, 37.92, 0], output: TEST_VIEWPORT_HIGH_ZOOM.project([-122.05, 37.92, 0]), - precision: PIXEL_TOLERANCE, - gpu64BitPrecision: 1e-7, - vs: TRANSFORM_VS.project_position_to_clipspace( - [-122.05, 37.92, 0], - [fp64LowPart(-122.05), fp64LowPart(37.92), 0] - ) + precision: PIXEL_TOLERANCE } ] }, @@ -212,50 +151,28 @@ const TEST_CASES = [ tests: [ { name: 'project_position_to_clipspace_world_position', - func: ({project_position_to_clipspace}) => { - let worldPosition = []; - project_position_to_clipspace([0.05, 0.08, 0], [0, 0, 0], [0, 0, 0], worldPosition); - [worldPosition] = project_position_to_clipspace.__out__; - return worldPosition; - }, + vs: TRANSFORM_VS.project_position_to_clipspace_world_position, + input: [0.05, 0.08, 0], output: getPixelOffset( TEST_VIEWPORT.projectPosition([-122, 38, 0]), TEST_VIEWPORT.projectPosition([-122.05, 37.92, 0]) - ), - precision: PIXEL_TOLERANCE, - gpu64BitPrecision: 1e-7, - vs: TRANSFORM_VS.project_position_to_clipspace_world_position( - [0.05, 0.08, 0], - [fp64LowPart(0.05), fp64LowPart(0.08), 0] ) }, { name: 'project_position_to_clipspace', - - func: ({project_position_to_clipspace_vec3_vec3_vec3}) => - project_position_to_clipspace_vec3_vec3_vec3([0.05, 0.08, 0], [0, 0, 0], [0, 0, 0]), - mapResult: coords => clipspaceToScreen(TEST_VIEWPORT, coords), + vs: TRANSFORM_VS.project_position_to_clipspace, + input: [0.05, 0.08, 0], output: TEST_VIEWPORT.project([-122, 38, 0]), - precision: PIXEL_TOLERANCE, - gpu64BitPrecision: 1e-7, - vs: TRANSFORM_VS.project_position_to_clipspace( - [0.05, 0.08, 0], - [fp64LowPart(0.05), fp64LowPart(0.08), 0] - ) + precision: PIXEL_TOLERANCE } ] } ]; -// TODO v9 re-enable -test.skip('project32&64#vs', async t => { +test('project32&64#vs', async t => { const oldEpsilon = config.EPSILON; - for (const usefp64 of [false, true]) { - // TODO - luma.gl v9 test disablement - if (usefp64 && device.info.gpu === 'apple') { - continue; - } + for (const usefp64 of [false, true]) { /* eslint-disable max-nested-callbacks, complexity */ for (const testCase of TEST_CASES) { if (usefp64 && testCase.params.coordinateSystem !== COORDINATE_SYSTEM.LNGLAT) { @@ -267,54 +184,34 @@ test.skip('project32&64#vs', async t => { let uniforms = project.getUniforms(testCase.params); if (usefp64) { - uniforms = Object.assign(uniforms, project64.getUniforms(testCase.params, uniforms)); + uniforms = { + ...uniforms, + ...project64.getUniforms(testCase.params, uniforms), + // fp64arithmetic uniform + ONE: 1.0 + }; } for (const c of testCase.tests) { const expected = (usefp64 && c.output64) || c.output; - // TODO - luma v9 - switch to device.info.gpu ? - const skipOnGPU = c.skipGPUs && c.skipGPUs.some(gpu => device.info.gpu.indexOf(gpu) >= 0); - - if (device.features.has('transform-feedback-webgl2') && !skipOnGPU) { - // Reduced precision tolerencewhen using 64 bit project module. - config.EPSILON = usefp64 ? c.gpu64BitPrecision || 1e-7 : c.precision || 1e-7; - const feedbackBuffers = {outValue: OUT_BUFFER}; - let actual: number[] | Float32Array = await runOnGPU({ - device, - uniforms, - vs: c.vs, - feedbackBuffers, - usefp64 - }); - actual = c.mapResult ? c.mapResult(actual) : actual; - const name = `GPU: ${usefp64 ? 'project64' : 'project32'} ${c.name}`; - verifyResult({t, actual, expected, name, sliceActual: true}); - } else { - // TODO - resolve dependencies properly - // luma's assembleShaders require WebGL context to work - const module = usefp64 ? project64 : project32; - const dependencies = appendDependencies(module, []).concat(module); - const vsSource = dependencies.map(dep => dep.vs).join(''); - - const projectVS = compileVertexShader(vsSource); - - // This is a work around for the transpiled shader code not able to handle type conversion - // It expects project_uViewProjectionMatrixFP64 to be vec2[16], not float[32] - const projectMatrix64 = uniforms.project_uViewProjectionMatrixFP64; - if (projectMatrix64 && projectMatrix64 instanceof Float32Array) { - const normalizedProjectMatrix64 = Array.from({length: 16}, (d, i) => { - return [projectMatrix64[i * 2], projectMatrix64[i * 2 + 1]]; - }); - uniforms.project_uViewProjectionMatrixFP64 = normalizedProjectMatrix64; + const actual = await runOnGPU({ + vs: c.vs, + modules: usefp64 ? [project64] : [project32], + varying: 'outValue', + vertexCount: 1, + uniforms: { + ...uniforms, + uPos: c.input, + uPos64Low: c.input.map(fp64LowPart) } - - const projectFunc = projectVS(uniforms); - config.EPSILON = c.precision || 1e-7; - let actual = c.func(projectFunc); - actual = c.mapResult ? c.mapResult(actual) : actual; - const name = `CPU: ${usefp64 ? 'project64' : 'project32'} ${c.name}`; - verifyResult({t, name, actual, expected}); - } + }); + config.EPSILON = c.precision ?? 1e-5; + + t.is( + verifyGPUResult(actual, expected), + true, + `${usefp64 ? 'project64' : 'project32'} ${c.name}` + ); } } } @@ -323,14 +220,3 @@ test.skip('project32&64#vs', async t => { config.EPSILON = oldEpsilon; t.end(); }); - -function appendDependencies(module, result) { - const dependencies = module.dependencies; - if (dependencies && dependencies.length > 0) { - for (const dep of dependencies) { - result = appendDependencies(dep, result); - } - result = result.concat(dependencies); - } - return result; -} diff --git a/test/modules/core/shaderlib/project/project-functions.spec.ts b/test/modules/core/shaderlib/project/project-functions.spec.ts index 55b1c2b2c91..22cf552b5ac 100644 --- a/test/modules/core/shaderlib/project/project-functions.spec.ts +++ b/test/modules/core/shaderlib/project/project-functions.spec.ts @@ -20,12 +20,12 @@ import test from 'tape-promise/tape'; -import {COORDINATE_SYSTEM, WebMercatorViewport, OrthographicView} from 'deck.gl'; -import project from '@deck.gl/core/shaderlib/project/project'; +import {COORDINATE_SYSTEM, WebMercatorViewport, OrthographicViewport, project} from '@deck.gl/core'; +import {fp64} from '@luma.gl/shadertools'; +const {fp64LowPart} = fp64; import {projectPosition} from '@deck.gl/core/shaderlib/project/project-functions'; import {equals, config} from '@math.gl/core'; - -import {compileVertexShader} from '../shaderlib-test-utils'; +import {runOnGPU, verifyGPUResult} from './project-glsl-test-utils'; const TEST_VIEWPORT = new WebMercatorViewport({ longitude: -122.45, @@ -62,13 +62,11 @@ const TEST_CASES = [ title: 'CARTESIAN:IDENTITY', position: [-10, 10, 10], params: { - viewport: new OrthographicView().makeViewport({ + viewport: new OrthographicViewport({ width: 1, height: 1, - viewState: { - target: [3.1416, 2.7183, 0], - zoom: 4 - } + target: [3.1416, 2.7183, 0], + zoom: 4 }), coordinateSystem: COORDINATE_SYSTEM.DEFAULT }, @@ -151,26 +149,44 @@ test('project#projectPosition', t => { t.end(); }); -test('project#projectPosition vs project_position', t => { +test('project#projectPosition vs project_position', async t => { config.EPSILON = 1e-5; - const vsSource = `${ - project.dependencies.map(dep => dep.vs).join('') - // for setting test context - }void set_geometry(vec3 pos) {geometry.worldPosition = pos;}\n${project.vs}`; - const projectVS = compileVertexShader(vsSource); + const vs = `\ +#version 300 es - TEST_CASES.filter(testCase => !testCase.params.fromCoordinateSystem).forEach(testCase => { - const uniforms = project.getUniforms(testCase.params); - const module = projectVS(uniforms); - module.set_geometry(testCase.position); +uniform vec3 uPos; +uniform vec3 uPos64Low; - const cpuResult = projectPosition(testCase.position, testCase.params); - const shaderResult = module.project_position_vec3(testCase.position); +out vec4 outValue; - t.comment(`Comparing ${cpuResult} to ${shaderResult}`); - t.ok(equals(cpuResult, shaderResult), testCase.title); - }); +void main() +{ + geometry.worldPosition = uPos; + outValue = project_position(vec4(uPos, 1.0), uPos64Low); +} +`; + + for (const {title, position, params} of TEST_CASES.filter( + testCase => !testCase.params.fromCoordinateSystem + )) { + const uniforms = project.getUniforms(params); + + const cpuResult = projectPosition(position, params); + const shaderResult = await runOnGPU({ + vs, + varying: 'outValue', + modules: [project], + vertexCount: 1, + uniforms: { + ...uniforms, + uPos: position, + uPos64Low: position.map(fp64LowPart) + } + }); + + t.is(verifyGPUResult(shaderResult, cpuResult), true, title); + } t.end(); }); diff --git a/test/modules/core/shaderlib/project/project-glsl-test-utils.ts b/test/modules/core/shaderlib/project/project-glsl-test-utils.ts index c5152af2cd8..a52e56303ab 100644 --- a/test/modules/core/shaderlib/project/project-glsl-test-utils.ts +++ b/test/modules/core/shaderlib/project/project-glsl-test-utils.ts @@ -18,62 +18,50 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {equals} from '@math.gl/core'; -import type {Buffer, Device, UniformValue} from '@luma.gl/core'; +import {equals, NumericArray} from '@math.gl/core'; +import type {UniformValue} from '@luma.gl/core'; import {BufferTransform, BufferTransformProps} from '@luma.gl/engine'; -import {project32} from '@deck.gl/core'; -import {project64} from '@deck.gl/extensions'; +import {device} from '@deck.gl/test-utils'; export function getPixelOffset(p1, p2) { return [p1[0] - p2[0], p1[1] - p2[1], p1[2] - p2[2], 1]; } -export function clipspaceToScreen(viewport, coords) { - return [ - ((coords[0] / coords[3] + 1) / 2) * viewport.width, - ((1 - coords[1] / coords[3]) / 2) * viewport.height, - coords[2] / coords[3] - ]; -} +const OUT_BUFFER = device.createBuffer({byteLength: 4 * 16}); export async function runOnGPU({ - device, uniforms, - usefp64 = true, + varying, ...transformProps -}: { - device: Device; +}: BufferTransformProps & { uniforms: Record; - vs: string; - feedbackBuffers: Record; - attributes?: Record; - bufferLayout?: unknown[]; - vertexCount?: number; - usefp64?: boolean; + varying: string; }): Promise { - const modules = usefp64 ? [project64] : [project32]; const transform = new BufferTransform(device, { - ...(transformProps as BufferTransformProps), - varyings: ['outValue'], - modules + ...transformProps, + feedbackBuffers: {[varying]: OUT_BUFFER}, + varyings: [varying] }); transform.model.setUniforms(uniforms); - transform.run(); + transform.run({ + discard: true + }); - const result: Uint8Array = await transformProps.feedbackBuffers.outValue.readAsync(); - return new Float32Array(result.buffer, result.byteOffset, result.byteLength / 4); + const result: Uint8Array = await OUT_BUFFER.readAsync(); + return new Float32Array(result.buffer); } -export function verifyResult({t, name, actual, expected, sliceActual = false}) { - actual = Number.isFinite(actual) ? [actual] : actual; - expected = Array.isArray(expected) ? expected : [expected]; - // Convert TypedArray to regular array - // TODO: remove after https://github.com/uber-web/math.gl/pull/29 - actual = sliceActual ? Array.from(actual.slice(0, expected.length)) : actual; +export function verifyGPUResult( + actual: Float32Array, + expected: number | NumericArray +): string | true { + const expectedArr: NumericArray = typeof expected === 'number' ? [expected] : expected; + // truncate buffer to match expected length + const actualArr = actual.slice(0, expectedArr.length); - if (equals(actual, expected)) { - t.pass(`${name} returns correct result`); + if (equals(actualArr, expectedArr)) { + return true; } else { - t.fail(`${name} returns ${actual}, expecting ${expected}`); + return `returns ${actualArr}, expecting ${expectedArr}`; } } diff --git a/test/modules/core/shaderlib/project/project-glsl.spec.ts b/test/modules/core/shaderlib/project/project-glsl.spec.ts index 1e7b70a4b42..2a8ee2fcf54 100644 --- a/test/modules/core/shaderlib/project/project-glsl.spec.ts +++ b/test/modules/core/shaderlib/project/project-glsl.spec.ts @@ -20,15 +20,12 @@ import test from 'tape-promise/tape'; -import {COORDINATE_SYSTEM, WebMercatorViewport, OrthographicView} from 'deck.gl'; -import project from '@deck.gl/core/shaderlib/project/project'; -import {Matrix4, Matrix3, Vector3, config, equals} from '@math.gl/core'; -import {device} from '@deck.gl/test-utils'; +import {COORDINATE_SYSTEM, WebMercatorViewport, OrthographicViewport, project} from '@deck.gl/core'; +import {Matrix4, Vector3, config, equals, NumericArray} from '@math.gl/core'; import {fp64} from '@luma.gl/shadertools'; const {fp64LowPart} = fp64; -import {compileVertexShader} from '../shaderlib-test-utils'; -import {getPixelOffset, clipspaceToScreen, runOnGPU, verifyResult} from './project-glsl-test-utils'; +import {getPixelOffset, runOnGPU, verifyGPUResult} from './project-glsl-test-utils'; const PIXEL_TOLERANCE = 1e-4; const TEST_VIEWPORT = new WebMercatorViewport({ @@ -51,67 +48,60 @@ const TEST_VIEWPORT_HIGH_ZOOM = new WebMercatorViewport({ height: 600 }); -const TEST_VIEWPORT_ORTHO = new OrthographicView().makeViewport({ +const TEST_VIEWPORT_ORTHO = new OrthographicViewport({ width: 800, height: 600, - viewState: { - target: [50, 50, 0], - zoom: 1 - } + target: [50, 50, 0], + zoom: 1 }); -const DUMMY_SOURCE_BUFFER = device.createBuffer({byteLength: 1}); -const OUT_BUFFER = device.createBuffer({byteLength: 16}); - -// used in printing a float into GLSL code, 1 will be 1.0 to avoid GLSL compile errors -const MAX_FRACTION_DIGITS = 5; -function getScalerType(a) { - if (Array.isArray(a)) { - return `vec${a.length}`; - } - return 'float'; -} -function getScaler(a) { - if (Array.isArray(a)) { - return `${getScalerType(a)}(${a.map(x => x.toFixed(MAX_FRACTION_DIGITS)).join(',')})`; - } - return a.toFixed(MAX_FRACTION_DIGITS); -} - const TRANSFORM_VS = { - project_size: (meter, worldPosition, commonPosition = [0, 0, 0, 0]) => `\ + project_size: (type: 'float' | 'vec2' | 'vec3') => `\ #version 300 es -out ${getScalerType(meter)} outValue; +uniform vec3 uWorldPos; +uniform vec4 uCommonPos; +uniform ${type} uMeterSize; +out ${type} outValue; void main() { - geometry.worldPosition = ${getScaler(worldPosition)}; - geometry.position = ${getScaler(commonPosition)}; - outValue = project_size(${getScaler(meter)}); + geometry.worldPosition = uWorldPos; + geometry.position = uCommonPos; + outValue = project_size(uMeterSize); } `, - project_position: (pos, pos64Low = [0, 0, 0]) => `\ + project_position: `\ #version 300 es +uniform vec3 uPos; +uniform vec3 uPos64Low; + out vec4 outValue; void main() { - geometry.worldPosition = ${getScaler(pos.slice(0, 3))}; - outValue = project_position(${getScaler(pos)}, ${getScaler(pos64Low)}); + geometry.worldPosition = uPos; + outValue = project_position(vec4(uPos, 1.0), uPos64Low); } `, - project_common_position_to_clipspace_vec4: pos => `\ + project_common_position_to_clipspace: `\ #version 300 es -out vec4 outValue; +uniform vec3 uPos; +out vec3 outValue; void main() { - geometry.worldPosition = ${getScaler(pos.slice(0, 3))}; - vec4 pos = project_position(${getScaler(pos)}, vec3(0.)); - outValue = project_common_position_to_clipspace(pos); + geometry.worldPosition = uPos; + vec4 pos = project_position(vec4(uPos, 1.0), vec3(0.)); + vec4 glPos = project_common_position_to_clipspace(pos); + outValue = glPos.xyz / glPos.w; + outValue = vec3( + (1.0 + outValue.x) / 2.0 * project_uViewportSize.x, + (1.0 - outValue.y) / 2.0 * project_uViewportSize.y, + outValue.z + ); } ` }; @@ -125,56 +115,61 @@ const TEST_CASES = [ tests: [ { name: 'project_size(float)', - func: ({project_size_float}) => project_size_float(1), - output: TEST_VIEWPORT.getDistanceScales().unitsPerMeter[2], - vs: TRANSFORM_VS.project_size(1, [TEST_VIEWPORT.longitude, TEST_VIEWPORT.latitude, 0]) + vs: TRANSFORM_VS.project_size('float'), + input: { + uWorldPos: [TEST_VIEWPORT.longitude, TEST_VIEWPORT.latitude, 0], + uCommonPos: [0, 0, 0, 0], + uMeterSize: 1 + }, + output: TEST_VIEWPORT.getDistanceScales().unitsPerMeter[2] }, { name: 'project_size(vec2)', - func: ({project_size_vec2}) => project_size_vec2([1, 1]), - output: TEST_VIEWPORT.getDistanceScales().unitsPerMeter.slice(0, 2), - vs: TRANSFORM_VS.project_size([1, 1], [TEST_VIEWPORT.longitude, TEST_VIEWPORT.latitude, 0]) + vs: TRANSFORM_VS.project_size('vec2'), + input: { + uWorldPos: [TEST_VIEWPORT.longitude, TEST_VIEWPORT.latitude, 0], + uCommonPos: [0, 0, 0, 0], + uMeterSize: [1, 1] + }, + output: TEST_VIEWPORT.getDistanceScales().unitsPerMeter.slice(0, 2) }, { name: 'project_size(vec3)', - func: ({project_size_vec3}) => project_size_vec3([1, 1, 1]), - output: TEST_VIEWPORT.getDistanceScales().unitsPerMeter, - vs: TRANSFORM_VS.project_size( - [1, 1, 1], - [TEST_VIEWPORT.longitude, TEST_VIEWPORT.latitude, 0] - ) + vs: TRANSFORM_VS.project_size('vec3'), + input: { + uWorldPos: [TEST_VIEWPORT.longitude, TEST_VIEWPORT.latitude, 0], + uCommonPos: [0, 0, 0, 0], + uMeterSize: [1, 1, 1] + }, + output: TEST_VIEWPORT.getDistanceScales().unitsPerMeter }, { name: 'project_position', - func: ({project_position}) => project_position([-122.45, 37.78, 0, 1], [0, 0, 0]), + vs: TRANSFORM_VS.project_position, + input: { + uPos: [-122.45, 37.78, 0], + uPos64Low: [fp64LowPart(-122.45), fp64LowPart(37.78), 0] + }, output: TEST_VIEWPORT.projectFlat([-122.45, 37.78]).concat([0, 1]), - gpuPrecision: PIXEL_TOLERANCE, - vs: TRANSFORM_VS.project_position( - [-122.45, 37.78, 0, 1], - [fp64LowPart(-122.45), fp64LowPart(37.78), 0] - ) + precision: PIXEL_TOLERANCE }, { name: 'project_common_position_to_clipspace(vec4)', - func: ({project_position, project_common_position_to_clipspace_vec4}) => - project_common_position_to_clipspace_vec4( - project_position([-122.45, 37.78, 0, 1], [0, 0, 0]) - ), - mapResult: coords => clipspaceToScreen(TEST_VIEWPORT, coords), + vs: TRANSFORM_VS.project_common_position_to_clipspace, + input: { + uPos: [-122.45, 37.78, 0] + }, output: TEST_VIEWPORT.project([-122.45, 37.78, 0]), - precision: PIXEL_TOLERANCE, - vs: TRANSFORM_VS.project_common_position_to_clipspace_vec4([-122.45, 37.78, 0, 1]) + precision: PIXEL_TOLERANCE }, { name: 'project_common_position_to_clipspace (vec4, non-zero z)', - func: ({project_position, project_common_position_to_clipspace_vec4}) => - project_common_position_to_clipspace_vec4( - project_position([-122.45, 37.78, 100, 1], [0, 0, 0]) - ), - mapResult: coords => clipspaceToScreen(TEST_VIEWPORT, coords), + vs: TRANSFORM_VS.project_common_position_to_clipspace, + input: { + uPos: [-122.45, 37.78, 100] + }, output: TEST_VIEWPORT.project([-122.45, 37.78, 100]), - precision: PIXEL_TOLERANCE, - vs: TRANSFORM_VS.project_common_position_to_clipspace_vec4([-122.45, 37.78, 100, 1]) + precision: PIXEL_TOLERANCE } ] }, @@ -187,36 +182,39 @@ const TEST_CASES = [ tests: [ { name: 'project_position', - func: ({project_position}) => project_position([-122.05, 37.92, 0, 1], [0, 0, 0]), + vs: TRANSFORM_VS.project_position, + input: { + uPos: [-122.05, 37.92, 0], + uPos64Low: [0, 0, 0] + }, // common space position is offset from viewport center output: getPixelOffset( TEST_VIEWPORT_HIGH_ZOOM.projectPosition([-122.05, 37.92, 0]), - TEST_VIEWPORT_HIGH_ZOOM.projectPosition([-122, 38, 0]) + TEST_VIEWPORT_HIGH_ZOOM.projectPosition([ + TEST_VIEWPORT.longitude, + TEST_VIEWPORT.latitude, + 0 + ]) ), - precision: PIXEL_TOLERANCE, - vs: TRANSFORM_VS.project_position([-122.05, 37.92, 0, 1]) + precision: PIXEL_TOLERANCE }, { name: 'project_common_position_to_clipspace(vec4)', - func: ({project_position, project_common_position_to_clipspace_vec4}) => - project_common_position_to_clipspace_vec4( - project_position([-122.05, 37.92, 0, 1], [0, 0, 0]) - ), - mapResult: coords => clipspaceToScreen(TEST_VIEWPORT_HIGH_ZOOM, coords), + vs: TRANSFORM_VS.project_common_position_to_clipspace, + input: { + uPos: [-122.05, 37.92, 0] + }, output: TEST_VIEWPORT_HIGH_ZOOM.project([-122.05, 37.92, 0]), - precision: PIXEL_TOLERANCE, - vs: TRANSFORM_VS.project_common_position_to_clipspace_vec4([-122.05, 37.92, 0, 1]) + precision: PIXEL_TOLERANCE }, { name: 'project_common_position_to_clipspace (vec4, non-zero z)', - func: ({project_position, project_common_position_to_clipspace_vec4}) => - project_common_position_to_clipspace_vec4( - project_position([-122.05, 37.92, 100, 1], [0, 0, 0]) - ), - mapResult: coords => clipspaceToScreen(TEST_VIEWPORT_HIGH_ZOOM, coords), + vs: TRANSFORM_VS.project_common_position_to_clipspace, + input: { + uPos: [-122.05, 37.92, 100] + }, output: TEST_VIEWPORT_HIGH_ZOOM.project([-122.05, 37.92, 100]), - precision: PIXEL_TOLERANCE, - vs: TRANSFORM_VS.project_common_position_to_clipspace_vec4([-122.05, 37.92, 100, 1]) + precision: PIXEL_TOLERANCE } ] }, @@ -231,7 +229,11 @@ const TEST_CASES = [ tests: [ { name: 'project_position', - func: ({project_position}) => project_position([1000, 1000, 0, 1], [0, 0, 0]), + vs: TRANSFORM_VS.project_position, + input: { + uPos: [1000, 1000, 0], + uPos64Low: [0, 0, 0] + }, // common space position is offset from coordinateOrigin // @turf/destination // destination([-122.05, 37.92], 1 * Math.sqrt(2), 45) -> [ -122.0385984916185, 37.92899265369385 ] @@ -239,19 +241,16 @@ const TEST_CASES = [ TEST_VIEWPORT.projectPosition([-122.0385984916185, 37.92899265369385, 100]), TEST_VIEWPORT.projectPosition([-122.05, 37.92, 0]) ), - precision: PIXEL_TOLERANCE, - vs: TRANSFORM_VS.project_position([1000, 1000, 0, 1]) + precision: PIXEL_TOLERANCE }, { name: 'project_common_position_to_clipspace(vec4)', - func: ({project_position, project_common_position_to_clipspace_vec4}) => - project_common_position_to_clipspace_vec4( - project_position([1000, 1000, 0, 1], [0, 0, 0]) - ), - mapResult: coords => clipspaceToScreen(TEST_VIEWPORT, coords), + vs: TRANSFORM_VS.project_common_position_to_clipspace, + input: { + uPos: [1000, 1000, 0] + }, output: TEST_VIEWPORT.project([-122.0385984916185, 37.92899265369385, 100]), - precision: PIXEL_TOLERANCE, - vs: TRANSFORM_VS.project_common_position_to_clipspace_vec4([1000, 1000, 0, 1]) + precision: PIXEL_TOLERANCE } ] }, @@ -265,25 +264,26 @@ const TEST_CASES = [ tests: [ { name: 'project_position', - func: ({project_position}) => project_position([0.05, 0.08, 0, 1], [0, 0, 0]), + vs: TRANSFORM_VS.project_position, + input: { + uPos: [0.05, 0.08, 0], + uPos64Low: [0, 0, 0] + }, // common space position is offset from coordinateOrigin output: getPixelOffset( TEST_VIEWPORT.projectPosition([-122, 38, 0]), TEST_VIEWPORT.projectPosition([-122.05, 37.92, 0]) ), - precision: PIXEL_TOLERANCE, - vs: TRANSFORM_VS.project_position([0.05, 0.08, 0, 1]) + precision: PIXEL_TOLERANCE }, { name: 'project_common_position_to_clipspace(vec4)', - func: ({project_position, project_common_position_to_clipspace_vec4}) => - project_common_position_to_clipspace_vec4( - project_position([0.05, 0.08, 0, 1], [0, 0, 0]) - ), - mapResult: coords => clipspaceToScreen(TEST_VIEWPORT, coords), + vs: TRANSFORM_VS.project_common_position_to_clipspace, + input: { + uPos: [0.05, 0.08, 0] + }, output: TEST_VIEWPORT.project([-122, 38, 0]), - precision: PIXEL_TOLERANCE, - vs: TRANSFORM_VS.project_common_position_to_clipspace_vec4([0.05, 0.08, 0, 1]) + precision: PIXEL_TOLERANCE } ] }, @@ -297,97 +297,111 @@ const TEST_CASES = [ tests: [ { name: 'project_position', - func: ({project_position}) => project_position([200, 200, 0, 1], [0, 0, 0]), + vs: TRANSFORM_VS.project_position, + input: { + uPos: [200, 200, 0], + uPos64Low: [0, 0, 0] + }, // common space position is offset from viewport center output: getPixelOffset( TEST_VIEWPORT_ORTHO.projectPosition([-200, 200, 10]), TEST_VIEWPORT_ORTHO.projectPosition([50, 50, 0]) ), - precision: PIXEL_TOLERANCE, - vs: TRANSFORM_VS.project_position([200, 200, 0, 1]) + precision: PIXEL_TOLERANCE }, { name: 'project_common_position_to_clipspace(vec4)', - func: ({project_position, project_common_position_to_clipspace_vec4}) => - project_common_position_to_clipspace_vec4(project_position([200, 200, 0, 1], [0, 0, 0])), - mapResult: coords => clipspaceToScreen(TEST_VIEWPORT, coords), + vs: TRANSFORM_VS.project_common_position_to_clipspace, + input: { + uPos: [200, 200, 0] + }, output: TEST_VIEWPORT_ORTHO.project([-200, 200, 10]), - precision: PIXEL_TOLERANCE, - vs: TRANSFORM_VS.project_common_position_to_clipspace_vec4([200, 200, 0, 1]) + precision: PIXEL_TOLERANCE } ] } ]; -// TODO - luma.gl v9 likely GPU identification error? -test.skip('project#vs', t => { - // TODO - resolve dependencies properly - // luma's assembleShaders require WebGL context to work - const vsSource = `${ - project.dependencies.map(dep => dep.vs).join('') - // for setting test context - }void set_geometry(vec4 position) {geometry.position = position;}\n${project.vs}`; - const projectVS = compileVertexShader(vsSource); +test('project#vs', async t => { const oldEpsilon = config.EPSILON; - TEST_CASES.forEach(testCase => { + for (const testCase of TEST_CASES) { t.comment(testCase.title); - const {viewport} = testCase.params; const uniforms = project.getUniforms(testCase.params); - const module = projectVS(uniforms); - module.set_geometry(viewport.center.concat(1)); - testCase.tests.forEach(c => { - const expected = c.output; - config.EPSILON = c.gpuPrecision || c.precision || 1e-7; - const feedbackBuffers = {outValue: OUT_BUFFER}; - let actual = runOnGPU({device, uniforms, vs: c.vs, feedbackBuffers}); - actual = c.mapResult ? c.mapResult(actual) : actual; - const name = `GPU: ${c.name}`; - verifyResult({t, name, actual, expected, sliceActual: true}); - }); - }); + for (const {name, vs, input, output, precision = 1e-7} of testCase.tests) { + config.EPSILON = precision; + let actual: NumericArray = await runOnGPU({ + vs, + varying: 'outValue', + modules: [project], + vertexCount: 1, + uniforms: {...uniforms, ...input} + }); + + t.is(verifyGPUResult(actual, output), true, name); + } + } config.EPSILON = oldEpsilon; t.end(); }); -test('project#vs#project_get_orientation_matrix', t => { - const vsSource = project.dependencies.map(dep => dep.vs).join('') + project.vs; - const projectVS = compileVertexShader(vsSource); - const getOrientationMatrix = projectVS({}).project_get_orientation_matrix; +test('project#vs#project_get_orientation_matrix', async t => { + const vs = `\ +#version 300 es + +uniform vec3 uDirUp; +uniform vec3 uInput; +out vec3 outValue; + +void main() { + mat3 transform = project_get_orientation_matrix(uDirUp); + outValue = transform * uInput; +} + `; + const uniforms = project.getUniforms({ + viewport: TEST_VIEWPORT, + coordinateSystem: COORDINATE_SYSTEM.LNGLAT + }); - const testCases = [ - [0, 0, 1], - [0, 0, -1], - [3, 0, 0], - [0, 4, 0], - [3, 4, 12] + const runTransform = async (up: NumericArray, v: NumericArray): Promise => { + const result = await runOnGPU({ + vs, + varying: 'outValue', + modules: [project], + vertexCount: 1, + uniforms: {...uniforms, uDirUp: up, uInput: v} + }); + return new Vector3(result.slice(0, 3)); + }; + + const testTransforms = [ + new Matrix4(), + new Matrix4().rotateX(Math.PI), + new Matrix4().rotateX(Math.PI / 6).rotateZ(-Math.PI / 2) ]; const vectorA = new Vector3([-3, -4, 12]); const vectorB = new Vector3([-1, 1, 1]); const angleAB = vectorA.clone().normalize().dot(vectorB.clone().normalize()); - for (const testVector of testCases) { - const matrix = new Matrix3(getOrientationMatrix(testVector)); - - const result = matrix.transform([0, 0, 1]); - const expected = new Vector3(testVector).normalize(); - t.comment(`result=${result.join(',')}`); - t.comment(`expected=${expected.join(',')}`); - t.ok(equals(result, expected), 'Transformed unit vector as expected'); + for (const matrix of testTransforms) { + const up = matrix.transformAsVector([0, 0, 1]); - const result2 = new Vector3(matrix.transform(vectorA)); - t.is(result2.len(), 13, 'Vector length is preserved'); + const transformedUp = await runTransform(up, [0, 0, 1]); + t.comment(`actual=${transformedUp}`); + t.comment(`expected=${up}`); + t.ok(equals(transformedUp, up, 1e-7), 'Transformed up as expected'); - const result3 = new Vector3(matrix.transform(vectorB)); - t.is(result3.len(), Math.sqrt(3), 'Vector length is preserved'); + const transformedA = await runTransform(up, vectorA); + t.ok(equals(transformedA.length, vectorA.length, 1e-7), 'Vector length is preserved'); + const transformedB = await runTransform(up, vectorB); + t.ok(equals(transformedB.length, vectorB.length, 1e-7), 'Vector length is preserved'); - t.is( - result2.normalize().dot(result3.normalize()), - angleAB, + t.ok( + equals(transformedA.normalize().dot(transformedB.normalize()), angleAB, 1e-7), 'Angle between vectors is preserved' ); } diff --git a/test/modules/core/shaderlib/project/viewport-uniforms.spec.ts b/test/modules/core/shaderlib/project/viewport-uniforms.spec.ts index d5cf55ea426..7709f8cbbaa 100644 --- a/test/modules/core/shaderlib/project/viewport-uniforms.spec.ts +++ b/test/modules/core/shaderlib/project/viewport-uniforms.spec.ts @@ -20,42 +20,35 @@ import test from 'tape-promise/tape'; -import {COORDINATE_SYSTEM, MapView, OrbitView} from 'deck.gl'; -import {project} from '@deck.gl/core'; +import {COORDINATE_SYSTEM, WebMercatorViewport, OrbitViewport, project} from '@deck.gl/core'; import {project64} from '@deck.gl/extensions'; const TEST_VIEWPORTS = { - map: new MapView().makeViewport({ + map: new WebMercatorViewport({ width: 800, height: 600, - viewState: { - latitude: 37.751537058389985, - longitude: -122.42694203247012, - zoom: 11, - bearing: -30, - pitch: 40 - } + latitude: 37.751537058389985, + longitude: -122.42694203247012, + zoom: 11, + bearing: -30, + pitch: 40 }), - mapHighZoom: new MapView().makeViewport({ + mapHighZoom: new WebMercatorViewport({ width: 800, height: 600, - viewState: { - latitude: 37.751537058389985, - longitude: -122.42694203247012, - zoom: 13, - bearing: -30, - pitch: 40 - } + latitude: 37.751537058389985, + longitude: -122.42694203247012, + zoom: 13, + bearing: -30, + pitch: 40 }), - infoVis: new OrbitView().makeViewport({ + infoVis: new OrbitViewport({ width: 800, height: 600, - viewState: { - rotationX: -30, - rotationOrbit: 40, - target: [10.285714285714, -3.14159265359], - zoom: 8 - } + rotationX: -30, + rotationOrbit: 40, + target: [10.285714285714, -3.14159265359, 0], + zoom: 8 }) }; diff --git a/test/modules/core/shaderlib/shaderlib-test-utils.ts b/test/modules/core/shaderlib/shaderlib-test-utils.ts deleted file mode 100644 index 1f524f596ef..00000000000 --- a/test/modules/core/shaderlib/shaderlib-test-utils.ts +++ /dev/null @@ -1,31 +0,0 @@ -// TODO - move to @luma.gl/debug ? -import Compiler from 'glsl-transpiler'; - -const compileVS = Compiler({ - uniform: name => `uniforms.${name}` -}); - -// @returns JavaScript function of the transpiled shader -export function compileVertexShader(source) { - const compiledSource = compileVS(source); - const {compiler} = compileVS; - const {functions} = compiler; - compiler.reset(); - - return evalScript( - `function vs(uniforms) { - - ${compiledSource} - - return { - ${Object.keys(functions).join(',')} - }; -}` - ); -} - -/* eslint-disable no-eval */ -function evalScript(source) { - const script = `(function() { return ${source}; })()`; - return eval(script); -} diff --git a/yarn.lock b/yarn.lock index 78c45fc089e..4958fe80967 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3795,11 +3795,6 @@ array-find-index@^1.0.1: resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= -array-flatten@^2.0.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" - integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== - array-ify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" @@ -4045,11 +4040,6 @@ backbone@1.2.3: dependencies: underscore ">=1.7.0" -balanced-match@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.3.0.tgz#a91cdd1ebef1a86659e70ff4def01625fc2d6756" - integrity sha1-qRzdHr7xqGZZ5w/03vAWJfwtZ1Y= - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -5679,11 +5669,6 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escaper@3.0.6, escaper@^2.5.3: - version "3.0.6" - resolved "https://registry.yarnpkg.com/escaper/-/escaper-3.0.6.tgz#82cb26d95e3de87c87ef786b0592ac19a55c704b" - integrity sha512-QEdbdnIdh8+VgK6jr2iOixGR/havRmnwAMqFmYldBn6QZrTYmuwHlAE4bZ36PUa5kKlnrb0egSvEQTvFfdHtEw== - escodegen@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" @@ -5980,13 +5965,6 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" -expression-eval@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/expression-eval/-/expression-eval-1.4.0.tgz#3e250c110ff9bb6606d0c8ad0ecb9600e388f76d" - integrity sha512-CvpqG2feKjGcr+6NB/ZOA2csOeVL+2DSiWrF/4h0mrdYv4SxR2vCZhLHSst4Sp+xHtN/LQtPfi6i7K9EJwzRGw== - dependencies: - jsep "^0.3.0" - expression-eval@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/expression-eval/-/expression-eval-5.0.1.tgz#845758fa9ba64d9edc7b6804ae404934a6cfee6b" @@ -6240,11 +6218,6 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== -float-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/float-regex/-/float-regex-1.0.0.tgz#f80fa91d672c6b924842034bd87a0dd72069d2ef" - integrity sha1-+A+pHWcsa5JIQgNL2HoN1yBp0u8= - flush-write-stream@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" @@ -6739,36 +6712,6 @@ globby@^9.2.0: pify "^4.0.1" slash "^2.0.0" -glsl-parser@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/glsl-parser/-/glsl-parser-2.0.1.tgz#3ffac4ee05cc4d8141fd6b1e41e82b3766ff61b9" - integrity sha512-hcPQtfz0AtxkyooSvim0RsHFNsiHXTY80GX2GtoTpFTImxW3cOINpb0cY6HFKnYkbheQRM7cDzCzzItNT6ZSiA== - dependencies: - glsl-tokenizer "^2.1.4" - through "2.3.4" - through2 "^0.6.3" - -glsl-tokenizer@^2.1.4, glsl-tokenizer@^2.1.5: - version "2.1.5" - resolved "https://registry.yarnpkg.com/glsl-tokenizer/-/glsl-tokenizer-2.1.5.tgz#1c2e78c16589933c274ba278d0a63b370c5fee1a" - integrity sha512-XSZEJ/i4dmz3Pmbnpsy3cKh7cotvFlBiZnDOwnj/05EwNp2XrhQ4XKJxT7/pDt4kp4YcpRSKz8eTV7S+mwV6MA== - dependencies: - through2 "^0.6.3" - -glsl-transpiler@^1.8.6: - version "1.8.6" - resolved "https://registry.yarnpkg.com/glsl-transpiler/-/glsl-transpiler-1.8.6.tgz#acb54459206a72b9962866f8b82619e3d82c9914" - integrity sha512-U/vPKq1hytHh8dHGzr3i9CpGO012PDVtmAlYFTEMFW6s/OriAlw/kWpHxlwgqquwFIq7yhhtlrcJ3Pa4lvkYEw== - dependencies: - array-flatten "^2.0.0" - float-regex "^1.0.0" - glsl-parser "^2.0.1" - glsl-tokenizer "^2.1.5" - inherits "^2.0.1" - pick-by-alias "^1.2.0" - prepr "^1.1.2" - xtend "^4.0.1" - gopd@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" @@ -9309,11 +9252,6 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parenthesis@^3.0.0: - version "3.1.7" - resolved "https://registry.yarnpkg.com/parenthesis/-/parenthesis-3.1.7.tgz#01c89b603a2a6a262ec47554e74ed154a9be2aa6" - integrity sha512-iMtu+HCbLXVrpf6Ys/4YKhcFxbux3xK4ZVB9r+a2kMSqeeQWQoDNYlXIsOjwlT2ldYXZ3k5PVeBnYn7fbAo/Bg== - parse-data-uri@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/parse-data-uri/-/parse-data-uri-0.2.0.tgz#bf04d851dd5c87b0ab238e5d01ace494b604b4c9" @@ -9484,11 +9422,6 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -pick-by-alias@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/pick-by-alias/-/pick-by-alias-1.2.0.tgz#5f7cb2b1f21a6e1e884a0c87855aa4a37361107b" - integrity sha1-X3yysfIabh6ISgyHhVqko3NhEHs= - picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -9617,18 +9550,6 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prepr@^1.1.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/prepr/-/prepr-1.2.3.tgz#080900bad9dba6effc79d624deefc545a3d8616b" - integrity sha512-G3j+37ot45Q2A3vDBwIiuP43WcL9rRNLM8Q9Av61vwJIpdlopodfv3jtet9nLT3IvefYj9gzwzY2zcKDNp//fA== - dependencies: - balanced-match "^0.3.0" - escaper "^2.5.3" - expression-eval "^1.4.0" - object-assign "^4.1.1" - parenthesis "^3.0.0" - strip-json-comments "^2.0.1" - prettier-check@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/prettier-check/-/prettier-check-2.0.0.tgz#edd086ee12d270579233ccb136a16e6afcfba1ae" @@ -9995,7 +9916,7 @@ readable-stream@2.2.9: string_decoder "~1.0.0" util-deprecate "~1.0.1" -"readable-stream@>=1.0.33-1 <1.1.0-0", readable-stream@~1.0.33-1: +readable-stream@~1.0.33-1: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= @@ -11155,11 +11076,6 @@ strip-indent@^2.0.0: resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= -strip-json-comments@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -11371,14 +11287,6 @@ thenify-all@^1.0.0: dependencies: any-promise "^1.0.0" -through2@^0.6.3: - version "0.6.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" - integrity sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg= - dependencies: - readable-stream ">=1.0.33-1 <1.1.0-0" - xtend ">=4.0.0 <4.1.0-0" - through2@^2.0.0, through2@^2.0.2: version "2.0.5" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" @@ -11399,11 +11307,6 @@ through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8, resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= -through@2.3.4: - version "2.3.4" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.4.tgz#495e40e8d8a8eaebc7c275ea88c2b8fc14c56455" - integrity sha1-SV5A6Nio6uvHwnXqiMK4/BTFZFU= - tilebelt@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tilebelt/-/tilebelt-1.0.1.tgz#3bbf7113b3fec468efb0d9148f4bb71ef126a21a" @@ -12165,7 +12068,7 @@ xss@^1.0.9: commander "^2.20.3" cssfilter "0.0.10" -"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.1, xtend@~4.0.1: +xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==