From 57e5219b586bfd175935762b674c0f0a6ac3cb8b Mon Sep 17 00:00:00 2001 From: xiaoiver Date: Tue, 26 Sep 2023 19:18:06 +0800 Subject: [PATCH] fix: simplify the parmas of createBindings #1527 (#1529) (#1532) * fix: simplify the parmas of createBindings #1527 (#1529) * fix: simplify the parmas of createBindings #1527 * feat: support cubemap in webgpu * fix: remove immutable param from Texture #1527 * chore: commit changeset * fix: add min/maxDepth params in setViewport * chore: add translation action * chore: add name for test action * chore: padding space in test action * fix: adjust Kernel API * fix: use device api & remove unused examples * chore: update action yaml * fix: rename to @antv/g-device-api * chore: commit changeset * chore: commit changeset * chore(release): bump version (#1533) Co-authored-by: github-actions[bot] --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 24 +- .../__node__tests__/webgl/material.spec.js | 4 +- package.json | 21 +- packages/g-mobile-webgl/CHANGELOG.md | 9 + packages/g-mobile-webgl/package.json | 4 +- .../src/ContextRegisterPlugin.ts | 18 +- packages/g-mobile-webgl/src/index.ts | 28 +- packages/g-plugin-3d/CHANGELOG.md | 9 + packages/g-plugin-3d/package.json | 3 +- .../src/geometries/CapsuleGeometry.ts | 2 +- .../src/geometries/ConeGeometry.ts | 2 +- .../src/geometries/CubeGeometry.ts | 2 +- .../src/geometries/CylinderGeometry.ts | 2 +- .../src/geometries/PlaneGeometry.ts | 2 +- .../src/geometries/ProceduralGeometry.ts | 5 +- .../src/geometries/SphereGeometry.ts | 2 +- .../src/geometries/TorusGeometry.ts | 2 +- packages/g-plugin-3d/src/index.ts | 34 +- .../src/materials/MeshBasicMaterial.ts | 9 +- .../src/materials/MeshLambertMaterial.ts | 2 +- .../src/materials/MeshPhongMaterial.ts | 2 +- .../src/materials/PointMaterial.ts | 9 +- .../g-plugin-device-renderer/CHANGELOG.md | 7 + .../g-plugin-device-renderer/package.json | 3 +- .../src/PickingPlugin.ts | 4 +- .../src/RenderGraphPlugin.ts | 6 +- .../src/TexturePool.ts | 11 +- .../src/drawcalls/Image.ts | 2 +- .../src/drawcalls/Instanced.ts | 105 +- .../src/drawcalls/InstancedFill.ts | 2 +- .../src/drawcalls/InstancedLine.ts | 2 +- .../src/drawcalls/InstancedPath.ts | 2 +- .../src/drawcalls/SDF.ts | 2 +- .../src/drawcalls/Text.ts | 10 +- .../src/drawcalls/symbol/GlyphManager.ts | 5 +- .../src/geometries/BufferGeometry.ts | 52 +- .../g-plugin-device-renderer/src/index.ts | 4 +- .../src/interfaces.ts | 2 +- .../src/materials/Material.ts | 17 +- .../src/materials/ShaderMaterial.ts | 2 +- .../src/passes/Copy.ts | 89 - .../src/passes/FXAA.ts | 12 +- .../src/passes/PostProcessing.ts | 110 - .../src/passes/index.ts | 1 - .../src/platform/constants.ts | 834 ---- .../src/platform/format.ts | 400 -- .../src/platform/index.ts | 8 - .../src/platform/interfaces.ts | 757 --- .../src/platform/utils/assert.ts | 11 - .../src/platform/utils/color.ts | 31 - .../src/platform/utils/depth.ts | 85 - .../src/platform/utils/endian.ts | 13 - .../src/platform/utils/hash.ts | 379 -- .../src/platform/utils/index.ts | 7 - .../src/platform/utils/states.ts | 282 -- .../src/platform/utils/uniform.ts | 370 -- .../src/render/DeviceProgram.ts | 2 +- .../src/render/DynamicUniformBuffer.ts | 11 +- .../src/render/RenderCache.ts | 55 +- .../src/render/RenderGraph.ts | 4 +- .../src/render/RenderGraphHelpers.ts | 4 +- .../src/render/RenderGraphPass.ts | 8 +- .../src/render/RenderHelper.ts | 2 +- .../src/render/RenderInst.ts | 77 +- .../src/render/RenderInstList.ts | 4 +- .../src/render/RenderInstManager.ts | 10 +- .../src/render/RenderTarget.ts | 16 +- .../src/render/RenderTargetDescription.ts | 4 +- .../src/render/SingleSampledTexture.ts | 17 +- .../src/render/TemporalTexture.ts | 20 +- .../src/render/TextureHolder.ts | 2 +- .../src/render/interfaces.ts | 7 +- .../src/render/utils/layer.ts | 2 +- .../src/render/utils/matrix.ts | 2 +- .../src/render/utils/projection.ts | 2 +- .../src/renderer/BatchManager.ts | 2 +- .../src/shader/compiler.ts | 466 -- packages/g-plugin-gpgpu/CHANGELOG.md | 171 - packages/g-plugin-gpgpu/LICENSE | 21 - packages/g-plugin-gpgpu/README.md | 16 - packages/g-plugin-gpgpu/package.json | 50 - packages/g-plugin-gpgpu/rollup.config.mjs | 14 - packages/g-plugin-gpgpu/src/Kernel.ts | 194 - packages/g-plugin-gpgpu/src/index.ts | 9 - packages/g-plugin-gpgpu/src/interface.ts | 214 - packages/g-plugin-gpgpu/tsconfig.json | 5 - packages/g-plugin-webgl-device/CHANGELOG.md | 169 - packages/g-plugin-webgl-device/LICENSE | 21 - packages/g-plugin-webgl-device/README.md | 3 - packages/g-plugin-webgl-device/package.json | 51 - .../g-plugin-webgl-device/rollup.config.mjs | 14 - .../src/WebGLDeviceContribution.ts | 71 - packages/g-plugin-webgl-device/src/index.ts | 23 - .../g-plugin-webgl-device/src/interfaces.ts | 6 - .../src/platform/Bindings.ts | 38 - .../src/platform/Buffer.ts | 230 - .../src/platform/ComputePass.ts | 53 - .../src/platform/ComputePipeline.ts | 33 - .../src/platform/Device.ts | 2573 ---------- .../src/platform/InputLayout.ts | 160 - .../src/platform/Program.ts | 221 - .../src/platform/QueryPool.ts | 58 - .../src/platform/Readback.ts | 220 - .../src/platform/RenderPipeline.ts | 126 - .../src/platform/RenderTarget.ts | 91 - .../src/platform/ResourceBase.ts | 39 - .../src/platform/ResourceCreationTracker.ts | 41 - .../src/platform/Sampler.ts | 183 - .../src/platform/Texture.ts | 414 -- .../src/platform/interfaces.ts | 59 - .../src/platform/utils.ts | 296 -- packages/g-plugin-webgl-device/tsconfig.json | 5 - packages/g-plugin-webgpu-device/CHANGELOG.md | 169 - packages/g-plugin-webgpu-device/LICENSE | 21 - packages/g-plugin-webgpu-device/README.md | 7 - packages/g-plugin-webgpu-device/package.json | 52 - .../g-plugin-webgpu-device/rollup.config.mjs | 14 - .../src/WebGPUDeviceContribution.ts | 62 - packages/g-plugin-webgpu-device/src/index.ts | 24 - .../g-plugin-webgpu-device/src/interfaces.ts | 4 - .../src/platform/Bindings.ts | 121 - .../src/platform/Buffer.ts | 135 - .../src/platform/ComputePass.ts | 89 - .../src/platform/ComputePipeline.ts | 55 - .../src/platform/Device.ts | 871 ---- .../src/platform/InputLayout.ts | 62 - .../src/platform/Program.ts | 89 - .../src/platform/QueryPool.ts | 57 - .../src/platform/Readback.ts | 369 -- .../src/platform/RenderPass.ts | 401 -- .../src/platform/RenderPipeline.ts | 37 - .../src/platform/ResourceBase.ts | 28 - .../src/platform/Sampler.ts | 67 - .../src/platform/Texture.ts | 144 - .../src/platform/constants.ts | 21 - .../src/platform/interfaces.ts | 47 - .../src/platform/utils.ts | 603 --- packages/g-plugin-webgpu-device/tsconfig.json | 8 - packages/g-web-components/CHANGELOG.md | 7 + packages/g-web-components/package.json | 2 +- packages/g-webgl/CHANGELOG.md | 9 + packages/g-webgl/package.json | 4 +- packages/g-webgl/src/ContextRegisterPlugin.ts | 21 +- packages/g-webgl/src/index.ts | 21 +- packages/g-webgpu/CHANGELOG.md | 9 + packages/g-webgpu/package.json | 4 +- .../g-webgpu/src/ContextRegisterPlugin.ts | 13 +- packages/g-webgpu/src/index.ts | 13 +- pnpm-lock.yaml | 4121 +++++++++++++---- site/.dumi/global.ts | 28 +- site/docs/plugins/device-renderer.en.md | 1 - site/docs/plugins/device-renderer.zh.md | 1 - site/examples/3d/device/demo/compute-boids.ts | 391 -- site/examples/3d/device/demo/cubemap.ts | 418 -- .../3d/device/demo/instanced-cubes.ts | 367 -- site/examples/3d/device/demo/meta.json | 96 - site/examples/3d/device/demo/msaa.ts | 194 - .../device/demo/primitive-topology-points.ts | 184 - .../demo/primitive-topology-triangles.ts | 198 - site/examples/3d/device/demo/resize-canvas.ts | 208 - site/examples/3d/device/demo/rotating-cube.ts | 334 -- site/examples/3d/device/demo/sampler.ts | 0 site/examples/3d/device/demo/textured-cube.ts | 389 -- site/examples/3d/device/demo/wgsl.ts | 163 - site/examples/3d/device/index.en.md | 4 - site/examples/3d/device/index.zh.md | 4 - .../basic-algorithm/demo/add-2-vectors.js | 94 +- .../demo/compute-shader-test.js | 97 +- .../demo/matrix-multiplication.js | 278 +- .../gpgpu/basic-algorithm/demo/reduce.js | 274 +- .../demo/bellman-ford-big-dataset.js | 163 +- .../demo/bellman-ford.js | 203 +- .../graph-analysis-algorithm/demo/bfs.js | 5 - .../demo/fruchterman.js | 80 +- .../graph-analysis-algorithm/demo/louvain.js | 5 - .../demo/pagerank-big-dataset.js | 129 +- .../graph-analysis-algorithm/demo/pagerank.js | 238 +- site/package.json | 1 + 179 files changed, 4490 insertions(+), 18271 deletions(-) delete mode 100644 packages/g-plugin-device-renderer/src/passes/Copy.ts delete mode 100644 packages/g-plugin-device-renderer/src/passes/PostProcessing.ts delete mode 100644 packages/g-plugin-device-renderer/src/platform/constants.ts delete mode 100644 packages/g-plugin-device-renderer/src/platform/format.ts delete mode 100644 packages/g-plugin-device-renderer/src/platform/index.ts delete mode 100644 packages/g-plugin-device-renderer/src/platform/interfaces.ts delete mode 100644 packages/g-plugin-device-renderer/src/platform/utils/assert.ts delete mode 100644 packages/g-plugin-device-renderer/src/platform/utils/color.ts delete mode 100644 packages/g-plugin-device-renderer/src/platform/utils/depth.ts delete mode 100644 packages/g-plugin-device-renderer/src/platform/utils/endian.ts delete mode 100644 packages/g-plugin-device-renderer/src/platform/utils/hash.ts delete mode 100644 packages/g-plugin-device-renderer/src/platform/utils/index.ts delete mode 100644 packages/g-plugin-device-renderer/src/platform/utils/states.ts delete mode 100644 packages/g-plugin-device-renderer/src/platform/utils/uniform.ts delete mode 100644 packages/g-plugin-device-renderer/src/shader/compiler.ts delete mode 100644 packages/g-plugin-gpgpu/CHANGELOG.md delete mode 100644 packages/g-plugin-gpgpu/LICENSE delete mode 100644 packages/g-plugin-gpgpu/README.md delete mode 100644 packages/g-plugin-gpgpu/package.json delete mode 100644 packages/g-plugin-gpgpu/rollup.config.mjs delete mode 100644 packages/g-plugin-gpgpu/src/Kernel.ts delete mode 100644 packages/g-plugin-gpgpu/src/index.ts delete mode 100644 packages/g-plugin-gpgpu/src/interface.ts delete mode 100644 packages/g-plugin-gpgpu/tsconfig.json delete mode 100644 packages/g-plugin-webgl-device/CHANGELOG.md delete mode 100644 packages/g-plugin-webgl-device/LICENSE delete mode 100644 packages/g-plugin-webgl-device/README.md delete mode 100644 packages/g-plugin-webgl-device/package.json delete mode 100644 packages/g-plugin-webgl-device/rollup.config.mjs delete mode 100644 packages/g-plugin-webgl-device/src/WebGLDeviceContribution.ts delete mode 100644 packages/g-plugin-webgl-device/src/index.ts delete mode 100644 packages/g-plugin-webgl-device/src/interfaces.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/Bindings.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/Buffer.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/ComputePass.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/ComputePipeline.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/Device.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/InputLayout.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/Program.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/QueryPool.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/Readback.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/RenderPipeline.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/RenderTarget.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/ResourceBase.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/ResourceCreationTracker.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/Sampler.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/Texture.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/interfaces.ts delete mode 100644 packages/g-plugin-webgl-device/src/platform/utils.ts delete mode 100644 packages/g-plugin-webgl-device/tsconfig.json delete mode 100644 packages/g-plugin-webgpu-device/CHANGELOG.md delete mode 100644 packages/g-plugin-webgpu-device/LICENSE delete mode 100644 packages/g-plugin-webgpu-device/README.md delete mode 100644 packages/g-plugin-webgpu-device/package.json delete mode 100644 packages/g-plugin-webgpu-device/rollup.config.mjs delete mode 100644 packages/g-plugin-webgpu-device/src/WebGPUDeviceContribution.ts delete mode 100644 packages/g-plugin-webgpu-device/src/index.ts delete mode 100644 packages/g-plugin-webgpu-device/src/interfaces.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/Bindings.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/Buffer.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/ComputePass.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/ComputePipeline.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/Device.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/InputLayout.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/Program.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/QueryPool.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/Readback.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/RenderPass.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/RenderPipeline.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/ResourceBase.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/Sampler.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/Texture.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/constants.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/interfaces.ts delete mode 100644 packages/g-plugin-webgpu-device/src/platform/utils.ts delete mode 100644 packages/g-plugin-webgpu-device/tsconfig.json delete mode 100644 site/examples/3d/device/demo/compute-boids.ts delete mode 100644 site/examples/3d/device/demo/cubemap.ts delete mode 100644 site/examples/3d/device/demo/instanced-cubes.ts delete mode 100644 site/examples/3d/device/demo/meta.json delete mode 100644 site/examples/3d/device/demo/msaa.ts delete mode 100644 site/examples/3d/device/demo/primitive-topology-points.ts delete mode 100644 site/examples/3d/device/demo/primitive-topology-triangles.ts delete mode 100644 site/examples/3d/device/demo/resize-canvas.ts delete mode 100644 site/examples/3d/device/demo/rotating-cube.ts delete mode 100644 site/examples/3d/device/demo/sampler.ts delete mode 100644 site/examples/3d/device/demo/textured-cube.ts delete mode 100644 site/examples/3d/device/demo/wgsl.ts delete mode 100644 site/examples/3d/device/index.en.md delete mode 100644 site/examples/3d/device/index.zh.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d6744069..7a1a9ffe4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: - name: Use Node.js 16 uses: actions/setup-node@v3 with: - node-version: 16 # semantic-release 需要 >= 16 的 Node.js 环境 + node-version: 16 cache: 'pnpm' # 发布开始通知 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e25150ead..63fe8b10f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,15 +5,7 @@ on: [pull_request] jobs: test: name: Test - # jest-electron 需要 macOS 环境, 但是 免费用户 并发有限制, 容易排队 https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners - # runs-on: macos-latest # (目前 macos-latest 对应的是 Big Sur 11, macos-12 对应 Monterey 12) - # macOS 3-core CPU, 其他 2-core CPU - runs-on: macos-latest - if: "!contains(github.event.head_commit.message, '[skip ci]')" - strategy: - matrix: - node-version: [16] - + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -27,24 +19,26 @@ jobs: with: version: 7 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js 16 uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: 16 cache: 'pnpm' + - name: Install headless-gl dependencies + run: | + sudo apt-get update + sudo apt-get install -y mesa-utils xvfb libgl1-mesa-dri libglapi-mesa libosmesa6 + - name: Install dependencies run: pnpm install - name: Build run: pnpm build - - name: Test - run: pnpm test - - name: Cov run: | - pnpm cov + xvfb-run -s "-ac -screen 0 1280x1024x16" pnpm cov env: CI: true - name: Coveralls diff --git a/__tests__/integration/__node__tests__/webgl/material.spec.js b/__tests__/integration/__node__tests__/webgl/material.spec.js index 3676116a9..a3bff4fe2 100644 --- a/__tests__/integration/__node__tests__/webgl/material.spec.js +++ b/__tests__/integration/__node__tests__/webgl/material.spec.js @@ -6,7 +6,7 @@ const { ShaderMaterial, BufferGeometry, Mesh, - VertexBufferFrequency, + VertexStepMode, Format, VertexAttributeBufferIndex, VertexAttributeLocation, @@ -81,7 +81,7 @@ describe('Render custom material with g-webgl', () => { bufferGeometry.setVertexBuffer({ bufferIndex: VertexAttributeBufferIndex.POSITION, byteStride: 4 * 3, - frequency: VertexBufferFrequency.VERTEX, + frequency: VertexStepMode.VERTEX, attributes: [ { format: Format.F32_RGB, diff --git a/package.json b/package.json index 9ffdcfa61..8265e5b78 100644 --- a/package.json +++ b/package.json @@ -51,27 +51,28 @@ }, "devDependencies": { "@antv/util": "^3.3.4", + "@changesets/cli": "^2.26.2", "@commitlint/cli": "^8.3.6", "@commitlint/config-angular": "^9.1.2", - "@changesets/cli": "^2.26.2", "@rollup/plugin-babel": "^6.0.3", "@rollup/plugin-commonjs": "^21.1.0", - "@rollup/plugin-node-resolve": "^15.1.0", + "@rollup/plugin-node-resolve": "^15.2.1", "@rollup/plugin-terser": "^0.4.3", - "@rollup/plugin-typescript": "^11.1.1", + "@rollup/plugin-typescript": "^11.1.3", + "@types/gl": "^6.0.2", "@types/jest": "^26.0.24", - "@types/node": "^14.18.51", - "@typescript-eslint/eslint-plugin": "^5.0.0", - "@typescript-eslint/parser": "^5.0.0", + "@types/node": "^14.18.61", + "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/parser": "^5.62.0", "canvas": "^2.11.2", - "case-police": "^0.5.10", + "case-police": "^0.5.14", "cross-env": "^6.0.3", "d3": "^7.8.5", "eslint": "^7.32.0", "eslint-plugin-jest": "24.3.6", + "get-pixels": "3.3.3", "git-contributor": "~1.0.11", "gl": "^6.0.2", - "get-pixels": "3.3.3", "hammerjs": "^2.0.8", "husky": "^7.0.4", "is-ci": "2.0.0", @@ -87,12 +88,12 @@ "pngjs": "^6.0.0", "prettier": "^2.8.8", "rimraf": "^4.4.1", - "rollup": "^3.25.1", + "rollup": "^3.29.2", "rollup-plugin-polyfill-node": "^0.8.0", "rollup-plugin-visualizer": "^5.9.2", "sinon": "^11.1.2", "ts-jest": "^26.5.6", - "typescript": "^5.1.3", + "typescript": "^5.2.2", "vite": "^3.2.7", "xmlserializer": "^0.6.1" }, diff --git a/packages/g-mobile-webgl/CHANGELOG.md b/packages/g-mobile-webgl/CHANGELOG.md index dddfd0727..47bc005cc 100644 --- a/packages/g-mobile-webgl/CHANGELOG.md +++ b/packages/g-mobile-webgl/CHANGELOG.md @@ -1,5 +1,14 @@ # @antv/g-mobile-webgl +## 0.9.21 + +### Patch Changes + +- 83195bb7: Use @antv/g-device-api. +- Updated dependencies [83195bb7] +- Updated dependencies [769480aa] + - @antv/g-plugin-device-renderer@1.9.18 + ## 0.9.20 ### Patch Changes diff --git a/packages/g-mobile-webgl/package.json b/packages/g-mobile-webgl/package.json index f4c14595e..b1228bef7 100644 --- a/packages/g-mobile-webgl/package.json +++ b/packages/g-mobile-webgl/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g-mobile-webgl", - "version": "0.9.20", + "version": "0.9.21", "description": "A renderer implemented by WebGL1/2 in mobile environment", "keywords": [ "antv", @@ -44,7 +44,7 @@ "@antv/g-plugin-html-renderer": "workspace:*", "@antv/g-plugin-image-loader": "workspace:*", "@antv/g-plugin-mobile-interaction": "workspace:*", - "@antv/g-plugin-webgl-device": "workspace:*", + "@antv/g-device-api": "^1.2.2", "@antv/util": "^3.3.4", "tslib": "^2.5.3" }, diff --git a/packages/g-mobile-webgl/src/ContextRegisterPlugin.ts b/packages/g-mobile-webgl/src/ContextRegisterPlugin.ts index bf3280e06..4cc0e01c1 100644 --- a/packages/g-mobile-webgl/src/ContextRegisterPlugin.ts +++ b/packages/g-mobile-webgl/src/ContextRegisterPlugin.ts @@ -1,17 +1,31 @@ import { AbstractRendererPlugin } from '@antv/g-lite'; import type * as DeviceRenderer from '@antv/g-plugin-device-renderer'; +import { WebGLDeviceContribution } from '@antv/g-device-api'; import { WebGLContextService } from './WebGLContextService'; +import { MobileWebglRenderConfig } from '.'; export class ContextRegisterPlugin extends AbstractRendererPlugin { name = 'mobile-webgl-context-register'; - constructor(private rendererPlugin: DeviceRenderer.Plugin) { + constructor( + private rendererPlugin: DeviceRenderer.Plugin, + private config: MobileWebglRenderConfig, + ) { super(); } init(): void { this.context.ContextService = WebGLContextService; - // @ts-ignore this.context.deviceRendererPlugin = this.rendererPlugin; + const config = this.config; + this.context.deviceContribution = new WebGLDeviceContribution({ + ...(config?.targets + ? { + targets: config.targets, + } + : { + targets: ['webgl2', 'webgl1'], + }), + }); } destroy(): void { delete this.context.ContextService; diff --git a/packages/g-mobile-webgl/src/index.ts b/packages/g-mobile-webgl/src/index.ts index 1354e75d5..b68a4c27e 100644 --- a/packages/g-mobile-webgl/src/index.ts +++ b/packages/g-mobile-webgl/src/index.ts @@ -5,17 +5,16 @@ import * as DragDropEvent from '@antv/g-plugin-dragndrop'; import * as HTMLRenderer from '@antv/g-plugin-html-renderer'; import * as ImageLoader from '@antv/g-plugin-image-loader'; import * as DomInteraction from '@antv/g-plugin-mobile-interaction'; -import * as WebGLDevice from '@antv/g-plugin-webgl-device'; import { isNil } from '@antv/util'; import { ContextRegisterPlugin } from './ContextRegisterPlugin'; -export { DomInteraction, DeviceRenderer, WebGLDevice, HTMLRenderer }; +export { DomInteraction, DeviceRenderer, HTMLRenderer }; -interface WebGLRendererConfig extends RendererConfig { +export interface WebGLRendererConfig extends RendererConfig { targets: ('webgl1' | 'webgl2')[]; } -type MobileWebglRenderConfig = Partial< +export type MobileWebglRenderConfig = Partial< WebGLRendererConfig & { isDocumentDraggable: boolean; isDocumentDroppable: boolean; @@ -30,26 +29,21 @@ export class Renderer extends AbstractRenderer { const deviceRendererPlugin = new DeviceRenderer.Plugin(); - this.registerPlugin(new ContextRegisterPlugin(deviceRendererPlugin)); - this.registerPlugin(new ImageLoader.Plugin()); this.registerPlugin( - new WebGLDevice.Plugin( - config?.targets - ? { - targets: config.targets, - } - : { - targets: ['webgl2', 'webgl1'], - }, - ), + new ContextRegisterPlugin(deviceRendererPlugin, config), ); + this.registerPlugin(new ImageLoader.Plugin()); this.registerPlugin(deviceRendererPlugin); this.registerPlugin(new DomInteraction.Plugin()); this.registerPlugin(new HTMLRenderer.Plugin()); this.registerPlugin( new DragDropEvent.Plugin({ - isDocumentDraggable: isNil(config?.isDocumentDraggable) ? true : config.isDocumentDraggable, - isDocumentDroppable: isNil(config?.isDocumentDroppable) ? true : config.isDocumentDroppable, + isDocumentDraggable: isNil(config?.isDocumentDraggable) + ? true + : config.isDocumentDraggable, + isDocumentDroppable: isNil(config?.isDocumentDroppable) + ? true + : config.isDocumentDroppable, dragstartDistanceThreshold: isNil(config?.dragstartDistanceThreshold) ? 10 : config.dragstartDistanceThreshold, diff --git a/packages/g-plugin-3d/CHANGELOG.md b/packages/g-plugin-3d/CHANGELOG.md index 0123766b8..d7a25fbe6 100644 --- a/packages/g-plugin-3d/CHANGELOG.md +++ b/packages/g-plugin-3d/CHANGELOG.md @@ -1,5 +1,14 @@ # @antv/g-plugin-3d +## 1.9.18 + +### Patch Changes + +- 83195bb7: Use @antv/g-device-api. +- Updated dependencies [83195bb7] +- Updated dependencies [769480aa] + - @antv/g-plugin-device-renderer@1.9.18 + ## 1.9.17 ### Patch Changes diff --git a/packages/g-plugin-3d/package.json b/packages/g-plugin-3d/package.json index 3f7379611..eeafb45b3 100644 --- a/packages/g-plugin-3d/package.json +++ b/packages/g-plugin-3d/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g-plugin-3d", - "version": "1.9.17", + "version": "1.9.18", "description": "Provide 3D extension for G", "keywords": [ "antv", @@ -41,6 +41,7 @@ "@antv/g-lite": "workspace:*", "@antv/g-plugin-device-renderer": "workspace:*", "@antv/g-shader-components": "workspace:*", + "@antv/g-device-api": "^1.2.2", "gl-matrix": "^3.4.3", "tslib": "^2.5.3" }, diff --git a/packages/g-plugin-3d/src/geometries/CapsuleGeometry.ts b/packages/g-plugin-3d/src/geometries/CapsuleGeometry.ts index 3b1f3f8ee..7dba9c267 100644 --- a/packages/g-plugin-3d/src/geometries/CapsuleGeometry.ts +++ b/packages/g-plugin-3d/src/geometries/CapsuleGeometry.ts @@ -1,4 +1,4 @@ -import type { Device } from '@antv/g-plugin-device-renderer'; +import type { Device } from '@antv/g-device-api'; import { ProceduralGeometry } from './ProceduralGeometry'; import { createConeData } from './util'; diff --git a/packages/g-plugin-3d/src/geometries/ConeGeometry.ts b/packages/g-plugin-3d/src/geometries/ConeGeometry.ts index 939d87954..fe47b1536 100644 --- a/packages/g-plugin-3d/src/geometries/ConeGeometry.ts +++ b/packages/g-plugin-3d/src/geometries/ConeGeometry.ts @@ -1,4 +1,4 @@ -import type { Device } from '@antv/g-plugin-device-renderer'; +import type { Device } from '@antv/g-device-api'; import { ProceduralGeometry } from './ProceduralGeometry'; import { createConeData } from './util'; diff --git a/packages/g-plugin-3d/src/geometries/CubeGeometry.ts b/packages/g-plugin-3d/src/geometries/CubeGeometry.ts index b6831fdc5..29f1ad399 100644 --- a/packages/g-plugin-3d/src/geometries/CubeGeometry.ts +++ b/packages/g-plugin-3d/src/geometries/CubeGeometry.ts @@ -1,4 +1,4 @@ -import type { Device } from '@antv/g-plugin-device-renderer'; +import type { Device } from '@antv/g-device-api'; import { vec3 } from 'gl-matrix'; import { ProceduralGeometry } from './ProceduralGeometry'; import { primitiveUv1Padding, primitiveUv1PaddingScale } from './util'; diff --git a/packages/g-plugin-3d/src/geometries/CylinderGeometry.ts b/packages/g-plugin-3d/src/geometries/CylinderGeometry.ts index 27ce83a68..234c794d1 100644 --- a/packages/g-plugin-3d/src/geometries/CylinderGeometry.ts +++ b/packages/g-plugin-3d/src/geometries/CylinderGeometry.ts @@ -1,4 +1,4 @@ -import type { Device } from '@antv/g-plugin-device-renderer'; +import type { Device } from '@antv/g-device-api'; import { ProceduralGeometry } from './ProceduralGeometry'; import { createConeData } from './util'; diff --git a/packages/g-plugin-3d/src/geometries/PlaneGeometry.ts b/packages/g-plugin-3d/src/geometries/PlaneGeometry.ts index f5fb55637..400cb92b2 100644 --- a/packages/g-plugin-3d/src/geometries/PlaneGeometry.ts +++ b/packages/g-plugin-3d/src/geometries/PlaneGeometry.ts @@ -1,4 +1,4 @@ -import type { Device } from '@antv/g-plugin-device-renderer'; +import type { Device } from '@antv/g-device-api'; import { ProceduralGeometry } from './ProceduralGeometry'; export interface PlaneGeometryProps { diff --git a/packages/g-plugin-3d/src/geometries/ProceduralGeometry.ts b/packages/g-plugin-3d/src/geometries/ProceduralGeometry.ts index d1ac44507..6da9808e9 100644 --- a/packages/g-plugin-3d/src/geometries/ProceduralGeometry.ts +++ b/packages/g-plugin-3d/src/geometries/ProceduralGeometry.ts @@ -1,12 +1,11 @@ import { AABB } from '@antv/g-lite'; import { BufferGeometry, - Format, VertexAttributeBufferIndex, VertexAttributeLocation, - VertexStepMode, } from '@antv/g-plugin-device-renderer'; -import type { Device } from '@antv/g-plugin-device-renderer'; +import type { Device } from '@antv/g-device-api'; +import { Format, VertexStepMode } from '@antv/g-device-api'; import { mat4, vec3, vec4 } from 'gl-matrix'; export interface Topology { diff --git a/packages/g-plugin-3d/src/geometries/SphereGeometry.ts b/packages/g-plugin-3d/src/geometries/SphereGeometry.ts index 91d634d93..77d00f7ad 100644 --- a/packages/g-plugin-3d/src/geometries/SphereGeometry.ts +++ b/packages/g-plugin-3d/src/geometries/SphereGeometry.ts @@ -1,4 +1,4 @@ -import type { Device } from '@antv/g-plugin-device-renderer'; +import type { Device } from '@antv/g-device-api'; import { ProceduralGeometry } from './ProceduralGeometry'; export interface SphereGeometryProps { diff --git a/packages/g-plugin-3d/src/geometries/TorusGeometry.ts b/packages/g-plugin-3d/src/geometries/TorusGeometry.ts index eff55e0c3..59dbeeb65 100644 --- a/packages/g-plugin-3d/src/geometries/TorusGeometry.ts +++ b/packages/g-plugin-3d/src/geometries/TorusGeometry.ts @@ -1,4 +1,4 @@ -import type { Device } from '@antv/g-plugin-device-renderer'; +import type { Device } from '@antv/g-device-api'; import { ProceduralGeometry } from './ProceduralGeometry'; export interface TorusGeometryProps { diff --git a/packages/g-plugin-3d/src/index.ts b/packages/g-plugin-3d/src/index.ts index 81ad52e7f..334716897 100644 --- a/packages/g-plugin-3d/src/index.ts +++ b/packages/g-plugin-3d/src/index.ts @@ -1,32 +1,34 @@ import { AbstractRendererPlugin } from '@antv/g-lite'; +import { + BufferGeometry, + Fog, + FogType, + Light, + Material, + Mesh, + ShaderMaterial, + VertexAttributeBufferIndex, + VertexAttributeLocation, +} from '@antv/g-plugin-device-renderer'; import { BlendFactor, BlendMode, BufferFrequencyHint, - BufferGeometry, ChannelWriteMask, - CompareMode, + CompareFunction, CullMode, - Fog, - FogType, Format, FrontFace, GL, - Light, - Material, - Mesh, - MipFilterMode, + MipmapFilterMode, PrimitiveTopology, SamplerFormatKind, - ShaderMaterial, StencilOp, TextureDimension, TextureUsage, - VertexAttributeBufferIndex, - VertexAttributeLocation, VertexStepMode, - WrapMode, -} from '@antv/g-plugin-device-renderer'; + AddressMode, +} from '@antv/g-device-api'; export * from './geometries'; export * from './lights'; @@ -37,7 +39,7 @@ export { BufferFrequencyHint, BufferGeometry, ChannelWriteMask, - CompareMode, + CompareFunction, CullMode, Fog, FogType, @@ -46,7 +48,7 @@ export { Light, Material, Mesh, - MipFilterMode, + MipmapFilterMode, PrimitiveTopology, SamplerFormatKind, ShaderMaterial, @@ -57,7 +59,7 @@ export { VertexAttributeBufferIndex, VertexAttributeLocation, VertexStepMode, - WrapMode, + AddressMode, }; export class Plugin extends AbstractRendererPlugin { diff --git a/packages/g-plugin-3d/src/materials/MeshBasicMaterial.ts b/packages/g-plugin-3d/src/materials/MeshBasicMaterial.ts index afccf710c..b69eec261 100644 --- a/packages/g-plugin-3d/src/materials/MeshBasicMaterial.ts +++ b/packages/g-plugin-3d/src/materials/MeshBasicMaterial.ts @@ -1,9 +1,6 @@ -import type { - IMaterial, - Texture, - Device, -} from '@antv/g-plugin-device-renderer'; -import { Material, CullMode } from '@antv/g-plugin-device-renderer'; +import type { IMaterial } from '@antv/g-plugin-device-renderer'; +import { Material } from '@antv/g-plugin-device-renderer'; +import { Texture, Device, CullMode } from '@antv/g-device-api'; import vert from '../shaders/material.basic.vert'; import frag from '../shaders/material.basic.frag'; diff --git a/packages/g-plugin-3d/src/materials/MeshLambertMaterial.ts b/packages/g-plugin-3d/src/materials/MeshLambertMaterial.ts index 18bef478d..042790064 100644 --- a/packages/g-plugin-3d/src/materials/MeshLambertMaterial.ts +++ b/packages/g-plugin-3d/src/materials/MeshLambertMaterial.ts @@ -1,6 +1,6 @@ import type { CSSRGB } from '@antv/g-lite'; import { parseColor } from '@antv/g-lite'; -import type { Device, Texture } from '@antv/g-plugin-device-renderer'; +import type { Device, Texture } from '@antv/g-device-api'; import frag from '../shaders/material.lambert.frag'; import vert from '../shaders/material.lambert.vert'; import type { IMeshBasicMaterial } from './MeshBasicMaterial'; diff --git a/packages/g-plugin-3d/src/materials/MeshPhongMaterial.ts b/packages/g-plugin-3d/src/materials/MeshPhongMaterial.ts index 9ab7ba021..32aa42fae 100644 --- a/packages/g-plugin-3d/src/materials/MeshPhongMaterial.ts +++ b/packages/g-plugin-3d/src/materials/MeshPhongMaterial.ts @@ -1,6 +1,6 @@ import type { CSSRGB } from '@antv/g-lite'; import { parseColor } from '@antv/g-lite'; -import type { Device, Texture } from '@antv/g-plugin-device-renderer'; +import type { Device, Texture } from '@antv/g-device-api'; import frag from '../shaders/material.phong.frag'; import vert from '../shaders/material.phong.vert'; import type { IMeshBasicMaterial } from './MeshBasicMaterial'; diff --git a/packages/g-plugin-3d/src/materials/PointMaterial.ts b/packages/g-plugin-3d/src/materials/PointMaterial.ts index 789545b95..6cd5843d0 100644 --- a/packages/g-plugin-3d/src/materials/PointMaterial.ts +++ b/packages/g-plugin-3d/src/materials/PointMaterial.ts @@ -1,9 +1,6 @@ -import type { - IMaterial, - Texture, - Device, -} from '@antv/g-plugin-device-renderer'; -import { Material, CullMode } from '@antv/g-plugin-device-renderer'; +import type { IMaterial } from '@antv/g-plugin-device-renderer'; +import { Material } from '@antv/g-plugin-device-renderer'; +import { Texture, Device, CullMode } from '@antv/g-device-api'; import vert from '../shaders/point.vert'; import frag from '../shaders/point.frag'; diff --git a/packages/g-plugin-device-renderer/CHANGELOG.md b/packages/g-plugin-device-renderer/CHANGELOG.md index e68806374..8e9430a50 100644 --- a/packages/g-plugin-device-renderer/CHANGELOG.md +++ b/packages/g-plugin-device-renderer/CHANGELOG.md @@ -1,5 +1,12 @@ # @antv/g-plugin-device-renderer +## 1.9.18 + +### Patch Changes + +- 83195bb7: Use @antv/g-device-api. +- 769480aa: Remove immutable param from Texture. + ## 1.9.17 ### Patch Changes diff --git a/packages/g-plugin-device-renderer/package.json b/packages/g-plugin-device-renderer/package.json index 61e1a7edb..374c8e6ef 100644 --- a/packages/g-plugin-device-renderer/package.json +++ b/packages/g-plugin-device-renderer/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g-plugin-device-renderer", - "version": "1.9.17", + "version": "1.9.18", "description": "A G plugin of renderer implementation with GPUDevice", "keywords": [ "antv", @@ -43,6 +43,7 @@ "@antv/g-plugin-image-loader": "workspace:*", "@antv/g-shader-components": "workspace:*", "@antv/util": "^3.3.4", + "@antv/g-device-api": "^1.2.2", "@webgpu/types": "^0.1.6", "earcut": "^2.2.3", "eventemitter3": "^5.0.1", diff --git a/packages/g-plugin-device-renderer/src/PickingPlugin.ts b/packages/g-plugin-device-renderer/src/PickingPlugin.ts index e95c54284..237cc0a5d 100644 --- a/packages/g-plugin-device-renderer/src/PickingPlugin.ts +++ b/packages/g-plugin-device-renderer/src/PickingPlugin.ts @@ -13,7 +13,7 @@ import { BlendMode, setAttachmentStateSimple, TransparentBlack, -} from './platform'; +} from '@antv/g-device-api'; import type { RenderHelper } from './render'; import { AntialiasingMode, @@ -309,7 +309,7 @@ export class PickingPlugin implements RenderingPlugin { // Push our outer template, which contains the dynamic UBO bindings... const template = this.renderHelper.pushTemplateRenderInst(); // SceneParams: binding = 0, ObjectParams: binding = 1 - template.setBindingLayouts([{ numUniformBuffers: 2, numSamplers: 0 }]); + template.setBindingLayout({ numUniformBuffers: 2, numSamplers: 0 }); template.setMegaStateFlags( setAttachmentStateSimple( { diff --git a/packages/g-plugin-device-renderer/src/RenderGraphPlugin.ts b/packages/g-plugin-device-renderer/src/RenderGraphPlugin.ts index 0b8a0ed79..df58cdba4 100644 --- a/packages/g-plugin-device-renderer/src/RenderGraphPlugin.ts +++ b/packages/g-plugin-device-renderer/src/RenderGraphPlugin.ts @@ -19,13 +19,13 @@ import { TextureDescriptor, TransparentBlack, TransparentWhite, -} from './platform'; +} from '@antv/g-device-api'; import { BlendFactor, BlendMode, colorNewFromRGBA, setAttachmentStateSimple, -} from './platform'; +} from '@antv/g-device-api'; import type { RGGraphBuilder, RenderHelper } from './render'; import { AntialiasingMode, @@ -352,7 +352,7 @@ export class RenderGraphPlugin implements RenderingPlugin { // Push our outer template, which contains the dynamic UBO bindings... const template = this.renderHelper.pushTemplateRenderInst(); // SceneParams: binding = 0, ObjectParams: binding = 1 - template.setBindingLayouts([{ numUniformBuffers: 2, numSamplers: 0 }]); + template.setBindingLayout({ numUniformBuffers: 2, numSamplers: 0 }); template.setMegaStateFlags( setAttachmentStateSimple( { diff --git a/packages/g-plugin-device-renderer/src/TexturePool.ts b/packages/g-plugin-device-renderer/src/TexturePool.ts index 22de91948..c36381f99 100644 --- a/packages/g-plugin-device-renderer/src/TexturePool.ts +++ b/packages/g-plugin-device-renderer/src/TexturePool.ts @@ -12,13 +12,13 @@ import { } from '@antv/g-lite'; import type { ImagePool } from '@antv/g-plugin-image-loader'; import { isString } from '@antv/util'; -import type { Device, Texture, TextureDescriptor } from './platform'; +import type { Device, Texture, TextureDescriptor } from '@antv/g-device-api'; import { Format, TextureDimension, TextureEvent, TextureUsage, -} from './platform'; +} from '@antv/g-device-api'; export interface GradientParams { width: number; @@ -45,17 +45,16 @@ export class TexturePool { if (!id || !this.textureCache[id]) { texture = device.createTexture({ - pixelFormat: Format.U8_RGBA_NORM, + format: Format.U8_RGBA_NORM, width: 1, height: 1, - depth: 1, - numLevels: 1, + depthOrArrayLayers: 1, + mipLevelCount: 1, dimension: TextureDimension.TEXTURE_2D, usage: TextureUsage.SAMPLED, pixelStore: { unpackFlipY: false, }, - immutable: false, ...descriptor, }); diff --git a/packages/g-plugin-device-renderer/src/drawcalls/Image.ts b/packages/g-plugin-device-renderer/src/drawcalls/Image.ts index a400a71a6..20e5507f7 100644 --- a/packages/g-plugin-device-renderer/src/drawcalls/Image.ts +++ b/packages/g-plugin-device-renderer/src/drawcalls/Image.ts @@ -4,7 +4,7 @@ import { VertexAttributeBufferIndex, VertexAttributeLocation, } from './Instanced'; -import { Format, VertexStepMode } from '../platform'; +import { Format, VertexStepMode } from '@antv/g-device-api'; import frag from '../shader/image.frag'; import vert from '../shader/image.vert'; import { enumToObject } from '../utils'; diff --git a/packages/g-plugin-device-renderer/src/drawcalls/Instanced.ts b/packages/g-plugin-device-renderer/src/drawcalls/Instanced.ts index b880db49d..dcfd5e3d4 100644 --- a/packages/g-plugin-device-renderer/src/drawcalls/Instanced.ts +++ b/packages/g-plugin-device-renderer/src/drawcalls/Instanced.ts @@ -12,18 +12,17 @@ import type { LightPool } from '../LightPool'; import type { Fog } from '../lights'; import type { Material } from '../materials'; import { MaterialEvent, ShaderMaterial } from '../materials'; -import type { BindingLayoutSamplerDescriptor } from '../platform'; import { ChannelWriteMask, - CompareMode, + CompareFunction, Format, makeTextureDescriptor2D, - MipFilterMode, + MipmapFilterMode, StencilOp, - TexFilterMode, + FilterMode, VertexStepMode, - WrapMode, -} from '../platform'; + AddressMode, +} from '@antv/g-device-api'; import type { RenderInst, RenderInstUniform, RenderHelper } from '../render'; import { DeviceProgram, @@ -127,7 +126,6 @@ export abstract class Instanced { private program: DeviceProgram = new DeviceProgram(); geometryDirty = true; - /** * the same material maybe shared between different canvases */ @@ -136,7 +134,6 @@ export abstract class Instanced { * texture mappings */ protected textureMappings: TextureMapping[] = []; - protected samplerEntries: BindingLayoutSamplerDescriptor[]; /** * Divisor of instanced array. @@ -515,12 +512,12 @@ export abstract class Instanced { this.material.stencilWrite = true; // @see https://open.gl/depthstencils this.material.depthWrite = false; - this.material.stencilCompare = CompareMode.ALWAYS; + this.material.stencilCompare = CompareFunction.ALWAYS; this.material.stencilPassOp = StencilOp.REPLACE; } else { this.material.stencilWrite = false; this.material.depthWrite = true; - this.material.stencilCompare = CompareMode.EQUAL; + this.material.stencilCompare = CompareFunction.EQUAL; this.material.stencilPassOp = StencilOp.KEEP; } } else { @@ -565,13 +562,13 @@ export abstract class Instanced { 'Material Texture ' + key, ); mapping.sampler = this.renderHelper.getCache().createSampler({ - wrapS: WrapMode.CLAMP, - wrapT: WrapMode.CLAMP, - minFilter: TexFilterMode.POINT, - magFilter: TexFilterMode.BILINEAR, - mipFilter: MipFilterMode.LINEAR, - minLOD: 0, - maxLOD: 0, + addressModeU: AddressMode.CLAMP_TO_EDGE, + addressModeV: AddressMode.CLAMP_TO_EDGE, + minFilter: FilterMode.POINT, + magFilter: FilterMode.BILINEAR, + mipmapFilter: MipmapFilterMode.LINEAR, + lodMinClamp: 0, + lodMaxClamp: 0, }); this.textureMappings.push(mapping); @@ -659,11 +656,13 @@ export abstract class Instanced { renderInst.setProgram(program); renderInst.setVertexInput( inputLayout, - this.geometry.vertexBuffers.map((buffer) => ({ - buffer, - byteOffset: 0, - })), - useIndexes ? { buffer: this.geometry.indexBuffer, byteOffset: 0 } : null, + this.geometry.vertexBuffers + .filter((b) => !!b) + .map((buffer) => ({ + buffer, + byteOffset: 0, + })), + useIndexes ? { buffer: this.geometry.indexBuffer, offset: 0 } : null, ); this.renderer.beforeUploadUBO(renderInst, this); @@ -893,43 +892,36 @@ export abstract class Instanced { // need generate barycentric coordinates const indices = geometry.indices; const indiceNum = geometry.indices.length; - const originalVertexBuffers = geometry.vertices.map((buffer) => { // @ts-ignore return buffer.slice(); }) as ArrayBufferView[]; - for ( let i = VertexAttributeBufferIndex.PICKING_COLOR; i < geometry.vertexBuffers.length; i++ ) { - const { byteStride } = + const { arrayStride } = geometry.inputLayoutDescriptor.vertexBufferDescriptors[i]; - geometry.vertices[i] = new Float32Array((byteStride / 4) * indiceNum); + geometry.vertices[i] = new Float32Array((arrayStride / 4) * indiceNum); } - // reallocate attribute data let cursor = 0; const uniqueIndices = new Uint32Array(indiceNum); for (let i = 0; i < indiceNum; i++) { const ii = indices[i]; - for (let j = 1; j < geometry.vertices.length; j++) { - const { byteStride } = + const { arrayStride } = geometry.inputLayoutDescriptor.vertexBufferDescriptors[j]; - const size = byteStride / 4; - + const size = arrayStride / 4; for (let k = 0; k < size; k++) { geometry.vertices[j][cursor * size + k] = originalVertexBuffers[j][ii * size + k]; } } - uniqueIndices[i] = cursor; cursor++; } - for ( let i = VertexAttributeBufferIndex.PICKING_COLOR + 1; i < geometry.vertexBuffers.length; @@ -938,21 +930,20 @@ export abstract class Instanced { // if (i === 3) { // continue; // } - - const { stepMode, byteStride } = + const { stepMode, arrayStride } = geometry.inputLayoutDescriptor.vertexBufferDescriptors[i]; - const descriptor = - geometry.inputLayoutDescriptor.vertexAttributeDescriptors.find( - ({ bufferIndex }) => bufferIndex === i, - ); + geometry.inputLayoutDescriptor.vertexBufferDescriptors[i].attributes[0]; if (descriptor) { - const { location, bufferIndex, bufferByteOffset, format, divisor } = - descriptor; - + const { + shaderLocation: location, + offset: bufferByteOffset, + format, + divisor, + } = descriptor; geometry.setVertexBuffer({ - bufferIndex, - byteStride, + bufferIndex: i, + byteStride: arrayStride, stepMode, attributes: [ { @@ -966,7 +957,6 @@ export abstract class Instanced { }); } } - // create barycentric attributes const barycentricBuffer = new Float32Array(indiceNum * 3); for (let i = 0; i < indiceNum; ) { @@ -1117,13 +1107,10 @@ export abstract class Instanced { ...materialMegaState, }); - renderInst.setBindingLayouts([ - { - numUniformBuffers, - numSamplers: this.textureMappings.length, - samplerEntries: this.samplerEntries, - }, - ]); + renderInst.setBindingLayout({ + numUniformBuffers, + numSamplers: this.textureMappings.length, + }); renderInst.setSamplerBindingsFromTextureMappings(this.textureMappings); } @@ -1215,13 +1202,13 @@ export abstract class Instanced { 'Fill Texture' + this.id, ); fillMapping.sampler = this.renderHelper.getCache().createSampler({ - wrapS: WrapMode.CLAMP, - wrapT: WrapMode.CLAMP, - minFilter: TexFilterMode.POINT, - magFilter: TexFilterMode.BILINEAR, - mipFilter: MipFilterMode.LINEAR, - minLOD: 0, - maxLOD: 0, + addressModeU: AddressMode.CLAMP_TO_EDGE, + addressModeV: AddressMode.CLAMP_TO_EDGE, + minFilter: FilterMode.POINT, + magFilter: FilterMode.BILINEAR, + mipmapFilter: MipmapFilterMode.LINEAR, + lodMinClamp: 0, + lodMaxClamp: 0, }); return fillMapping; diff --git a/packages/g-plugin-device-renderer/src/drawcalls/InstancedFill.ts b/packages/g-plugin-device-renderer/src/drawcalls/InstancedFill.ts index ffb533ce7..7f33fac21 100644 --- a/packages/g-plugin-device-renderer/src/drawcalls/InstancedFill.ts +++ b/packages/g-plugin-device-renderer/src/drawcalls/InstancedFill.ts @@ -4,7 +4,7 @@ import { VertexAttributeBufferIndex, VertexAttributeLocation, } from './Instanced'; -import { Format, VertexStepMode } from '../platform'; +import { Format, VertexStepMode } from '@antv/g-device-api'; import meshFrag from '../shader/mesh.frag'; import meshVert from '../shader/mesh.vert'; import { updateBuffer } from './InstancedPath'; diff --git a/packages/g-plugin-device-renderer/src/drawcalls/InstancedLine.ts b/packages/g-plugin-device-renderer/src/drawcalls/InstancedLine.ts index 99afa450f..165b49e61 100644 --- a/packages/g-plugin-device-renderer/src/drawcalls/InstancedLine.ts +++ b/packages/g-plugin-device-renderer/src/drawcalls/InstancedLine.ts @@ -11,7 +11,7 @@ import type { ParsedPolylineStyleProps, } from '@antv/g-lite'; import { DisplayObject, Shape, isDisplayObject } from '@antv/g-lite'; -import { Format, VertexStepMode } from '../platform'; +import { Format, VertexStepMode } from '@antv/g-device-api'; import frag from '../shader/instanced-line.frag'; import vert from '../shader/instanced-line.vert'; import { enumToObject } from '../utils/enum'; diff --git a/packages/g-plugin-device-renderer/src/drawcalls/InstancedPath.ts b/packages/g-plugin-device-renderer/src/drawcalls/InstancedPath.ts index 294a584b4..2f8d72cc8 100644 --- a/packages/g-plugin-device-renderer/src/drawcalls/InstancedPath.ts +++ b/packages/g-plugin-device-renderer/src/drawcalls/InstancedPath.ts @@ -17,7 +17,7 @@ import { import { mat4 } from 'gl-matrix'; import { arcToCubic } from '@antv/util'; import earcut from 'earcut'; -import { Format, VertexStepMode } from '../platform'; +import { Format, VertexStepMode } from '@antv/g-device-api'; import frag from '../shader/line.frag'; import vert from '../shader/line.vert'; import { enumToObject } from '../utils/enum'; diff --git a/packages/g-plugin-device-renderer/src/drawcalls/SDF.ts b/packages/g-plugin-device-renderer/src/drawcalls/SDF.ts index d30aaf146..0b200b1f9 100644 --- a/packages/g-plugin-device-renderer/src/drawcalls/SDF.ts +++ b/packages/g-plugin-device-renderer/src/drawcalls/SDF.ts @@ -8,7 +8,7 @@ import type { ParsedRectStyleProps, } from '@antv/g-lite'; import { Shape } from '@antv/g-lite'; -import { Format, VertexStepMode } from '../platform'; +import { Format, VertexStepMode } from '@antv/g-device-api'; import frag from '../shader/sdf.frag'; import vert from '../shader/sdf.vert'; import { enumToObject } from '../utils/enum'; diff --git a/packages/g-plugin-device-renderer/src/drawcalls/Text.ts b/packages/g-plugin-device-renderer/src/drawcalls/Text.ts index b90957d63..c5d15c64d 100644 --- a/packages/g-plugin-device-renderer/src/drawcalls/Text.ts +++ b/packages/g-plugin-device-renderer/src/drawcalls/Text.ts @@ -6,7 +6,7 @@ import type { } from '@antv/g-lite'; import { isCSSRGB } from '@antv/g-lite'; import { mat4 } from 'gl-matrix'; -import { CullMode, Format, VertexStepMode } from '../platform'; +import { CullMode, Format, VertexStepMode } from '@antv/g-device-api'; import { RENDER_ORDER_SCALE } from '../renderer/Batch'; import frag from '../shader/text.frag'; import vert from '../shader/text.vert'; @@ -294,11 +294,11 @@ export class TextDrawcall extends Instanced { const vertice = this.geometry.vertices[ TextVertexAttributeBufferIndex.INSTANCED ] as Float32Array; - const { byteStride } = + const { arrayStride } = this.geometry.inputLayoutDescriptor.vertexBufferDescriptors[ TextVertexAttributeBufferIndex.INSTANCED ]; - const bytes = byteStride / 4; + const bytes = arrayStride / 4; const [start, end] = this.packedBufferObjectMap.get(object); const sliced = vertice.slice(start, end); for (let i = 0; i < end - start; i += bytes) { @@ -355,11 +355,11 @@ export class TextDrawcall extends Instanced { const vertice = this.geometry.vertices[ TextVertexAttributeBufferIndex.INSTANCED ] as Float32Array; - const { byteStride } = + const { arrayStride } = this.geometry.inputLayoutDescriptor.vertexBufferDescriptors[ TextVertexAttributeBufferIndex.INSTANCED ]; - const bytes = byteStride / 4; + const bytes = arrayStride / 4; objects.forEach((object) => { const { diff --git a/packages/g-plugin-device-renderer/src/drawcalls/symbol/GlyphManager.ts b/packages/g-plugin-device-renderer/src/drawcalls/symbol/GlyphManager.ts index 7941554f8..e5dd3a8a6 100644 --- a/packages/g-plugin-device-renderer/src/drawcalls/symbol/GlyphManager.ts +++ b/packages/g-plugin-device-renderer/src/drawcalls/symbol/GlyphManager.ts @@ -1,6 +1,6 @@ import { CanvasLike, GlobalRuntime } from '@antv/g-lite'; -import type { Device, Texture } from '../../platform'; -import { Format, makeTextureDescriptor2D } from '../../platform'; +import type { Device, Texture } from '@antv/g-device-api'; +import { Format, makeTextureDescriptor2D } from '@antv/g-device-api'; import { TinySDF } from '../../utils'; import type { StyleGlyph } from './AlphaImage'; import { AlphaImage } from './AlphaImage'; @@ -173,7 +173,6 @@ export class GlyphManager { unpackFlipY: false, unpackAlignment: 1, }, - immutable: false, }); this.glyphAtlasTexture.setImageData([data]); } diff --git a/packages/g-plugin-device-renderer/src/geometries/BufferGeometry.ts b/packages/g-plugin-device-renderer/src/geometries/BufferGeometry.ts index fab8e03cf..84e961cd7 100644 --- a/packages/g-plugin-device-renderer/src/geometries/BufferGeometry.ts +++ b/packages/g-plugin-device-renderer/src/geometries/BufferGeometry.ts @@ -6,13 +6,13 @@ import type { Device, InputLayoutDescriptor, VertexStepMode, -} from '../platform'; +} from '@antv/g-device-api'; import { BufferFrequencyHint, BufferUsage, Format, PrimitiveTopology, -} from '../platform'; +} from '@antv/g-device-api'; export function makeDataBuffer( device: Device, @@ -65,31 +65,18 @@ export enum GeometryEvent { * just hold descriptors of buffers & indices, won't use underlying GPU resources */ export class BufferGeometry extends EventEmitter { - /** - * 绘制模式 - */ drawMode: PrimitiveTopology = PrimitiveTopology.TRIANGLES; - /** - * 存放 Attribute Buffer 列表 - */ vertexBuffers: Buffer[] = []; vertices: ArrayBufferView[] = []; - /** - * 存放 Index Buffer - */ indexBuffer: Buffer; - /** - * 索引数组 - */ indices: IndicesArray; inputLayoutDescriptor: InputLayoutDescriptor = { vertexBufferDescriptors: [], - vertexAttributeDescriptors: [], indexBufferFormat: null, program: null, }; @@ -146,28 +133,29 @@ export class BufferGeometry extends EventEmitter { const { bufferIndex, byteStride, stepMode, attributes, data } = descriptor; this.inputLayoutDescriptor.vertexBufferDescriptors[bufferIndex] = { - byteStride, + arrayStride: byteStride, stepMode, + attributes: [], }; this.vertices[bufferIndex] = data; attributes.forEach( ({ format, bufferByteOffset, location, divisor, byteStride }) => { - const existed = - this.inputLayoutDescriptor.vertexAttributeDescriptors.find( - (e) => e.bufferIndex === bufferIndex && e.location === location, - ); + const existed = this.inputLayoutDescriptor.vertexBufferDescriptors[ + bufferIndex + ].attributes.find((e) => e.shaderLocation === location); if (existed) { existed.format = format; - existed.bufferByteOffset = bufferByteOffset; + existed.offset = bufferByteOffset; existed.divisor = divisor; } else { - this.inputLayoutDescriptor.vertexAttributeDescriptors.push({ + this.inputLayoutDescriptor.vertexBufferDescriptors[ + bufferIndex + ].attributes.push({ format, - bufferIndex, - bufferByteOffset, - location, + offset: bufferByteOffset, + shaderLocation: location, divisor, }); } @@ -200,18 +188,17 @@ export class BufferGeometry extends EventEmitter { index: number, data: Uint8Array, ) { - const { byteStride } = + const { arrayStride } = this.inputLayoutDescriptor.vertexBufferDescriptors[bufferIndex]; - const descriptor = - this.inputLayoutDescriptor.vertexAttributeDescriptors.find( - (d) => d.location === location, - ); + const descriptor = this.inputLayoutDescriptor.vertexBufferDescriptors[ + bufferIndex + ].attributes.find((d) => d.shaderLocation === location); if (descriptor) { const vertexBuffer = this.getVertexBuffer(bufferIndex); - const offset = index * byteStride; - vertexBuffer.setSubData(descriptor.bufferByteOffset + offset, data); + const offset = index * arrayStride; + vertexBuffer.setSubData(descriptor.offset + offset, data); // TODO: update vertices // this.vertices[bufferIndex] = data; @@ -243,7 +230,6 @@ export class BufferGeometry extends EventEmitter { this.indexBuffer.destroy(); } - this.inputLayoutDescriptor.vertexAttributeDescriptors = []; this.inputLayoutDescriptor.vertexBufferDescriptors = []; this.indexBuffer = undefined; diff --git a/packages/g-plugin-device-renderer/src/index.ts b/packages/g-plugin-device-renderer/src/index.ts index 2977ea385..d91dcca4d 100644 --- a/packages/g-plugin-device-renderer/src/index.ts +++ b/packages/g-plugin-device-renderer/src/index.ts @@ -6,7 +6,7 @@ import { Mesh } from './Mesh'; import { MeshUpdater } from './MeshUpdater'; import { PickingIdGenerator } from './PickingIdGenerator'; import { PickingPlugin } from './PickingPlugin'; -import type { Texture, TextureDescriptor } from './platform'; +import type { Texture, TextureDescriptor } from '@antv/g-device-api'; import { RenderHelper } from './render/RenderHelper'; import { Batch, @@ -33,9 +33,7 @@ export * from './lights'; export * from './materials'; export * from './drawcalls'; export * from './passes'; -export * from './platform'; export * from './render'; -export * from './shader/compiler'; export * from './utils'; export { Renderable3D, Batch, TexturePool, RenderGraphPlugin, Mesh }; diff --git a/packages/g-plugin-device-renderer/src/interfaces.ts b/packages/g-plugin-device-renderer/src/interfaces.ts index f6eabf9a6..bc01c8124 100644 --- a/packages/g-plugin-device-renderer/src/interfaces.ts +++ b/packages/g-plugin-device-renderer/src/interfaces.ts @@ -1,4 +1,4 @@ -import type { SwapChain } from './platform'; +import type { SwapChain } from '@antv/g-device-api'; export interface DeviceContribution { createSwapChain: ($canvas: HTMLCanvasElement) => Promise; diff --git a/packages/g-plugin-device-renderer/src/materials/Material.ts b/packages/g-plugin-device-renderer/src/materials/Material.ts index b61a74aa8..89acbab0a 100644 --- a/packages/g-plugin-device-renderer/src/materials/Material.ts +++ b/packages/g-plugin-device-renderer/src/materials/Material.ts @@ -6,17 +6,20 @@ import type { BlendFactor, BlendMode, Color, - CompareMode, + CompareFunction, CullMode, Device, Format, FrontFace, StencilOp, Texture, -} from '../platform'; -import { TextureEvent } from '../platform'; -import { copyMegaState, defaultMegaState } from '../platform/utils'; -import { getUniforms } from '../shader/compiler'; +} from '@antv/g-device-api'; +import { + TextureEvent, + copyMegaState, + defaultMegaState, + getUniforms, +} from '@antv/g-device-api'; export interface IMaterial { cullMode: CullMode; @@ -29,11 +32,11 @@ export interface IMaterial { blendSrcAlpha: BlendFactor; blendDstAlpha: BlendFactor; - depthCompare: CompareMode; + depthCompare: CompareFunction; depthTest: boolean; depthWrite: boolean; - stencilCompare: CompareMode; + stencilCompare: CompareFunction; stencilWrite: boolean; stencilPassOp: StencilOp; stencilRef: number; diff --git a/packages/g-plugin-device-renderer/src/materials/ShaderMaterial.ts b/packages/g-plugin-device-renderer/src/materials/ShaderMaterial.ts index 284f2527d..5f158b9da 100644 --- a/packages/g-plugin-device-renderer/src/materials/ShaderMaterial.ts +++ b/packages/g-plugin-device-renderer/src/materials/ShaderMaterial.ts @@ -1,4 +1,4 @@ -import type { Device } from '../platform'; +import type { Device } from '@antv/g-device-api'; import type { IMaterial } from './Material'; import { Material } from './Material'; diff --git a/packages/g-plugin-device-renderer/src/passes/Copy.ts b/packages/g-plugin-device-renderer/src/passes/Copy.ts deleted file mode 100644 index 2a1d09e22..000000000 --- a/packages/g-plugin-device-renderer/src/passes/Copy.ts +++ /dev/null @@ -1,89 +0,0 @@ -// import { BufferGeometry } from '../geometries'; -// import { Format, InputLayout, InputState, VertexStepMode } from '../platform'; -// import { fullscreenMegaState, nArray } from '../platform/utils'; -import { DeviceProgram } from '../render/DeviceProgram'; -// import { RGAttachmentSlot, RGGraphBuilder } from '../render/interfaces'; -// import { RenderHelper } from '../render/RenderHelper'; -// import { TextureMapping } from '../render/TextureHolder'; -// import { fillVec4, ShaderLibrary } from '../render/utils'; -import vert from '../shader/passes/fullscreen.vert'; -import frag from '../shader/passes/copy.frag'; - -export class CopyProgram extends DeviceProgram { - vert = vert; - frag = frag; - - features = {}; -} - -// interface RenderInput { -// backbufferWidth: number; -// backbufferHeight: number; -// } - -// const textureMapping = nArray(1, () => new TextureMapping()); -// let geometry: Geometry; -// let inputState: InputState; -// let inputLayout: InputLayout; - -// export function useCopyPass( -// // builder: RGGraphBuilder, -// renderHelper: RenderHelper, -// // renderInput: RenderInput, -// // mainColorTargetID: number, -// ): void { -// // const mainColorResolveTextureID = builder.resolveRenderTarget(mainColorTargetID); -// // pass.attachResolveTexture(mainColorResolveTextureID); - -// const renderInst = renderHelper.renderInstManager.newRenderInst(); -// renderInst.setUniformBuffer(renderHelper.uniformBuffer); -// renderInst.setAllowSkippingIfPipelineNotReady(false); - -// renderInst.setMegaStateFlags(fullscreenMegaState); -// renderInst.setBindingLayouts([{ numUniformBuffers: 0, numSamplers: 1 }]); -// renderInst.drawPrimitives(3); - -// const copyProgram = new CopyProgram(); -// const program = renderHelper.renderCache.createProgram(copyProgram); - -// renderInst.setProgram(program); - -// if (!geometry) { -// geometry = new Geometry(); -// geometry.device = renderHelper.getDevice(); -// geometry.setVertexBuffer({ -// bufferIndex: 0, -// byteStride: 4 * 2, -// stepMode: VertexStepMode.VERTEX, -// attributes: [ -// { -// format: Format.F32_RG, -// bufferByteOffset: 4 * 0, -// location: 0, -// }, -// ], -// // rendering a fullscreen triangle instead of quad -// // @see https://www.saschawillems.de/blog/2016/08/13/vulkan-tutorial-on-rendering-a-fullscreen-quad-without-buffers/ -// data: new Float32Array([-4, -4, 4, -4, 0, 4]), -// }); -// geometry.vertexCount = 3; - -// inputLayout = renderHelper.getCache().createInputLayout(geometry.inputLayoutDescriptor); - -// inputState = renderHelper.getDevice().createInputState( -// inputLayout, -// geometry.vertexBuffers.map((buffer) => ({ -// buffer, -// byteOffset: 0, -// })), -// null, -// program, -// ); -// } - -// // textureMapping[0].texture = scope.getResolveTextureForID(mainColorResolveTextureID); -// // renderInst.setSamplerBindingsFromTextureMappings(textureMapping); -// renderInst.setInputLayoutAndState(inputLayout, inputState); - -// renderInst.drawPrimitives(3); -// } diff --git a/packages/g-plugin-device-renderer/src/passes/FXAA.ts b/packages/g-plugin-device-renderer/src/passes/FXAA.ts index 5ffde2303..c2f64d22a 100644 --- a/packages/g-plugin-device-renderer/src/passes/FXAA.ts +++ b/packages/g-plugin-device-renderer/src/passes/FXAA.ts @@ -1,7 +1,11 @@ import { BufferGeometry } from '../geometries'; -import type { InputLayout } from '../platform'; -import { Format, VertexStepMode } from '../platform'; -import { fullscreenMegaState, nArray } from '../platform/utils'; +import type { InputLayout } from '@antv/g-device-api'; +import { + Format, + VertexStepMode, + fullscreenMegaState, + nArray, +} from '@antv/g-device-api'; import { DeviceProgram } from '../render/DeviceProgram'; import type { RGGraphBuilder } from '../render/interfaces'; import { RGAttachmentSlot } from '../render/interfaces'; @@ -53,7 +57,7 @@ export function pushFXAAPass( renderInst.setAllowSkippingIfPipelineNotReady(false); renderInst.setMegaStateFlags(fullscreenMegaState); - renderInst.setBindingLayouts([{ numUniformBuffers: 1, numSamplers: 1 }]); + renderInst.setBindingLayout({ numUniformBuffers: 1, numSamplers: 1 }); renderInst.drawPrimitives(3); // since gl_VertexID is not available in GLSL 100, we need to use a geometry diff --git a/packages/g-plugin-device-renderer/src/passes/PostProcessing.ts b/packages/g-plugin-device-renderer/src/passes/PostProcessing.ts deleted file mode 100644 index b0e2e7514..000000000 --- a/packages/g-plugin-device-renderer/src/passes/PostProcessing.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { BufferGeometry } from '../geometries'; -import type { InputLayout, Program } from '../platform'; -import { Format, VertexStepMode } from '../platform'; -import { fullscreenMegaState } from '../platform/utils'; -import type { DeviceProgram, TextureMapping, RenderHelper } from '../render'; -import { fillVec4 } from '../render'; -import type { RGGraphBuilder } from '../render/interfaces'; -import { RGAttachmentSlot } from '../render/interfaces'; -import type { RenderInput } from '../render/RenderGraphHelpers'; - -export class PostProcessing { - constructor(private renderHelper: RenderHelper) {} - - protected deviceProgram: DeviceProgram; - protected debugName: string; - - protected geometry: BufferGeometry; - protected inputLayout: InputLayout; - protected textureMappings: TextureMapping[] = []; - protected program: Program; - - init() { - this.program = this.renderHelper.renderCache.createProgramSimple( - this.deviceProgram, - ); - - this.geometry = new BufferGeometry(this.renderHelper.getDevice()); - this.geometry.setVertexBuffer({ - bufferIndex: 0, - byteStride: 4 * 2, - stepMode: VertexStepMode.VERTEX, - attributes: [ - { - format: Format.F32_RG, - bufferByteOffset: 4 * 0, - location: 0, - }, - ], - // rendering a fullscreen triangle instead of quad - // @see https://www.saschawillems.de/blog/2016/08/13/vulkan-tutorial-on-rendering-a-fullscreen-quad-without-buffers/ - data: new Float32Array([-4, -4, 4, -4, 0, 4]), - }); - this.geometry.vertexCount = 3; - - this.inputLayout = this.renderHelper - .getCache() - .createInputLayout(this.geometry.inputLayoutDescriptor); - } - - build( - builder: RGGraphBuilder, - renderInput: RenderInput, - mainColorTargetID: number, - ) { - builder.pushPass((pass) => { - pass.setDebugName(this.debugName); - pass.attachRenderTargetID(RGAttachmentSlot.Color0, mainColorTargetID); - - const mainColorResolveTextureID = - builder.resolveRenderTarget(mainColorTargetID); - pass.attachResolveTexture(mainColorResolveTextureID); - - const renderInst = this.renderHelper.renderInstManager.newRenderInst(); - renderInst.setUniformBuffer(this.renderHelper.uniformBuffer); - renderInst.setAllowSkippingIfPipelineNotReady(false); - - renderInst.setMegaStateFlags(fullscreenMegaState); - renderInst.drawPrimitives(3); - - renderInst.setBindingLayouts([{ numUniformBuffers: 1, numSamplers: 1 }]); - - // since gl_VertexID is not available in GLSL 100, we need to use a geometry - const offs = renderInst.allocateUniformBuffer(0, 4); - const d = renderInst.mapUniformBufferF32(0); - fillVec4( - d, - offs, - 1.0 / renderInput.backbufferWidth, - 1.0 / renderInput.backbufferHeight, - ); - - renderInst.setProgram(this.program); - - pass.exec((passRenderer, scope) => { - this.textureMappings[0].texture = scope.getResolveTextureForID( - mainColorResolveTextureID, - ); - renderInst.setSamplerBindingsFromTextureMappings(this.textureMappings); - - // this.inputState = this.renderHelper.getDevice().createInput( - // this.inputLayout, - // this.geometry.vertexBuffers.map((buffer) => ({ - // buffer, - // byteOffset: 0, - // })), - // null, - // program, - // ); - - // renderInst.setVertexInput(this.inputLayout, this.inputState); - renderInst.drawOnPass(this.renderHelper.renderCache, passRenderer); - }); - }); - } - - destroy() { - this.geometry.destroy(); - this.inputLayout.destroy(); - } -} diff --git a/packages/g-plugin-device-renderer/src/passes/index.ts b/packages/g-plugin-device-renderer/src/passes/index.ts index 4e849a47b..3524d8134 100644 --- a/packages/g-plugin-device-renderer/src/passes/index.ts +++ b/packages/g-plugin-device-renderer/src/passes/index.ts @@ -1,2 +1 @@ -export * from './Copy'; export * from './FXAA'; diff --git a/packages/g-plugin-device-renderer/src/platform/constants.ts b/packages/g-plugin-device-renderer/src/platform/constants.ts deleted file mode 100644 index 3e15ae473..000000000 --- a/packages/g-plugin-device-renderer/src/platform/constants.ts +++ /dev/null @@ -1,834 +0,0 @@ -/** - * ported from @luma.gl/constants - * - * Standard WebGL and WebGL2 constants - * These constants are also defined on the WebGLRenderingContext interface. - */ -export enum GL { - // Clearing buffers - // Constants passed to clear() to clear buffer masks. - - DEPTH_BUFFER_BIT = 0x00000100, - STENCIL_BUFFER_BIT = 0x00000400, - COLOR_BUFFER_BIT = 0x00004000, - - // Rendering primitives - // Constants passed to drawElements() or drawArrays() to specify what kind of primitive to render. - - POINTS = 0x0000, - LINES = 0x0001, - LINE_LOOP = 0x0002, - LINE_STRIP = 0x0003, - TRIANGLES = 0x0004, - TRIANGLE_STRIP = 0x0005, - TRIANGLE_FAN = 0x0006, - - // Blending modes - // Constants passed to blendFunc() or blendFuncSeparate() to specify the blending mode (for both, RBG and alpha, or separately). - - ZERO = 0, - ONE = 1, - SRC_COLOR = 0x0300, - ONE_MINUS_SRC_COLOR = 0x0301, - SRC_ALPHA = 0x0302, - ONE_MINUS_SRC_ALPHA = 0x0303, - DST_ALPHA = 0x0304, - ONE_MINUS_DST_ALPHA = 0x0305, - DST_COLOR = 0x0306, - ONE_MINUS_DST_COLOR = 0x0307, - SRC_ALPHA_SATURATE = 0x0308, - CONSTANT_COLOR = 0x8001, - ONE_MINUS_CONSTANT_COLOR = 0x8002, - CONSTANT_ALPHA = 0x8003, - ONE_MINUS_CONSTANT_ALPHA = 0x8004, - - // Blending equations - // Constants passed to blendEquation() or blendEquationSeparate() to control - // how the blending is calculated (for both, RBG and alpha, or separately). - - FUNC_ADD = 0x8006, - FUNC_SUBTRACT = 0x800a, - FUNC_REVERSE_SUBTRACT = 0x800b, - - // Getting GL parameter information - // Constants passed to getParameter() to specify what information to return. - - BLEND_EQUATION = 0x8009, - BLEND_EQUATION_RGB = 0x8009, - BLEND_EQUATION_ALPHA = 0x883d, - BLEND_DST_RGB = 0x80c8, - BLEND_SRC_RGB = 0x80c9, - BLEND_DST_ALPHA = 0x80ca, - BLEND_SRC_ALPHA = 0x80cb, - BLEND_COLOR = 0x8005, - ARRAY_BUFFER_BINDING = 0x8894, - ELEMENT_ARRAY_BUFFER_BINDING = 0x8895, - LINE_WIDTH = 0x0b21, - ALIASED_POINT_SIZE_RANGE = 0x846d, - ALIASED_LINE_WIDTH_RANGE = 0x846e, - CULL_FACE_MODE = 0x0b45, - FRONT_FACE = 0x0b46, - DEPTH_RANGE = 0x0b70, - DEPTH_WRITEMASK = 0x0b72, - DEPTH_CLEAR_VALUE = 0x0b73, - DEPTH_FUNC = 0x0b74, - STENCIL_CLEAR_VALUE = 0x0b91, - STENCIL_FUNC = 0x0b92, - STENCIL_FAIL = 0x0b94, - STENCIL_PASS_DEPTH_FAIL = 0x0b95, - STENCIL_PASS_DEPTH_PASS = 0x0b96, - STENCIL_REF = 0x0b97, - STENCIL_VALUE_MASK = 0x0b93, - STENCIL_WRITEMASK = 0x0b98, - STENCIL_BACK_FUNC = 0x8800, - STENCIL_BACK_FAIL = 0x8801, - STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802, - STENCIL_BACK_PASS_DEPTH_PASS = 0x8803, - STENCIL_BACK_REF = 0x8ca3, - STENCIL_BACK_VALUE_MASK = 0x8ca4, - STENCIL_BACK_WRITEMASK = 0x8ca5, - VIEWPORT = 0x0ba2, - SCISSOR_BOX = 0x0c10, - COLOR_CLEAR_VALUE = 0x0c22, - COLOR_WRITEMASK = 0x0c23, - UNPACK_ALIGNMENT = 0x0cf5, - PACK_ALIGNMENT = 0x0d05, - MAX_TEXTURE_SIZE = 0x0d33, - MAX_VIEWPORT_DIMS = 0x0d3a, - SUBPIXEL_BITS = 0x0d50, - RED_BITS = 0x0d52, - GREEN_BITS = 0x0d53, - BLUE_BITS = 0x0d54, - ALPHA_BITS = 0x0d55, - DEPTH_BITS = 0x0d56, - STENCIL_BITS = 0x0d57, - POLYGON_OFFSET_UNITS = 0x2a00, - POLYGON_OFFSET_FACTOR = 0x8038, - TEXTURE_BINDING_2D = 0x8069, - SAMPLE_BUFFERS = 0x80a8, - SAMPLES = 0x80a9, - SAMPLE_COVERAGE_VALUE = 0x80aa, - SAMPLE_COVERAGE_INVERT = 0x80ab, - COMPRESSED_TEXTURE_FORMATS = 0x86a3, - VENDOR = 0x1f00, - RENDERER = 0x1f01, - VERSION = 0x1f02, - IMPLEMENTATION_COLOR_READ_TYPE = 0x8b9a, - IMPLEMENTATION_COLOR_READ_FORMAT = 0x8b9b, - BROWSER_DEFAULT_WEBGL = 0x9244, - - // Buffers - // Constants passed to bufferData(), bufferSubData(), bindBuffer(), or - // getBufferParameter(). - - STATIC_DRAW = 0x88e4, - STREAM_DRAW = 0x88e0, - DYNAMIC_DRAW = 0x88e8, - ARRAY_BUFFER = 0x8892, - ELEMENT_ARRAY_BUFFER = 0x8893, - BUFFER_SIZE = 0x8764, - BUFFER_USAGE = 0x8765, - - // Vertex attributes - // Constants passed to getVertexAttrib(). - - CURRENT_VERTEX_ATTRIB = 0x8626, - VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622, - VERTEX_ATTRIB_ARRAY_SIZE = 0x8623, - VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624, - VERTEX_ATTRIB_ARRAY_TYPE = 0x8625, - VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886a, - VERTEX_ATTRIB_ARRAY_POINTER = 0x8645, - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889f, - - // Culling - // Constants passed to cullFace(). - - CULL_FACE = 0x0b44, - FRONT = 0x0404, - BACK = 0x0405, - FRONT_AND_BACK = 0x0408, - - // Enabling and disabling - // Constants passed to enable() or disable(). - - BLEND = 0x0be2, - DEPTH_TEST = 0x0b71, - DITHER = 0x0bd0, - POLYGON_OFFSET_FILL = 0x8037, - SAMPLE_ALPHA_TO_COVERAGE = 0x809e, - SAMPLE_COVERAGE = 0x80a0, - SCISSOR_TEST = 0x0c11, - STENCIL_TEST = 0x0b90, - - // Errors - // Constants returned from getError(). - - NO_ERROR = 0, - INVALID_ENUM = 0x0500, - INVALID_VALUE = 0x0501, - INVALID_OPERATION = 0x0502, - OUT_OF_MEMORY = 0x0505, - CONTEXT_LOST_WEBGL = 0x9242, - - // Front face directions - // Constants passed to frontFace(). - - CW = 0x0900, - CCW = 0x0901, - - // Hints - // Constants passed to hint() - - DONT_CARE = 0x1100, - FASTEST = 0x1101, - NICEST = 0x1102, - GENERATE_MIPMAP_HINT = 0x8192, - - // Data types - - BYTE = 0x1400, - UNSIGNED_BYTE = 0x1401, - SHORT = 0x1402, - UNSIGNED_SHORT = 0x1403, - INT = 0x1404, - UNSIGNED_INT = 0x1405, - FLOAT = 0x1406, - DOUBLE = 0x140a, - - // Pixel formats - - DEPTH_COMPONENT = 0x1902, - ALPHA = 0x1906, - RGB = 0x1907, - RGBA = 0x1908, - LUMINANCE = 0x1909, - LUMINANCE_ALPHA = 0x190a, - - // Pixel types - - // UNSIGNED_BYTE = 0x1401, - UNSIGNED_SHORT_4_4_4_4 = 0x8033, - UNSIGNED_SHORT_5_5_5_1 = 0x8034, - UNSIGNED_SHORT_5_6_5 = 0x8363, - - // Shaders - // Constants passed to createShader() or getShaderParameter() - - FRAGMENT_SHADER = 0x8b30, - VERTEX_SHADER = 0x8b31, - COMPILE_STATUS = 0x8b81, - DELETE_STATUS = 0x8b80, - LINK_STATUS = 0x8b82, - VALIDATE_STATUS = 0x8b83, - ATTACHED_SHADERS = 0x8b85, - ACTIVE_ATTRIBUTES = 0x8b89, - ACTIVE_UNIFORMS = 0x8b86, - MAX_VERTEX_ATTRIBS = 0x8869, - MAX_VERTEX_UNIFORM_VECTORS = 0x8dfb, - MAX_VARYING_VECTORS = 0x8dfc, - MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8b4d, - MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8b4c, - MAX_TEXTURE_IMAGE_UNITS = 0x8872, - MAX_FRAGMENT_UNIFORM_VECTORS = 0x8dfd, - SHADER_TYPE = 0x8b4f, - SHADING_LANGUAGE_VERSION = 0x8b8c, - CURRENT_PROGRAM = 0x8b8d, - - // Depth or stencil tests - // Constants passed to depthFunc() or stencilFunc(). - - NEVER = 0x0200, - ALWAYS = 0x0207, - LESS = 0x0201, - EQUAL = 0x0202, - LEQUAL = 0x0203, - GREATER = 0x0204, - GEQUAL = 0x0206, - NOTEQUAL = 0x0205, - - // Stencil actions - // Constants passed to stencilOp(). - - KEEP = 0x1e00, - REPLACE = 0x1e01, - INCR = 0x1e02, - DECR = 0x1e03, - INVERT = 0x150a, - INCR_WRAP = 0x8507, - DECR_WRAP = 0x8508, - - // Textures - // Constants passed to texParameteri(), - // texParameterf(), bindTexture(), texImage2D(), and others. - - NEAREST = 0x2600, - LINEAR = 0x2601, - NEAREST_MIPMAP_NEAREST = 0x2700, - LINEAR_MIPMAP_NEAREST = 0x2701, - NEAREST_MIPMAP_LINEAR = 0x2702, - LINEAR_MIPMAP_LINEAR = 0x2703, - TEXTURE_MAG_FILTER = 0x2800, - TEXTURE_MIN_FILTER = 0x2801, - TEXTURE_WRAP_S = 0x2802, - TEXTURE_WRAP_T = 0x2803, - TEXTURE_2D = 0x0de1, - TEXTURE = 0x1702, - TEXTURE_CUBE_MAP = 0x8513, - TEXTURE_BINDING_CUBE_MAP = 0x8514, - TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515, - TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516, - TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517, - TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518, - TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519, - TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851a, - MAX_CUBE_MAP_TEXTURE_SIZE = 0x851c, - // TEXTURE0 - 31 0x84C0 - 0x84DF A texture unit. - TEXTURE0 = 0x84c0, - ACTIVE_TEXTURE = 0x84e0, - REPEAT = 0x2901, - CLAMP_TO_EDGE = 0x812f, - MIRRORED_REPEAT = 0x8370, - - // Emulation - TEXTURE_WIDTH = 0x1000, - TEXTURE_HEIGHT = 0x1001, - - // Uniform types - - FLOAT_VEC2 = 0x8b50, - FLOAT_VEC3 = 0x8b51, - FLOAT_VEC4 = 0x8b52, - INT_VEC2 = 0x8b53, - INT_VEC3 = 0x8b54, - INT_VEC4 = 0x8b55, - BOOL = 0x8b56, - BOOL_VEC2 = 0x8b57, - BOOL_VEC3 = 0x8b58, - BOOL_VEC4 = 0x8b59, - FLOAT_MAT2 = 0x8b5a, - FLOAT_MAT3 = 0x8b5b, - FLOAT_MAT4 = 0x8b5c, - SAMPLER_2D = 0x8b5e, - SAMPLER_CUBE = 0x8b60, - - // Shader precision-specified types - - LOW_FLOAT = 0x8df0, - MEDIUM_FLOAT = 0x8df1, - HIGH_FLOAT = 0x8df2, - LOW_INT = 0x8df3, - MEDIUM_INT = 0x8df4, - HIGH_INT = 0x8df5, - - // Framebuffers and renderbuffers - - FRAMEBUFFER = 0x8d40, - RENDERBUFFER = 0x8d41, - RGBA4 = 0x8056, - RGB5_A1 = 0x8057, - RGB565 = 0x8d62, - DEPTH_COMPONENT16 = 0x81a5, - STENCIL_INDEX = 0x1901, - STENCIL_INDEX8 = 0x8d48, - DEPTH_STENCIL = 0x84f9, - RENDERBUFFER_WIDTH = 0x8d42, - RENDERBUFFER_HEIGHT = 0x8d43, - RENDERBUFFER_INTERNAL_FORMAT = 0x8d44, - RENDERBUFFER_RED_SIZE = 0x8d50, - RENDERBUFFER_GREEN_SIZE = 0x8d51, - RENDERBUFFER_BLUE_SIZE = 0x8d52, - RENDERBUFFER_ALPHA_SIZE = 0x8d53, - RENDERBUFFER_DEPTH_SIZE = 0x8d54, - RENDERBUFFER_STENCIL_SIZE = 0x8d55, - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8cd0, - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8cd1, - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8cd2, - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8cd3, - COLOR_ATTACHMENT0 = 0x8ce0, - DEPTH_ATTACHMENT = 0x8d00, - STENCIL_ATTACHMENT = 0x8d20, - DEPTH_STENCIL_ATTACHMENT = 0x821a, - NONE = 0, - FRAMEBUFFER_COMPLETE = 0x8cd5, - FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8cd6, - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8cd7, - FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8cd9, - FRAMEBUFFER_UNSUPPORTED = 0x8cdd, - FRAMEBUFFER_BINDING = 0x8ca6, - RENDERBUFFER_BINDING = 0x8ca7, - READ_FRAMEBUFFER = 0x8ca8, - DRAW_FRAMEBUFFER = 0x8ca9, - MAX_RENDERBUFFER_SIZE = 0x84e8, - INVALID_FRAMEBUFFER_OPERATION = 0x0506, - - // Pixel storage modes - // Constants passed to pixelStorei(). - - UNPACK_FLIP_Y_WEBGL = 0x9240, - UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241, - UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243, - - // ///////////////////////////////////////////////////// - // Additional constants defined WebGL 2 - // These constants are defined on the WebGL2RenderingContext interface. - // All WebGL 1 constants are also available in a WebGL 2 context. - // ///////////////////////////////////////////////////// - - // Getting GL parameter information - // Constants passed to getParameter() - // to specify what information to return. - - READ_BUFFER = 0x0c02, - UNPACK_ROW_LENGTH = 0x0cf2, - UNPACK_SKIP_ROWS = 0x0cf3, - UNPACK_SKIP_PIXELS = 0x0cf4, - PACK_ROW_LENGTH = 0x0d02, - PACK_SKIP_ROWS = 0x0d03, - PACK_SKIP_PIXELS = 0x0d04, - TEXTURE_BINDING_3D = 0x806a, - UNPACK_SKIP_IMAGES = 0x806d, - UNPACK_IMAGE_HEIGHT = 0x806e, - MAX_3D_TEXTURE_SIZE = 0x8073, - MAX_ELEMENTS_VERTICES = 0x80e8, - MAX_ELEMENTS_INDICES = 0x80e9, - MAX_TEXTURE_LOD_BIAS = 0x84fd, - MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8b49, - MAX_VERTEX_UNIFORM_COMPONENTS = 0x8b4a, - MAX_ARRAY_TEXTURE_LAYERS = 0x88ff, - MIN_PROGRAM_TEXEL_OFFSET = 0x8904, - MAX_PROGRAM_TEXEL_OFFSET = 0x8905, - MAX_VARYING_COMPONENTS = 0x8b4b, - FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8b8b, - RASTERIZER_DISCARD = 0x8c89, - VERTEX_ARRAY_BINDING = 0x85b5, - MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122, - MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125, - MAX_SERVER_WAIT_TIMEOUT = 0x9111, - MAX_ELEMENT_INDEX = 0x8d6b, - - // Textures - // Constants passed to texParameteri(), - // texParameterf(), bindTexture(), texImage2D(), and others. - - RED = 0x1903, - RGB8 = 0x8051, - RGBA8 = 0x8058, - RGB10_A2 = 0x8059, - TEXTURE_3D = 0x806f, - TEXTURE_WRAP_R = 0x8072, - TEXTURE_MIN_LOD = 0x813a, - TEXTURE_MAX_LOD = 0x813b, - TEXTURE_BASE_LEVEL = 0x813c, - TEXTURE_MAX_LEVEL = 0x813d, - TEXTURE_COMPARE_MODE = 0x884c, - TEXTURE_COMPARE_FUNC = 0x884d, - SRGB = 0x8c40, - SRGB8 = 0x8c41, - SRGB8_ALPHA8 = 0x8c43, - COMPARE_REF_TO_TEXTURE = 0x884e, - RGBA32F = 0x8814, - RGB32F = 0x8815, - RGBA16F = 0x881a, - RGB16F = 0x881b, - TEXTURE_2D_ARRAY = 0x8c1a, - TEXTURE_BINDING_2D_ARRAY = 0x8c1d, - R11F_G11F_B10F = 0x8c3a, - RGB9_E5 = 0x8c3d, - RGBA32UI = 0x8d70, - RGB32UI = 0x8d71, - RGBA16UI = 0x8d76, - RGB16UI = 0x8d77, - RGBA8UI = 0x8d7c, - RGB8UI = 0x8d7d, - RGBA32I = 0x8d82, - RGB32I = 0x8d83, - RGBA16I = 0x8d88, - RGB16I = 0x8d89, - RGBA8I = 0x8d8e, - RGB8I = 0x8d8f, - RED_INTEGER = 0x8d94, - RGB_INTEGER = 0x8d98, - RGBA_INTEGER = 0x8d99, - R8 = 0x8229, - RG8 = 0x822b, - R16F = 0x822d, - R32F = 0x822e, - RG16F = 0x822f, - RG32F = 0x8230, - R8I = 0x8231, - R8UI = 0x8232, - R16I = 0x8233, - R16UI = 0x8234, - R32I = 0x8235, - R32UI = 0x8236, - RG8I = 0x8237, - RG8UI = 0x8238, - RG16I = 0x8239, - RG16UI = 0x823a, - RG32I = 0x823b, - RG32UI = 0x823c, - R8_SNORM = 0x8f94, - RG8_SNORM = 0x8f95, - RGB8_SNORM = 0x8f96, - RGBA8_SNORM = 0x8f97, - RGB10_A2UI = 0x906f, - - /* covered by extension - COMPRESSED_R11_EAC = 0x9270, - COMPRESSED_SIGNED_R11_EAC = 0x9271, - COMPRESSED_RG11_EAC = 0x9272, - COMPRESSED_SIGNED_RG11_EAC = 0x9273, - COMPRESSED_RGB8_ETC2 = 0x9274, - COMPRESSED_SRGB8_ETC2 = 0x9275, - COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276, - COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC = 0x9277, - COMPRESSED_RGBA8_ETC2_EAC = 0x9278, - COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279, - */ - TEXTURE_IMMUTABLE_FORMAT = 0x912f, - TEXTURE_IMMUTABLE_LEVELS = 0x82df, - - // Pixel types - - UNSIGNED_INT_2_10_10_10_REV = 0x8368, - UNSIGNED_INT_10F_11F_11F_REV = 0x8c3b, - UNSIGNED_INT_5_9_9_9_REV = 0x8c3e, - FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8dad, - UNSIGNED_INT_24_8 = 0x84fa, - HALF_FLOAT = 0x140b, - RG = 0x8227, - RG_INTEGER = 0x8228, - INT_2_10_10_10_REV = 0x8d9f, - - // Queries - - CURRENT_QUERY = 0x8865, - QUERY_RESULT = 0x8866, - QUERY_RESULT_AVAILABLE = 0x8867, - ANY_SAMPLES_PASSED = 0x8c2f, - ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8d6a, - - // Draw buffers - - MAX_DRAW_BUFFERS = 0x8824, - DRAW_BUFFER0 = 0x8825, - DRAW_BUFFER1 = 0x8826, - DRAW_BUFFER2 = 0x8827, - DRAW_BUFFER3 = 0x8828, - DRAW_BUFFER4 = 0x8829, - DRAW_BUFFER5 = 0x882a, - DRAW_BUFFER6 = 0x882b, - DRAW_BUFFER7 = 0x882c, - DRAW_BUFFER8 = 0x882d, - DRAW_BUFFER9 = 0x882e, - DRAW_BUFFER10 = 0x882f, - DRAW_BUFFER11 = 0x8830, - DRAW_BUFFER12 = 0x8831, - DRAW_BUFFER13 = 0x8832, - DRAW_BUFFER14 = 0x8833, - DRAW_BUFFER15 = 0x8834, - MAX_COLOR_ATTACHMENTS = 0x8cdf, - COLOR_ATTACHMENT1 = 0x8ce1, - COLOR_ATTACHMENT2 = 0x8ce2, - COLOR_ATTACHMENT3 = 0x8ce3, - COLOR_ATTACHMENT4 = 0x8ce4, - COLOR_ATTACHMENT5 = 0x8ce5, - COLOR_ATTACHMENT6 = 0x8ce6, - COLOR_ATTACHMENT7 = 0x8ce7, - COLOR_ATTACHMENT8 = 0x8ce8, - COLOR_ATTACHMENT9 = 0x8ce9, - COLOR_ATTACHMENT10 = 0x8cea, - COLOR_ATTACHMENT11 = 0x8ceb, - COLOR_ATTACHMENT12 = 0x8cec, - COLOR_ATTACHMENT13 = 0x8ced, - COLOR_ATTACHMENT14 = 0x8cee, - COLOR_ATTACHMENT15 = 0x8cef, - - // Samplers - - SAMPLER_3D = 0x8b5f, - SAMPLER_2D_SHADOW = 0x8b62, - SAMPLER_2D_ARRAY = 0x8dc1, - SAMPLER_2D_ARRAY_SHADOW = 0x8dc4, - SAMPLER_CUBE_SHADOW = 0x8dc5, - INT_SAMPLER_2D = 0x8dca, - INT_SAMPLER_3D = 0x8dcb, - INT_SAMPLER_CUBE = 0x8dcc, - INT_SAMPLER_2D_ARRAY = 0x8dcf, - UNSIGNED_INT_SAMPLER_2D = 0x8dd2, - UNSIGNED_INT_SAMPLER_3D = 0x8dd3, - UNSIGNED_INT_SAMPLER_CUBE = 0x8dd4, - UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8dd7, - MAX_SAMPLES = 0x8d57, - SAMPLER_BINDING = 0x8919, - - // Buffers - - PIXEL_PACK_BUFFER = 0x88eb, - PIXEL_UNPACK_BUFFER = 0x88ec, - PIXEL_PACK_BUFFER_BINDING = 0x88ed, - PIXEL_UNPACK_BUFFER_BINDING = 0x88ef, - COPY_READ_BUFFER = 0x8f36, - COPY_WRITE_BUFFER = 0x8f37, - COPY_READ_BUFFER_BINDING = 0x8f36, - COPY_WRITE_BUFFER_BINDING = 0x8f37, - - // Data types - - FLOAT_MAT2x3 = 0x8b65, - FLOAT_MAT2x4 = 0x8b66, - FLOAT_MAT3x2 = 0x8b67, - FLOAT_MAT3x4 = 0x8b68, - FLOAT_MAT4x2 = 0x8b69, - FLOAT_MAT4x3 = 0x8b6a, - UNSIGNED_INT_VEC2 = 0x8dc6, - UNSIGNED_INT_VEC3 = 0x8dc7, - UNSIGNED_INT_VEC4 = 0x8dc8, - UNSIGNED_NORMALIZED = 0x8c17, - SIGNED_NORMALIZED = 0x8f9c, - - // Vertex attributes - - VERTEX_ATTRIB_ARRAY_INTEGER = 0x88fd, - VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88fe, - - // Transform feedback - - TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8c7f, - MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8c80, - TRANSFORM_FEEDBACK_VARYINGS = 0x8c83, - TRANSFORM_FEEDBACK_BUFFER_START = 0x8c84, - TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8c85, - TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8c88, - MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8c8a, - MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8c8b, - INTERLEAVED_ATTRIBS = 0x8c8c, - SEPARATE_ATTRIBS = 0x8c8d, - TRANSFORM_FEEDBACK_BUFFER = 0x8c8e, - TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8c8f, - TRANSFORM_FEEDBACK = 0x8e22, - TRANSFORM_FEEDBACK_PAUSED = 0x8e23, - TRANSFORM_FEEDBACK_ACTIVE = 0x8e24, - TRANSFORM_FEEDBACK_BINDING = 0x8e25, - - // Framebuffers and renderbuffers - - FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210, - FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211, - FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212, - FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213, - FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214, - FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215, - FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216, - FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217, - FRAMEBUFFER_DEFAULT = 0x8218, - // DEPTH_STENCIL_ATTACHMENT = 0x821A, - // DEPTH_STENCIL = 0x84F9, - DEPTH24_STENCIL8 = 0x88f0, - DRAW_FRAMEBUFFER_BINDING = 0x8ca6, - READ_FRAMEBUFFER_BINDING = 0x8caa, - RENDERBUFFER_SAMPLES = 0x8cab, - FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8cd4, - FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8d56, - - // Uniforms - - UNIFORM_BUFFER = 0x8a11, - UNIFORM_BUFFER_BINDING = 0x8a28, - UNIFORM_BUFFER_START = 0x8a29, - UNIFORM_BUFFER_SIZE = 0x8a2a, - MAX_VERTEX_UNIFORM_BLOCKS = 0x8a2b, - MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8a2d, - MAX_COMBINED_UNIFORM_BLOCKS = 0x8a2e, - MAX_UNIFORM_BUFFER_BINDINGS = 0x8a2f, - MAX_UNIFORM_BLOCK_SIZE = 0x8a30, - MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8a31, - MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8a33, - UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8a34, - ACTIVE_UNIFORM_BLOCKS = 0x8a36, - UNIFORM_TYPE = 0x8a37, - UNIFORM_SIZE = 0x8a38, - UNIFORM_BLOCK_INDEX = 0x8a3a, - UNIFORM_OFFSET = 0x8a3b, - UNIFORM_ARRAY_STRIDE = 0x8a3c, - UNIFORM_MATRIX_STRIDE = 0x8a3d, - UNIFORM_IS_ROW_MAJOR = 0x8a3e, - UNIFORM_BLOCK_BINDING = 0x8a3f, - UNIFORM_BLOCK_DATA_SIZE = 0x8a40, - UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8a42, - UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8a43, - UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8a44, - UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8a46, - - // Sync objects - - OBJECT_TYPE = 0x9112, - SYNC_CONDITION = 0x9113, - SYNC_STATUS = 0x9114, - SYNC_FLAGS = 0x9115, - SYNC_FENCE = 0x9116, - SYNC_GPU_COMMANDS_COMPLETE = 0x9117, - UNSIGNALED = 0x9118, - SIGNALED = 0x9119, - ALREADY_SIGNALED = 0x911a, - TIMEOUT_EXPIRED = 0x911b, - CONDITION_SATISFIED = 0x911c, - WAIT_FAILED = 0x911d, - SYNC_FLUSH_COMMANDS_BIT = 0x00000001, - - // Miscellaneous constants - - COLOR = 0x1800, - DEPTH = 0x1801, - STENCIL = 0x1802, - MIN = 0x8007, - MAX = 0x8008, - DEPTH_COMPONENT24 = 0x81a6, - STREAM_READ = 0x88e1, - STREAM_COPY = 0x88e2, - STATIC_READ = 0x88e5, - STATIC_COPY = 0x88e6, - DYNAMIC_READ = 0x88e9, - DYNAMIC_COPY = 0x88ea, - DEPTH_COMPONENT32F = 0x8cac, - DEPTH32F_STENCIL8 = 0x8cad, - INVALID_INDEX = 0xffffffff, - TIMEOUT_IGNORED = -1, - MAX_CLIENT_WAIT_TIMEOUT_WEBGL = 0x9247, - - // Constants defined in WebGL extensions - - // ANGLE_instanced_arrays - - VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88fe, - - // WEBGL_debug_renderer_info - - UNMASKED_VENDOR_WEBGL = 0x9245, - UNMASKED_RENDERER_WEBGL = 0x9246, - - // EXT_texture_filter_anisotropic - - MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84ff, - TEXTURE_MAX_ANISOTROPY_EXT = 0x84fe, - - // WEBGL_compressed_texture_s3tc - - COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83f0, - COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83f1, - COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83f2, - COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83f3, - - // WEBGL_compressed_texture_es3 - - COMPRESSED_R11_EAC = 0x9270, - COMPRESSED_SIGNED_R11_EAC = 0x9271, - COMPRESSED_RG11_EAC = 0x9272, - COMPRESSED_SIGNED_RG11_EAC = 0x9273, - COMPRESSED_RGB8_ETC2 = 0x9274, - COMPRESSED_RGBA8_ETC2_EAC = 0x9275, - COMPRESSED_SRGB8_ETC2 = 0x9276, - COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9277, - COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9278, - COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9279, - - // WEBGL_compressed_texture_pvrtc - - COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8c00, - COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8c02, - COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8c01, - COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8c03, - - // WEBGL_compressed_texture_etc1 - - COMPRESSED_RGB_ETC1_WEBGL = 0x8d64, - - // WEBGL_compressed_texture_atc - - COMPRESSED_RGB_ATC_WEBGL = 0x8c92, - COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8c92, - COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87ee, - - // WEBGL_depth_texture - - UNSIGNED_INT_24_8_WEBGL = 0x84fa, - - // OES_texture_half_float - - HALF_FLOAT_OES = 0x8d61, - - // WEBGL_color_buffer_float - - RGBA32F_EXT = 0x8814, - RGB32F_EXT = 0x8815, - FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211, - UNSIGNED_NORMALIZED_EXT = 0x8c17, - - // EXT_blend_minmax - - MIN_EXT = 0x8007, - MAX_EXT = 0x8008, - - // EXT_sRGB - - SRGB_EXT = 0x8c40, - SRGB_ALPHA_EXT = 0x8c42, - SRGB8_ALPHA8_EXT = 0x8c43, - FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210, - - // OES_standard_derivatives - - FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8b8b, - - // WEBGL_draw_buffers - - COLOR_ATTACHMENT0_WEBGL = 0x8ce0, - COLOR_ATTACHMENT1_WEBGL = 0x8ce1, - COLOR_ATTACHMENT2_WEBGL = 0x8ce2, - COLOR_ATTACHMENT3_WEBGL = 0x8ce3, - COLOR_ATTACHMENT4_WEBGL = 0x8ce4, - COLOR_ATTACHMENT5_WEBGL = 0x8ce5, - COLOR_ATTACHMENT6_WEBGL = 0x8ce6, - COLOR_ATTACHMENT7_WEBGL = 0x8ce7, - COLOR_ATTACHMENT8_WEBGL = 0x8ce8, - COLOR_ATTACHMENT9_WEBGL = 0x8ce9, - COLOR_ATTACHMENT10_WEBGL = 0x8cea, - COLOR_ATTACHMENT11_WEBGL = 0x8ceb, - COLOR_ATTACHMENT12_WEBGL = 0x8cec, - COLOR_ATTACHMENT13_WEBGL = 0x8ced, - COLOR_ATTACHMENT14_WEBGL = 0x8cee, - COLOR_ATTACHMENT15_WEBGL = 0x8cef, - DRAW_BUFFER0_WEBGL = 0x8825, - DRAW_BUFFER1_WEBGL = 0x8826, - DRAW_BUFFER2_WEBGL = 0x8827, - DRAW_BUFFER3_WEBGL = 0x8828, - DRAW_BUFFER4_WEBGL = 0x8829, - DRAW_BUFFER5_WEBGL = 0x882a, - DRAW_BUFFER6_WEBGL = 0x882b, - DRAW_BUFFER7_WEBGL = 0x882c, - DRAW_BUFFER8_WEBGL = 0x882d, - DRAW_BUFFER9_WEBGL = 0x882e, - DRAW_BUFFER10_WEBGL = 0x882f, - DRAW_BUFFER11_WEBGL = 0x8830, - DRAW_BUFFER12_WEBGL = 0x8831, - DRAW_BUFFER13_WEBGL = 0x8832, - DRAW_BUFFER14_WEBGL = 0x8833, - DRAW_BUFFER15_WEBGL = 0x8834, - MAX_COLOR_ATTACHMENTS_WEBGL = 0x8cdf, - MAX_DRAW_BUFFERS_WEBGL = 0x8824, - - // OES_vertex_array_object - - VERTEX_ARRAY_BINDING_OES = 0x85b5, - - // EXT_disjoint_timer_query - - QUERY_COUNTER_BITS_EXT = 0x8864, - CURRENT_QUERY_EXT = 0x8865, - QUERY_RESULT_EXT = 0x8866, - QUERY_RESULT_AVAILABLE_EXT = 0x8867, - TIME_ELAPSED_EXT = 0x88bf, - TIMESTAMP_EXT = 0x8e28, - GPU_DISJOINT_EXT = 0x8fbb, // A Boolean indicating whether or not the GPU performed any disjoint operation. -} diff --git a/packages/g-plugin-device-renderer/src/platform/format.ts b/packages/g-plugin-device-renderer/src/platform/format.ts deleted file mode 100644 index 199670c21..000000000 --- a/packages/g-plugin-device-renderer/src/platform/format.ts +++ /dev/null @@ -1,400 +0,0 @@ -import { SamplerFormatKind } from './interfaces'; - -export enum FormatTypeFlags { - U8 = 0x01, - U16, - U32, - S8, - S16, - S32, - F16, - F32, - - // Compressed texture formats. - BC1 = 0x41, - BC2, - BC3, - BC4_UNORM, - BC4_SNORM, - BC5_UNORM, - BC5_SNORM, - - // Special-case packed texture formats. - U16_PACKED_5551 = 0x61, - U16_PACKED_565, - - // Depth/stencil texture formats. - D24 = 0x81, - D32F, - D24S8, - D32FS8, -} - -export enum FormatCompFlags { - R = 0x01, - RG = 0x02, - RGB = 0x03, - RGBA = 0x04, - A = 0x05, -} - -export function getFormatCompFlagsComponentCount(n: FormatCompFlags): number { - // The number of components is the flag value. Easy. - return n; -} - -export enum FormatFlags { - None = 0b00000000, - Normalized = 0b00000001, - sRGB = 0b00000010, - Depth = 0b00000100, - Stencil = 0b00001000, - RenderTarget = 0b00010000, -} - -export function makeFormat( - type: FormatTypeFlags, - comp: FormatCompFlags, - flags: FormatFlags, -): Format { - return (type << 16) | (comp << 8) | flags; -} - -export enum Format { - ALPHA = makeFormat(FormatTypeFlags.U8, FormatCompFlags.A, FormatFlags.None), - F16_R = makeFormat(FormatTypeFlags.F16, FormatCompFlags.R, FormatFlags.None), - F16_RG = makeFormat( - FormatTypeFlags.F16, - FormatCompFlags.RG, - FormatFlags.None, - ), - F16_RGB = makeFormat( - FormatTypeFlags.F16, - FormatCompFlags.RGB, - FormatFlags.None, - ), - F16_RGBA = makeFormat( - FormatTypeFlags.F16, - FormatCompFlags.RGBA, - FormatFlags.None, - ), - F32_R = makeFormat(FormatTypeFlags.F32, FormatCompFlags.R, FormatFlags.None), - F32_RG = makeFormat( - FormatTypeFlags.F32, - FormatCompFlags.RG, - FormatFlags.None, - ), - F32_RGB = makeFormat( - FormatTypeFlags.F32, - FormatCompFlags.RGB, - FormatFlags.None, - ), - F32_RGBA = makeFormat( - FormatTypeFlags.F32, - FormatCompFlags.RGBA, - FormatFlags.None, - ), - U8_R = makeFormat(FormatTypeFlags.U8, FormatCompFlags.R, FormatFlags.None), - U8_R_NORM = makeFormat( - FormatTypeFlags.U8, - FormatCompFlags.R, - FormatFlags.Normalized, - ), - U8_RG = makeFormat(FormatTypeFlags.U8, FormatCompFlags.RG, FormatFlags.None), - U8_RG_NORM = makeFormat( - FormatTypeFlags.U8, - FormatCompFlags.RG, - FormatFlags.Normalized, - ), - U8_RGB = makeFormat( - FormatTypeFlags.U8, - FormatCompFlags.RGB, - FormatFlags.None, - ), - U8_RGB_NORM = makeFormat( - FormatTypeFlags.U8, - FormatCompFlags.RGB, - FormatFlags.Normalized, - ), - U8_RGB_SRGB = makeFormat( - FormatTypeFlags.U8, - FormatCompFlags.RGB, - FormatFlags.sRGB | FormatFlags.Normalized, - ), - U8_RGBA = makeFormat( - FormatTypeFlags.U8, - FormatCompFlags.RGBA, - FormatFlags.None, - ), - U8_RGBA_NORM = makeFormat( - FormatTypeFlags.U8, - FormatCompFlags.RGBA, - FormatFlags.Normalized, - ), - U8_RGBA_SRGB = makeFormat( - FormatTypeFlags.U8, - FormatCompFlags.RGBA, - FormatFlags.sRGB | FormatFlags.Normalized, - ), - U16_R = makeFormat(FormatTypeFlags.U16, FormatCompFlags.R, FormatFlags.None), - U16_R_NORM = makeFormat( - FormatTypeFlags.U16, - FormatCompFlags.R, - FormatFlags.Normalized, - ), - U16_RG_NORM = makeFormat( - FormatTypeFlags.U16, - FormatCompFlags.RG, - FormatFlags.Normalized, - ), - U16_RGBA_NORM = makeFormat( - FormatTypeFlags.U16, - FormatCompFlags.RGBA, - FormatFlags.Normalized, - ), - U16_RGB = makeFormat( - FormatTypeFlags.U16, - FormatCompFlags.RGB, - FormatFlags.None, - ), - U32_R = makeFormat(FormatTypeFlags.U32, FormatCompFlags.R, FormatFlags.None), - U32_RG = makeFormat( - FormatTypeFlags.U32, - FormatCompFlags.RG, - FormatFlags.None, - ), - S8_R = makeFormat(FormatTypeFlags.S8, FormatCompFlags.R, FormatFlags.None), - S8_R_NORM = makeFormat( - FormatTypeFlags.S8, - FormatCompFlags.R, - FormatFlags.Normalized, - ), - S8_RG_NORM = makeFormat( - FormatTypeFlags.S8, - FormatCompFlags.RG, - FormatFlags.Normalized, - ), - S8_RGB_NORM = makeFormat( - FormatTypeFlags.S8, - FormatCompFlags.RGB, - FormatFlags.Normalized, - ), - S8_RGBA_NORM = makeFormat( - FormatTypeFlags.S8, - FormatCompFlags.RGBA, - FormatFlags.Normalized, - ), - S16_R = makeFormat(FormatTypeFlags.S16, FormatCompFlags.R, FormatFlags.None), - S16_RG = makeFormat( - FormatTypeFlags.S16, - FormatCompFlags.RG, - FormatFlags.None, - ), - S16_RG_NORM = makeFormat( - FormatTypeFlags.S16, - FormatCompFlags.RG, - FormatFlags.Normalized, - ), - S16_RGB_NORM = makeFormat( - FormatTypeFlags.S16, - FormatCompFlags.RGB, - FormatFlags.Normalized, - ), - S16_RGBA = makeFormat( - FormatTypeFlags.S16, - FormatCompFlags.RGBA, - FormatFlags.None, - ), - S16_RGBA_NORM = makeFormat( - FormatTypeFlags.S16, - FormatCompFlags.RGBA, - FormatFlags.Normalized, - ), - S32_R = makeFormat(FormatTypeFlags.S32, FormatCompFlags.R, FormatFlags.None), - - // Packed texture formats. - U16_RGBA_5551 = makeFormat( - FormatTypeFlags.U16_PACKED_5551, - FormatCompFlags.RGBA, - FormatFlags.Normalized, - ), - U16_RGB_565 = makeFormat( - FormatTypeFlags.U16_PACKED_565, - FormatCompFlags.RGB, - FormatFlags.Normalized, - ), - - // Compressed - BC1 = makeFormat( - FormatTypeFlags.BC1, - FormatCompFlags.RGBA, - FormatFlags.Normalized, - ), - BC1_SRGB = makeFormat( - FormatTypeFlags.BC1, - FormatCompFlags.RGBA, - FormatFlags.Normalized | FormatFlags.sRGB, - ), - BC2 = makeFormat( - FormatTypeFlags.BC2, - FormatCompFlags.RGBA, - FormatFlags.Normalized, - ), - BC2_SRGB = makeFormat( - FormatTypeFlags.BC2, - FormatCompFlags.RGBA, - FormatFlags.Normalized | FormatFlags.sRGB, - ), - BC3 = makeFormat( - FormatTypeFlags.BC3, - FormatCompFlags.RGBA, - FormatFlags.Normalized, - ), - BC3_SRGB = makeFormat( - FormatTypeFlags.BC3, - FormatCompFlags.RGBA, - FormatFlags.Normalized | FormatFlags.sRGB, - ), - BC4_UNORM = makeFormat( - FormatTypeFlags.BC4_UNORM, - FormatCompFlags.R, - FormatFlags.Normalized, - ), - BC4_SNORM = makeFormat( - FormatTypeFlags.BC4_SNORM, - FormatCompFlags.R, - FormatFlags.Normalized, - ), - BC5_UNORM = makeFormat( - FormatTypeFlags.BC5_UNORM, - FormatCompFlags.RG, - FormatFlags.Normalized, - ), - BC5_SNORM = makeFormat( - FormatTypeFlags.BC5_SNORM, - FormatCompFlags.RG, - FormatFlags.Normalized, - ), - - // Depth/Stencil - D24 = makeFormat(FormatTypeFlags.D24, FormatCompFlags.R, FormatFlags.Depth), - D24_S8 = makeFormat( - FormatTypeFlags.D24S8, - FormatCompFlags.RG, - FormatFlags.Depth | FormatFlags.Stencil, - ), - D32F = makeFormat(FormatTypeFlags.D32F, FormatCompFlags.R, FormatFlags.Depth), - D32F_S8 = makeFormat( - FormatTypeFlags.D32FS8, - FormatCompFlags.RG, - FormatFlags.Depth | FormatFlags.Stencil, - ), - - // Special RT formats for preferred backend support. - U8_RGB_RT = makeFormat( - FormatTypeFlags.U8, - FormatCompFlags.RGB, - FormatFlags.RenderTarget | FormatFlags.Normalized, - ), - U8_RGBA_RT = makeFormat( - FormatTypeFlags.U8, - FormatCompFlags.RGBA, - FormatFlags.RenderTarget | FormatFlags.Normalized, - ), - U8_RGBA_RT_SRGB = makeFormat( - FormatTypeFlags.U8, - FormatCompFlags.RGBA, - FormatFlags.RenderTarget | FormatFlags.Normalized | FormatFlags.sRGB, - ), -} - -export function getFormatCompFlags(fmt: Format): FormatCompFlags { - return (fmt >>> 8) & 0xff; -} - -export function getFormatTypeFlags(fmt: Format): FormatTypeFlags { - return (fmt >>> 16) & 0xff; -} - -export function getFormatFlags(fmt: Format): FormatFlags { - return fmt & 0xff; -} - -export function getFormatTypeFlagsByteSize( - typeFlags: FormatTypeFlags, -): 1 | 2 | 4 { - switch (typeFlags) { - case FormatTypeFlags.F32: - case FormatTypeFlags.U32: - case FormatTypeFlags.S32: - return 4; - case FormatTypeFlags.U16: - case FormatTypeFlags.S16: - case FormatTypeFlags.F16: - return 2; - case FormatTypeFlags.U8: - case FormatTypeFlags.S8: - return 1; - default: - throw new Error('whoops'); - } -} - -/** - * Gets the byte size for an individual component. - * e.g. for F32_RGB, this will return "4", since F32 has 4 bytes. - */ -export function getFormatCompByteSize(fmt: Format): 1 | 2 | 4 { - return getFormatTypeFlagsByteSize(getFormatTypeFlags(fmt)); -} - -export function getFormatComponentCount(fmt: Format): number { - return getFormatCompFlagsComponentCount(getFormatCompFlags(fmt)); -} - -export function getFormatByteSize(fmt: Format): number { - const typeByteSize = getFormatTypeFlagsByteSize(getFormatTypeFlags(fmt)); - const componentCount = getFormatCompFlagsComponentCount( - getFormatCompFlags(fmt), - ); - return typeByteSize * componentCount; -} - -export function setFormatFlags(fmt: Format, flags: FormatFlags): Format { - return (fmt & 0xffffff00) | flags; -} - -export function setFormatComponentCount( - fmt: Format, - compFlags: FormatCompFlags, -): Format { - return (fmt & 0xffff00ff) | (compFlags << 8); -} - -export function getFormatSamplerKind(fmt: Format): SamplerFormatKind { - const flags = getFormatFlags(fmt); - if (flags & FormatFlags.Depth) { - return SamplerFormatKind.Depth; - } - if (flags & FormatFlags.Normalized) { - return SamplerFormatKind.Float; - } - const typeFlags = getFormatTypeFlags(fmt); - if (typeFlags === FormatTypeFlags.F16 || typeFlags === FormatTypeFlags.F32) { - return SamplerFormatKind.Float; - } else if ( - typeFlags === FormatTypeFlags.U8 || - typeFlags === FormatTypeFlags.U16 || - typeFlags === FormatTypeFlags.U32 - ) { - return SamplerFormatKind.Uint; - } else if ( - typeFlags === FormatTypeFlags.S8 || - typeFlags === FormatTypeFlags.S16 || - typeFlags === FormatTypeFlags.S32 - ) { - return SamplerFormatKind.Sint; - } else { - throw new Error('whoops'); - } -} diff --git a/packages/g-plugin-device-renderer/src/platform/index.ts b/packages/g-plugin-device-renderer/src/platform/index.ts deleted file mode 100644 index 28561378b..000000000 --- a/packages/g-plugin-device-renderer/src/platform/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * provide a HAL - */ - -export * from './format'; -export * from './interfaces'; -export * from './constants'; -export * from './utils'; diff --git a/packages/g-plugin-device-renderer/src/platform/interfaces.ts b/packages/g-plugin-device-renderer/src/platform/interfaces.ts deleted file mode 100644 index bb44577f4..000000000 --- a/packages/g-plugin-device-renderer/src/platform/interfaces.ts +++ /dev/null @@ -1,757 +0,0 @@ -import type { EventEmitter } from 'eventemitter3'; -import { GL } from './constants'; -import type { Format } from './format'; - -export enum ResourceType { - Buffer, - Texture, - RenderTarget, - Sampler, - Program, - Bindings, - InputLayout, - RenderPipeline, - ComputePipeline, - Readback, - QueryPool, -} - -export interface Disposable { - destroy: () => void; -} - -export interface ResourceBase extends Disposable, EventEmitter { - id: number; - name?: string; -} -export interface Buffer extends ResourceBase { - type: ResourceType.Buffer; - setSubData: ( - dstByteOffset: number, - src: Uint8Array, - srcByteOffset?: number, - byteLength?: number, - ) => void; -} -export interface Texture extends ResourceBase { - type: ResourceType.Texture; - setImageData: ( - data: (TexImageSource | ArrayBufferView)[], - firstMipLevel?: number, - ) => void; -} -export interface RenderTarget extends ResourceBase { - type: ResourceType.RenderTarget; -} -export interface Sampler extends ResourceBase { - type: ResourceType.Sampler; -} -export interface Program extends ResourceBase { - type: ResourceType.Program; - setUniformsLegacy: (uniforms: Record) => void; -} -export interface Bindings extends ResourceBase { - type: ResourceType.Bindings; -} -export interface InputLayout extends ResourceBase { - type: ResourceType.InputLayout; -} -export interface RenderPipeline extends ResourceBase { - type: ResourceType.RenderPipeline; -} -export interface QueryPool extends ResourceBase { - type: ResourceType.QueryPool; - - queryResultOcclusion: (dstOffs: number) => boolean | null; -} -export interface Readback extends ResourceBase { - type: ResourceType.Readback; - - readTexture: ( - t: Texture, - x: number, - y: number, - width: number, - height: number, - dst: ArrayBufferView, - dstOffset?: number, - length?: number, - ) => Promise; - - readTextureSync: ( - t: Texture, - x: number, - y: number, - width: number, - height: number, - dst: ArrayBufferView, - dstOffset?: number, - length?: number, - ) => ArrayBufferView; - - readBuffer: ( - b: Buffer, - srcByteOffset?: number, - dst?: ArrayBufferView, - dstOffset?: number, - length?: number, - ) => Promise; -} -export interface ComputePipeline extends ResourceBase { - type: ResourceType.ComputePipeline; -} - -export type Resource = - | Buffer - | Texture - | RenderTarget - | Sampler - | Program - | Bindings - | InputLayout - | RenderPipeline - | ComputePipeline - | Readback; - -export enum CompareMode { - NEVER = GL.NEVER, - LESS = GL.LESS, - EQUAL = GL.EQUAL, - LEQUAL = GL.LEQUAL, - GREATER = GL.GREATER, - NOTEQUAL = GL.NOTEQUAL, - GEQUAL = GL.GEQUAL, - ALWAYS = GL.ALWAYS, -} - -export enum FrontFace { - CCW = GL.CCW, - CW = GL.CW, -} - -export enum CullMode { - NONE, - FRONT, - BACK, - FRONT_AND_BACK, -} - -/** - * Blend factor RGBA components. - * @see https://www.w3.org/TR/webgpu/#enumdef-gpublendfactor - */ -export enum BlendFactor { - /** - * (0, 0, 0, 0) - */ - ZERO = GL.ZERO, - /** - * (1, 1, 1, 1) - */ - ONE = GL.ONE, - /** - * (Rsrc, Gsrc, Bsrc, Asrc) - */ - SRC = GL.SRC_COLOR, - /** - * (1 - Rsrc, 1 - Gsrc, 1 - Bsrc, 1 - Asrc) - */ - ONE_MINUS_SRC = GL.ONE_MINUS_SRC_COLOR, - /** - * (Rdst, Gdst, Bdst, Adst) - */ - DST = GL.DST_COLOR, - /** - * (1 - Rdst, 1 - Gdst, 1 - Bdst, 1 - Adst) - */ - ONE_MINUS_DST = GL.ONE_MINUS_DST_COLOR, - /** - * (Asrc, Asrc, Asrc, Asrc) - */ - SRC_ALPHA = GL.SRC_ALPHA, - /** - * (1 - Asrc, 1 - Asrc, 1 - Asrc, 1 - Asrc) - */ - ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA, - /** - * (Adst, Adst, Adst, Adst) - */ - DST_ALPHA = GL.DST_ALPHA, - /** - * (1 - Adst, 1 - Adst, 1 - Adst, 1 - Adst) - */ - ONE_MINUS_DST_ALPHA = GL.ONE_MINUS_DST_ALPHA, - /** - * (Rconst, Gconst, Bconst, Aconst) - */ - CONST = GL.CONSTANT_COLOR, - /** - * (1 - Rconst, 1 - Gconst, 1 - Bconst, 1 - Aconst) - */ - ONE_MINUS_CONSTANT = GL.ONE_MINUS_CONSTANT_COLOR, - /** - * (min(Asrc, 1 - Adst), min(Asrc, 1 - Adst), min(Asrc, 1 - Adst), 1) - */ - SRC_ALPHA_SATURATE = GL.SRC_ALPHA_SATURATE, -} - -/** - * Defines the algorithm used to combine source and destination blend factors. - * @see https://www.w3.org/TR/webgpu/#enumdef-gpublendoperation - */ -export enum BlendMode { - /** - * RGBAsrc × RGBAsrcFactor + RGBAdst × RGBAdstFactor - */ - ADD = GL.FUNC_ADD, - /** - * RGBAsrc × RGBAsrcFactor - RGBAdst × RGBAdstFactor - */ - SUBSTRACT = GL.FUNC_SUBTRACT, - /** - * RGBAdst × RGBAdstFactor - RGBAsrc × RGBAsrcFactor - */ - REVERSE_SUBSTRACT = GL.FUNC_REVERSE_SUBTRACT, - // TODO: WebGL 1 should use ext - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/blendEquation#parameters - /** - * min(RGBAsrc, RGBAdst) - */ - MIN = GL.MIN, - /** - * max(RGBAsrc, RGBAdst) - */ - MAX = GL.MAX, -} - -export enum WrapMode { - CLAMP, - REPEAT, - MIRROR, -} -export enum TexFilterMode { - POINT, - BILINEAR, -} -export enum MipFilterMode { - NO_MIP, - NEAREST, - LINEAR, -} -export enum PrimitiveTopology { - POINTS, - TRIANGLES, - TRIANGLE_STRIP, - LINES, - LINE_STRIP, -} - -/** - * @see https://www.w3.org/TR/webgpu/#GPUBufferDescriptor - */ -export interface BufferDescriptor { - viewOrSize: ArrayBufferView | number; - usage: BufferUsage; - hint?: BufferFrequencyHint; -} - -/** - * @see https://www.w3.org/TR/webgpu/#buffer-usage - */ -export enum BufferUsage { - MAP_READ = 0x0001, - MAP_WRITE = 0x0002, - COPY_SRC = 0x0004, - COPY_DST = 0x0008, - INDEX = 0x0010, - VERTEX = 0x0020, - UNIFORM = 0x0040, - STORAGE = 0x0080, - INDIRECT = 0x0100, - QUERY_RESOLVE = 0x0200, -} - -export enum BufferFrequencyHint { - STATIC = 0x01, - DYNAMIC = 0x02, -} - -/** - * @see https://www.w3.org/TR/webgpu/#enumdef-gpuvertexstepmode - */ -export enum VertexStepMode { - VERTEX = 0x01, - INSTANCE = 0x02, -} - -export enum TextureEvent { - LOADED = 'loaded', -} - -export enum TextureDimension { - TEXTURE_2D, - TEXTURE_2D_ARRAY, - TEXTURE_3D, - TEXTURE_CUBE_MAP, -} - -export enum TextureUsage { - SAMPLED = 0x01, - RENDER_TARGET = 0x02, -} - -export enum ChannelWriteMask { - NONE = 0x00, - RED = 0x01, - GREEN = 0x02, - BLUE = 0x04, - ALPHA = 0x08, - RGB = 0x07, - ALL = 0x0f, -} - -/** - * @see https://www.w3.org/TR/webgpu/#enumdef-gpustenciloperation - */ -export enum StencilOp { - KEEP = GL.KEEP, - ZERO = GL.ZERO, - REPLACE = GL.REPLACE, - INVERT = GL.INVERT, - INCREMENT_CLAMP = GL.INCR, - DECREMENT_CLAMP = GL.DECR, - INCREMENT_WRAP = GL.INCR_WRAP, - DECREMENT_WRAP = GL.DECR_WRAP, -} - -export interface VertexBufferDescriptor { - buffer: Buffer; - byteOffset?: number; -} - -export type IndexBufferDescriptor = VertexBufferDescriptor; - -export interface VertexAttributeDescriptor { - location: number; - format: Format; - bufferIndex: number; - bufferByteOffset: number; - divisor?: number; -} - -export interface InputLayoutBufferDescriptor { - byteStride: number; - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpuvertexbufferlayout-stepmode - */ - stepMode: VertexStepMode; -} - -export interface TextureDescriptor { - dimension?: TextureDimension; - pixelFormat: Format; - width: number; - height: number; - depth?: number; - numLevels?: number; - usage: TextureUsage; - immutable?: boolean; - pixelStore?: Partial<{ - packAlignment: number; - unpackAlignment: number; - unpackFlipY: boolean; - }>; -} - -export function makeTextureDescriptor2D( - pixelFormat: Format, - width: number, - height: number, - numLevels: number, -): TextureDescriptor { - const dimension = TextureDimension.TEXTURE_2D, - depth = 1; - const usage = TextureUsage.SAMPLED; - return { dimension, pixelFormat, width, height, depth, numLevels, usage }; -} - -export interface SamplerDescriptor { - wrapS: WrapMode; - wrapT: WrapMode; - wrapQ?: WrapMode; - minFilter: TexFilterMode; - magFilter: TexFilterMode; - mipFilter: MipFilterMode; - minLOD?: number; - maxLOD?: number; - maxAnisotropy?: number; - compareMode?: CompareMode; -} - -export interface RenderTargetDescriptor { - pixelFormat: Format; - width: number; - height: number; - sampleCount?: number; - texture?: Texture; -} - -export interface BufferBinding { - buffer: Buffer; - wordCount: number; -} - -export interface SamplerBinding { - texture: Texture | null; - sampler: Sampler | null; -} - -export enum SamplerFormatKind { - Float, - Uint, - Sint, - Depth, -} - -export type BufferBindingType = 'uniform' | 'storage' | 'read-only-storage'; - -export interface BindingLayoutSamplerDescriptor { - dimension: TextureDimension; - formatKind: SamplerFormatKind; - comparison?: boolean; -} - -export interface BindingLayoutStorageDescriptor { - type: BufferBindingType; -} - -export interface BindingLayoutDescriptor { - numUniformBuffers?: number; - numSamplers?: number; - storageEntries?: BindingLayoutStorageDescriptor[]; // used in compute shader - samplerEntries?: BindingLayoutSamplerDescriptor[]; -} - -export interface BindingsDescriptor { - bindingLayout: BindingLayoutDescriptor; - // infer from shader module @see https://www.w3.org/TR/webgpu/#dom-gpupipelinebase-getbindgrouplayout - pipeline?: RenderPipeline | ComputePipeline; - uniformBufferBindings?: BufferBinding[]; - samplerBindings?: SamplerBinding[]; - storageBufferBindings?: BufferBinding[]; -} - -/** - * Support the following shaderStage: vertex | fragment | compute. - */ -export interface ProgramDescriptor { - vertex?: { - glsl?: string; - wgsl?: string; - }; - fragment?: { - glsl?: string; - wgsl?: string; - }; - compute?: { - wgsl: string; - }; -} - -export interface ProgramDescriptorSimple { - vert?: string; - frag?: string; - preprocessedVert?: string; - preprocessedFrag?: string; - preprocessedCompute?: string; -} - -export interface InputLayoutDescriptor { - vertexBufferDescriptors: (InputLayoutBufferDescriptor | null)[]; - vertexAttributeDescriptors: VertexAttributeDescriptor[]; - indexBufferFormat: Format | null; - /** - * Read attributes from linked program. - */ - program: Program; -} - -export interface ChannelBlendState { - blendMode: BlendMode; - blendSrcFactor: BlendFactor; - blendDstFactor: BlendFactor; -} - -export interface AttachmentState { - channelWriteMask?: ChannelWriteMask; - rgbBlendState: ChannelBlendState; - alphaBlendState: ChannelBlendState; -} - -export interface MegaStateDescriptor { - attachmentsState: AttachmentState[]; - blendConstant?: Color; - depthCompare?: CompareMode; - depthWrite?: boolean; - stencilCompare?: CompareMode; - stencilWrite?: boolean; - stencilPassOp?: StencilOp; - stencilRef?: number; - cullMode?: CullMode; - frontFace?: FrontFace; - polygonOffset?: boolean; -} - -export interface PipelineDescriptor { - bindingLayouts?: BindingLayoutDescriptor[]; - inputLayout: InputLayout | null; - program: Program; -} - -export interface RenderPipelineDescriptor extends PipelineDescriptor { - topology?: PrimitiveTopology; - megaStateDescriptor?: MegaStateDescriptor; - - // Attachment data. - colorAttachmentFormats: (Format | null)[]; - depthStencilAttachmentFormat?: Format | null; - sampleCount?: number; -} - -export type ComputePipelineDescriptor = PipelineDescriptor; - -export interface Color { - r: number; - g: number; - b: number; - a: number; -} - -export interface RenderPassDescriptor { - colorAttachment: (RenderTarget | null)[]; - colorAttachmentLevel?: number[]; - colorClearColor?: (Color | 'load')[]; - colorResolveTo: (Texture | null)[]; - colorResolveToLevel?: number[]; - colorStore?: boolean[]; - depthStencilAttachment?: RenderTarget | null; - depthStencilResolveTo?: Texture | null; - depthStencilStore?: boolean; - depthClearValue?: number | 'load'; - stencilClearValue?: number | 'load'; - occlusionQueryPool?: QueryPool | null; -} - -export interface DeviceLimits { - uniformBufferWordAlignment: number; - uniformBufferMaxPageWordSize: number; - readonly supportedSampleCounts: number[]; - occlusionQueriesRecommended: boolean; - computeShadersSupported: boolean; -} - -export interface DebugGroup { - name: string; - drawCallCount: number; - textureBindCount: number; - bufferUploadCount: number; - triangleCount: number; -} - -export enum ViewportOrigin { - LOWER_LEFT, - UPPER_LEFT, -} - -export enum ClipSpaceNearZ { - NEGATIVE_ONE, - ZERO, -} - -export interface VendorInfo { - readonly platformString: string; - readonly glslVersion: string; - readonly explicitBindingLocations: boolean; - readonly separateSamplerTextures: boolean; - readonly viewportOrigin: ViewportOrigin; - readonly clipSpaceNearZ: ClipSpaceNearZ; - readonly supportMRT: boolean; -} - -export type PlatformFramebuffer = WebGLFramebuffer; - -export interface SwapChain { - // @see https://www.w3.org/TR/webgpu/#canvas-configuration - configureSwapChain: ( - width: number, - height: number, - platformFramebuffer?: PlatformFramebuffer, - ) => void; - getDevice: () => Device; - getCanvas: () => HTMLCanvasElement | OffscreenCanvas; - getOnscreenTexture: () => Texture; -} - -/** - * @see https://www.w3.org/TR/webgpu/#debug-markers - */ -interface DebugCommandsMixin { - pushDebugGroup: (groupLabel: string) => void; - popDebugGroup: () => void; - insertDebugMarker: (markerLabel: string) => void; -} - -export interface RenderPass extends DebugCommandsMixin { - // State management. - setViewport: (x: number, y: number, w: number, h: number) => void; - setScissor: (x: number, y: number, w: number, h: number) => void; - setPipeline: (pipeline: RenderPipeline) => void; - setBindings: ( - bindingLayoutIndex: number, - bindings: Bindings, - dynamicByteOffsets: number[], - ) => void; - setVertexInput: ( - inputLayout: InputLayout | null, - buffers: (VertexBufferDescriptor | null)[] | null, - indexBuffer: IndexBufferDescriptor | null, - ) => void; - setStencilRef: (value: number) => void; - - // Draw commands. - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpurendercommandsmixin-draw - */ - draw: ( - vertexCount: number, - instanceCount?: number, - firstVertex?: number, - firstInstance?: number, - ) => void; - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpurendercommandsmixin-drawindexed - */ - drawIndexed: ( - indexCount: number, - instanceCount?: number, - firstIndex?: number, - baseVertex?: number, - firstInstance?: number, - ) => void; - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpurendercommandsmixin-drawindirect - */ - drawIndirect: (indirectBuffer: Buffer, indirectOffset: number) => void; - - // Query system. - beginOcclusionQuery: (dstOffs: number) => void; - endOcclusionQuery: (dstOffs: number) => void; -} - -/** - * @see https://www.w3.org/TR/webgpu/#compute-passes - */ -export interface ComputePass extends DebugCommandsMixin { - setPipeline: (pipeline: ComputePipeline) => void; - setBindings: ( - bindingLayoutIndex: number, - bindings: Bindings, - dynamicByteOffsets: number[], - ) => void; - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpucomputepassencoder-dispatchworkgroups - */ - dispatchWorkgroups: ( - workgroupCountX: number, - workgroupCountY?: number, - workgroupCountZ?: number, - ) => void; - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpucomputepassencoder-dispatchworkgroupsindirect - */ - dispatchWorkgroupsIndirect: ( - indirectBuffer: Buffer, - indirectOffset: number, - ) => void; -} - -export enum QueryPoolType { - OcclusionConservative, -} -/** - * Device represents a "virtual GPU" - * @see https://www.w3.org/TR/webgpu/#gpu-device - * - * Support following backends: - * * webgl1 CanvasWebGLRenderingContext - * * WebGL2 CanvasWebGL2RenderingContext - * * WebGPU GPUDevice - * - * A bit about the design of this API; all resources are "opaque", meaning you cannot look at the - * implementation details or underlying fields of the resources, and most objects cannot have their - * creation parameters modified after they are created. So, while buffers and textures can have their - * contents changed through data upload passes, they cannot be resized after creation. Create a new object - * and destroy the old one if you wish to "resize" it. - */ -export interface Device { - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpudevice-createbuffer - */ - createBuffer: (descriptor: BufferDescriptor) => Buffer; - createTexture: (descriptor: TextureDescriptor) => Texture; - createSampler: (descriptor: SamplerDescriptor) => Sampler; - createRenderTarget: (descriptor: RenderTargetDescriptor) => RenderTarget; - createRenderTargetFromTexture: (texture: Texture) => RenderTarget; - createProgram: (program: ProgramDescriptor) => Program; - createBindings: (bindingsDescriptor: BindingsDescriptor) => Bindings; - createInputLayout: ( - inputLayoutDescriptor: InputLayoutDescriptor, - ) => InputLayout; - createRenderPipeline: ( - descriptor: RenderPipelineDescriptor, - ) => RenderPipeline; - createComputePipeline: ( - descriptor: ComputePipelineDescriptor, - ) => ComputePipeline; - createReadback: () => Readback; - createQueryPool: (type: QueryPoolType, elemCount: number) => QueryPool; - - createRenderPass: (renderPassDescriptor: RenderPassDescriptor) => RenderPass; - createComputePass: () => ComputePass; - - beginFrame(): void; - endFrame(): void; - submitPass: (pass: RenderPass | ComputePass) => void; - destroy(): void; - - // Render pipeline compilation control. - pipelineQueryReady: (o: RenderPipeline) => boolean; - pipelineForceReady: (o: RenderPipeline) => void; - - copySubTexture2D: ( - dst: Texture, - dstX: number, - dstY: number, - src: Texture, - srcX: number, - srcY: number, - ) => void; - - // Information queries. - queryLimits: () => DeviceLimits; - queryTextureFormatSupported: ( - format: Format, - width: number, - height: number, - ) => boolean; - queryPlatformAvailable: () => boolean; - queryVendorInfo: () => VendorInfo; - queryRenderPass: (o: RenderPass) => Readonly; - queryRenderTarget: (o: RenderTarget) => Readonly; - - // Debugging. - setResourceName: (o: Resource, s: string) => void; - setResourceLeakCheck: (o: Resource, v: boolean) => void; - checkForLeaks: () => void; - programPatched: (o: Program, descriptor: ProgramDescriptor) => void; -} diff --git a/packages/g-plugin-device-renderer/src/platform/utils/assert.ts b/packages/g-plugin-device-renderer/src/platform/utils/assert.ts deleted file mode 100644 index e1f20c704..000000000 --- a/packages/g-plugin-device-renderer/src/platform/utils/assert.ts +++ /dev/null @@ -1,11 +0,0 @@ -export function assert(b: boolean, message = ''): asserts b { - if (!b) { - console.error(new Error().stack); - throw new Error(`Assert fail: ${message}`); - } -} - -export function assertExists(v: T | null | undefined): T { - if (v !== undefined && v !== null) return v; - else throw new Error('Missing object'); -} diff --git a/packages/g-plugin-device-renderer/src/platform/utils/color.ts b/packages/g-plugin-device-renderer/src/platform/utils/color.ts deleted file mode 100644 index 8848dc72e..000000000 --- a/packages/g-plugin-device-renderer/src/platform/utils/color.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { Color } from '../interfaces'; - -export function colorEqual(c0: Readonly, c1: Readonly): boolean { - return c0.r === c1.r && c0.g === c1.g && c0.b === c1.b && c0.a === c1.a; -} - -export function colorCopy(dst: Color, src: Readonly): void { - dst.r = src.r; - dst.g = src.g; - dst.b = src.b; - dst.a = src.a; -} - -export function colorNewCopy(src: Readonly): Color { - const { r, g, b, a } = src; - return { r, g, b, a }; -} - -export function colorNewFromRGBA( - r: number, - g: number, - b: number, - a = 1.0, -): Color { - return { r, g, b, a }; -} - -export const TransparentBlack = colorNewFromRGBA(0, 0, 0, 0); -export const OpaqueBlack = colorNewFromRGBA(0, 0, 0, 1); -export const TransparentWhite = colorNewFromRGBA(1, 1, 1, 0); -export const OpaqueWhite = colorNewFromRGBA(1, 1, 1, 1); diff --git a/packages/g-plugin-device-renderer/src/platform/utils/depth.ts b/packages/g-plugin-device-renderer/src/platform/utils/depth.ts deleted file mode 100644 index 1282f2fd1..000000000 --- a/packages/g-plugin-device-renderer/src/platform/utils/depth.ts +++ /dev/null @@ -1,85 +0,0 @@ -import type { mat4 } from 'gl-matrix'; -import { CompareMode } from '../interfaces'; - -/** - * @see https://forum.babylonjs.com/t/reverse-depth-buffer-z-buffer/6905/2 - */ -export const IsDepthReversed = true; - -export function reverseDepthForPerspectiveProjectionMatrix( - m: mat4, - isDepthReversed = IsDepthReversed, -): void { - if (isDepthReversed) { - m[10] = -m[10]; - m[14] = -m[14]; - } -} - -export function reverseDepthForOrthographicProjectionMatrix( - m: mat4, - isDepthReversed = IsDepthReversed, -): void { - if (isDepthReversed) { - m[10] = -m[10]; - m[14] = -m[14] + 1; - } -} - -export function reverseDepthForCompareMode( - compareMode: CompareMode, - isDepthReversed = IsDepthReversed, -): CompareMode { - if (isDepthReversed) { - switch (compareMode) { - case CompareMode.LESS: - return CompareMode.GREATER; - case CompareMode.LEQUAL: - return CompareMode.GEQUAL; - case CompareMode.GEQUAL: - return CompareMode.LEQUAL; - case CompareMode.GREATER: - return CompareMode.LESS; - default: - return compareMode; - } - } else { - return compareMode; - } -} - -export function reverseDepthForClearValue( - n: number, - isDepthReversed = IsDepthReversed, -): number { - if (isDepthReversed) { - return 1.0 - n; - } else { - return n; - } -} - -export function reverseDepthForDepthOffset( - n: number, - isDepthReversed = IsDepthReversed, -): number { - if (isDepthReversed) { - return -n; - } else { - return n; - } -} - -export function compareDepthValues( - a: number, - b: number, - op: CompareMode, - isDepthReversed = IsDepthReversed, -): boolean { - op = reverseDepthForCompareMode(op, isDepthReversed); - if (op === CompareMode.LESS) return a < b; - else if (op === CompareMode.LEQUAL) return a <= b; - else if (op === CompareMode.GREATER) return a > b; - else if (op === CompareMode.GEQUAL) return a >= b; - else throw new Error('whoops'); -} diff --git a/packages/g-plugin-device-renderer/src/platform/utils/endian.ts b/packages/g-plugin-device-renderer/src/platform/utils/endian.ts deleted file mode 100644 index dae508768..000000000 --- a/packages/g-plugin-device-renderer/src/platform/utils/endian.ts +++ /dev/null @@ -1,13 +0,0 @@ -export enum Endianness { - LITTLE_ENDIAN, - BIG_ENDIAN, -} - -const test: Uint16Array = new Uint16Array([0xfeff]); -const testView: DataView = new DataView(test.buffer); -const systemEndianness: Endianness = - testView.getUint8(0) == 0xff ? Endianness.LITTLE_ENDIAN : Endianness.BIG_ENDIAN; - -export function getSystemEndianness(): Endianness { - return systemEndianness; -} diff --git a/packages/g-plugin-device-renderer/src/platform/utils/hash.ts b/packages/g-plugin-device-renderer/src/platform/utils/hash.ts deleted file mode 100644 index 1b9d86e2a..000000000 --- a/packages/g-plugin-device-renderer/src/platform/utils/hash.ts +++ /dev/null @@ -1,379 +0,0 @@ -import { isNil } from '@antv/util'; -import type { Format } from '../format'; -import type { - AttachmentState, - BindingLayoutDescriptor, - BindingLayoutSamplerDescriptor, - BindingsDescriptor, - BufferBinding, - ChannelBlendState, - InputLayoutBufferDescriptor, - InputLayoutDescriptor, - MegaStateDescriptor, - Program, - RenderPipelineDescriptor, - SamplerBinding, - SamplerDescriptor, - VertexAttributeDescriptor, -} from '../interfaces'; -import { colorEqual } from './color'; -import { copyMegaState } from './states'; - -type EqualFunc = (a: K, b: K) => boolean; -export function arrayEqual(a: T[], b: T[], e: EqualFunc): boolean { - if (a.length !== b.length) return false; - for (let i = 0; i < a.length; i++) if (!e(a[i], b[i])) return false; - return true; -} - -type CopyFunc = (a: T) => T; -export function arrayCopy(a: T[], copyFunc: CopyFunc): T[] { - const b = Array(a.length); - for (let i = 0; i < a.length; i++) b[i] = copyFunc(a[i]); - return b; -} - -function bufferBindingEquals( - a: Readonly, - b: Readonly, -): boolean { - return a.buffer === b.buffer && a.wordCount === b.wordCount; -} - -function bindingLayoutSamplerDescriptorEqual( - a: Readonly, - b: Readonly, -): boolean { - return a.dimension === b.dimension && a.formatKind === b.formatKind; -} - -function samplerBindingEquals( - a: Readonly, - b: Readonly, -): boolean { - if (a === null) return b === null; - if (b === null) return false; - return a.sampler === b.sampler && a.texture === b.texture; -} - -export function bindingLayoutDescriptorEqual( - a: Readonly, - b: Readonly, -): boolean { - if (a.numSamplers !== b.numSamplers) return false; - if (a.numUniformBuffers !== b.numUniformBuffers) return false; - if ((a.samplerEntries === undefined) !== (b.samplerEntries === undefined)) - return false; - if ( - a.samplerEntries !== undefined && - !arrayEqual( - a.samplerEntries!, - b.samplerEntries!, - bindingLayoutSamplerDescriptorEqual, - ) - ) - return false; - return true; -} - -export function bindingsDescriptorEquals( - a: Readonly, - b: Readonly, -): boolean { - if (a.samplerBindings.length !== b.samplerBindings.length) return false; - if (!arrayEqual(a.samplerBindings, b.samplerBindings, samplerBindingEquals)) - return false; - if ( - !arrayEqual( - a.uniformBufferBindings, - b.uniformBufferBindings, - bufferBindingEquals, - ) - ) - return false; - if (!bindingLayoutEquals(a.bindingLayout, b.bindingLayout)) return false; - return true; -} - -function channelBlendStateEquals( - a: Readonly, - b: Readonly, -): boolean { - return ( - a.blendMode == b.blendMode && - a.blendSrcFactor === b.blendSrcFactor && - a.blendDstFactor === b.blendDstFactor - ); -} - -function attachmentStateEquals( - a: Readonly, - b: Readonly, -): boolean { - if (!channelBlendStateEquals(a.rgbBlendState, b.rgbBlendState)) return false; - if (!channelBlendStateEquals(a.alphaBlendState, b.alphaBlendState)) - return false; - if (a.channelWriteMask !== b.channelWriteMask) return false; - return true; -} - -function megaStateDescriptorEquals( - a: MegaStateDescriptor, - b: MegaStateDescriptor, -): boolean { - if ( - !arrayEqual(a.attachmentsState, b.attachmentsState, attachmentStateEquals) - ) - return false; - if (!colorEqual(a.blendConstant, b.blendConstant)) return false; - - return ( - a.depthCompare === b.depthCompare && - a.depthWrite === b.depthWrite && - a.stencilCompare === b.stencilCompare && - a.stencilWrite === b.stencilWrite && - a.stencilPassOp === b.stencilPassOp && - a.stencilRef === b.stencilRef && - a.cullMode === b.cullMode && - a.frontFace === b.frontFace && - a.polygonOffset === b.polygonOffset - ); -} - -function bindingLayoutEquals( - a: Readonly, - b: Readonly, -): boolean { - return ( - a.numSamplers === b.numSamplers && - a.numUniformBuffers === b.numUniformBuffers - ); -} - -function programEquals(a: Readonly, b: Readonly): boolean { - return a.id === b.id; -} - -function formatEquals(a: Format | null, b: Format | null): boolean { - return a === b; -} - -export function renderPipelineDescriptorEquals( - a: Readonly, - b: Readonly, -): boolean { - if (a.topology !== b.topology) return false; - if (a.inputLayout !== b.inputLayout) return false; - if (a.sampleCount !== b.sampleCount) return false; - if (!megaStateDescriptorEquals(a.megaStateDescriptor, b.megaStateDescriptor)) - return false; - if (!programEquals(a.program, b.program)) return false; - if (!arrayEqual(a.bindingLayouts, b.bindingLayouts, bindingLayoutEquals)) - return false; - if ( - !arrayEqual( - a.colorAttachmentFormats, - b.colorAttachmentFormats, - formatEquals, - ) - ) - return false; - if (a.depthStencilAttachmentFormat !== b.depthStencilAttachmentFormat) - return false; - return true; -} - -export function vertexAttributeDescriptorEquals( - a: Readonly, - b: Readonly, -): boolean { - return ( - a.bufferIndex === b.bufferIndex && - a.bufferByteOffset === b.bufferByteOffset && - a.location === b.location && - a.format === b.format && - a.divisor === b.divisor - ); -} - -export function inputLayoutBufferDescriptorEquals( - a: Readonly, - b: Readonly, -): boolean { - if (isNil(a)) return isNil(b); - if (isNil(b)) return false; - return a.byteStride === b.byteStride && a.stepMode === b.stepMode; -} - -export function inputLayoutDescriptorEquals( - a: Readonly, - b: Readonly, -): boolean { - if (a.indexBufferFormat !== b.indexBufferFormat) return false; - if ( - !arrayEqual( - a.vertexBufferDescriptors, - b.vertexBufferDescriptors, - inputLayoutBufferDescriptorEquals, - ) - ) - return false; - if ( - !arrayEqual( - a.vertexAttributeDescriptors, - b.vertexAttributeDescriptors, - vertexAttributeDescriptorEquals, - ) - ) - return false; - if (!programEquals(a.program, b.program)) return false; - return true; -} - -export function samplerDescriptorEquals( - a: Readonly, - b: Readonly, -): boolean { - return ( - a.wrapS === b.wrapS && - a.wrapT === b.wrapT && - a.minFilter === b.minFilter && - a.magFilter === b.magFilter && - a.mipFilter === b.mipFilter && - a.minLOD === b.minLOD && - a.maxLOD === b.maxLOD && - a.maxAnisotropy === b.maxAnisotropy && - a.compareMode === b.compareMode - ); -} - -export function samplerBindingCopy( - a: Readonly, -): SamplerBinding { - const sampler = a.sampler; - const texture = a.texture; - return { sampler, texture }; -} - -export function samplerBindingNew(): SamplerBinding { - return { sampler: null, texture: null }; -} - -export function bufferBindingCopy(a: Readonly): BufferBinding { - const buffer = a.buffer; - const wordCount = a.wordCount; - return { buffer, wordCount }; -} - -export function bindingsDescriptorCopy( - a: Readonly, -): BindingsDescriptor { - const bindingLayout = a.bindingLayout; - const samplerBindings = arrayCopy(a.samplerBindings, samplerBindingCopy); - const uniformBufferBindings = arrayCopy( - a.uniformBufferBindings, - bufferBindingCopy, - ); - return { - bindingLayout, - samplerBindings, - uniformBufferBindings, - pipeline: a.pipeline, - }; -} - -export function bindingLayoutSamplerDescriptorCopy( - a: Readonly, -): BindingLayoutSamplerDescriptor { - const dimension = a.dimension, - formatKind = a.formatKind; - return { dimension, formatKind }; -} - -export function bindingLayoutDescriptorCopy( - a: Readonly, -): BindingLayoutDescriptor { - const numSamplers = a.numSamplers; - const numUniformBuffers = a.numUniformBuffers; - const samplerEntries = - a.samplerEntries !== undefined - ? arrayCopy(a.samplerEntries!, bindingLayoutSamplerDescriptorCopy) - : undefined; - return { numSamplers, numUniformBuffers, samplerEntries }; -} - -export function renderPipelineDescriptorCopy( - a: Readonly, -): RenderPipelineDescriptor { - const bindingLayouts = arrayCopy( - a.bindingLayouts, - bindingLayoutDescriptorCopy, - ); - const inputLayout = a.inputLayout; - const program = a.program; - const topology = a.topology; - const megaStateDescriptor = copyMegaState(a.megaStateDescriptor); - const colorAttachmentFormats = a.colorAttachmentFormats.slice(); - const depthStencilAttachmentFormat = a.depthStencilAttachmentFormat; - const sampleCount = a.sampleCount; - return { - bindingLayouts, - inputLayout, - megaStateDescriptor, - program, - topology, - colorAttachmentFormats, - depthStencilAttachmentFormat, - sampleCount, - }; -} - -export function vertexAttributeDescriptorCopy( - a: Readonly, -): VertexAttributeDescriptor { - const location = a.location; - const format = a.format; - const bufferIndex = a.bufferIndex; - const bufferByteOffset = a.bufferByteOffset; - const divisor = a.divisor; - return { - location, - format, - bufferIndex, - bufferByteOffset, - divisor, - }; -} - -export function inputLayoutBufferDescriptorCopy( - a: Readonly, -): InputLayoutBufferDescriptor | null { - if (!isNil(a)) { - const byteStride = a.byteStride; - const stepMode = a.stepMode; - return { byteStride, stepMode }; - } else { - return a; - } -} - -export function inputLayoutDescriptorCopy( - a: Readonly, -): InputLayoutDescriptor { - const vertexAttributeDescriptors = arrayCopy( - a.vertexAttributeDescriptors, - vertexAttributeDescriptorCopy, - ); - const vertexBufferDescriptors = arrayCopy( - a.vertexBufferDescriptors, - inputLayoutBufferDescriptorCopy, - ); - const indexBufferFormat = a.indexBufferFormat; - const program = a.program; - return { - vertexAttributeDescriptors, - vertexBufferDescriptors, - indexBufferFormat, - program, - }; -} diff --git a/packages/g-plugin-device-renderer/src/platform/utils/index.ts b/packages/g-plugin-device-renderer/src/platform/utils/index.ts deleted file mode 100644 index 6c18c6b50..000000000 --- a/packages/g-plugin-device-renderer/src/platform/utils/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './assert'; -export * from './color'; -export * from './depth'; -export * from './states'; -export * from './hash'; -export * from './endian'; -export * from './uniform'; diff --git a/packages/g-plugin-device-renderer/src/platform/utils/states.ts b/packages/g-plugin-device-renderer/src/platform/utils/states.ts deleted file mode 100644 index 503cce010..000000000 --- a/packages/g-plugin-device-renderer/src/platform/utils/states.ts +++ /dev/null @@ -1,282 +0,0 @@ -import type { - AttachmentState, - BindingLayoutSamplerDescriptor, - ChannelBlendState, - MegaStateDescriptor, -} from '../interfaces'; -import { - BlendFactor, - BlendMode, - ChannelWriteMask, - CompareMode, - CullMode, - FrontFace, - SamplerFormatKind, - StencilOp, - TextureDimension, -} from '../interfaces'; -import { colorCopy, colorNewCopy, TransparentBlack } from './color'; -// import { reverseDepthForCompareMode } from './depth'; - -export function isPowerOfTwo(n: number): boolean { - return n && (n & (n - 1)) === 0; -} - -export function fallbackUndefined(v: T | null | undefined, fallback: T): T { - return v !== null && v !== undefined ? v : fallback; -} - -export function nullify(v: T | undefined | null): T | null { - return v === undefined ? null : v; -} - -export function fillArray(L: T[], n: number, v: T): void { - L.length = n; - L.fill(v); -} - -export function align(n: number, multiple: number): number { - const mask = multiple - 1; - return (n + mask) & ~mask; -} - -export function alignNonPowerOfTwo(n: number, multiple: number): number { - return (((n + multiple - 1) / multiple) | 0) * multiple; -} - -// @see https://github.com/d3/d3-array#bisectRight -export function bisectRight( - L: T[], - e: T, - compare: (a: T, b: T) => number, -): number { - let lo = 0, - hi = L.length; - while (lo < hi) { - const mid = lo + ((hi - lo) >>> 1); - const cmp = compare(e, L[mid]); - if (cmp < 0) hi = mid; - else lo = mid + 1; - } - return lo; -} - -export function spliceBisectRight( - L: T[], - e: T, - compare: (a: T, b: T) => number, -): void { - const idx = bisectRight(L, e, compare); - L.splice(idx, 0, e); -} - -export function setBitFlagEnabled( - v: number, - mask: number, - enabled: boolean, -): number { - if (enabled) v |= mask; - else v &= ~mask; - return v; -} - -export function nArray(n: number, c: () => T): T[] { - const d = new Array(n); - for (let i = 0; i < n; i++) d[i] = c(); - return d; -} - -export function prependLineNo(str: string, lineStart = 1) { - const lines = str.split('\n'); - return lines - .map((s, i) => `${leftPad('' + (lineStart + i), 4, ' ')} ${s}`) - .join('\n'); -} - -export function leftPad(S: string, spaces: number, ch = '0'): string { - while (S.length < spaces) S = `${ch}${S}`; - return S; -} - -export function range(start: number, count: number): number[] { - const L: number[] = []; - for (let i = start; i < start + count; i++) L.push(i); - return L; -} - -function copyChannelBlendState( - dst: ChannelBlendState, - src: ChannelBlendState, -): void { - dst.blendDstFactor = src.blendDstFactor; - dst.blendSrcFactor = src.blendSrcFactor; - dst.blendMode = src.blendMode; -} - -export function copyAttachmentState( - dst: AttachmentState | undefined, - src: AttachmentState, -): AttachmentState { - if (dst === undefined) { - dst = { - rgbBlendState: {} as ChannelBlendState, - alphaBlendState: {} as ChannelBlendState, - channelWriteMask: 0, - }; - } - - copyChannelBlendState(dst.rgbBlendState, src.rgbBlendState); - copyChannelBlendState(dst.alphaBlendState, src.alphaBlendState); - dst.channelWriteMask = src.channelWriteMask; - return dst; -} - -function copyAttachmentsState( - dst: AttachmentState[], - src: AttachmentState[], -): void { - if (dst.length !== src.length) dst.length = src.length; - for (let i = 0; i < src.length; i++) - dst[i] = copyAttachmentState(dst[i], src[i]); -} - -export function setMegaStateFlags( - dst: MegaStateDescriptor, - src: Partial, -): void { - if (src.attachmentsState !== undefined) { - copyAttachmentsState(dst.attachmentsState, src.attachmentsState); - } - - if (src.blendConstant !== undefined) { - colorCopy(dst.blendConstant, src.blendConstant); - } - - dst.depthCompare = fallbackUndefined(src.depthCompare, dst.depthCompare); - dst.depthWrite = fallbackUndefined(src.depthWrite, dst.depthWrite); - dst.stencilCompare = fallbackUndefined( - src.stencilCompare, - dst.stencilCompare, - ); - dst.stencilWrite = fallbackUndefined(src.stencilWrite, dst.stencilWrite); - dst.stencilPassOp = fallbackUndefined(src.stencilPassOp, dst.stencilPassOp); - dst.stencilRef = fallbackUndefined(src.stencilRef, dst.stencilRef); - dst.cullMode = fallbackUndefined(src.cullMode, dst.cullMode); - dst.frontFace = fallbackUndefined(src.frontFace, dst.frontFace); - dst.polygonOffset = fallbackUndefined(src.polygonOffset, dst.polygonOffset); -} - -export function copyMegaState(src: MegaStateDescriptor): MegaStateDescriptor { - const dst = Object.assign({}, src); - // Copy fields that need copying. - dst.attachmentsState = []; - copyAttachmentsState(dst.attachmentsState, src.attachmentsState); - dst.blendConstant = colorNewCopy(dst.blendConstant); - return dst; -} - -export interface AttachmentStateSimple { - channelWriteMask: ChannelWriteMask; - rgbBlendMode?: BlendMode; - alphaBlendMode?: BlendMode; - rgbBlendSrcFactor?: BlendFactor; - alphaBlendSrcFactor?: BlendFactor; - rgbBlendDstFactor?: BlendFactor; - alphaBlendDstFactor?: BlendFactor; -} - -export function copyAttachmentStateFromSimple( - dst: AttachmentState, - src: Partial, -): void { - if (src.channelWriteMask !== undefined) { - dst.channelWriteMask = src.channelWriteMask; - } - - if (src.rgbBlendMode !== undefined) { - dst.rgbBlendState.blendMode = src.rgbBlendMode; - } - - if (src.alphaBlendMode !== undefined) { - dst.alphaBlendState.blendMode = src.alphaBlendMode; - } - - if (src.rgbBlendSrcFactor !== undefined) { - dst.rgbBlendState.blendSrcFactor = src.rgbBlendSrcFactor; - } - if (src.alphaBlendSrcFactor !== undefined) { - dst.alphaBlendState.blendSrcFactor = src.alphaBlendSrcFactor; - } - - if (src.rgbBlendDstFactor !== undefined) { - dst.rgbBlendState.blendDstFactor = src.rgbBlendDstFactor; - } - if (src.alphaBlendDstFactor !== undefined) { - dst.alphaBlendState.blendDstFactor = src.alphaBlendDstFactor; - } -} - -const defaultBlendState: ChannelBlendState = { - blendMode: BlendMode.ADD, - blendSrcFactor: BlendFactor.ONE, - blendDstFactor: BlendFactor.ZERO, -}; - -export const defaultMegaState: MegaStateDescriptor = { - attachmentsState: [ - { - channelWriteMask: ChannelWriteMask.ALL, - rgbBlendState: defaultBlendState, - alphaBlendState: defaultBlendState, - }, - ], - - blendConstant: colorNewCopy(TransparentBlack), - depthWrite: true, - depthCompare: CompareMode.LEQUAL, - // depthCompare: reverseDepthForCompareMode(CompareMode.LessEqual), - // stencilCompare: CompareMode.Never, - stencilCompare: CompareMode.ALWAYS, - stencilWrite: false, - stencilPassOp: StencilOp.KEEP, - stencilRef: 0, - cullMode: CullMode.NONE, - frontFace: FrontFace.CCW, - polygonOffset: false, -}; - -export function makeMegaState( - other: Partial | null = null, - src: MegaStateDescriptor = defaultMegaState, -) { - const dst = copyMegaState(src); - if (other !== null) setMegaStateFlags(dst, other); - return dst; -} - -export const fullscreenMegaState = makeMegaState( - { depthCompare: CompareMode.ALWAYS, depthWrite: false }, - defaultMegaState, -); - -export function setAttachmentStateSimple( - dst: Partial, - simple: Partial, -): Partial { - if (dst.attachmentsState === undefined) { - dst.attachmentsState = []; - copyAttachmentsState( - dst.attachmentsState, - defaultMegaState.attachmentsState, - ); - } - - copyAttachmentStateFromSimple(dst.attachmentsState[0], simple); - return dst; -} - -export const defaultBindingLayoutSamplerDescriptor: BindingLayoutSamplerDescriptor = - { - formatKind: SamplerFormatKind.Float, - dimension: TextureDimension.TEXTURE_2D, - }; diff --git a/packages/g-plugin-device-renderer/src/platform/utils/uniform.ts b/packages/g-plugin-device-renderer/src/platform/utils/uniform.ts deleted file mode 100644 index 67ccdb5aa..000000000 --- a/packages/g-plugin-device-renderer/src/platform/utils/uniform.ts +++ /dev/null @@ -1,370 +0,0 @@ -/** - * ported from luma.gl - * uniformXXX for WebGL1 according to format - */ -import { GL } from '../constants'; -import { assert } from './assert'; - -// if array name then clean the array brackets -const UNIFORM_NAME_REGEXP = /([^[]*)(\[[0-9]+\])?/; - -export function parseUniformName(name: string): { - name: string; - isArray: boolean; - length: number; -} { - // Shortcut to avoid redundant or bad matches - if (name[name.length - 1] !== ']') { - return { - name, - length: 1, - isArray: false, - }; - } - - const matches = name.match(UNIFORM_NAME_REGEXP); - if (!matches || matches.length < 2) { - throw new Error(`Failed to parse GLSL uniform name ${name}`); - } - - return { - name: matches[1], - length: Number(matches[2]) || 1, - isArray: Boolean(matches[2]), - }; -} - -function getSamplerSetter() { - let cache = null; - return ( - gl: WebGLRenderingContextBase, - location: WebGLUniformLocation, - value: any, - ) => { - const update = cache !== value; - if (update) { - gl.uniform1i(location, value); - cache = value; - } - - return update; - }; -} - -function getArraySetter(functionName: string, toArray, size, uniformSetter) { - let cache = null; - let cacheLength = null; - return (gl: WebGLRenderingContextBase, location: number, value: any) => { - const arrayValue = toArray(value, size); - const length = arrayValue.length; - let update = false; - if (cache === null) { - cache = new Float32Array(length); - cacheLength = length; - update = true; - } else { - assert(cacheLength === length, 'Uniform length cannot change.'); - for (let i = 0; i < length; ++i) { - if (arrayValue[i] !== cache[i]) { - update = true; - break; - } - } - } - if (update) { - uniformSetter(gl, functionName, location, arrayValue); - cache.set(arrayValue); - } - - return update; - }; -} - -function setVectorUniform( - gl: WebGLRenderingContextBase, - functionName: string, - location: number, - value: any, -) { - gl[functionName](location, value); -} - -function setMatrixUniform( - gl: WebGLRenderingContextBase, - functionName: string, - location: number, - value: any, -) { - gl[functionName](location, false, value); -} - -const FLOAT_ARRAY = {}; -const INT_ARRAY = {}; -const UINT_ARRAY = {}; -const array1: number[] = [0]; -type ValueType = boolean | number | number[] | boolean[] | ArrayBufferView; -function toTypedArray( - value: ValueType, - uniformLength: number, - Type: - | Float32ArrayConstructor - | Uint16ArrayConstructor - | Uint32ArrayConstructor - | Int32ArrayConstructor, - cache: Record, -): ArrayBufferView { - // convert boolean uniforms to Number - if (uniformLength === 1 && typeof value === 'boolean') { - value = value ? 1 : 0; - } - if (Number.isFinite(value)) { - array1[0] = value as number; - value = array1; - } - const length = (value as number[]).length; - if (length % uniformLength) { - // log.warn(`Uniform size should be multiples of ${uniformLength}`, value)(); - } - - if (value instanceof Type) { - return value; - } - let result = cache[length]; - if (!result) { - result = new Type(length); - cache[length] = result; - } - for (let i = 0; i < length; i++) { - result[i] = value[i]; - } - return result; -} - -function toFloatArray(value: ValueType, uniformLength: number) { - return toTypedArray(value, uniformLength, Float32Array, FLOAT_ARRAY); -} - -function toIntArray(value: ValueType, uniformLength: number) { - return toTypedArray(value, uniformLength, Int32Array, INT_ARRAY); -} - -function toUIntArray(value: ValueType, uniformLength: number) { - return toTypedArray(value, uniformLength, Uint32Array, UINT_ARRAY); -} - -export const UNIFORM_SETTERS = { - // WEBGL1 - [GL.FLOAT]: getArraySetter.bind( - null, - 'uniform1fv', - toFloatArray, - 1, - setVectorUniform, - ), - [GL.FLOAT_VEC2]: getArraySetter.bind( - null, - 'uniform2fv', - toFloatArray, - 2, - setVectorUniform, - ), - [GL.FLOAT_VEC3]: getArraySetter.bind( - null, - 'uniform3fv', - toFloatArray, - 3, - setVectorUniform, - ), - [GL.FLOAT_VEC4]: getArraySetter.bind( - null, - 'uniform4fv', - toFloatArray, - 4, - setVectorUniform, - ), - - [GL.INT]: getArraySetter.bind( - null, - 'uniform1iv', - toIntArray, - 1, - setVectorUniform, - ), - [GL.INT_VEC2]: getArraySetter.bind( - null, - 'uniform2iv', - toIntArray, - 2, - setVectorUniform, - ), - [GL.INT_VEC3]: getArraySetter.bind( - null, - 'uniform3iv', - toIntArray, - 3, - setVectorUniform, - ), - [GL.INT_VEC4]: getArraySetter.bind( - null, - 'uniform4iv', - toIntArray, - 4, - setVectorUniform, - ), - - [GL.BOOL]: getArraySetter.bind( - null, - 'uniform1iv', - toIntArray, - 1, - setVectorUniform, - ), - [GL.BOOL_VEC2]: getArraySetter.bind( - null, - 'uniform2iv', - toIntArray, - 2, - setVectorUniform, - ), - [GL.BOOL_VEC3]: getArraySetter.bind( - null, - 'uniform3iv', - toIntArray, - 3, - setVectorUniform, - ), - [GL.BOOL_VEC4]: getArraySetter.bind( - null, - 'uniform4iv', - toIntArray, - 4, - setVectorUniform, - ), - - // uniformMatrix(false): don't transpose the matrix - [GL.FLOAT_MAT2]: getArraySetter.bind( - null, - 'uniformMatrix2fv', - toFloatArray, - 4, - setMatrixUniform, - ), - [GL.FLOAT_MAT3]: getArraySetter.bind( - null, - 'uniformMatrix3fv', - toFloatArray, - 9, - setMatrixUniform, - ), - [GL.FLOAT_MAT4]: getArraySetter.bind( - null, - 'uniformMatrix4fv', - toFloatArray, - 16, - setMatrixUniform, - ), - - // WEBGL2 - unsigned integers, irregular matrices, additional texture samplers - - [GL.UNSIGNED_INT]: getArraySetter.bind( - null, - 'uniform1uiv', - toUIntArray, - 1, - setVectorUniform, - ), - [GL.UNSIGNED_INT_VEC2]: getArraySetter.bind( - null, - 'uniform2uiv', - toUIntArray, - 2, - setVectorUniform, - ), - [GL.UNSIGNED_INT_VEC3]: getArraySetter.bind( - null, - 'uniform3uiv', - toUIntArray, - 3, - setVectorUniform, - ), - [GL.UNSIGNED_INT_VEC4]: getArraySetter.bind( - null, - 'uniform4uiv', - toUIntArray, - 4, - setVectorUniform, - ), - - // uniformMatrix(false): don't transpose the matrix - [GL.FLOAT_MAT2x3]: getArraySetter.bind( - null, - 'uniformMatrix2x3fv', - toFloatArray, - 6, - setMatrixUniform, - ), - [GL.FLOAT_MAT2x4]: getArraySetter.bind( - null, - 'uniformMatrix2x4fv', - toFloatArray, - 8, - setMatrixUniform, - ), - [GL.FLOAT_MAT3x2]: getArraySetter.bind( - null, - 'uniformMatrix3x2fv', - toFloatArray, - 6, - setMatrixUniform, - ), - [GL.FLOAT_MAT3x4]: getArraySetter.bind( - null, - 'uniformMatrix3x4fv', - toFloatArray, - 12, - setMatrixUniform, - ), - [GL.FLOAT_MAT4x2]: getArraySetter.bind( - null, - 'uniformMatrix4x2fv', - toFloatArray, - 8, - setMatrixUniform, - ), - [GL.FLOAT_MAT4x3]: getArraySetter.bind( - null, - 'uniformMatrix4x3fv', - toFloatArray, - 12, - setMatrixUniform, - ), - - [GL.SAMPLER_2D]: getSamplerSetter, - [GL.SAMPLER_CUBE]: getSamplerSetter, - - [GL.SAMPLER_3D]: getSamplerSetter, - [GL.SAMPLER_2D_SHADOW]: getSamplerSetter, - [GL.SAMPLER_2D_ARRAY]: getSamplerSetter, - [GL.SAMPLER_2D_ARRAY_SHADOW]: getSamplerSetter, - [GL.SAMPLER_CUBE_SHADOW]: getSamplerSetter, - [GL.INT_SAMPLER_2D]: getSamplerSetter, - [GL.INT_SAMPLER_3D]: getSamplerSetter, - [GL.INT_SAMPLER_CUBE]: getSamplerSetter, - [GL.INT_SAMPLER_2D_ARRAY]: getSamplerSetter, - [GL.UNSIGNED_INT_SAMPLER_2D]: getSamplerSetter, - [GL.UNSIGNED_INT_SAMPLER_3D]: getSamplerSetter, - [GL.UNSIGNED_INT_SAMPLER_CUBE]: getSamplerSetter, - [GL.UNSIGNED_INT_SAMPLER_2D_ARRAY]: getSamplerSetter, -}; - -export function getUniformSetter( - gl: WebGLRenderingContext, - location: WebGLUniformLocation, - info: WebGLActiveInfo, -): any { - const setter = UNIFORM_SETTERS[info.type]; - if (!setter) { - throw new Error(`Unknown GLSL uniform type ${info.type}`); - } - return setter().bind(null, gl, location); -} diff --git a/packages/g-plugin-device-renderer/src/render/DeviceProgram.ts b/packages/g-plugin-device-renderer/src/render/DeviceProgram.ts index 65f00eb45..c17d2f4d2 100644 --- a/packages/g-plugin-device-renderer/src/render/DeviceProgram.ts +++ b/packages/g-plugin-device-renderer/src/render/DeviceProgram.ts @@ -1,5 +1,5 @@ import { isNil } from '@antv/util'; -import { assert, nullify } from '../platform/utils'; +import { assert, nullify } from '@antv/g-device-api'; export class DeviceProgram { name = '(unnamed)'; diff --git a/packages/g-plugin-device-renderer/src/render/DynamicUniformBuffer.ts b/packages/g-plugin-device-renderer/src/render/DynamicUniformBuffer.ts index 52ba9aa10..03ee7cf78 100644 --- a/packages/g-plugin-device-renderer/src/render/DynamicUniformBuffer.ts +++ b/packages/g-plugin-device-renderer/src/render/DynamicUniformBuffer.ts @@ -1,6 +1,11 @@ -import type { Device, Buffer } from '../platform'; -import { BufferUsage, BufferFrequencyHint } from '../platform'; -import { alignNonPowerOfTwo, assert, assertExists } from '../platform/utils'; +import type { Device, Buffer } from '@antv/g-device-api'; +import { + BufferUsage, + BufferFrequencyHint, + alignNonPowerOfTwo, + assert, + assertExists, +} from '@antv/g-device-api'; // This is a very basic linear allocator. We allocate offsets in-order. export class DynamicUniformBuffer { diff --git a/packages/g-plugin-device-renderer/src/render/RenderCache.ts b/packages/g-plugin-device-renderer/src/render/RenderCache.ts index cc816c203..50fbd550d 100644 --- a/packages/g-plugin-device-renderer/src/render/RenderCache.ts +++ b/packages/g-plugin-device-renderer/src/render/RenderCache.ts @@ -1,6 +1,5 @@ import type { AttachmentState, - BindingLayoutDescriptor, Bindings, BindingsDescriptor, ChannelBlendState, @@ -15,9 +14,9 @@ import type { RenderPipelineDescriptor, Sampler, SamplerDescriptor, -} from '../platform'; -import { assert } from '../platform/utils'; +} from '@antv/g-device-api'; import { + assert, bindingsDescriptorCopy, bindingsDescriptorEquals, inputLayoutDescriptorCopy, @@ -25,8 +24,9 @@ import { renderPipelineDescriptorCopy, renderPipelineDescriptorEquals, samplerDescriptorEquals, -} from '../platform/utils/hash'; -import { preprocessProgramObj_GLSL } from '../shader/compiler'; + preprocessProgram_GLSL, + ProgramDescriptorSimpleWithOrig, +} from '@antv/g-device-api'; import { DeviceProgram } from './DeviceProgram'; import { hashCodeNumberFinish, @@ -35,6 +35,16 @@ import { nullHashFunc, } from './HashMap'; +function preprocessProgramObj_GLSL( + device: Device, + obj: DeviceProgram, +): ProgramDescriptorSimpleWithOrig { + const defines = obj.defines !== undefined ? obj.defines : null; + const vert = obj.both !== undefined ? obj.both + obj.vert : obj.vert; + const frag = obj.both !== undefined ? obj.both + obj.frag : obj.frag; + return preprocessProgram_GLSL(device.queryVendorInfo(), vert, frag, defines); +} + function programDescriptorSimpleEquals( a: ProgramDescriptorSimple, b: ProgramDescriptorSimple, @@ -57,15 +67,6 @@ function programDescriptorSimpleCopy( return { preprocessedVert, preprocessedFrag, vert, frag }; } -function renderBindingLayoutHash( - hash: number, - a: BindingLayoutDescriptor, -): number { - hash = hashCodeNumberUpdate(hash, a.numUniformBuffers); - hash = hashCodeNumberUpdate(hash, a.numSamplers); - return hash; -} - function blendStateHash(hash: number, a: ChannelBlendState): number { hash = hashCodeNumberUpdate(hash, a.blendMode); hash = hashCodeNumberUpdate(hash, a.blendSrcFactor); @@ -94,8 +95,14 @@ function megaStateDescriptorHash(hash: number, a: MegaStateDescriptor): number { hash = colorHash(hash, a.blendConstant); hash = hashCodeNumberUpdate(hash, a.depthCompare); hash = hashCodeNumberUpdate(hash, a.depthWrite ? 1 : 0); - hash = hashCodeNumberUpdate(hash, a.stencilCompare); - hash = hashCodeNumberUpdate(hash, a.stencilPassOp); + hash = hashCodeNumberUpdate(hash, a.stencilFront?.compare); + hash = hashCodeNumberUpdate(hash, a.stencilFront?.passOp); + hash = hashCodeNumberUpdate(hash, a.stencilFront?.failOp); + hash = hashCodeNumberUpdate(hash, a.stencilFront?.depthFailOp); + hash = hashCodeNumberUpdate(hash, a.stencilBack?.compare); + hash = hashCodeNumberUpdate(hash, a.stencilBack?.passOp); + hash = hashCodeNumberUpdate(hash, a.stencilBack?.failOp); + hash = hashCodeNumberUpdate(hash, a.stencilBack?.depthFailOp); hash = hashCodeNumberUpdate(hash, a.stencilWrite ? 1 : 0); hash = hashCodeNumberUpdate(hash, a.cullMode); hash = hashCodeNumberUpdate(hash, a.frontFace ? 1 : 0); @@ -108,8 +115,6 @@ function renderPipelineDescriptorHash(a: RenderPipelineDescriptor): number { hash = hashCodeNumberUpdate(hash, a.program.id); if (a.inputLayout !== null) hash = hashCodeNumberUpdate(hash, a.inputLayout.id); - for (let i = 0; i < a.bindingLayouts.length; i++) - hash = renderBindingLayoutHash(hash, a.bindingLayouts[i]); hash = megaStateDescriptorHash(hash, a.megaStateDescriptor); for (let i = 0; i < a.colorAttachmentFormats.length; i++) hash = hashCodeNumberUpdate(hash, a.colorAttachmentFormats[i] || 0); @@ -128,7 +133,9 @@ function bindingsDescriptorHash(a: BindingsDescriptor): number { const binding = a.uniformBufferBindings[i]; if (binding !== null && binding.buffer !== null) { hash = hashCodeNumberUpdate(hash, binding.buffer.id); - hash = hashCodeNumberUpdate(hash, binding.wordCount); + hash = hashCodeNumberUpdate(hash, binding.binding); + hash = hashCodeNumberUpdate(hash, binding.offset); + hash = hashCodeNumberUpdate(hash, binding.size); } } return hashCodeNumberFinish(hash); @@ -183,6 +190,9 @@ export class RenderCache { } createInputLayout(descriptor: InputLayoutDescriptor): InputLayout { + // remove hollows + descriptor.vertexBufferDescriptors = + descriptor.vertexBufferDescriptors.filter((d) => !!d); let inputLayout = this.inputLayoutsCache.get(descriptor); if (inputLayout === null) { const descriptorCopy = inputLayoutDescriptorCopy(descriptor); @@ -195,7 +205,7 @@ export class RenderCache { createProgramSimple(deviceProgram: DeviceProgram): Program { const { vert, frag, preprocessedFrag, preprocessedVert } = deviceProgram; - let program = null; + let program: Program = null; if (preprocessedVert && preprocessedFrag) { program = this.programCache.get({ vert, @@ -232,11 +242,6 @@ export class RenderCache { return program; } - // createProgram(programDescriptor: ProgramDescriptor): Program { - // programDescriptor.ensurePreprocessed(this.device.queryVendorInfo()); - // return this.createProgramSimple(programDescriptor); - // } - createSampler(descriptor: SamplerDescriptor): Sampler { let sampler = this.samplerCache.get(descriptor); if (sampler === null) { diff --git a/packages/g-plugin-device-renderer/src/render/RenderGraph.ts b/packages/g-plugin-device-renderer/src/render/RenderGraph.ts index 0586fdb03..4dc083b17 100644 --- a/packages/g-plugin-device-renderer/src/render/RenderGraph.ts +++ b/packages/g-plugin-device-renderer/src/render/RenderGraph.ts @@ -1,5 +1,5 @@ -import type { Device, RenderTarget, Texture } from '../platform'; -import { assert, assertExists, fillArray } from '../platform/utils'; +import type { Device, RenderTarget, Texture } from '@antv/g-device-api'; +import { assert, assertExists, fillArray } from '@antv/g-device-api'; import type { PassSetupFunc, RGGraphBuilder, diff --git a/packages/g-plugin-device-renderer/src/render/RenderGraphHelpers.ts b/packages/g-plugin-device-renderer/src/render/RenderGraphHelpers.ts index 58301bad2..919cf3893 100644 --- a/packages/g-plugin-device-renderer/src/render/RenderGraphHelpers.ts +++ b/packages/g-plugin-device-renderer/src/render/RenderGraphHelpers.ts @@ -1,10 +1,10 @@ -import type { Color } from '../platform'; +import type { Color } from '@antv/g-device-api'; import { Format, colorNewFromRGBA, OpaqueBlack, OpaqueWhite, -} from '../platform'; +} from '@antv/g-device-api'; // import { reverseDepthForClearValue } from '../platform/utils'; import { RGAttachmentSlot } from './interfaces'; import { RGRenderTargetDescription } from './RenderTargetDescription'; diff --git a/packages/g-plugin-device-renderer/src/render/RenderGraphPass.ts b/packages/g-plugin-device-renderer/src/render/RenderGraphPass.ts index aecb4e601..858b9d131 100644 --- a/packages/g-plugin-device-renderer/src/render/RenderGraphPass.ts +++ b/packages/g-plugin-device-renderer/src/render/RenderGraphPass.ts @@ -1,5 +1,9 @@ -import type { QueryPool, RenderPassDescriptor, Texture } from '../platform'; -import { assert } from '../platform/utils'; +import type { + QueryPool, + RenderPassDescriptor, + Texture, +} from '@antv/g-device-api'; +import { assert } from '@antv/g-device-api'; import type { IRenderGraphPass, PassExecFunc, diff --git a/packages/g-plugin-device-renderer/src/render/RenderHelper.ts b/packages/g-plugin-device-renderer/src/render/RenderHelper.ts index 5f94c5140..b6e70e6fb 100644 --- a/packages/g-plugin-device-renderer/src/render/RenderHelper.ts +++ b/packages/g-plugin-device-renderer/src/render/RenderHelper.ts @@ -1,5 +1,5 @@ import { RendererParameters, ToneMapping } from '../interfaces'; -import type { Device } from '../platform'; +import type { Device } from '@antv/g-device-api'; import { DynamicUniformBuffer } from './DynamicUniformBuffer'; import { RenderCache } from './RenderCache'; import { RenderGraph } from './RenderGraph'; diff --git a/packages/g-plugin-device-renderer/src/render/RenderInst.ts b/packages/g-plugin-device-renderer/src/render/RenderInst.ts index 6e0ebf44c..d7bab86d7 100644 --- a/packages/g-plugin-device-renderer/src/render/RenderInst.ts +++ b/packages/g-plugin-device-renderer/src/render/RenderInst.ts @@ -1,6 +1,5 @@ import { isNumber } from '@antv/util'; import type { - BindingLayoutDescriptor, BindingsDescriptor, Device, IndexBufferDescriptor, @@ -11,8 +10,7 @@ import type { RenderPipelineDescriptor, SamplerBinding, VertexBufferDescriptor, -} from '../platform'; -import { PrimitiveTopology } from '../platform'; +} from '@antv/g-device-api'; import { assert, assertExists, @@ -21,7 +19,8 @@ import { nArray, setBitFlagEnabled, setMegaStateFlags, -} from '../platform/utils'; + PrimitiveTopology, +} from '@antv/g-device-api'; import type { DynamicUniformBuffer } from './DynamicUniformBuffer'; import type { RenderCache } from './RenderCache'; import { fillVec4 } from './utils'; @@ -74,7 +73,6 @@ export class RenderInst { constructor() { this.renderPipelineDescriptor = { - bindingLayouts: [], inputLayout: null, megaStateDescriptor: copyMegaState(defaultMegaState), program: null!, @@ -141,7 +139,11 @@ export class RenderInst { this.sortKey = o.sortKey; const tbd = this.bindingDescriptors[0], obd = o.bindingDescriptors[0]; - if (obd.bindingLayout !== null) this.setBindingLayout(obd.bindingLayout); + this.setBindingLayout({ + numSamplers: obd.samplerBindings?.length, + numUniformBuffers: obd.uniformBufferBindings?.length, + }); + for ( let i = 0; i < @@ -151,8 +153,8 @@ export class RenderInst { ); i++ ) - tbd.uniformBufferBindings[i].wordCount = - o.bindingDescriptors[0].uniformBufferBindings[i].wordCount; + tbd.uniformBufferBindings[i].size = + o.bindingDescriptors[0].uniformBufferBindings[i].size; this.setSamplerBindingsFromTextureMappings(obd.samplerBindings); for (let i = 0; i < o.dynamicUniformBufferByteOffsets.length; i++) this.dynamicUniformBufferByteOffsets[i] = @@ -163,8 +165,8 @@ export class RenderInst { // Validate uniform buffer bindings. for (let i = 0; i < this.bindingDescriptors.length; i++) { const bd = this.bindingDescriptors[i]; - for (let j = 0; j < bd.bindingLayout.numUniformBuffers; j++) - assert(bd.uniformBufferBindings[j].wordCount > 0); + for (let j = 0; j < bd.uniformBufferBindings?.length; j++) + assert(bd.uniformBufferBindings[j].size > 0); } assert(this.drawCount > 0); @@ -213,13 +215,14 @@ export class RenderInst { this.renderPipelineDescriptor.inputLayout = inputLayout; } - private setBindingLayout(bindingLayout: BindingLayoutDescriptor): void { + setBindingLayout(bindingLayout: { + numUniformBuffers: number; + numSamplers: number; + }): void { assert( bindingLayout.numUniformBuffers < this.dynamicUniformBufferByteOffsets.length, ); - this.renderPipelineDescriptor.bindingLayouts[0] = bindingLayout; - this.bindingDescriptors[0].bindingLayout = bindingLayout; for ( let i = this.bindingDescriptors[0].uniformBufferBindings.length; @@ -227,8 +230,9 @@ export class RenderInst { i++ ) this.bindingDescriptors[0].uniformBufferBindings.push({ + binding: 0, buffer: null, - wordCount: 0, + size: 0, }); for ( let i = this.bindingDescriptors[0].samplerBindings.length; @@ -241,15 +245,6 @@ export class RenderInst { }); } - /** - * Sets the {@see BindingLayoutDescriptor}s that this render inst will render with. - */ - setBindingLayouts(bindingLayouts: BindingLayoutDescriptor[]): void { - assert(bindingLayouts.length <= this.bindingDescriptors.length); - assert(bindingLayouts.length === 1); - this.setBindingLayout(bindingLayouts[0]); - } - drawIndexes(indexCount: number, indexStart = 0): void { this.flags = setBitFlagEnabled(this.flags, RenderInstFlags.Indexed, true); this.drawCount = indexCount; @@ -354,14 +349,14 @@ export class RenderInst { */ allocateUniformBuffer(bufferIndex: number, wordCount: number): number { assert( - this.bindingDescriptors[0].bindingLayout.numUniformBuffers < + this.bindingDescriptors[0].uniformBufferBindings?.length < this.dynamicUniformBufferByteOffsets.length, ); this.dynamicUniformBufferByteOffsets[bufferIndex] = this.uniformBuffer.allocateChunk(wordCount) << 2; const dst = this.bindingDescriptors[0].uniformBufferBindings[bufferIndex]; - dst.wordCount = wordCount; + dst.size = wordCount << 2; return this.getUniformBufferOffset(bufferIndex); } @@ -374,22 +369,6 @@ export class RenderInst { return wordOffset; } - /** - * Directly sets the uniform buffer assigned to the buffer slot at index {@param bufferIndex} - * to be {@param wordOffset}. Use this if you have already allocated a uniform buffer chunk through - * some other means and wish to directly assign it to this render inst. - */ - setUniformBufferOffset( - bufferIndex: number, - wordOffset: number, - wordCount: number, - ): void { - this.dynamicUniformBufferByteOffsets[bufferIndex] = wordOffset << 2; - - const dst = this.bindingDescriptors[0].uniformBufferBindings[bufferIndex]; - dst.wordCount = wordCount; - } - /** * This is a convenience wrapper for {@see RenderDynamicUniformBuffer.mapBufferF32}, but uses * the values previously assigned for the uniform buffer slot at index {@param bufferIndex}. @@ -469,7 +448,7 @@ export class RenderInst { : null; this.renderPipelineDescriptor.colorAttachmentFormats[i] = colorAttachmentDescriptor !== null - ? colorAttachmentDescriptor.pixelFormat + ? colorAttachmentDescriptor.format : null; if (colorAttachmentDescriptor !== null) { if (sampleCount === -1) @@ -484,7 +463,7 @@ export class RenderInst { : null; this.renderPipelineDescriptor.depthStencilAttachmentFormat = depthStencilAttachmentDescriptor !== null - ? depthStencilAttachmentDescriptor.pixelFormat + ? depthStencilAttachmentDescriptor.format : null; if (depthStencilAttachmentDescriptor !== null) { if (sampleCount === -1) @@ -525,10 +504,13 @@ export class RenderInst { let i = 0; i < this.bindingDescriptors[0].uniformBufferBindings.length; i++ - ) + ) { this.bindingDescriptors[0].uniformBufferBindings[i].buffer = assertExists( this.uniformBuffer.buffer, ); + this.bindingDescriptors[0].uniformBufferBindings[i].offset = + this.dynamicUniformBufferByteOffsets[i]; + } if ((this.renderPipelineDescriptor.program as any).gl_program) { this.uniforms.forEach((uniforms) => { @@ -545,11 +527,8 @@ export class RenderInst { ...this.bindingDescriptors[0], pipeline: gfxPipeline, }); - passRenderer.setBindings( - 0, - gfxBindings, - this.dynamicUniformBufferByteOffsets, - ); + + passRenderer.setBindings(gfxBindings); if (this.flags & RenderInstFlags.Indexed) { passRenderer.drawIndexed( diff --git a/packages/g-plugin-device-renderer/src/render/RenderInstList.ts b/packages/g-plugin-device-renderer/src/render/RenderInstList.ts index 1a29a015c..b0f14b6be 100644 --- a/packages/g-plugin-device-renderer/src/render/RenderInstList.ts +++ b/packages/g-plugin-device-renderer/src/render/RenderInstList.ts @@ -1,5 +1,5 @@ -import type { RenderPass } from '../platform'; -import { spliceBisectRight } from '../platform/utils'; +import type { RenderPass } from '@antv/g-device-api'; +import { spliceBisectRight } from '@antv/g-device-api'; import type { RenderCache } from './RenderCache'; import type { RenderInst } from './RenderInst'; import { RenderInstFlags } from './RenderInst'; diff --git a/packages/g-plugin-device-renderer/src/render/RenderInstManager.ts b/packages/g-plugin-device-renderer/src/render/RenderInstManager.ts index fae8ac508..ecf9e6f05 100644 --- a/packages/g-plugin-device-renderer/src/render/RenderInstManager.ts +++ b/packages/g-plugin-device-renderer/src/render/RenderInstManager.ts @@ -1,5 +1,5 @@ -import type { RenderPass } from '../platform'; -import { assert, assertExists } from '../platform/utils'; +import type { RenderPass } from '@antv/g-device-api'; +import { assert, assertExists } from '@antv/g-device-api'; import type { RenderCache } from './RenderCache'; import type { RenderInst } from './RenderInst'; import { RenderInstFlags } from './RenderInst'; @@ -24,7 +24,8 @@ export class RenderInstManager { const renderInstIndex = this.instPool.allocRenderInstIndex(); const renderInst = this.instPool.pool[renderInstIndex]; renderInst.debug = null; - if (templateIndex >= 0) renderInst.setFromTemplate(this.templatePool.pool[templateIndex]); + if (templateIndex >= 0) + renderInst.setFromTemplate(this.templatePool.pool[templateIndex]); return renderInst; } @@ -62,7 +63,8 @@ export class RenderInstManager { const templateIndex = this.templatePool.allocCount - 1; const newTemplateIndex = this.templatePool.allocRenderInstIndex(); const newTemplate = this.templatePool.pool[newTemplateIndex]; - if (templateIndex >= 0) newTemplate.setFromTemplate(this.templatePool.pool[templateIndex]); + if (templateIndex >= 0) + newTemplate.setFromTemplate(this.templatePool.pool[templateIndex]); newTemplate.flags |= RenderInstFlags.Template; return newTemplate; } diff --git a/packages/g-plugin-device-renderer/src/render/RenderTarget.ts b/packages/g-plugin-device-renderer/src/render/RenderTarget.ts index b6744c76f..bee27c66b 100644 --- a/packages/g-plugin-device-renderer/src/render/RenderTarget.ts +++ b/packages/g-plugin-device-renderer/src/render/RenderTarget.ts @@ -1,21 +1,19 @@ -import type { Device, Format, RenderTarget, Texture } from '../platform'; -import { TextureDimension, TextureUsage } from '../platform'; -import { assert } from '../platform/utils'; +import type { Device, Format, RenderTarget, Texture } from '@antv/g-device-api'; +import { assert, TextureDimension, TextureUsage } from '@antv/g-device-api'; import type { RGRenderTargetDescription } from './RenderTargetDescription'; export class RGRenderTarget { debugName: string; readonly dimension = TextureDimension.TEXTURE_2D; - readonly depth = 1; - readonly numLevels = 1; + readonly depthOrArrayLayers = 1; + readonly mipLevelCount = 1; - pixelFormat: Format; + format: Format; width = 0; height = 0; sampleCount = 0; usage: TextureUsage = TextureUsage.RENDER_TARGET; - immutable = true; needsClear = true; texture: Texture | null = null; @@ -23,7 +21,7 @@ export class RGRenderTarget { age = 0; constructor(device: Device, desc: Readonly) { - this.pixelFormat = desc.pixelFormat; + this.format = desc.format; this.width = desc.width; this.height = desc.height; this.sampleCount = desc.sampleCount; @@ -50,7 +48,7 @@ export class RGRenderTarget { matchesDescription(desc: Readonly): boolean { return ( - this.pixelFormat === desc.pixelFormat && + this.format === desc.format && this.width === desc.width && this.height === desc.height && this.sampleCount === desc.sampleCount diff --git a/packages/g-plugin-device-renderer/src/render/RenderTargetDescription.ts b/packages/g-plugin-device-renderer/src/render/RenderTargetDescription.ts index fe1e92ef5..e4c6b42b6 100644 --- a/packages/g-plugin-device-renderer/src/render/RenderTargetDescription.ts +++ b/packages/g-plugin-device-renderer/src/render/RenderTargetDescription.ts @@ -1,4 +1,4 @@ -import type { Color, Format } from '../platform'; +import type { Color, Format } from '@antv/g-device-api'; export class RGRenderTargetDescription { width = 0; @@ -9,7 +9,7 @@ export class RGRenderTargetDescription { depthClearValue: number | 'load' = 'load'; stencilClearValue: number | 'load' = 'load'; - constructor(public pixelFormat: Format) {} + constructor(public format: Format) {} /** * Set the dimensions of a render target description. diff --git a/packages/g-plugin-device-renderer/src/render/SingleSampledTexture.ts b/packages/g-plugin-device-renderer/src/render/SingleSampledTexture.ts index 36c17d7c3..21141a6b8 100644 --- a/packages/g-plugin-device-renderer/src/render/SingleSampledTexture.ts +++ b/packages/g-plugin-device-renderer/src/render/SingleSampledTexture.ts @@ -1,26 +1,25 @@ -import type { Device, Format, Texture } from '../platform'; -import { TextureDimension, TextureUsage } from '../platform'; +import type { Device, Format, Texture } from '@antv/g-device-api'; +import { assert, TextureDimension, TextureUsage } from '@antv/g-device-api'; import type { RGRenderTargetDescription } from './RenderTargetDescription'; -import { assert } from '../platform/utils'; // Whenever we need to resolve a multi-sampled render target to a single-sampled texture, // we record an extra single-sampled texture here. export class SingleSampledTexture { readonly dimension = TextureDimension.TEXTURE_2D; - readonly depth = 1; - readonly numLevels = 1; + readonly depthOrArrayLayers = 1; + readonly mipLevelCount = 1; + readonly usage = TextureUsage.RENDER_TARGET; - pixelFormat: Format; + format: Format; width = 0; height = 0; texture: Texture; age = 0; - immutable = true; constructor(device: Device, desc: Readonly) { - this.pixelFormat = desc.pixelFormat; + this.format = desc.format; this.width = desc.width; this.height = desc.height; @@ -29,7 +28,7 @@ export class SingleSampledTexture { matchesDescription(desc: Readonly): boolean { return ( - this.pixelFormat === desc.pixelFormat && + this.format === desc.format && this.width === desc.width && this.height === desc.height ); diff --git a/packages/g-plugin-device-renderer/src/render/TemporalTexture.ts b/packages/g-plugin-device-renderer/src/render/TemporalTexture.ts index 69ba197ea..9c1663939 100644 --- a/packages/g-plugin-device-renderer/src/render/TemporalTexture.ts +++ b/packages/g-plugin-device-renderer/src/render/TemporalTexture.ts @@ -1,5 +1,5 @@ -import type { Device, Texture } from '../platform'; -import { assert } from '../platform/utils'; +import type { Device, Texture } from '@antv/g-device-api'; +import { assert } from '@antv/g-device-api'; import type { RGRenderTargetDescription } from './RenderTargetDescription'; import { SingleSampledTexture } from './SingleSampledTexture'; @@ -11,7 +11,10 @@ export class TemporalTexture { private inputTexture: SingleSampledTexture | null = null; private outputTexture: SingleSampledTexture | null = null; - setDescription(device: Device, desc: Readonly): void { + setDescription( + device: Device, + desc: Readonly, + ): void { // Updating the description will happen at the start of the frame, // so we need to keep the inputTexture alive (the previous frame's texture), // and create a new outputTexture. @@ -25,7 +28,11 @@ export class TemporalTexture { assert(this.inputTexture === this.outputTexture); - if (this.outputTexture !== null && this.outputTexture.matchesDescription(desc)) return; + if ( + this.outputTexture !== null && + this.outputTexture.matchesDescription(desc) + ) + return; this.outputTexture = new SingleSampledTexture(device, desc); if (this.inputTexture === null) this.inputTexture = this.outputTexture; @@ -40,7 +47,10 @@ export class TemporalTexture { } destroy(): void { - if (this.outputTexture !== null && this.outputTexture !== this.inputTexture) { + if ( + this.outputTexture !== null && + this.outputTexture !== this.inputTexture + ) { this.outputTexture.destroy(); this.outputTexture = null; } diff --git a/packages/g-plugin-device-renderer/src/render/TextureHolder.ts b/packages/g-plugin-device-renderer/src/render/TextureHolder.ts index dc7f756e6..93fac4b7a 100644 --- a/packages/g-plugin-device-renderer/src/render/TextureHolder.ts +++ b/packages/g-plugin-device-renderer/src/render/TextureHolder.ts @@ -1,4 +1,4 @@ -import type { Sampler, Texture } from '../platform'; +import type { Sampler, Texture } from '@antv/g-device-api'; export interface ViewerTexture { name: string; diff --git a/packages/g-plugin-device-renderer/src/render/interfaces.ts b/packages/g-plugin-device-renderer/src/render/interfaces.ts index 97b12d478..ee1dc4ce3 100644 --- a/packages/g-plugin-device-renderer/src/render/interfaces.ts +++ b/packages/g-plugin-device-renderer/src/render/interfaces.ts @@ -1,4 +1,9 @@ -import type { QueryPool, RenderPass, RenderTarget, Texture } from '../platform'; +import type { + QueryPool, + RenderPass, + RenderTarget, + Texture, +} from '@antv/g-device-api'; import type { RGRenderTargetDescription } from './RenderTargetDescription'; export enum RGAttachmentSlot { diff --git a/packages/g-plugin-device-renderer/src/render/utils/layer.ts b/packages/g-plugin-device-renderer/src/render/utils/layer.ts index b4269ac1a..795ef89fb 100644 --- a/packages/g-plugin-device-renderer/src/render/utils/layer.ts +++ b/packages/g-plugin-device-renderer/src/render/utils/layer.ts @@ -1,5 +1,5 @@ import { clamp } from '@antv/util'; -import { assert } from '../../platform/utils'; +import { assert } from '@antv/g-device-api'; // Suggested values for the "layer" of makeSortKey. These are rough groups, and you can define your own // ordering within the rough groups (e.g. you might use BACKGROUND + 1, or BACKGROUND + 2). diff --git a/packages/g-plugin-device-renderer/src/render/utils/matrix.ts b/packages/g-plugin-device-renderer/src/render/utils/matrix.ts index 03ab0ef96..432c565bd 100644 --- a/packages/g-plugin-device-renderer/src/render/utils/matrix.ts +++ b/packages/g-plugin-device-renderer/src/render/utils/matrix.ts @@ -1,7 +1,7 @@ // Helpers to fill vertex buffers. import type { ReadonlyVec3, ReadonlyVec4, ReadonlyMat4 } from 'gl-matrix'; // import { ReadonlyMat2d } from 'gl-matrix'; -import type { Color } from '../../platform'; +import type { Color } from '@antv/g-device-api'; export function fillVec3v( d: Float32Array, diff --git a/packages/g-plugin-device-renderer/src/render/utils/projection.ts b/packages/g-plugin-device-renderer/src/render/utils/projection.ts index 37f03e705..6f2198fd9 100644 --- a/packages/g-plugin-device-renderer/src/render/utils/projection.ts +++ b/packages/g-plugin-device-renderer/src/render/utils/projection.ts @@ -1,5 +1,5 @@ import { mat4 } from 'gl-matrix'; -import { ClipSpaceNearZ } from '../../platform'; +import { ClipSpaceNearZ } from '@antv/g-device-api'; const mtxOpenGLFromD3D = mat4.fromValues( 1, diff --git a/packages/g-plugin-device-renderer/src/renderer/BatchManager.ts b/packages/g-plugin-device-renderer/src/renderer/BatchManager.ts index 2bd1a63f7..cdaaf9fd6 100644 --- a/packages/g-plugin-device-renderer/src/renderer/BatchManager.ts +++ b/packages/g-plugin-device-renderer/src/renderer/BatchManager.ts @@ -3,10 +3,10 @@ import type { RenderingPluginContext, Shape, } from '@antv/g-lite'; +import type { Device } from '@antv/g-device-api'; import type { Renderable3D } from '../components/Renderable3D'; import type { LightPool } from '../LightPool'; import type { Instanced } from '../drawcalls/Instanced'; -import type { Device } from '../platform'; import type { RenderInstList, RenderHelper } from '../render'; import type { TexturePool } from '../TexturePool'; import type { Batch } from './Batch'; diff --git a/packages/g-plugin-device-renderer/src/shader/compiler.ts b/packages/g-plugin-device-renderer/src/shader/compiler.ts deleted file mode 100644 index 5e338ea5b..000000000 --- a/packages/g-plugin-device-renderer/src/shader/compiler.ts +++ /dev/null @@ -1,466 +0,0 @@ -import type { Device, VendorInfo } from '../platform'; -import { ClipSpaceNearZ, ViewportOrigin } from '../platform'; -import { assert } from '../platform/utils'; -import { DeviceProgram } from '../render'; - -const ES100_REPLACEMENTS: [RegExp, string][] = [ - // In GLSL 1.00 ES these functions are provided by an extension - [/\btexture(2D|2DProj|Cube)Lod\(/g, 'texture$1LodEXT('], - - // Overloads in GLSL 3.00 map to individual functions. Note that we cannot - // differentiate 2D,2DProj,Cube without type analysis so we choose the most common variant. - [/\btexture\(/g, 'texture2D('], - [/\btextureLod\(/g, 'texture2DLodEXT('], -]; - -function defineStr(k: string, v: string): string { - return `#define ${k} ${v}`; -} - -export function getDefines(shader: string): Record { - const defines = {}; - shader.replace(/^\s*#define\s*(\S*)\s*(\S*)\s*$/gm, (_, name, value) => { - const v = Number(value); - defines[name] = isNaN(v) ? value : v; - return ''; - }); - return defines; -} - -export function getAttributeLocations( - vert: string, - defines: Record, -): { location: number; name: string }[] { - const locations = []; - vert.replace( - /^\s*layout\(location\s*=\s*(\S*)\)\s*in\s+\S+\s*(.*);$/gm, - (_, location, name) => { - const l = Number(location); - locations.push({ location: isNaN(l) ? defines[location] : l, name }); - return ''; - }, - ); - return locations; -} - -/** - * struct DirectionalLight { - vec3 direction; - float intensity; - vec3 color; -}; - */ -interface StructInfo { - type: string; - uniforms: { - type: string; - name: string; - }[]; -} -export function getUniforms(vert: string) { - const uniformNames: string[] = []; - const structs: StructInfo[] = []; - - vert.replace( - /\s*struct\s*(.*)\s*{((?:\s*.*\s*)*?)};/g, - (_, type, uniformStr) => { - const uniforms = []; - uniformStr - .trim() - .split('\n') - .forEach((line) => { - const [type, name] = line.trim().split(/\s+/); - uniforms.push({ - type: type.trim(), - name: name.replace(';', '').trim(), - }); - }); - structs.push({ - type: type.trim(), - uniforms, - }); - return ''; - }, - ); - - vert.replace(/\s*uniform\s*.*\s*{((?:\s*.*\s*)*?)};/g, (_, uniforms) => { - uniforms - .trim() - .split('\n') - .forEach((line: string) => { - const result = line.trim().split(' '); - const type = result[0] || ''; - let name = result[1] || ''; - // DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - const isArray = name.indexOf('[') > -1; - name = name.replace(';', '').replace('[', '').trim(); - // ignore conditional comments - if (type.startsWith('#')) { - return; - } - - // account for structs - if (type) { - const struct = structs.find((struct) => type === struct.type); - if (struct) { - if (isArray) { - for (let i = 0; i < 5; i++) { - struct.uniforms.forEach((uniform) => { - uniformNames.push(`${name}[${i}].${uniform.name}`); - }); - } - } else { - struct.uniforms.forEach((uniform) => { - uniformNames.push(`${name}.${uniform.name}`); - }); - } - } - } - - if (name) { - uniformNames.push(name); - } - }); - return ''; - }); - - return uniformNames; -} - -function parseBinding(layout: string | undefined): number | null { - if (layout === undefined) return null; - - const g = /binding\s*=\s*(\d+)/.exec(layout); - if (g !== null) { - const bindingNum = parseInt(g[1], 10); - if (!Number.isNaN(bindingNum)) return bindingNum; - } - - return null; -} - -function getSeparateSamplerTypes( - combinedSamplerType: string, -): [string, string] { - let samplerType = ``, - textureType = combinedSamplerType; - if (combinedSamplerType.endsWith(`Shadow`)) { - textureType = textureType.slice(0, -6); - samplerType = `Shadow`; - } - return [textureType, samplerType]; -} - -export function preprocessShader_GLSL( - vendorInfo: VendorInfo, - type: 'vert' | 'frag', - source: string, - defines: Record | null = null, -): string { - const isGLSL100 = vendorInfo.glslVersion === '#version 100'; - // const supportMRT = vendorInfo.supportMRT && !!features.MRT; - const supportMRT = false; - - const lines = source - .split('\n') - .map((n) => { - // Remove comments. - return n.replace(/[/][/].*$/, ''); - }) - .filter((n) => { - // Filter whitespace. - const isEmpty = !n || /^\s+$/.test(n); - return !isEmpty; - }); - - // #define KEY VAR - let definesString = ''; - if (defines !== null) - definesString = Object.keys(defines) - .map((key) => defineStr(key, defines[key])) - .join('\n'); - - const precision = - lines.find((line) => line.startsWith('precision')) || - 'precision mediump float;'; - let rest = lines.filter((line) => !line.startsWith('precision')).join('\n'); - let extraDefines = ''; - - if (vendorInfo.viewportOrigin === ViewportOrigin.UPPER_LEFT) { - extraDefines += `${defineStr(`VIEWPORT_ORIGIN_TL`, `1`)}\n`; - } - if (vendorInfo.clipSpaceNearZ === ClipSpaceNearZ.ZERO) { - extraDefines += `${defineStr(`CLIPSPACE_NEAR_ZERO`, `1`)}\n`; - } - - if (vendorInfo.explicitBindingLocations) { - let set = 0, - implicitBinding = 0, - location = 0; - - rest = rest.replace( - /^(layout\((.*)\))?\s*uniform(.+{)$/gm, - (substr, cap, layout, rest) => { - const layout2 = layout ? `${layout}, ` : ``; - return `layout(${layout2}set = ${set}, binding = ${implicitBinding++}) uniform ${rest}`; - }, - ); - - // XXX(jstpierre): WebGPU now binds UBOs and textures in different sets as a porting hack, hrm... - set++; - implicitBinding = 0; - - assert(vendorInfo.separateSamplerTextures); - rest = rest.replace( - /^(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm, - (substr, cap, layout, combinedSamplerType, samplerName) => { - let binding = parseBinding(layout); - if (binding === null) binding = implicitBinding++; - - const [textureType, samplerType] = - getSeparateSamplerTypes(combinedSamplerType); - return type === 'frag' - ? ` -layout(set = ${set}, binding = ${ - binding * 2 + 0 - }) uniform texture${textureType} T_${samplerName}; -layout(set = ${set}, binding = ${ - binding * 2 + 1 - }) uniform sampler${samplerType} S_${samplerName};`.trim() - : ''; - }, - ); - - rest = rest.replace( - type === 'frag' ? /^\b(varying|in)\b/gm : /^\b(varying|out)\b/gm, - (substr, tok) => { - return `layout(location = ${location++}) ${tok}`; - }, - ); - - /** - * @see https://github.com/gfx-rs/naga/issues/1994 - */ - extraDefines += `${defineStr(`gl_VertexID`, `gl_VertexIndex`)}\n`; - extraDefines += `${defineStr(`gl_InstanceID`, `gl_InstanceIndex`)}\n`; - } - - if (vendorInfo.separateSamplerTextures) { - rest = rest.replace( - /\bPD_SAMPLER_(\w+)\((.*?)\)/g, - (substr, combinedSamplerType, samplerName) => { - const [textureType, samplerType] = - getSeparateSamplerTypes(combinedSamplerType); - return `texture${textureType} T_P_${samplerName}, sampler${samplerType} S_P_${samplerName}`; - }, - ); - - rest = rest.replace( - /\bPP_SAMPLER_(\w+)\((.*?)\)/g, - (substr, combinedSamplerType, samplerName) => { - return `T_${samplerName}, S_${samplerName}`; - }, - ); - - rest = rest.replace( - /\bSAMPLER_(\w+)\((.*?)\)/g, - (substr, combinedSamplerType, samplerName) => { - return `sampler${combinedSamplerType}(T_${samplerName}, S_${samplerName})`; - }, - ); - - rest = rest.replace(/\bTEXTURE\((.*?)\)/g, (substr, samplerName) => { - return `T_${samplerName}`; - }); - } else { - rest = rest.replace( - /\bPD_SAMPLER_(\w+)\((.*?)\)/g, - (substr, combinedSamplerType, samplerName) => { - return `sampler${combinedSamplerType} P_${samplerName}`; - }, - ); - - rest = rest.replace( - /\bPP_SAMPLER_(\w+)\((.*?)\)/g, - (substr, combinedSamplerType, samplerName) => { - return samplerName; - }, - ); - - rest = rest.replace( - /\bSAMPLER_(\w+)\((.*?)\)/g, - (substr, combinedSamplerType, samplerName) => { - return samplerName; - }, - ); - - rest = rest.replace(/\bTEXTURE\((.*?)\)/g, (substr, samplerName) => { - return samplerName; - }); - } - - // using #define means we can't use `const in/out` in params - // ${isGLSL100 && type === 'vert' ? '#define in attribute\n#define out varying' : ''} - // ${isGLSL100 && type === 'frag' ? '#define in varying' : ''} - - // headless-gl will throw the following error if we prepend `#version 100`: - // #version directive must occur before anything else, except for comments and white space - let concat = `${isGLSL100 ? '' : vendorInfo.glslVersion} -${isGLSL100 && supportMRT ? '#extension GL_EXT_draw_buffers : require' : ''} -${ - isGLSL100 && type === 'frag' - ? '#extension GL_OES_standard_derivatives : enable' - : '' -} -${precision} -${extraDefines} -${definesString} -${rest} -`.trim(); - - // out vec4 outputColor; -> layout(location = 0) out vec4 outputColor; - if (vendorInfo.explicitBindingLocations && type === 'frag') { - concat = concat.replace(/^\b(out)\b/gm, (substr, tok) => { - return `layout(location = 0) ${tok}`; - }); - } - - // GLSL 300 -> 100 - // @see https://webgl2fundamentals.org/webgl/lessons/webgl1-to-webgl2.html - if (isGLSL100) { - // in -> varying - if (type === 'frag') { - concat = concat.replace( - /^\s*in\s+(\S+)\s*(.*);$/gm, - (_, dataType, name) => { - return `varying ${dataType} ${name};\n`; - }, - ); - } - if (type === 'vert') { - // out -> varying - concat = concat.replace( - /^\s*out\s+(\S+)\s*(.*);$/gm, - (_, dataType, name) => { - return `varying ${dataType} ${name};\n`; - }, - ); - // in -> attribute - concat = concat.replace( - // /^\s*layout\(location\s*=\s*\d*\)\s*in\s*(.*)\s*(.*);$/gm, - /^\s*layout\(location\s*=\s*\S*\)\s*in\s+(\S+)\s*(.*);$/gm, - (_, dataType, name) => { - return `attribute ${dataType} ${name};\n`; - }, - ); - } - - // interface blocks supported in GLSL ES 3.00 and above only - concat = concat.replace( - /\s*uniform\s*.*\s*{((?:\s*.*\s*)*?)};/g, - (substr, uniforms) => { - return uniforms.trim().replace(/^.*$/gm, (uniform: string) => { - // eg. #ifdef - const trimmed = uniform.trim(); - if (trimmed.startsWith('#')) { - return trimmed; - } - return uniform ? `uniform ${trimmed}` : ''; - }); - }, - ); - - if (type === 'frag') { - let glFragColor: string; - concat = concat.replace( - /^\s*out\s+(\S+)\s*(.*);$/gm, - (_, dataType, name) => { - glFragColor = name; - return `${dataType} ${name};\n`; - }, - ); - - const lastIndexOfMain = concat.lastIndexOf('}'); - concat = - concat.substring(0, lastIndexOfMain) + - ` - gl_FragColor = vec4(${glFragColor}); -` + - concat.substring(lastIndexOfMain); - } - - // MRT - // if (supportMRT) { - // if (type === 'frag') { - // const gBuffers = []; - // concat = concat.replace( - // /^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm, - // (_, buffer) => { - // gBuffers.push(buffer); - // return `vec4 ${buffer};\n`; - // }, - // ); - - // const lastIndexOfMain = concat.lastIndexOf('}'); - // concat = - // concat.substring(0, lastIndexOfMain) + - // ` - // ${gBuffers - // .map( - // (gBuffer, i) => `gl_FragData[${i}] = ${gBuffer}; - // `, - // ) - // .join('\n')}` + - // concat.substring(lastIndexOfMain); - // } - // } - - // remove layout(location = 0) - concat = concat.replace(/^\s*layout\((.*)\)/gm, ''); - - // replace texture with texture2D - for (const [pattern, replacement] of ES100_REPLACEMENTS) { - concat = concat.replace(pattern, replacement); - } - } - - return concat; -} - -export interface ProgramDescriptorSimpleWithOrig { - vert: string; - frag: string; - preprocessedVert: string; - preprocessedFrag: string; -} - -export function preprocessProgram_GLSL( - vendorInfo: VendorInfo, - vert: string, - frag: string, - defines: Record | null = null, -): ProgramDescriptorSimpleWithOrig { - const preprocessedVert = preprocessShader_GLSL( - vendorInfo, - 'vert', - vert, - defines, - ); - const preprocessedFrag = preprocessShader_GLSL( - vendorInfo, - 'frag', - frag, - defines, - ); - return { vert, frag, preprocessedVert, preprocessedFrag }; -} - -export function preprocessProgramObj_GLSL( - device: Device, - obj: DeviceProgram, -): ProgramDescriptorSimpleWithOrig { - const defines = obj.defines !== undefined ? obj.defines : null; - const vert = obj.both !== undefined ? obj.both + obj.vert : obj.vert; - const frag = obj.both !== undefined ? obj.both + obj.frag : obj.frag; - return preprocessProgram_GLSL(device.queryVendorInfo(), vert, frag, defines); -} diff --git a/packages/g-plugin-gpgpu/CHANGELOG.md b/packages/g-plugin-gpgpu/CHANGELOG.md deleted file mode 100644 index 103b8f000..000000000 --- a/packages/g-plugin-gpgpu/CHANGELOG.md +++ /dev/null @@ -1,171 +0,0 @@ -# @antv/g-plugin-gpgpu - -## 1.9.20 - -### Patch Changes - -- c54cc6fb: Antialiasing SDF & Text. -- 568ec0f4: Export Device API in webgl & webgpu. - - @antv/g-webgpu@1.9.20 - -## 1.9.19 - -### Patch Changes - -- @antv/g-webgpu@1.9.19 - -## 1.9.18 - -### Patch Changes - -- Updated dependencies [e5d69c70] - - @antv/g-lite@1.2.13 - - @antv/g-webgpu@1.9.18 - -## 1.9.17 - -### Patch Changes - -- @antv/g-webgpu@1.9.17 - -## 1.9.16 - -### Patch Changes - -- @antv/g-webgpu@1.9.16 - -## 1.9.15 - -### Patch Changes - -- Updated dependencies [eb61cba4] -- Updated dependencies [eb61cba4] - - @antv/g-lite@1.2.12 - - @antv/g-webgpu@1.9.15 - -## 1.9.14 - -### Patch Changes - -- Updated dependencies [d63ea0bf] - - @antv/g-lite@1.2.11 - - @antv/g-webgpu@1.9.14 - -## 1.9.13 - -### Patch Changes - -- Updated dependencies [414d08d9] - - @antv/g-lite@1.2.10 - - @antv/g-webgpu@1.9.13 - -## 1.9.12 - -### Patch Changes - -- Updated dependencies [3856560c] - - @antv/g-lite@1.2.9 - - @antv/g-webgpu@1.9.12 - -## 1.9.11 - -### Patch Changes - -- Updated dependencies [3d4f5da7] -- Updated dependencies [3d4f5da7] -- Updated dependencies [3d4f5da7] - - @antv/g-lite@1.2.8 - - @antv/g-webgpu@1.9.11 - -## 1.9.10 - -### Patch Changes - -- @antv/g-webgpu@1.9.10 - -## 1.9.9 - -### Patch Changes - -- @antv/g-webgpu@1.9.9 - -## 1.9.8 - -### Patch Changes - -- @antv/g-webgpu@1.9.8 - -## 1.9.7 - -### Patch Changes - -- Updated dependencies [70aa0b32] -- Updated dependencies [789bd4c9] - - @antv/g-webgpu@1.9.7 - - @antv/g-lite@1.2.7 - -## 1.9.6 - -### Patch Changes - -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] - - @antv/g-lite@1.2.6 - - @antv/g-webgpu@1.9.6 - -## 1.9.5 - -### Patch Changes - -- Updated dependencies [ff2f4585] -- Updated dependencies [6fa21f84] - - @antv/g-lite@1.2.5 - - @antv/g-webgpu@1.9.5 - -## 1.9.4 - -### Patch Changes - -- Updated dependencies [6757ccbd] - - @antv/g-lite@1.2.4 - - @antv/g-webgpu@1.9.4 - -## 1.9.3 - -### Patch Changes - -- Updated dependencies [6cbaae4d] - - @antv/g-lite@1.2.3 - - @antv/g-webgpu@1.9.3 - -## 1.9.2 - -### Patch Changes - -- Updated dependencies [0eb5142d] -- Updated dependencies [71990540] - - @antv/g-webgpu@1.9.2 - - @antv/g-lite@1.2.2 - -## 1.9.1 - -### Patch Changes - -- Updated dependencies [b0dd4788] - - @antv/g-lite@1.2.1 - - @antv/g-webgpu@1.9.1 - -## 1.9.0 - -### Minor Changes - -- Remove default export in @antv/g-math - -### Patch Changes - -- Updated dependencies - - @antv/g-lite@1.2.0 - - @antv/g-webgpu@1.9.0 diff --git a/packages/g-plugin-gpgpu/LICENSE b/packages/g-plugin-gpgpu/LICENSE deleted file mode 100644 index 778560b1b..000000000 --- a/packages/g-plugin-gpgpu/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 AntV team - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/packages/g-plugin-gpgpu/README.md b/packages/g-plugin-gpgpu/README.md deleted file mode 100644 index d83b4d523..000000000 --- a/packages/g-plugin-gpgpu/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# @antv/g-plugin-gpgpu - -Provide GPGPU capabilities based on [WebGPU](https://www.w3.org/TR/webgpu/). - -## Getting Started - -```js -import { Canvas, CanvasEvent } from '@antv/g'; -import { Renderer, DeviceRenderer } from '@antv/g-webgpu'; -import { Plugin, Kernel } from '@antv/g-plugin-gpgpu'; - -const { BufferUsage } = DeviceRenderer; - -const renderer = new Renderer(); -renderer.registerPlugin(new Plugin()); -``` diff --git a/packages/g-plugin-gpgpu/package.json b/packages/g-plugin-gpgpu/package.json deleted file mode 100644 index 916de6e95..000000000 --- a/packages/g-plugin-gpgpu/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "@antv/g-plugin-gpgpu", - "version": "1.9.20", - "description": "A G plugin for GPGPU based on WebGPU", - "keywords": [ - "webgpu", - "gpgpu", - "antv", - "g" - ], - "homepage": "https://github.com/antvis/g#readme", - "bugs": { - "url": "https://github.com/antvis/g/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/antvis/g.git" - }, - "license": "MIT", - "author": "https://github.com/orgs/antvis/people", - "exports": { - "types": "./dist/index.d.ts", - "import": "./dist/index.esm.js", - "default": "./dist/index.js" - }, - "main": "dist/index.js", - "unpkg": "dist/index.umd.min.js", - "module": "dist/index.esm.js", - "types": "dist/index.d.ts", - "files": [ - "package.json", - "dist", - "LICENSE", - "README.md" - ], - "scripts": { - "build": "npm run clean && rollup -c", - "clean": "rimraf dist", - "sync": "tnpm sync", - "watch": "rollup -c -w" - }, - "dependencies": { - "@antv/g-lite": "workspace:*", - "@antv/g-webgpu": "workspace:*", - "tslib": "^2.5.3" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/packages/g-plugin-gpgpu/rollup.config.mjs b/packages/g-plugin-gpgpu/rollup.config.mjs deleted file mode 100644 index f82c5a288..000000000 --- a/packages/g-plugin-gpgpu/rollup.config.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { readFileSync } from 'fs'; -import { createConfig } from '../../rollup.config.mjs'; - -export default createConfig({ - pkg: JSON.parse( - readFileSync(new URL('./package.json', import.meta.url), 'utf8'), - ), - umdName: 'G.GPGPU', - external: ['@antv/g-lite', '@antv/g-webgpu'], - globals: { - '@antv/g-lite': 'window.G', - '@antv/g-webgpu': 'window.G.WebGPU', - }, -}); diff --git a/packages/g-plugin-gpgpu/src/Kernel.ts b/packages/g-plugin-gpgpu/src/Kernel.ts deleted file mode 100644 index c34340e90..000000000 --- a/packages/g-plugin-gpgpu/src/Kernel.ts +++ /dev/null @@ -1,194 +0,0 @@ -import { DeviceRenderer } from '@antv/g-webgpu'; -import type { KernelBundle } from './interface'; -import { Target } from './interface'; - -export interface KernelOptions { - computeShader?: string; - bundle?: KernelBundle; -} - -export interface KernelBufferDescriptor { - name?: string; - binding?: number; - data: ArrayBufferView; -} - -const platformString2Target: Record = { - WebGL1: Target.GLSL100, - WebGL2: Target.GLSL450, - WebGPU: Target.WGSL, -}; - -export class Kernel { - /** - * WGSL code, won't be transpiled by compiler - */ - private computeShader: string; - - /** - * bundle contains GLSL/WGSL - */ - private bundle: KernelBundle; - - /** - * underlying GPU device - */ - private device: DeviceRenderer.Device; - - private computePipeline: DeviceRenderer.ComputePipeline; - - private buffers: { - name: string; - buffer: DeviceRenderer.Buffer; - wordCount: number; - group: number; - binding: number; - bindingType: 'uniform' | 'storage' | 'read-only-storage'; - }[] = []; - - constructor( - device: DeviceRenderer.Device, - { computeShader, bundle }: KernelOptions, - ) { - this.device = device; - this.computeShader = computeShader; - this.bundle = bundle; - - this.init(); - } - - private init() { - const target = - platformString2Target[this.device.queryVendorInfo().platformString]; - - if (this.computeShader) { - if (!this.bundle) { - this.bundle = { - shaders: { - WGSL: this.computeShader, - GLSL450: '', - GLSL100: '', - }, - context: { - name: '', - dispatch: [0, 0, 0], - threadGroupSize: [0, 0, 0], - maxIteration: 1, - needPingpong: false, - output: { - name: '', - }, - uniforms: [], - defines: [], - globalDeclarations: [], - }, - }; - } else { - this.bundle.shaders.WGSL = this.computeShader; - } - } - - const program = this.device.createProgram({ - compute: { - wgsl: this.bundle.shaders[target], - }, - }); - - this.computePipeline = this.device.createComputePipeline({ - program, - bindingLayouts: [], - inputLayout: null, - }); - } - - /** - * set or update buffer by binding number, - * it should match binding declared in compute shader - */ - setBinding(binding: number, buffer: DeviceRenderer.Buffer) { - // @ts-ignore - const { usage } = buffer; - - const isUniform = usage & DeviceRenderer.BufferUsage.UNIFORM; - const isWritable = usage & DeviceRenderer.BufferUsage.COPY_SRC; - - // search by binding - const existed = this.buffers.find((buffer) => buffer.binding === binding); - if (existed) { - existed.buffer.destroy(); - this.buffers.splice(this.buffers.indexOf(existed), 1); - } - - this.buffers.push({ - name: '', - buffer, - // @ts-ignore - wordCount: buffer.size / 4, - binding, - bindingType: isUniform - ? 'uniform' - : isWritable - ? 'storage' - : 'read-only-storage', - group: 0, // fixed group 0 - }); - - return null; - } - - dispatch(x: [number, number, number] | number, y = 1, z = 1) { - let dispatchParams: [number, number, number]; - if (Array.isArray(x)) { - dispatchParams = x; - } else { - dispatchParams = [x, y, z]; - } - - const computePass = this.device.createComputePass(); - computePass.setPipeline(this.computePipeline); - - const uniforms = this.buffers.filter( - ({ bindingType }) => bindingType === 'uniform', - ); - const storages = this.buffers.filter( - ({ bindingType }) => bindingType !== 'uniform', - ); - - const bindings = this.device.createBindings({ - pipeline: this.computePipeline, - bindingLayout: { - numUniformBuffers: uniforms.length, - storageEntries: storages.map(({ bindingType }) => ({ - type: bindingType, - })), - }, - uniformBufferBindings: uniforms.map(({ buffer, wordCount }) => ({ - buffer, - wordCount, - })), - storageBufferBindings: storages.map(({ buffer, wordCount }) => ({ - buffer, - wordCount, - })), - }); - - // fixed bind group 0 - computePass.setBindings(0, bindings, []); - computePass.dispatchWorkgroups(...dispatchParams); - this.device.submitPass(computePass); - } - - /** - * readback buffer async - */ - async readBuffer(buffer: DeviceRenderer.Buffer): Promise { - const readback = this.device.createReadback(); - return readback.readBuffer(buffer); - } - - destroy() { - this.buffers.forEach(({ buffer }) => { - buffer.destroy(); - }); - } -} diff --git a/packages/g-plugin-gpgpu/src/index.ts b/packages/g-plugin-gpgpu/src/index.ts deleted file mode 100644 index abbbea22c..000000000 --- a/packages/g-plugin-gpgpu/src/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AbstractRendererPlugin } from '@antv/g-lite'; - -export * from './interface'; -export * from './Kernel'; -export class Plugin extends AbstractRendererPlugin { - name = 'gpgpu'; - init(): void {} - destroy(): void {} -} diff --git a/packages/g-plugin-gpgpu/src/interface.ts b/packages/g-plugin-gpgpu/src/interface.ts deleted file mode 100644 index a9a07c7cb..000000000 --- a/packages/g-plugin-gpgpu/src/interface.ts +++ /dev/null @@ -1,214 +0,0 @@ -enum AST_TOKEN_TYPES { - Void = 'Void', - Boolean = 'Boolean', - Float = 'Float', - Uint32 = 'Uint32', - Int32 = 'Int32', - Vector = 'Vector', - Vector2Float = 'vec2', - Vector3Float = 'vec3', - Vector4Float = 'vec4', - Vector2Boolean = 'vec2', - Vector3Boolean = 'vec3', - Vector4Boolean = 'vec4', - Vector2Uint = 'vec2', - Vector3Uint = 'vec3', - Vector4Uint = 'vec4', - Vector2Int = 'vec2', - Vector3Int = 'vec3', - Vector4Int = 'vec4', - Matrix = 'Matrix', - Matrix3x3Float = 'mat3x3', - Matrix4x4Float = 'mat4x4', - Struct = 'Struct', - FloatArray = 'Float[]', - Vector4FloatArray = 'vec4[]', -} - -enum AST_NODE_TYPES { - Program = 'Program', - Identifier = 'Identifier', - VariableDeclaration = 'VariableDeclaration', - BlockStatement = 'BlockStatement', - ReturnStatement = 'ReturnStatement', - FunctionDeclaration = 'FunctionDeclaration', - VariableDeclarator = 'VariableDeclarator', - AssignmentExpression = 'AssignmentExpression', - LogicalExpression = 'LogicalExpression', - BinaryExpression = 'BinaryExpression', - ArrayExpression = 'ArrayExpression', - UnaryExpression = 'UnaryExpression', - UpdateExpression = 'UpdateExpression', - FunctionExpression = 'FunctionExpression', - MemberExpression = 'MemberExpression', - ConditionalExpression = 'ConditionalExpression', - ExpressionStatement = 'ExpressionStatement', - CallExpression = 'CallExpression', - NumThreadStatement = 'NumThreadStatement', - StorageStatement = 'StorageStatement', - DoWhileStatement = 'DoWhileStatement', - WhileStatement = 'WhileStatement', - ForStatement = 'ForStatement', - BreakStatement = 'BreakStatement', - ContinueStatement = 'ContinueStatement', - IfStatement = 'IfStatement', - ImportedFunctionStatement = 'ImportedFunctionStatement', -} - -enum STORAGE_CLASS { - Input = 'Input', - Output = 'Output', - Uniform = 'Uniform', - Workgroup = 'Workgroup', - UniformConstant = 'UniformConstant', - Image = 'Image', - StorageBuffer = 'StorageBuffer', - Private = 'Private', - Function = 'Function', -} - -type TypedArrayConstructor = - | Int8ArrayConstructor - | Uint8ArrayConstructor - | Uint8ClampedArrayConstructor - | Int16ArrayConstructor - | Uint16ArrayConstructor - | Int32ArrayConstructor - | Uint32ArrayConstructor - | Float32ArrayConstructor - | Float64ArrayConstructor; - -type DataType = - | AST_TOKEN_TYPES.Uint32 - | AST_TOKEN_TYPES.Int32 - | AST_TOKEN_TYPES.Boolean - | AST_TOKEN_TYPES.Float - | AST_TOKEN_TYPES.Vector2Float - | AST_TOKEN_TYPES.Vector3Float - | AST_TOKEN_TYPES.Vector4Float - | AST_TOKEN_TYPES.Vector2Int - | AST_TOKEN_TYPES.Vector3Int - | AST_TOKEN_TYPES.Vector4Int - | AST_TOKEN_TYPES.Vector2Uint - | AST_TOKEN_TYPES.Vector3Uint - | AST_TOKEN_TYPES.Vector4Uint - | AST_TOKEN_TYPES.Vector2Boolean - | AST_TOKEN_TYPES.Vector3Boolean - | AST_TOKEN_TYPES.Vector4Boolean - | AST_TOKEN_TYPES.Matrix3x3Float - | AST_TOKEN_TYPES.Matrix4x4Float - | AST_TOKEN_TYPES.FloatArray - | AST_TOKEN_TYPES.Vector4FloatArray - | AST_TOKEN_TYPES.Void; - -interface GLSLContext { - /** - * 程序名 - */ - name: string; - - shader?: string; - /** - * size of thread grid - * 即 WebGL 2 Compute 中的 dispatchCompute - * 或者 WebGPU 中的 dispatch - */ - dispatch: [number, number, number]; - /** - * size of each thread group - * Compute Shader 中的 local_size_x/y/z - */ - threadGroupSize: [number, number, number]; - /** - * 迭代次数,例如布局运算中需要迭代很多次才能到达稳定 - */ - maxIteration: number; - /** - * 是否需要 pingpong,如果存在输入和输出为同一个的情况 - */ - needPingpong: boolean; - /** - * 目前仅支持单一输出,受限于 WebGL 实现 - */ - output: { - name: string; - size?: [number, number]; - textureSize?: [number, number]; - length?: number; - typedArrayConstructor?: TypedArrayConstructor; - gpuBuffer?: any; - outputElementsPerTexel?: number; - }; - /** - * 常量,可分成编译时和运行时两类: - * 1. 编译时即可确定值 - * 2. 运行时:例如循环长度需要为常量,但在编译时又无法确定 - * TODO 支持定义函数,例如 tensorflow 中的 DIV_CEIL - */ - defines: { - name: string; - type: DataType; - value: number; - runtime: boolean; // 是否是运行时生成 - }[]; - globalDeclarations: { - name: string; - type: DataType; - value: string; - shared: boolean; - }[]; - uniforms: { - name: string; - type: DataType; - data?: - | number - | number[] - | Float32Array - | Uint8Array - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array; - size?: [number, number]; - storageClass: STORAGE_CLASS; - readonly: boolean; - writeonly: boolean; - isReferer?: boolean; - group?: number; - binding?: number; - }[]; -} - -/** - * 根据目标平台生成 Shader 代码 - * * WebGL GLSL 1.0 - * * WebGPU Chrome/Edge GLSL 4.5 & WGSL @see https://gpuweb.github.io/gpuweb/wgsl.html - * * Safari WHLSL (maybe deprecated) - */ -enum Target { - GLSL100 = 'GLSL100', - GLSL450 = 'GLSL450', - WGSL = 'WGSL', -} - -const DefineValuePlaceholder = '__DefineValuePlaceholder__'; - -interface KernelBundle { - shaders: { - [Target.WGSL]: string; - [Target.GLSL450]: string; - [Target.GLSL100]: string; - }; - context?: GLSLContext; - toString: () => string; -} - -export { - AST_TOKEN_TYPES, - AST_NODE_TYPES, - STORAGE_CLASS, - Target, - DefineValuePlaceholder, -}; -export type { GLSLContext, DataType, KernelBundle }; diff --git a/packages/g-plugin-gpgpu/tsconfig.json b/packages/g-plugin-gpgpu/tsconfig.json deleted file mode 100644 index edf14785b..000000000 --- a/packages/g-plugin-gpgpu/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "include": ["src/**/*"], - "exclude": ["node_modules"] -} \ No newline at end of file diff --git a/packages/g-plugin-webgl-device/CHANGELOG.md b/packages/g-plugin-webgl-device/CHANGELOG.md deleted file mode 100644 index 51460faf8..000000000 --- a/packages/g-plugin-webgl-device/CHANGELOG.md +++ /dev/null @@ -1,169 +0,0 @@ -# @antv/g-plugin-webgl-device - -## 1.9.17 - -### Patch Changes - -- c54cc6fb: Antialiasing SDF & Text. -- 568ec0f4: Export Device API in webgl & webgpu. -- Updated dependencies [c54cc6fb] -- Updated dependencies [568ec0f4] - - @antv/g-plugin-device-renderer@1.9.17 - -## 1.9.16 - -### Patch Changes - -- Updated dependencies [be1f91bf] - - @antv/g-plugin-device-renderer@1.9.16 - -## 1.9.15 - -### Patch Changes - -- Updated dependencies [e5d69c70] - - @antv/g-plugin-device-renderer@1.9.15 - - @antv/g-lite@1.2.13 - -## 1.9.14 - -### Patch Changes - -- Updated dependencies [eb61cba4] -- Updated dependencies [eb61cba4] - - @antv/g-lite@1.2.12 - - @antv/g-plugin-device-renderer@1.9.14 - -## 1.9.13 - -### Patch Changes - -- Updated dependencies [d63ea0bf] - - @antv/g-lite@1.2.11 - - @antv/g-plugin-device-renderer@1.9.13 - -## 1.9.12 - -### Patch Changes - -- Updated dependencies [414d08d9] - - @antv/g-plugin-device-renderer@1.9.12 - - @antv/g-lite@1.2.10 - -## 1.9.11 - -### Patch Changes - -- Updated dependencies [3856560c] - - @antv/g-plugin-device-renderer@1.9.11 - - @antv/g-lite@1.2.9 - -## 1.9.10 - -### Patch Changes - -- Updated dependencies [3d4f5da7] -- Updated dependencies [3d4f5da7] -- Updated dependencies [3d4f5da7] - - @antv/g-plugin-device-renderer@1.9.10 - - @antv/g-lite@1.2.8 - -## 1.9.9 - -### Patch Changes - -- Updated dependencies [d9e769f2] -- Updated dependencies [d9e769f2] -- Updated dependencies [d9e769f2] - - @antv/g-plugin-device-renderer@1.9.9 - -## 1.9.8 - -### Patch Changes - -- Updated dependencies [06bcc557] - - @antv/g-plugin-device-renderer@1.9.8 - -## 1.9.7 - -### Patch Changes - -- 70aa0b32: Retrieve runtime from context instead of global. -- 789bd4c9: Split a path containing multiple segments into subpaths. -- Updated dependencies [70aa0b32] -- Updated dependencies [789bd4c9] - - @antv/g-plugin-device-renderer@1.9.7 - - @antv/g-lite@1.2.7 - -## 1.9.6 - -### Patch Changes - -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] - - @antv/g-plugin-device-renderer@1.9.6 - - @antv/g-lite@1.2.6 - -## 1.9.5 - -### Patch Changes - -- Updated dependencies [ff2f4585] -- Updated dependencies [6fa21f84] - - @antv/g-plugin-device-renderer@1.9.5 - - @antv/g-lite@1.2.5 - -## 1.9.4 - -### Patch Changes - -- Updated dependencies [6757ccbd] -- Updated dependencies [6757ccbd] - - @antv/g-plugin-device-renderer@1.9.4 - - @antv/g-lite@1.2.4 - -## 1.9.3 - -### Patch Changes - -- 6cbaae4d: Change picking process from async to sync way -- Updated dependencies [6cbaae4d] - - @antv/g-plugin-device-renderer@1.9.3 - - @antv/g-lite@1.2.3 - -## 1.9.2 - -### Patch Changes - -- 0eb5142d: Avoid overriding defXY when parsing path -- 71990540: Make picking process async for WebGL2 & WebGPU implementations -- Updated dependencies [0eb5142d] -- Updated dependencies [71990540] - - @antv/g-plugin-device-renderer@1.9.2 - - @antv/g-lite@1.2.2 - -## 1.9.1 - -### Patch Changes - -- b0dd4788: Remove this syntax in @antv/g-math since it's already an ESM now -- Updated dependencies [b0dd4788] - - @antv/g-plugin-device-renderer@1.9.1 - - @antv/g-lite@1.2.1 - -## 1.9.0 - -### Minor Changes - -- Remove default export in @antv/g-math - -### Patch Changes - -- Updated dependencies - - @antv/g-lite@1.2.0 - - @antv/g-plugin-device-renderer@1.9.0 diff --git a/packages/g-plugin-webgl-device/LICENSE b/packages/g-plugin-webgl-device/LICENSE deleted file mode 100644 index 778560b1b..000000000 --- a/packages/g-plugin-webgl-device/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 AntV team - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/packages/g-plugin-webgl-device/README.md b/packages/g-plugin-webgl-device/README.md deleted file mode 100644 index 242c51e27..000000000 --- a/packages/g-plugin-webgl-device/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# g-plugin-webgl-device - -使用 WebGL 提供 GPUDevice 能力。 diff --git a/packages/g-plugin-webgl-device/package.json b/packages/g-plugin-webgl-device/package.json deleted file mode 100644 index 15f017b8d..000000000 --- a/packages/g-plugin-webgl-device/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "@antv/g-plugin-webgl-device", - "version": "1.9.17", - "description": "A G plugin implements GPUDevice interface with WebGL API", - "keywords": [ - "antv", - "g", - "webgl" - ], - "homepage": "https://github.com/antvis/g#readme", - "bugs": { - "url": "https://github.com/antvis/g/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/antvis/g.git" - }, - "license": "MIT", - "author": "https://github.com/orgs/antvis/people", - "exports": { - "types": "./dist/index.d.ts", - "import": "./dist/index.esm.js", - "default": "./dist/index.js" - }, - "main": "dist/index.js", - "unpkg": "dist/index.umd.min.js", - "module": "dist/index.esm.js", - "types": "dist/index.d.ts", - "files": [ - "package.json", - "dist", - "LICENSE", - "README.md" - ], - "scripts": { - "build": "npm run clean && rollup -c", - "clean": "rimraf dist", - "sync": "tnpm sync", - "watch": "rollup -c -w" - }, - "dependencies": { - "@antv/g-lite": "workspace:*", - "@antv/g-plugin-device-renderer": "workspace:*", - "@antv/util": "^3.3.4", - "eventemitter3": "^5.0.1", - "tslib": "^2.5.3" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/packages/g-plugin-webgl-device/rollup.config.mjs b/packages/g-plugin-webgl-device/rollup.config.mjs deleted file mode 100644 index ec5d77a45..000000000 --- a/packages/g-plugin-webgl-device/rollup.config.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { readFileSync } from 'fs'; -import { createConfig } from '../../rollup.config.mjs'; - -export default createConfig({ - pkg: JSON.parse( - readFileSync(new URL('./package.json', import.meta.url), 'utf8'), - ), - umdName: 'G.WebGLDevice', - external: ['@antv/g-lite', '@antv/g-plugin-device-renderer'], - globals: { - '@antv/g-lite': 'window.G', - '@antv/g-plugin-device-renderer': 'window.G.DeviceRenderer', - }, -}); diff --git a/packages/g-plugin-webgl-device/src/WebGLDeviceContribution.ts b/packages/g-plugin-webgl-device/src/WebGLDeviceContribution.ts deleted file mode 100644 index b2e91b229..000000000 --- a/packages/g-plugin-webgl-device/src/WebGLDeviceContribution.ts +++ /dev/null @@ -1,71 +0,0 @@ -import type { DeviceContribution } from '@antv/g-plugin-device-renderer'; -import type { WebGLRendererPluginOptions } from './interfaces'; -import { Device_GL } from './platform/Device'; - -export class WebGLDeviceContribution implements DeviceContribution { - constructor(private pluginOptions: Partial) {} - - async createSwapChain($canvas: HTMLCanvasElement) { - const options: WebGLContextAttributes = { - // alpha: true, - antialias: false, - // @see https://stackoverflow.com/questions/27746091/preservedrawingbuffer-false-is-it-worth-the-effort - preserveDrawingBuffer: false, - // @see https://webglfundamentals.org/webgl/lessons/webgl-qna-how-to-use-the-stencil-buffer.html - stencil: true, - // @see https://webglfundamentals.org/webgl/lessons/webgl-and-alpha.html - premultipliedAlpha: true, - }; - this.handleContextEvents($canvas); - - const { targets } = this.pluginOptions; - - let gl: WebGLRenderingContext | WebGL2RenderingContext; - if (targets.includes('webgl2')) { - gl = - $canvas.getContext('webgl2', options) || - ($canvas.getContext( - 'experimental-webgl2', - options, - ) as WebGL2RenderingContext); - } - - if (!gl && targets.includes('webgl1')) { - gl = - $canvas.getContext('webgl', options) || - ($canvas.getContext( - 'experimental-webgl', - options, - ) as WebGLRenderingContext); - } - - return new Device_GL(gl as WebGLRenderingContext | WebGL2RenderingContext, { - shaderDebug: true, - trackResources: true, - }); - } - - private handleContextEvents($canvas: HTMLCanvasElement) { - const { onContextLost, onContextRestored, onContextCreationError } = - this.pluginOptions; - // bind context event listeners - if (onContextCreationError) { - // @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/webglcontextcreationerror_event - $canvas.addEventListener( - 'webglcontextcreationerror', - onContextCreationError, - false, - ); - } - if (onContextLost) { - $canvas.addEventListener('webglcontextlost', onContextLost, false); - } - if (onContextRestored) { - $canvas.addEventListener( - 'webglcontextrestored', - onContextRestored, - false, - ); - } - } -} diff --git a/packages/g-plugin-webgl-device/src/index.ts b/packages/g-plugin-webgl-device/src/index.ts deleted file mode 100644 index 7ee949a50..000000000 --- a/packages/g-plugin-webgl-device/src/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { AbstractRendererPlugin } from '@antv/g-lite'; -import type { WebGLRendererPluginOptions } from './interfaces'; -import { WebGLDeviceContribution } from './WebGLDeviceContribution'; - -export { WebGLDeviceContribution }; - -export class Plugin extends AbstractRendererPlugin { - name = 'webgl-device'; - constructor(private options: Partial) { - super(); - } - - init(): void { - // @ts-ignore - this.context.deviceContribution = new WebGLDeviceContribution({ - ...this.options, - }); - } - destroy(): void { - // @ts-ignore - delete this.context.deviceContribution; - } -} diff --git a/packages/g-plugin-webgl-device/src/interfaces.ts b/packages/g-plugin-webgl-device/src/interfaces.ts deleted file mode 100644 index dde0cc049..000000000 --- a/packages/g-plugin-webgl-device/src/interfaces.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface WebGLRendererPluginOptions { - targets: ('webgl1' | 'webgl2')[]; - onContextCreationError: (e: Event) => void; - onContextLost: (e: Event) => void; - onContextRestored: (e: Event) => void; -} diff --git a/packages/g-plugin-webgl-device/src/platform/Bindings.ts b/packages/g-plugin-webgl-device/src/platform/Bindings.ts deleted file mode 100644 index e3e818799..000000000 --- a/packages/g-plugin-webgl-device/src/platform/Bindings.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { - Bindings, - BindingsDescriptor, - BufferBinding, - SamplerBinding, -} from '@antv/g-plugin-device-renderer'; -import { ResourceType, assert } from '@antv/g-plugin-device-renderer'; -import type { Device_GL } from './Device'; -import { ResourceBase_GL } from './ResourceBase'; - -export class Bindings_GL extends ResourceBase_GL implements Bindings { - type: ResourceType.Bindings = ResourceType.Bindings; - - uniformBufferBindings: BufferBinding[]; - samplerBindings: (SamplerBinding | null)[]; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: Device_GL; - descriptor: BindingsDescriptor; - }) { - super({ id, device }); - - const { bindingLayout, uniformBufferBindings, samplerBindings } = descriptor; - assert(uniformBufferBindings.length >= bindingLayout.numUniformBuffers); - assert(samplerBindings.length >= bindingLayout.numSamplers); - for (let i = 0; i < bindingLayout.numUniformBuffers; i++) { - assert(uniformBufferBindings[i].wordCount > 0); - } - - this.uniformBufferBindings = descriptor.uniformBufferBindings; - this.samplerBindings = descriptor.samplerBindings; - } -} diff --git a/packages/g-plugin-webgl-device/src/platform/Buffer.ts b/packages/g-plugin-webgl-device/src/platform/Buffer.ts deleted file mode 100644 index f217e3f60..000000000 --- a/packages/g-plugin-webgl-device/src/platform/Buffer.ts +++ /dev/null @@ -1,230 +0,0 @@ -import { - Buffer, - BufferDescriptor, - BufferFrequencyHint, - align, -} from '@antv/g-plugin-device-renderer'; -import { - // assert, - BufferUsage, - ResourceType, -} from '@antv/g-plugin-device-renderer'; -import { isNumber } from '@antv/util'; -import type { Device_GL } from './Device'; -import { ResourceBase_GL } from './ResourceBase'; -import { - getPlatformBuffer, - isWebGL2, - translateBufferHint, - translateBufferUsageToTarget, -} from './utils'; - -export class Buffer_GL extends ResourceBase_GL implements Buffer { - type: ResourceType.Buffer = ResourceType.Buffer; - - gl_buffer_pages: WebGLBuffer[]; - gl_target: GLenum; - usage: BufferUsage; - byteSize: number; - pageByteSize: number; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: Device_GL; - descriptor: BufferDescriptor; - }) { - super({ id, device }); - - const { viewOrSize, usage, hint = BufferFrequencyHint.STATIC } = descriptor; - const { uniformBufferMaxPageByteSize, gl } = device; - - const isStorageTexture = usage & BufferUsage.STORAGE; - - if (isStorageTexture) { - // // Use Texture as storage instead of Buffer. - // const texture = this.createTexture({ - // dimension: TextureDimension.n2D, - // pixelFormat: Format.U8_RGBA_NORM, - // usage: TextureUsage.Sampled, - // width: 1, - // height: 1, - // depth: 1, - // numLevels: 1, - // immutable: true, - // }); - // texture.setImageData([new Uint8Array(4 * depth)]); - - // Create later. - return this; - } - - const isUBO = usage & BufferUsage.UNIFORM; - - if (!isUBO) { - if (isWebGL2(gl)) { - // Temporarily unbind VAO when creating buffers to not stomp on the VAO configuration. - gl.bindVertexArray(null); - } else { - device.OES_vertex_array_object.bindVertexArrayOES(null); - } - } - - // const byteSize = isNumber(viewOrSize) - // ? viewOrSize * 4 - // : viewOrSize.byteLength * 4; - - const byteSize = isNumber(viewOrSize) - ? align(viewOrSize, 4) - : align(viewOrSize.byteLength, 4); - - this.gl_buffer_pages = []; - - let pageByteSize: number; - if (isUBO) { - // assert(byteSize % uniformBufferMaxPageByteSize === 0); - let byteSizeLeft = byteSize; - while (byteSizeLeft > 0) { - this.gl_buffer_pages.push( - this.createBufferPage( - Math.min(byteSizeLeft, uniformBufferMaxPageByteSize), - usage, - hint, - ), - ); - byteSizeLeft -= uniformBufferMaxPageByteSize; - } - - pageByteSize = uniformBufferMaxPageByteSize; - - // TODO: uniform in WebGL1 - } else { - this.gl_buffer_pages.push(this.createBufferPage(byteSize, usage, hint)); - pageByteSize = byteSize; - } - - this.pageByteSize = pageByteSize; - this.byteSize = byteSize; - this.usage = usage; - this.gl_target = translateBufferUsageToTarget(usage); - - // init data - if (!isNumber(viewOrSize)) { - this.setSubData(0, new Uint8Array(viewOrSize.buffer)); - } - - if (!isUBO) { - if (isWebGL2(gl)) { - gl.bindVertexArray(this.device['currentBoundVAO']); - } else { - device.OES_vertex_array_object.bindVertexArrayOES( - this.device['currentBoundVAO'], - ); - } - } - } - - setSubData( - dstByteOffset: number, - data: Uint8Array, - srcByteOffset = 0, - byteSize: number = data.byteLength - srcByteOffset, - ): void { - const gl = this.device.gl; - const { - // gl_target, - // byteSize: dstByteSize, - pageByteSize: dstPageByteSize, - } = this; - // Account for setSubData being called with a dstByteOffset that is beyond the end of the buffer. - // if (isWebGL2(gl) && gl_target === gl.UNIFORM_BUFFER) { - // // Manually check asserts for speed. - // if (!(dstByteOffset % dstPageByteSize === 0)) - // throw new Error( - // `Assert fail: (dstByteOffset [${dstByteOffset}] % dstPageByteSize [${dstPageByteSize}]) === 0`, - // ); - // if (!(byteSize % dstPageByteSize === 0)) - // throw new Error( - // `Assert fail: (byteSize [${byteSize}] % dstPageByteSize [${dstPageByteSize}]) === 0`, - // ); - // } - // if (!(dstByteOffset + byteSize <= dstByteSize)) { - // throw new Error( - // `Assert fail: (dstByteOffset [${dstByteOffset}] + byteSize [${byteSize}]) <= dstByteSize [${dstByteSize}], gl_target ${gl_target}`, - // ); - // // exceed, need to recreate - // } - - const virtBufferByteOffsetEnd = dstByteOffset + byteSize; - let virtBufferByteOffset = dstByteOffset; - let physBufferByteOffset = dstByteOffset % dstPageByteSize; - while (virtBufferByteOffset < virtBufferByteOffsetEnd) { - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindBuffer#parameters - const target = isWebGL2(gl) ? gl.COPY_WRITE_BUFFER : this.gl_target; - - const buffer = getPlatformBuffer(this, virtBufferByteOffset); - // @ts-ignore - if (buffer.ubo) { - return; - } - gl.bindBuffer(target, buffer); - - // only WebGL2 support srcOffset & length - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferSubData - if (isWebGL2(gl)) { - gl.bufferSubData( - target, - physBufferByteOffset, - data, - srcByteOffset, - Math.min( - virtBufferByteOffsetEnd - virtBufferByteOffset, - dstPageByteSize, - ), - ); - } else { - gl.bufferSubData(target, physBufferByteOffset, data); - } - - virtBufferByteOffset += dstPageByteSize; - physBufferByteOffset = 0; - srcByteOffset += dstPageByteSize; - this.device['debugGroupStatisticsBufferUpload'](); - } - } - - destroy() { - super.destroy(); - for (let i = 0; i < this.gl_buffer_pages.length; i++) { - // no ubo in WebGL1 - // @ts-ignore - if (!this.gl_buffer_pages[i].ubo) { - this.device.gl.deleteBuffer(this.gl_buffer_pages[i]); - } - } - } - - private createBufferPage( - byteSize: number, - usage: BufferUsage, - hint: BufferFrequencyHint, - ): WebGLBuffer { - const gl = this.device.gl; - const isUBO = usage & BufferUsage.UNIFORM; - if (!isWebGL2(gl) && isUBO) { - return { - ubo: true, - }; - } else { - const gl_buffer = this.device.ensureResourceExists(gl.createBuffer()); - const gl_target = translateBufferUsageToTarget(usage); - const gl_hint = translateBufferHint(hint); - gl.bindBuffer(gl_target, gl_buffer); - gl.bufferData(gl_target, byteSize, gl_hint); - return gl_buffer; - } - } -} diff --git a/packages/g-plugin-webgl-device/src/platform/ComputePass.ts b/packages/g-plugin-webgl-device/src/platform/ComputePass.ts deleted file mode 100644 index a1826e737..000000000 --- a/packages/g-plugin-webgl-device/src/platform/ComputePass.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { - Buffer, - Bindings, - ComputePass, - ComputePipeline, -} from '@antv/g-plugin-device-renderer'; -// import { assert, assertExists } from '@antv/g-plugin-device-renderer'; -// import type { ComputePipeline_GL } from './ComputePipeline'; - -export class ComputePass_GL implements ComputePass { - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpucomputepassencoder-dispatch - */ - dispatchWorkgroups( - workgroupCountX: number, - workgroupCountY?: number, - workgroupCountZ?: number, - ) {} - - dispatchWorkgroupsIndirect(indirectBuffer: Buffer, indirectOffset: number) {} - - finish() { - // this.gpuComputePassEncoder.end(); - // this.gpuComputePassEncoder = null; - // return this.commandEncoder.finish(); - } - - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpucommandencoder-begincomputepass - */ - beginComputePass(): void { - // assert(this.gpuComputePassEncoder === null); - // this.setComputePassDescriptor(computePassDescriptor); - // this.gpuComputePassEncoder = this.commandEncoder.beginComputePass( - // this.gpuComputePassDescriptor, - // ); - } - - setPipeline(pipeline_: ComputePipeline): void { - // const pipeline = pipeline_ as ComputePipeline_WebGPU; - // const gpuComputePipeline = assertExists(pipeline.gpuComputePipeline); - // this.gpuComputePassEncoder.setPipeline(gpuComputePipeline); - } - - setBindings(bindingLayoutIndex: number, bindings_: Bindings): void { - // const bindings = bindings_ as Bindings_WebGPU; - // this.gpuComputePassEncoder.setBindGroup(bindingLayoutIndex, bindings.gpuBindGroup[0]); - } - - pushDebugGroup(name: string) {} - popDebugGroup() {} - insertDebugMarker(markerLabel: string) {} -} diff --git a/packages/g-plugin-webgl-device/src/platform/ComputePipeline.ts b/packages/g-plugin-webgl-device/src/platform/ComputePipeline.ts deleted file mode 100644 index ae823ba6f..000000000 --- a/packages/g-plugin-webgl-device/src/platform/ComputePipeline.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { - ComputePipeline, - ComputePipelineDescriptor, -} from '@antv/g-plugin-device-renderer'; -import { ResourceType } from '@antv/g-plugin-device-renderer'; -// import type { Program_GL } from './Program'; -import type { Device_GL } from './Device'; -import { ResourceBase_GL } from './ResourceBase'; - -export class ComputePipeline_GL - extends ResourceBase_GL - implements ComputePipeline -{ - type: ResourceType.ComputePipeline = ResourceType.ComputePipeline; - - descriptor: ComputePipelineDescriptor; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: Device_GL; - descriptor: ComputePipelineDescriptor; - }) { - super({ id, device }); - - this.descriptor = descriptor; - - // const program = descriptor.program as Program_GL; - } -} diff --git a/packages/g-plugin-webgl-device/src/platform/Device.ts b/packages/g-plugin-webgl-device/src/platform/Device.ts deleted file mode 100644 index 84fb21cf7..000000000 --- a/packages/g-plugin-webgl-device/src/platform/Device.ts +++ /dev/null @@ -1,2573 +0,0 @@ -import { - AttachmentState, - BindingLayoutDescriptor, - Bindings, - BindingsDescriptor, - Buffer, - BufferDescriptor, - BufferFrequencyHint, - ComputePass, - ComputePipeline, - ComputePipelineDescriptor, - DebugGroup, - Device, - DeviceLimits, - IndexBufferDescriptor, - InputLayout, - InputLayoutDescriptor, - MegaStateDescriptor, - PlatformFramebuffer, - Program, - ProgramDescriptor, - QueryPool, - QueryPoolType, - Readback, - RenderPass, - RenderPassDescriptor, - RenderPipeline, - RenderPipelineDescriptor, - RenderTarget, - RenderTargetDescriptor, - Resource, - Sampler, - SamplerDescriptor, - SwapChain, - Texture, - TextureDescriptor, - TransparentWhite, - VendorInfo, - VertexBufferDescriptor, - preprocessShader_GLSL, -} from '@antv/g-plugin-device-renderer'; -import { - assert, - assertExists, - BufferUsage, - ChannelWriteMask, - ClipSpaceNearZ, - colorCopy, - colorEqual, - CompareMode, - copyMegaState, - CopyProgram, - CullMode, - defaultMegaState, - Format, - FormatCompFlags, - FormatFlags, - FormatTypeFlags, - getFormatCompFlags, - getFormatFlags, - getFormatTypeFlags, - GL, - makeDataBuffer, - nullify, - prependLineNo, - PrimitiveTopology, - ResourceType, - SamplerFormatKind, - TextureDimension, - TextureUsage, - VertexStepMode, - ViewportOrigin, -} from '@antv/g-plugin-device-renderer'; -import { Bindings_GL } from './Bindings'; -import { Buffer_GL } from './Buffer'; -import { InputLayout_GL } from './InputLayout'; -import type { - BindingLayoutSamplerDescriptor_GL, - EXT_texture_compression_rgtc, - EXT_texture_norm16, - GPlatformWebGL2Config, - KHR_parallel_shader_compile, - OES_draw_buffers_indexed, -} from './interfaces'; -import { ProgramCompileState_GL, Program_GL } from './Program'; -import { QueryPool_GL } from './QueryPool'; -import { Readback_GL } from './Readback'; -import { RenderPipeline_GL } from './RenderPipeline'; -import { RenderTarget_GL } from './RenderTarget'; -import { ComputePipeline_GL } from './ComputePipeline'; -import { ResourceCreationTracker } from './ResourceCreationTracker'; -import { Sampler_GL } from './Sampler'; -import { Texture_GL } from './Texture'; -import { - assignPlatformName, - findall, - getPlatformBuffer, - getPlatformSampler, - getPlatformTexture, - isBlendStateNone, - isBlockCompressSized, - isFormatSizedInteger, - isTextureFormatCompressed, - isWebGL2, -} from './utils'; -import { ComputePass_GL } from './ComputePass'; -import { isNil } from '@antv/util'; - -// This is a workaround for ANGLE not supporting UBOs greater than 64kb (the limit of D3D). -// https://bugs.chromium.org/p/angleproject/issues/detail?id=3388 -const UBO_PAGE_MAX_BYTE_SIZE = 0x10000; - -export class Device_GL implements SwapChain, Device { - // Configuration - private shaderDebug = false; - private contextAttributes: WebGLContextAttributes; - - // GL extensions - // @see https://developer.mozilla.org/zh-CN/docs/Web/API/OES_vertex_array_object - OES_vertex_array_object: OES_vertex_array_object | null = null; - // @see https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays - ANGLE_instanced_arrays: ANGLE_instanced_arrays | null = null; - // @see https://developer.mozilla.org/en-US/docs/Web/API/OES_texture_float - OES_texture_float: OES_texture_float | null = null; - // @see https://www.khronos.org/registry/webgl/extensions/OES_draw_buffers_indexed/ - OES_draw_buffers_indexed: OES_draw_buffers_indexed | null = null; - // @see https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_draw_buffers - // WEBGL_draw_buffers: WEBGL_draw_buffers | null = null; - // @see https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_depth_texture - WEBGL_depth_texture: WEBGL_depth_texture | null = null; - WEBGL_compressed_texture_s3tc: WEBGL_compressed_texture_s3tc | null = null; - WEBGL_compressed_texture_s3tc_srgb: WEBGL_compressed_texture_s3tc_srgb | null = - null; - EXT_texture_compression_rgtc: EXT_texture_compression_rgtc | null = null; - EXT_texture_filter_anisotropic: EXT_texture_filter_anisotropic | null = null; - KHR_parallel_shader_compile: KHR_parallel_shader_compile | null = null; - // @see https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_norm16 - EXT_texture_norm16: EXT_texture_norm16 | null = null; - OES_texture_float_linear: OES_texture_float_linear | null = null; - OES_texture_half_float_linear: OES_texture_half_float_linear | null = null; - - // Swap Chain - private scTexture: Texture_GL | null = null; - private scPlatformFramebuffer: WebGLFramebuffer | null = null; - - // Device - private currentActiveTexture: GLenum | null = null; - private currentBoundVAO: WebGLVertexArrayObject | null = null; - private currentProgram: Program_GL | null = null; - - private resourceCreationTracker: ResourceCreationTracker | null = null; - private resourceUniqueId = 0; - - // Cached GL driver state - private currentColorAttachments: (RenderTarget_GL | null)[] = []; - private currentColorAttachmentLevels: number[] = []; - private currentColorResolveTos: (Texture_GL | null)[] = []; - private currentColorResolveToLevels: number[] = []; - private currentDepthStencilAttachment: RenderTarget_GL | null; - private currentDepthStencilResolveTo: Texture_GL | null = null; - private currentSampleCount = -1; - private currentPipeline: RenderPipeline_GL; - private currentIndexBufferByteOffset: number | null = null; - private currentMegaState: MegaStateDescriptor = - copyMegaState(defaultMegaState); - private currentSamplers: (WebGLSampler | null)[] = []; - - private currentTextures: (WebGLTexture | null)[] = []; - - private currentUniformBuffers: Buffer[] = []; - private currentUniformBufferByteOffsets: number[] = []; - private currentUniformBufferByteSizes: number[] = []; - private currentScissorEnabled = false; - private currentStencilRef: number | null = null; - - // Pass Execution - private currentRenderPassDescriptor: RenderPassDescriptor | null = null; - private debugGroupStack: DebugGroup[] = []; - private resolveColorAttachmentsChanged = false; - private resolveColorReadFramebuffer: WebGLFramebuffer; - private resolveColorDrawFramebuffer: WebGLFramebuffer; - private resolveDepthStencilAttachmentsChanged = false; - private resolveDepthStencilReadFramebuffer: WebGLFramebuffer; - private resolveDepthStencilDrawFramebuffer: WebGLFramebuffer; - /** - * use DRAW_FRAMEBUFFER in WebGL2 - */ - private renderPassDrawFramebuffer: WebGLFramebuffer; - private readbackFramebuffer: WebGLFramebuffer; - - private fallbackTexture2D: WebGLTexture; - private fallbackTexture2DDepth: WebGLTexture; - private fallbackTexture2DArray: WebGLTexture; - private fallbackTexture3D: WebGLTexture; - private fallbackTextureCube: WebGLTexture; - private fallbackVertexBuffer: Buffer; - - // VendorInfo - readonly platformString: string; - readonly glslVersion: string; - readonly explicitBindingLocations = false; - readonly separateSamplerTextures = false; - readonly viewportOrigin = ViewportOrigin.LOWER_LEFT; - readonly clipSpaceNearZ = ClipSpaceNearZ.NEGATIVE_ONE; - readonly supportMRT: boolean = false; - - private inBlitRenderPass = false; - private blitRenderPipeline: RenderPipeline; - private blitInputLayout: InputLayout; - private blitVertexBuffer: Buffer; - private blitBindings: Bindings; - private blitProgram: Program_GL; - - // GLimits - /** - * @see https://github.com/shrekshao/MoveWebGL1EngineToWebGL2/blob/master/Move-a-WebGL-1-Engine-To-WebGL-2-Blog-2.md#uniform-buffer - */ - uniformBufferMaxPageByteSize: number; - uniformBufferWordAlignment: number; - uniformBufferMaxPageWordSize: number; - supportedSampleCounts: number[] = []; - maxVertexAttribs: number; - occlusionQueriesRecommended = false; - computeShadersSupported = false; - - gl: WebGLRenderingContext | WebGL2RenderingContext; - - constructor( - gl: WebGLRenderingContext | WebGL2RenderingContext, - configuration: GPlatformWebGL2Config, - ) { - this.gl = gl; - this.contextAttributes = assertExists(gl.getContextAttributes()); - - if (!isWebGL2(gl)) { - this.OES_vertex_array_object = gl.getExtension('OES_vertex_array_object'); - // TODO: when ANGLE_instanced_arrays unavailable... - this.ANGLE_instanced_arrays = gl.getExtension('ANGLE_instanced_arrays'); - this.OES_texture_float = gl.getExtension('OES_texture_float'); - // this.WEBGL_draw_buffers = gl.getExtension('WEBGL_draw_buffers'); - // @see https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_depth_texture - // this.WEBGL_depth_texture = gl.getExtension('WEBGL_depth_texture'); - // @see https://developer.mozilla.org/en-US/docs/Web/API/EXT_frag_depth - gl.getExtension('EXT_frag_depth'); - // @see https://developer.mozilla.org/en-US/docs/Web/API/OES_element_index_uint - gl.getExtension('OES_element_index_uint'); - // @see https://developer.mozilla.org/en-US/docs/Web/API/OES_standard_derivatives - gl.getExtension('OES_standard_derivatives'); - - // won't use MRT anymore... - // if (this.WEBGL_draw_buffers) { - // this.supportMRT = true; - // } - } else { - this.EXT_texture_norm16 = gl.getExtension('EXT_texture_norm16'); - // this.supportMRT = true; - } - - this.WEBGL_compressed_texture_s3tc = gl.getExtension( - 'WEBGL_compressed_texture_s3tc', - ); - this.WEBGL_compressed_texture_s3tc_srgb = gl.getExtension( - 'WEBGL_compressed_texture_s3tc_srgb', - ); - this.EXT_texture_compression_rgtc = gl.getExtension( - 'EXT_texture_compression_rgtc', - ); - this.EXT_texture_filter_anisotropic = gl.getExtension( - 'EXT_texture_filter_anisotropic', - ); - this.EXT_texture_norm16 = gl.getExtension('EXT_texture_norm16'); - this.OES_texture_float_linear = gl.getExtension('OES_texture_float_linear'); - this.OES_texture_half_float_linear = gl.getExtension( - 'OES_texture_half_float_linear', - ); - this.KHR_parallel_shader_compile = gl.getExtension( - 'KHR_parallel_shader_compile', - ); - // this.OES_draw_buffers_indexed = gl.getExtension('OES_draw_buffers_indexed'); - - if (isWebGL2(gl)) { - this.platformString = 'WebGL2'; - this.glslVersion = '#version 300 es'; - } else { - this.platformString = 'WebGL1'; - this.glslVersion = '#version 100'; // 100 es not supported - } - - // Create our fake swap-chain texture. - this.scTexture = new Texture_GL({ - id: this.getNextUniqueId(), - device: this, - descriptor: { - width: 0, - height: 0, - depth: 1, - dimension: TextureDimension.TEXTURE_2D, - numLevels: 1, - usage: TextureUsage.RENDER_TARGET, - pixelFormat: - this.contextAttributes.alpha === false - ? Format.U8_RGB_RT - : Format.U8_RGBA_RT, - }, - fake: true, - }); - this.scTexture.formatKind = SamplerFormatKind.Float; - this.scTexture.gl_target = null; - this.scTexture.gl_texture = null; - - this.resolveColorReadFramebuffer = this.ensureResourceExists( - gl.createFramebuffer(), - ); - this.resolveColorDrawFramebuffer = this.ensureResourceExists( - gl.createFramebuffer(), - ); - this.resolveDepthStencilReadFramebuffer = this.ensureResourceExists( - gl.createFramebuffer(), - ); - this.resolveDepthStencilDrawFramebuffer = this.ensureResourceExists( - gl.createFramebuffer(), - ); - this.renderPassDrawFramebuffer = this.ensureResourceExists( - gl.createFramebuffer(), - ); - this.readbackFramebuffer = this.ensureResourceExists( - gl.createFramebuffer(), - ); - - this.fallbackTexture2D = this.createFallbackTexture( - TextureDimension.TEXTURE_2D, - SamplerFormatKind.Float, - ); - this.fallbackTexture2DDepth = this.createFallbackTexture( - TextureDimension.TEXTURE_2D, - SamplerFormatKind.Depth, - ); - this.fallbackVertexBuffer = this.createBuffer({ - viewOrSize: 1, - usage: BufferUsage.VERTEX, - hint: BufferFrequencyHint.STATIC, - }); - - if (isWebGL2(gl)) { - // this.fallbackTexture2DArray = this.createFallbackTexture( - // TextureDimension.n2DArray, - // SamplerFormatKind.Float, - // ); - // this.fallbackTexture3D = this.createFallbackTexture( - // TextureDimension.n3D, - // SamplerFormatKind.Float, - // ); - // this.fallbackTextureCube = this.createFallbackTexture( - // TextureDimension.Cube, - // SamplerFormatKind.Float, - // ); - } - - // Adjust for GL defaults. - this.currentMegaState.depthCompare = CompareMode.LESS; - this.currentMegaState.depthWrite = false; - this.currentMegaState.attachmentsState[0].channelWriteMask = - ChannelWriteMask.ALL; - - // always have depth test enabled. - gl.enable(gl.DEPTH_TEST); - gl.enable(gl.STENCIL_TEST); - - this.checkLimits(); - - if (configuration.shaderDebug) { - this.shaderDebug = true; - } - - if (configuration.trackResources) { - this.resourceCreationTracker = new ResourceCreationTracker(); - } - } - - destroy() { - if (this.blitBindings) { - this.blitBindings.destroy(); - } - if (this.blitInputLayout) { - this.blitInputLayout.destroy(); - } - if (this.blitRenderPipeline) { - this.blitRenderPipeline.destroy(); - } - if (this.blitVertexBuffer) { - this.blitVertexBuffer.destroy(); - } - if (this.blitProgram) { - this.blitProgram.destroy(); - } - } - - private createFallbackTexture( - dimension: TextureDimension, - formatKind: SamplerFormatKind, - ): WebGLTexture { - const depth = dimension === TextureDimension.TEXTURE_CUBE_MAP ? 6 : 1; - // const supportDepthTexture = - // isWebGL2(this.gl) || (!isWebGL2(this.gl) && !!this.WEBGL_depth_texture); - const pixelFormat = - formatKind === SamplerFormatKind.Depth - ? Format.D32F - : Format.U8_RGBA_NORM; - - const texture = this.createTexture({ - dimension, - pixelFormat, - usage: TextureUsage.SAMPLED, - width: 1, - height: 1, - depth, - numLevels: 1, - immutable: true, - }); - - // this.blackTexture = this.ensureResourceExists(gl.createTexture()); - // gl.bindTexture(GL.TEXTURE_2D, this.blackTexture); - // gl.texImage2D( - // GL.TEXTURE_2D, - // 0, - // isWebGL2(gl) ? gl.RGBA8 : gl.RGBA, - // 1, - // 1, - // 0, - // gl.RGBA, - // gl.UNSIGNED_BYTE, - // new Uint8Array(4), - // ) - - if (formatKind === SamplerFormatKind.Float) { - texture.setImageData([new Uint8Array(4 * depth)]); - } - return getPlatformTexture(texture); - } - - private getNextUniqueId(): number { - return ++this.resourceUniqueId; - } - - private checkLimits(): void { - const gl = this.gl; - - this.maxVertexAttribs = gl.getParameter(GL.MAX_VERTEX_ATTRIBS); - - if (isWebGL2(gl)) { - this.uniformBufferMaxPageByteSize = Math.min( - gl.getParameter(GL.MAX_UNIFORM_BLOCK_SIZE), - UBO_PAGE_MAX_BYTE_SIZE, - ); - this.uniformBufferWordAlignment = - gl.getParameter(gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT) / 4; - - const supportedSampleCounts = gl.getInternalformatParameter( - gl.RENDERBUFFER, - gl.DEPTH32F_STENCIL8, - gl.SAMPLES, - ); - this.supportedSampleCounts = supportedSampleCounts - ? [...supportedSampleCounts] - : []; - this.occlusionQueriesRecommended = true; - } else { - // mock ubo in WebGL1 - this.uniformBufferWordAlignment = 64; - this.uniformBufferMaxPageByteSize = UBO_PAGE_MAX_BYTE_SIZE; - } - - this.uniformBufferMaxPageWordSize = this.uniformBufferMaxPageByteSize / 4; - - if (!this.supportedSampleCounts.includes(1)) { - this.supportedSampleCounts.push(1); - } - this.supportedSampleCounts.sort((a, b) => a - b); - } - - //#region SwapChain - configureSwapChain( - width: number, - height: number, - platformFramebuffer?: PlatformFramebuffer, - ): void { - const texture = this.scTexture as Texture_GL; - texture.width = width; - texture.height = height; - this.scPlatformFramebuffer = nullify(platformFramebuffer); - } - - getDevice(): Device { - return this; - } - - getCanvas(): HTMLCanvasElement | OffscreenCanvas { - return this.gl.canvas; - } - - getOnscreenTexture(): Texture { - return this.scTexture; - } - - beginFrame(): void {} - - endFrame(): void {} - //#endregion - - //#region Device - // @see https://webgl2fundamentals.org/webgl/lessons/webgl-data-textures.html - translateTextureInternalFormat( - fmt: Format, - isRenderbufferStorage = false, - ): GLenum { - switch (fmt) { - case Format.ALPHA: - return GL.ALPHA; - case Format.F16_R: - return GL.R16F; - case Format.F16_RG: - return GL.RG16F; - case Format.F16_RGB: - return GL.RGB16F; - case Format.F16_RGBA: - return GL.RGBA16F; - case Format.F32_R: - return GL.R32F; - case Format.F32_RG: - return GL.RG32F; - case Format.F32_RGB: - return GL.RGB32F; - case Format.F32_RGBA: - return GL.RGBA32F; - case Format.U8_R_NORM: - return GL.R8; - case Format.U8_RG_NORM: - return GL.RG8; - case Format.U8_RGB_NORM: - case Format.U8_RGB_RT: - return GL.RGB8; - case Format.U8_RGB_SRGB: - return GL.SRGB8; - case Format.U8_RGBA_NORM: - case Format.U8_RGBA_RT: - // WebGL1 renderbuffer only support RGBA4 RGB565 RGB5_A1 - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/renderbufferStorage#parameters - // But texImage2D allows RGBA - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D - return isWebGL2(this.gl) - ? GL.RGBA8 - : isRenderbufferStorage - ? GL.RGBA4 - : GL.RGBA; - case Format.U8_RGBA_SRGB: - case Format.U8_RGBA_RT_SRGB: - return GL.SRGB8_ALPHA8; - case Format.U16_R: - return GL.R16UI; - case Format.U16_R_NORM: - return this.EXT_texture_norm16.R16_EXT; - case Format.U16_RG_NORM: - return this.EXT_texture_norm16.RG16_EXT; - case Format.U16_RGBA_NORM: - return this.EXT_texture_norm16.RGBA16_EXT; - case Format.U16_RGBA_5551: - return GL.RGB5_A1; - case Format.U16_RGB_565: - return GL.RGB565; - case Format.U32_R: - return GL.R32UI; - case Format.S8_RGBA_NORM: - return GL.RGBA8_SNORM; - case Format.S8_RG_NORM: - return GL.RG8_SNORM; - case Format.BC1: - return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT; - case Format.BC1_SRGB: - return this.WEBGL_compressed_texture_s3tc_srgb - .COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; - case Format.BC2: - return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT; - case Format.BC2_SRGB: - return this.WEBGL_compressed_texture_s3tc_srgb - .COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; - case Format.BC3: - return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT; - case Format.BC3_SRGB: - return this.WEBGL_compressed_texture_s3tc_srgb - .COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; - case Format.BC4_UNORM: - return this.EXT_texture_compression_rgtc!.COMPRESSED_RED_RGTC1_EXT; - case Format.BC4_SNORM: - return this.EXT_texture_compression_rgtc - .COMPRESSED_SIGNED_RED_RGTC1_EXT; - case Format.BC5_UNORM: - return this.EXT_texture_compression_rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT; - case Format.BC5_SNORM: - return this.EXT_texture_compression_rgtc - .COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT; - case Format.D32F_S8: - return isWebGL2(this.gl) - ? GL.DEPTH32F_STENCIL8 - : this.WEBGL_depth_texture - ? GL.DEPTH_STENCIL - : GL.DEPTH_COMPONENT16; - case Format.D24_S8: - return isWebGL2(this.gl) - ? GL.DEPTH24_STENCIL8 - : this.WEBGL_depth_texture - ? GL.DEPTH_STENCIL - : GL.DEPTH_COMPONENT16; - case Format.D32F: - return isWebGL2(this.gl) - ? GL.DEPTH_COMPONENT32F - : this.WEBGL_depth_texture - ? GL.DEPTH_COMPONENT - : GL.DEPTH_COMPONENT16; - case Format.D24: - return isWebGL2(this.gl) - ? GL.DEPTH_COMPONENT24 - : this.WEBGL_depth_texture - ? GL.DEPTH_COMPONENT - : GL.DEPTH_COMPONENT16; - default: - throw new Error('whoops'); - } - } - - translateTextureType(fmt: Format): GLenum { - const typeFlags: FormatTypeFlags = getFormatTypeFlags(fmt); - switch (typeFlags) { - case FormatTypeFlags.U8: - return GL.UNSIGNED_BYTE; - case FormatTypeFlags.U16: - return GL.UNSIGNED_SHORT; - case FormatTypeFlags.U32: - return GL.UNSIGNED_INT; - case FormatTypeFlags.S8: - return GL.BYTE; - case FormatTypeFlags.F16: - return GL.HALF_FLOAT; - case FormatTypeFlags.F32: - return GL.FLOAT; - case FormatTypeFlags.U16_PACKED_5551: - return GL.UNSIGNED_SHORT_5_5_5_1; - case FormatTypeFlags.D32F: - return isWebGL2(this.gl) - ? GL.FLOAT - : this.WEBGL_depth_texture - ? GL.UNSIGNED_INT - : GL.UNSIGNED_BYTE; - case FormatTypeFlags.D24: - return isWebGL2(this.gl) - ? GL.UNSIGNED_INT_24_8 - : this.WEBGL_depth_texture - ? GL.UNSIGNED_SHORT - : GL.UNSIGNED_BYTE; - case FormatTypeFlags.D24S8: - // @see https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_depth_texture - return isWebGL2(this.gl) - ? GL.UNSIGNED_INT_24_8 - : this.WEBGL_depth_texture - ? GL.UNSIGNED_INT_24_8_WEBGL - : GL.UNSIGNED_BYTE; - case FormatTypeFlags.D32FS8: - return GL.FLOAT_32_UNSIGNED_INT_24_8_REV; - default: - throw new Error('whoops'); - } - } - - translateTextureFormat(fmt: Format): GLenum { - if (isTextureFormatCompressed(fmt)) { - return this.translateTextureInternalFormat(fmt); - } - - // @see https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_depth_texture - const supportDepthTexture = - isWebGL2(this.gl) || (!isWebGL2(this.gl) && !!this.WEBGL_depth_texture); - - switch (fmt) { - case Format.D24_S8: - case Format.D32F_S8: - return supportDepthTexture ? GL.DEPTH_STENCIL : GL.RGBA; - case Format.D24: - case Format.D32F: - return supportDepthTexture ? GL.DEPTH_COMPONENT : GL.RGBA; - default: - break; - } - - const isInteger = isFormatSizedInteger(fmt); - - const compFlags: FormatCompFlags = getFormatCompFlags(fmt); - switch (compFlags) { - case FormatCompFlags.A: - return GL.ALPHA; - case FormatCompFlags.R: - return isInteger ? GL.RED_INTEGER : GL.RED; - case FormatCompFlags.RG: - return isInteger ? GL.RG_INTEGER : GL.RG; - case FormatCompFlags.RGB: - return isInteger ? GL.RGB_INTEGER : GL.RGB; - case FormatCompFlags.RGBA: - // TODO: Chrome throw error when readPixels RGBA_INTEGER and UNSIGNED_BYTE - // @see https://github.com/KhronosGroup/WebGL/issues/2747 - // return isInteger ? GL.RGBA_INTEGER : GL.RGBA; - return GL.RGBA; - } - } - - setActiveTexture(texture: GLenum): void { - if (this.currentActiveTexture !== texture) { - this.gl.activeTexture(texture); - this.currentActiveTexture = texture; - } - } - - private bindVAO(vao: WebGLVertexArrayObject | null): void { - if (this.currentBoundVAO !== vao) { - if (isWebGL2(this.gl)) { - this.gl.bindVertexArray(vao); - } else { - this.OES_vertex_array_object.bindVertexArrayOES(vao); - } - this.currentBoundVAO = vao; - } - } - - private programCompiled(program: Program_GL): void { - assert(program.compileState !== ProgramCompileState_GL.NeedsCompile); - - if (program.compileState === ProgramCompileState_GL.Compiling) { - program.compileState = ProgramCompileState_GL.NeedsBind; - - if (this.shaderDebug) { - this.checkProgramCompilationForErrors(program); - } - } - } - - private useProgram(program: Program_GL): void { - if (this.currentProgram === program) return; - - this.programCompiled(program); - this.gl.useProgram(program.gl_program); - this.currentProgram = program; - } - - ensureResourceExists(resource: T | null): T { - if (resource === null) { - const error = this.gl.getError(); - throw new Error( - `Created resource is null; GL error encountered: ${error}`, - ); - } else { - return resource; - } - } - - createBuffer(descriptor: BufferDescriptor): Buffer { - return new Buffer_GL({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - createTexture(descriptor: TextureDescriptor): Texture { - return new Texture_GL({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - createSampler(descriptor: SamplerDescriptor): Sampler { - return new Sampler_GL({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - createRenderTarget(descriptor: RenderTargetDescriptor): RenderTarget { - return new RenderTarget_GL({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - createRenderTargetFromTexture(texture: Texture): RenderTarget { - const { pixelFormat, width, height, numLevels } = texture as Texture_GL; - // Render targets cannot have a mip chain currently. - assert(numLevels === 1); - - return this.createRenderTarget({ - pixelFormat, - width, - height, - sampleCount: 1, - texture, - }) as RenderTarget_GL; - } - - createProgram(descriptor: ProgramDescriptor): Program_GL { - const rawVertexGLSL = descriptor.vertex?.glsl; - // preprocess GLSL first - if (descriptor.vertex.glsl) { - descriptor.vertex.glsl = preprocessShader_GLSL( - this.queryVendorInfo(), - 'vert', - descriptor.vertex.glsl, - ); - } - if (descriptor.fragment.glsl) { - descriptor.fragment.glsl = preprocessShader_GLSL( - this.queryVendorInfo(), - 'frag', - descriptor.fragment.glsl, - ); - } - return this.createProgramSimple(descriptor, rawVertexGLSL); - } - - private createProgramSimple( - descriptor: ProgramDescriptor, - rawVertexGLSL: string, - ): Program_GL { - const program = new Program_GL( - { - id: this.getNextUniqueId(), - device: this, - descriptor, - }, - rawVertexGLSL, - ); - return program; - } - - createBindings(descriptor: BindingsDescriptor): Bindings { - return new Bindings_GL({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - createInputLayout(descriptor: InputLayoutDescriptor): InputLayout { - return new InputLayout_GL({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - createRenderPipeline(descriptor: RenderPipelineDescriptor): RenderPipeline { - return new RenderPipeline_GL({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - createComputePass(): ComputePass { - return new ComputePass_GL(); - } - - createComputePipeline( - descriptor: ComputePipelineDescriptor, - ): ComputePipeline { - return new ComputePipeline_GL({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - createReadback(): Readback { - return new Readback_GL({ - id: this.getNextUniqueId(), - device: this, - }); - } - - createQueryPool(type: QueryPoolType, elemCount: number): QueryPool { - return new QueryPool_GL({ - id: this.getNextUniqueId(), - device: this, - descriptor: { - type, - elemCount, - }, - }); - } - - private formatRenderPassDescriptor(descriptor: RenderPassDescriptor) { - const { colorAttachment } = descriptor; - - descriptor.depthClearValue = descriptor.depthClearValue ?? 'load'; - descriptor.stencilClearValue = descriptor.stencilClearValue ?? 'load'; - - for (let i = 0; i < colorAttachment.length; i++) { - if (!descriptor.colorAttachmentLevel) { - descriptor.colorAttachmentLevel = []; - } - descriptor.colorAttachmentLevel[i] = - descriptor.colorAttachmentLevel[i] ?? 0; - - if (!descriptor.colorResolveToLevel) { - descriptor.colorResolveToLevel = []; - } - descriptor.colorResolveToLevel[i] = - descriptor.colorResolveToLevel[i] ?? 0; - - if (!descriptor.colorClearColor) { - descriptor.colorClearColor = []; - } - descriptor.colorClearColor[i] = descriptor.colorClearColor[i] ?? 'load'; - - if (!descriptor.colorStore) { - descriptor.colorStore = []; - } - descriptor.colorStore[i] = descriptor.colorStore[i] ?? false; - } - } - - createRenderPass(descriptor: RenderPassDescriptor): RenderPass { - assert(this.currentRenderPassDescriptor === null); - this.currentRenderPassDescriptor = descriptor; - - // Format renderpass descriptor - this.formatRenderPassDescriptor(descriptor); - - const { - colorAttachment, - colorAttachmentLevel, - colorClearColor, - colorResolveTo, - colorResolveToLevel, - depthStencilAttachment, - depthClearValue, - stencilClearValue, - depthStencilResolveTo, - } = descriptor; - this.setRenderPassParametersBegin(colorAttachment.length); - for (let i = 0; i < colorAttachment.length; i++) { - this.setRenderPassParametersColor( - i, - colorAttachment[i] as RenderTarget_GL | null, - colorAttachmentLevel[i], - colorResolveTo[i] as Texture_GL | null, - colorResolveToLevel[i], - ); - } - this.setRenderPassParametersDepthStencil( - depthStencilAttachment as RenderTarget_GL | null, - depthStencilResolveTo as Texture_GL | null, - ); - this.validateCurrentAttachments(); - for (let i = 0; i < colorAttachment.length; i++) { - const clearColor = colorClearColor[i]; - if (clearColor === 'load') continue; - this.setRenderPassParametersClearColor( - i, - clearColor.r, - clearColor.g, - clearColor.b, - clearColor.a, - ); - } - this.setRenderPassParametersClearDepthStencil( - depthClearValue, - stencilClearValue, - ); - return this; - } - - submitPass(pass: RenderPass): void { - assert(this.currentRenderPassDescriptor !== null); - this.endPass(); - this.currentRenderPassDescriptor = null; - } - - copySubTexture2D( - dst_: Texture, - dstX: number, - dstY: number, - src_: Texture, - srcX: number, - srcY: number, - ): void { - const gl = this.gl; - - const dst = dst_ as Texture_GL; - const src = src_ as Texture_GL; - assert(src.numLevels === 1); - assert(dst.numLevels === 1); - - if (isWebGL2(gl)) { - if (dst === this.scTexture) { - gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, this.scPlatformFramebuffer); - } else { - gl.bindFramebuffer( - gl.DRAW_FRAMEBUFFER, - this.resolveColorDrawFramebuffer, - ); - this.bindFramebufferAttachment( - gl.DRAW_FRAMEBUFFER, - gl.COLOR_ATTACHMENT0, - dst, - 0, - ); - } - - gl.bindFramebuffer(gl.READ_FRAMEBUFFER, this.resolveColorReadFramebuffer); - this.bindFramebufferAttachment( - gl.READ_FRAMEBUFFER, - gl.COLOR_ATTACHMENT0, - src, - 0, - ); - - gl.blitFramebuffer( - srcX, - srcY, - srcX + src.width, - srcY + src.height, - dstX, - dstY, - dstX + src.width, - dstY + src.height, - gl.COLOR_BUFFER_BIT, - gl.LINEAR, - ); - - gl.bindFramebuffer(gl.READ_FRAMEBUFFER, null); - gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null); - } - } - - queryLimits(): DeviceLimits { - return this; - } - - queryTextureFormatSupported( - format: Format, - width: number, - height: number, - ): boolean { - switch (format) { - case Format.BC1_SRGB: - case Format.BC2_SRGB: - case Format.BC3_SRGB: - if (this.WEBGL_compressed_texture_s3tc_srgb !== null) - return isBlockCompressSized(width, height, 4, 4); - return false; - case Format.BC1: - case Format.BC2: - case Format.BC3: - if (this.WEBGL_compressed_texture_s3tc !== null) - return isBlockCompressSized(width, height, 4, 4); - return false; - case Format.BC4_UNORM: - case Format.BC4_SNORM: - case Format.BC5_UNORM: - case Format.BC5_SNORM: - if (this.EXT_texture_compression_rgtc !== null) - return isBlockCompressSized(width, height, 4, 4); - return false; - case Format.U16_R_NORM: - case Format.U16_RG_NORM: - case Format.U16_RGBA_NORM: - return this.EXT_texture_norm16 !== null; - case Format.F32_R: - case Format.F32_RG: - case Format.F32_RGB: - case Format.F32_RGBA: - return this.OES_texture_float_linear !== null; - case Format.F16_R: - case Format.F16_RG: - case Format.F16_RGB: - case Format.F16_RGBA: - return this.OES_texture_half_float_linear !== null; - default: - return true; - } - } - - private queryProgramReady(program: Program_GL): boolean { - const gl = this.gl; - - if (program.compileState === ProgramCompileState_GL.NeedsCompile) { - // This should not happen. - throw new Error('whoops'); - } - if (program.compileState === ProgramCompileState_GL.Compiling) { - let complete: boolean; - - if (this.KHR_parallel_shader_compile !== null) { - complete = gl.getProgramParameter( - program.gl_program, - this.KHR_parallel_shader_compile.COMPLETION_STATUS_KHR, - ); - } else { - // If we don't have async shader compilation, assume all compilation is done immediately :/ - complete = true; - } - - if (complete) { - this.programCompiled(program); - } - - return complete; - } - - return ( - program.compileState === ProgramCompileState_GL.NeedsBind || - program.compileState === ProgramCompileState_GL.ReadyToUse - ); - } - - queryPlatformAvailable(): boolean { - return this.gl.isContextLost(); - } - - queryVendorInfo(): VendorInfo { - return this; - } - - queryRenderPass(o: RenderPass): Readonly { - return this.currentRenderPassDescriptor; - } - - queryRenderTarget(o: RenderTarget): Readonly { - const renderTarget = o as RenderTarget_GL; - return renderTarget; - } - //#endregion - - //#region Debugging - - setResourceName(o: Resource, name: string): void { - o.name = name; - - if (o.type === ResourceType.Buffer) { - const { gl_buffer_pages } = o as Buffer_GL; - for (let i = 0; i < gl_buffer_pages.length; i++) - assignPlatformName(gl_buffer_pages[i], `${name} Page ${i}`); - } else if (o.type === ResourceType.Texture) { - assignPlatformName(getPlatformTexture(o), name); - } else if (o.type === ResourceType.Sampler) { - assignPlatformName(getPlatformSampler(o), name); - } else if (o.type === ResourceType.RenderTarget) { - const { gl_renderbuffer } = o as RenderTarget_GL; - if (gl_renderbuffer !== null) assignPlatformName(gl_renderbuffer, name); - } else if (o.type === ResourceType.InputLayout) { - assignPlatformName((o as InputLayout_GL).vao, name); - } - } - - setResourceLeakCheck(o: Resource, v: boolean): void { - if (this.resourceCreationTracker !== null) - this.resourceCreationTracker.setResourceLeakCheck(o, v); - } - - checkForLeaks(): void { - if (this.resourceCreationTracker !== null) - this.resourceCreationTracker.checkForLeaks(); - } - - pushDebugGroup(name: string): void {} - - popDebugGroup(): void {} - - insertDebugMarker(markerLabel: string) {} - - // pushDebugGroup(debugGroup: DebugGroup): void { - // this.debugGroupStack.push(debugGroup); - // } - - // popDebugGroup(): void { - // this.debugGroupStack.pop(); - // } - - programPatched(o: Program, descriptor: ProgramDescriptor): void { - assert(this.shaderDebug); - - // const program = o as Program_GL; - // const gl = this.gl; - // gl.deleteProgram(program.gl_program); - // program.descriptor = descriptor; - // program.gl_program = this.ensureResourceExists(gl.createProgram()); - // program.compileState = ProgramCompileState_GL.NeedsCompile; - // this.tryCompileProgram(program); - // this.checkProgramCompilationForErrors(program); - } - - getBufferData( - buffer: Buffer, - dstBuffer: ArrayBufferView, - wordOffset = 0, - ): void { - const gl = this.gl; - - if (isWebGL2(gl)) { - gl.bindBuffer( - gl.COPY_READ_BUFFER, - getPlatformBuffer(buffer, wordOffset * 4), - ); - gl.getBufferSubData(gl.COPY_READ_BUFFER, wordOffset * 4, dstBuffer); - } else { - } - } - //#endregion - - private debugGroupStatisticsDrawCall(count = 1): void { - for (let i = this.debugGroupStack.length - 1; i >= 0; i--) - this.debugGroupStack[i].drawCallCount += count; - } - - private debugGroupStatisticsBufferUpload(count = 1): void { - for (let i = this.debugGroupStack.length - 1; i >= 0; i--) - this.debugGroupStack[i].bufferUploadCount += count; - } - - private debugGroupStatisticsTextureBind(count = 1): void { - for (let i = this.debugGroupStack.length - 1; i >= 0; i--) - this.debugGroupStack[i].textureBindCount += count; - } - - private debugGroupStatisticsTriangles(count: number): void { - for (let i = this.debugGroupStack.length - 1; i >= 0; i--) - this.debugGroupStack[i].triangleCount += count; - } - - private reportShaderError(shader: WebGLShader, str: string): boolean { - const gl = this.gl; - const status = gl.getShaderParameter(shader, gl.COMPILE_STATUS); - if (!status) { - console.error(prependLineNo(str)); - const debug_shaders = gl.getExtension('WEBGL_debug_shaders'); - if (debug_shaders) - console.error(debug_shaders.getTranslatedShaderSource(shader)); - console.error(gl.getShaderInfoLog(shader)); - } - return status; - } - - private checkProgramCompilationForErrors(program: Program_GL): void { - const gl = this.gl; - - const prog = program.gl_program!; - if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) { - const descriptor = program.descriptor; - - if ( - !this.reportShaderError(program.gl_shader_vert, descriptor.vertex.glsl) - ) - return; - - if ( - !this.reportShaderError( - program.gl_shader_frag, - descriptor.fragment.glsl, - ) - ) - return; - - // Neither shader had an error, report the program info log. - console.error(gl.getProgramInfoLog(program.gl_program)); - } - } - - private bindFramebufferAttachment( - framebuffer: GLenum, - binding: GLenum, - attachment: RenderTarget_GL | Texture_GL | null, - level: number, - ): void { - const gl = this.gl; - - if (attachment === null) { - gl.framebufferRenderbuffer(framebuffer, binding, gl.RENDERBUFFER, null); - } else if (attachment.type === ResourceType.RenderTarget) { - if ((attachment as RenderTarget_GL).gl_renderbuffer !== null) { - gl.framebufferRenderbuffer( - framebuffer, - binding, - gl.RENDERBUFFER, - (attachment as RenderTarget_GL).gl_renderbuffer, - ); - } else if ((attachment as RenderTarget_GL).texture !== null) { - gl.framebufferTexture2D( - framebuffer, - binding, - GL.TEXTURE_2D, - getPlatformTexture((attachment as RenderTarget_GL).texture), - level, - ); - } - } else if (attachment.type === ResourceType.Texture) { - // TODO: use Tex2D array with gl.framebufferTextureLayer - gl.framebufferTexture2D( - framebuffer, - binding, - GL.TEXTURE_2D, - getPlatformTexture(attachment as Texture_GL), - level, - ); - } - } - - private bindFramebufferDepthStencilAttachment( - framebuffer: GLenum, - attachment: RenderTarget_GL | Texture_GL | null, - ): void { - const gl = this.gl; - - const flags = - attachment !== null - ? getFormatFlags(attachment.pixelFormat) - : FormatFlags.Depth | FormatFlags.Stencil; - const depth = !!(flags & FormatFlags.Depth); - const stencil = !!(flags & FormatFlags.Stencil); - - if (depth && stencil) { - const supportDepthTexture = - isWebGL2(this.gl) || (!isWebGL2(this.gl) && !!this.WEBGL_depth_texture); - if (supportDepthTexture) { - this.bindFramebufferAttachment( - framebuffer, - gl.DEPTH_STENCIL_ATTACHMENT, - attachment, - 0, - ); - } else { - this.bindFramebufferAttachment( - framebuffer, - gl.DEPTH_ATTACHMENT, - attachment, - 0, - ); - } - } else if (depth) { - this.bindFramebufferAttachment( - framebuffer, - gl.DEPTH_ATTACHMENT, - attachment, - 0, - ); - this.bindFramebufferAttachment( - framebuffer, - gl.STENCIL_ATTACHMENT, - null, - 0, - ); - } else if (stencil) { - this.bindFramebufferAttachment( - framebuffer, - gl.STENCIL_ATTACHMENT, - attachment, - 0, - ); - this.bindFramebufferAttachment(framebuffer, gl.DEPTH_ATTACHMENT, null, 0); - } - } - - private validateCurrentAttachments(): void { - let sampleCount = -1, - width = -1, - height = -1; - - for (let i = 0; i < this.currentColorAttachments.length; i++) { - const attachment = this.currentColorAttachments[i]; - - if (attachment === null) continue; - - if (sampleCount === -1) { - sampleCount = attachment.sampleCount; - width = attachment.width; - height = attachment.height; - } else { - assert(sampleCount === attachment.sampleCount); - assert(width === attachment.width); - assert(height === attachment.height); - } - } - - if (this.currentDepthStencilAttachment) { - if (sampleCount === -1) { - sampleCount = this.currentDepthStencilAttachment.sampleCount; - width = this.currentDepthStencilAttachment.width; - height = this.currentDepthStencilAttachment.height; - } else { - assert(sampleCount === this.currentDepthStencilAttachment.sampleCount); - assert(width === this.currentDepthStencilAttachment.width); - assert(height === this.currentDepthStencilAttachment.height); - } - } - - this.currentSampleCount = sampleCount; - } - - private setRenderPassParametersBegin(numColorAttachments: number): void { - const gl = this.gl; - if (isWebGL2(gl)) { - gl.bindFramebuffer(GL.DRAW_FRAMEBUFFER, this.renderPassDrawFramebuffer); - } else { - if (!this.inBlitRenderPass) { - gl.bindFramebuffer(GL.FRAMEBUFFER, this.renderPassDrawFramebuffer); - } - } - - if (!this.inBlitRenderPass) { - for ( - let i = numColorAttachments; - i < this.currentColorAttachments.length; - i++ - ) { - const target = isWebGL2(gl) ? GL.DRAW_FRAMEBUFFER : GL.FRAMEBUFFER; - const attachment = isWebGL2(gl) - ? GL.COLOR_ATTACHMENT0 - : GL.COLOR_ATTACHMENT0_WEBGL; - - gl.framebufferRenderbuffer( - target, - attachment + i, - GL.RENDERBUFFER, - null, - ); - gl.framebufferTexture2D(target, attachment + i, GL.TEXTURE_2D, null, 0); - } - } - this.currentColorAttachments.length = numColorAttachments; - - // if (isWebGL2(gl)) { - // gl.drawBuffers([ - // GL.COLOR_ATTACHMENT0, - // GL.COLOR_ATTACHMENT1, - // GL.COLOR_ATTACHMENT2, - // GL.COLOR_ATTACHMENT3, - // ]); - // } else { - // if (!this.inBlitRenderPass) { - // // MRT @see https://github.com/shrekshao/MoveWebGL1EngineToWebGL2/blob/master/Move-a-WebGL-1-Engine-To-WebGL-2-Blog-1.md#multiple-render-targets - // this.WEBGL_draw_buffers.drawBuffersWEBGL([ - // GL.COLOR_ATTACHMENT0_WEBGL, // gl_FragData[0] - // GL.COLOR_ATTACHMENT1_WEBGL, // gl_FragData[1] - // GL.COLOR_ATTACHMENT2_WEBGL, // gl_FragData[2] - // GL.COLOR_ATTACHMENT3_WEBGL, // gl_FragData[3] - // ]); - // } - // } - } - - private setRenderPassParametersColor( - i: number, - colorAttachment: RenderTarget_GL | null, - attachmentLevel: number, - colorResolveTo: Texture_GL | null, - resolveToLevel: number, - ): void { - const gl = this.gl; - - if ( - this.currentColorAttachments[i] !== colorAttachment || - this.currentColorAttachmentLevels[i] !== attachmentLevel - ) { - this.currentColorAttachments[i] = colorAttachment; - this.currentColorAttachmentLevels[i] = attachmentLevel; - - // disable MRT in WebGL1 - if (isWebGL2(gl) || i === 0) { - this.bindFramebufferAttachment( - isWebGL2(gl) ? GL.DRAW_FRAMEBUFFER : GL.FRAMEBUFFER, - (isWebGL2(gl) ? GL.COLOR_ATTACHMENT0 : GL.COLOR_ATTACHMENT0_WEBGL) + - i, - colorAttachment, - attachmentLevel, - ); - } - - this.resolveColorAttachmentsChanged = true; - } - - if ( - this.currentColorResolveTos[i] !== colorResolveTo || - this.currentColorResolveToLevels[i] !== resolveToLevel - ) { - this.currentColorResolveTos[i] = colorResolveTo; - this.currentColorResolveToLevels[i] = resolveToLevel; - - if (colorResolveTo !== null) { - this.resolveColorAttachmentsChanged = true; - } - } - } - - private setRenderPassParametersDepthStencil( - depthStencilAttachment: RenderTarget | null, - depthStencilResolveTo: Texture | null, - ): void { - const gl = this.gl; - - if (this.currentDepthStencilAttachment !== depthStencilAttachment) { - this.currentDepthStencilAttachment = - depthStencilAttachment as RenderTarget_GL | null; - - if (!this.inBlitRenderPass) { - this.bindFramebufferDepthStencilAttachment( - isWebGL2(gl) ? GL.DRAW_FRAMEBUFFER : GL.FRAMEBUFFER, - this.currentDepthStencilAttachment, - ); - } - this.resolveDepthStencilAttachmentsChanged = true; - } - - if (this.currentDepthStencilResolveTo !== depthStencilResolveTo) { - this.currentDepthStencilResolveTo = depthStencilResolveTo as Texture_GL; - - if (depthStencilResolveTo) { - this.resolveDepthStencilAttachmentsChanged = true; - } - } - } - - private setRenderPassParametersClearColor( - slot: number, - r: number, - g: number, - b: number, - a: number, - ): void { - const gl = this.gl; - - if (this.OES_draw_buffers_indexed !== null) { - const attachment = this.currentMegaState.attachmentsState[slot]; - if (attachment && attachment.channelWriteMask !== ChannelWriteMask.ALL) { - this.OES_draw_buffers_indexed.colorMaskiOES( - slot, - true, - true, - true, - true, - ); - attachment.channelWriteMask = ChannelWriteMask.ALL; - } - } else { - const attachment = this.currentMegaState.attachmentsState[0]; - if (attachment && attachment.channelWriteMask !== ChannelWriteMask.ALL) { - gl.colorMask(true, true, true, true); - attachment.channelWriteMask = ChannelWriteMask.ALL; - } - } - - this.setScissorEnabled(false); - - if (isWebGL2(gl)) { - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clearBuffer - gl.clearBufferfv(gl.COLOR, slot, [r, g, b, a]); - } else { - gl.clearColor(r, g, b, a); - gl.clear(gl.COLOR_BUFFER_BIT); - } - } - - private setRenderPassParametersClearDepthStencil( - depthClearValue: number | 'load' = 'load', - stencilClearValue: number | 'load' = 'load', - ): void { - const gl = this.gl; - - if (depthClearValue !== 'load') { - assert(!!this.currentDepthStencilAttachment); - // GL clears obey the masks... bad API or worst API? - if (!this.currentMegaState.depthWrite) { - gl.depthMask(true); - this.currentMegaState.depthWrite = true; - } - if (isWebGL2(gl)) { - gl.clearBufferfv(gl.DEPTH, 0, [depthClearValue]); - } else { - gl.clearDepth(depthClearValue); - gl.clear(gl.DEPTH_BUFFER_BIT); - } - } - if (stencilClearValue !== 'load') { - assert(!!this.currentDepthStencilAttachment); - if (!this.currentMegaState.stencilWrite) { - gl.enable(gl.STENCIL_TEST); - gl.stencilMask(0xff); - this.currentMegaState.stencilWrite = true; - } - if (isWebGL2(gl)) { - gl.clearBufferiv(gl.STENCIL, 0, [stencilClearValue]); - } else { - gl.clearStencil(stencilClearValue); - gl.clear(gl.STENCIL_BUFFER_BIT); - } - } - } - - setBindings( - bindingLayoutIndex: number, - bindings_: Bindings, - dynamicByteOffsets: number[], - ): void { - const gl = this.gl; - - assert( - bindingLayoutIndex < - this.currentPipeline.bindingLayouts.bindingLayoutTables.length, - ); - const bindingLayoutTable = - this.currentPipeline.bindingLayouts.bindingLayoutTables[ - bindingLayoutIndex - ]; - - const { uniformBufferBindings, samplerBindings } = bindings_ as Bindings_GL; - // Ignore extra bindings. - assert( - uniformBufferBindings.length >= bindingLayoutTable.numUniformBuffers, - ); - assert(samplerBindings.length >= bindingLayoutTable.numSamplers); - assert(dynamicByteOffsets.length >= uniformBufferBindings.length); - - for (let i = 0; i < uniformBufferBindings.length; i++) { - const binding = uniformBufferBindings[i]; - if (binding.wordCount === 0) continue; - const index = bindingLayoutTable.firstUniformBuffer + i; - const buffer = binding.buffer as Buffer_GL; - const byteOffset = dynamicByteOffsets[i]; - const byteSize = binding.wordCount * 4; - if ( - buffer !== this.currentUniformBuffers[index] || - byteOffset !== this.currentUniformBufferByteOffsets[index] || - byteSize !== this.currentUniformBufferByteSizes[index] - ) { - const platformBufferByteOffset = byteOffset % buffer.pageByteSize; - const platformBuffer = - buffer.gl_buffer_pages[(byteOffset / buffer.pageByteSize) | 0]; - assert(platformBufferByteOffset + byteSize <= buffer.pageByteSize); - - if (isWebGL2(gl)) { - gl.bindBufferRange( - gl.UNIFORM_BUFFER, - index, - platformBuffer, - platformBufferByteOffset, - byteSize, - ); - } else { - // TODO: WebGL1 uniform - } - this.currentUniformBuffers[index] = buffer; - this.currentUniformBufferByteOffsets[index] = byteOffset; - this.currentUniformBufferByteSizes[index] = byteSize; - } - } - - for (let i = 0; i < bindingLayoutTable.numSamplers; i++) { - const binding = samplerBindings[i]; - const samplerIndex = bindingLayoutTable.firstSampler + i; - const samplerEntry = bindingLayoutTable.samplerEntries[i]; - const gl_sampler = - binding !== null && binding.sampler !== null - ? getPlatformSampler(binding.sampler) - : null; - const gl_texture = - binding !== null && binding.texture !== null - ? getPlatformTexture(binding.texture) - : null; - - if (this.currentSamplers[samplerIndex] !== gl_sampler) { - if (isWebGL2(gl)) { - gl.bindSampler(samplerIndex, gl_sampler); - } - this.currentSamplers[samplerIndex] = gl_sampler; - } - - if (this.currentTextures[samplerIndex] !== gl_texture) { - this.setActiveTexture(gl.TEXTURE0 + samplerIndex); - if (gl_texture !== null) { - // update index - (binding.texture as Texture_GL).textureIndex = samplerIndex; - const { gl_target, width, height } = assertExists(binding) - .texture as Texture_GL; - gl.bindTexture(gl_target, gl_texture); - - // In WebGL1 set tex's parameters @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texParameter - if (!isWebGL2(gl)) { - (binding.sampler as Sampler_GL)?.setTextureParameters( - gl_target, - width, - height, - ); - } - - this.debugGroupStatisticsTextureBind(); - - assert(samplerEntry.gl_target === gl_target); - // assert(samplerEntry.formatKind === formatKind); - } else { - gl.bindTexture( - samplerEntry.gl_target, - this.getFallbackTexture(samplerEntry), - ); - } - this.currentTextures[samplerIndex] = gl_texture; - } - } - } - - setViewport(x: number, y: number, w: number, h: number): void { - const gl = this.gl; - gl.viewport(x, y, w, h); - } - - setScissor(x: number, y: number, w: number, h: number): void { - const gl = this.gl; - this.setScissorEnabled(true); - gl.scissor(x, y, w, h); - } - - private applyAttachmentStateIndexed( - i: number, - currentAttachmentState: AttachmentState, - newAttachmentState: AttachmentState, - ): void { - const gl = this.gl; - const dbi = this.OES_draw_buffers_indexed!; - - if ( - currentAttachmentState.channelWriteMask !== - newAttachmentState.channelWriteMask - ) { - dbi.colorMaskiOES( - i, - !!(newAttachmentState.channelWriteMask & ChannelWriteMask.RED), - !!(newAttachmentState.channelWriteMask & ChannelWriteMask.GREEN), - !!(newAttachmentState.channelWriteMask & ChannelWriteMask.BLUE), - !!(newAttachmentState.channelWriteMask & ChannelWriteMask.ALPHA), - ); - currentAttachmentState.channelWriteMask = - newAttachmentState.channelWriteMask; - } - - const blendModeChanged = - currentAttachmentState.rgbBlendState.blendMode !== - newAttachmentState.rgbBlendState.blendMode || - currentAttachmentState.alphaBlendState.blendMode !== - newAttachmentState.alphaBlendState.blendMode; - const blendFuncChanged = - currentAttachmentState.rgbBlendState.blendSrcFactor !== - newAttachmentState.rgbBlendState.blendSrcFactor || - currentAttachmentState.alphaBlendState.blendSrcFactor !== - newAttachmentState.alphaBlendState.blendSrcFactor || - currentAttachmentState.rgbBlendState.blendDstFactor !== - newAttachmentState.rgbBlendState.blendDstFactor || - currentAttachmentState.alphaBlendState.blendDstFactor !== - newAttachmentState.alphaBlendState.blendDstFactor; - - if (blendFuncChanged || blendModeChanged) { - if ( - isBlendStateNone(currentAttachmentState.rgbBlendState) && - isBlendStateNone(currentAttachmentState.alphaBlendState) - ) - dbi.enableiOES(i, gl.BLEND); - else if ( - isBlendStateNone(newAttachmentState.rgbBlendState) && - isBlendStateNone(newAttachmentState.alphaBlendState) - ) - dbi.disableiOES(i, gl.BLEND); - } - - if (blendModeChanged) { - dbi.blendEquationSeparateiOES( - i, - newAttachmentState.rgbBlendState.blendMode, - newAttachmentState.alphaBlendState.blendMode, - ); - currentAttachmentState.rgbBlendState.blendMode = - newAttachmentState.rgbBlendState.blendMode; - currentAttachmentState.alphaBlendState.blendMode = - newAttachmentState.alphaBlendState.blendMode; - } - - if (blendFuncChanged) { - dbi.blendFuncSeparateiOES( - i, - newAttachmentState.rgbBlendState.blendSrcFactor, - newAttachmentState.rgbBlendState.blendDstFactor, - newAttachmentState.alphaBlendState.blendSrcFactor, - newAttachmentState.alphaBlendState.blendDstFactor, - ); - currentAttachmentState.rgbBlendState.blendSrcFactor = - newAttachmentState.rgbBlendState.blendSrcFactor; - currentAttachmentState.alphaBlendState.blendSrcFactor = - newAttachmentState.alphaBlendState.blendSrcFactor; - currentAttachmentState.rgbBlendState.blendDstFactor = - newAttachmentState.rgbBlendState.blendDstFactor; - currentAttachmentState.alphaBlendState.blendDstFactor = - newAttachmentState.alphaBlendState.blendDstFactor; - } - } - - private applyAttachmentState( - currentAttachmentState: AttachmentState, - newAttachmentState: AttachmentState, - ): void { - const gl = this.gl; - - if ( - currentAttachmentState.channelWriteMask !== - newAttachmentState.channelWriteMask - ) { - gl.colorMask( - !!(newAttachmentState.channelWriteMask & ChannelWriteMask.RED), - !!(newAttachmentState.channelWriteMask & ChannelWriteMask.GREEN), - !!(newAttachmentState.channelWriteMask & ChannelWriteMask.BLUE), - !!(newAttachmentState.channelWriteMask & ChannelWriteMask.ALPHA), - ); - currentAttachmentState.channelWriteMask = - newAttachmentState.channelWriteMask; - } - - const blendModeChanged = - currentAttachmentState.rgbBlendState.blendMode !== - newAttachmentState.rgbBlendState.blendMode || - currentAttachmentState.alphaBlendState.blendMode !== - newAttachmentState.alphaBlendState.blendMode; - const blendFuncChanged = - currentAttachmentState.rgbBlendState.blendSrcFactor !== - newAttachmentState.rgbBlendState.blendSrcFactor || - currentAttachmentState.alphaBlendState.blendSrcFactor !== - newAttachmentState.alphaBlendState.blendSrcFactor || - currentAttachmentState.rgbBlendState.blendDstFactor !== - newAttachmentState.rgbBlendState.blendDstFactor || - currentAttachmentState.alphaBlendState.blendDstFactor !== - newAttachmentState.alphaBlendState.blendDstFactor; - - if (blendFuncChanged || blendModeChanged) { - if ( - isBlendStateNone(currentAttachmentState.rgbBlendState) && - isBlendStateNone(currentAttachmentState.alphaBlendState) - ) { - gl.enable(gl.BLEND); - } else if ( - isBlendStateNone(newAttachmentState.rgbBlendState) && - isBlendStateNone(newAttachmentState.alphaBlendState) - ) { - gl.disable(gl.BLEND); - } - } - - if (blendModeChanged) { - gl.blendEquationSeparate( - newAttachmentState.rgbBlendState.blendMode, - newAttachmentState.alphaBlendState.blendMode, - ); - currentAttachmentState.rgbBlendState.blendMode = - newAttachmentState.rgbBlendState.blendMode; - currentAttachmentState.alphaBlendState.blendMode = - newAttachmentState.alphaBlendState.blendMode; - } - - if (blendFuncChanged) { - gl.blendFuncSeparate( - newAttachmentState.rgbBlendState.blendSrcFactor, - newAttachmentState.rgbBlendState.blendDstFactor, - newAttachmentState.alphaBlendState.blendSrcFactor, - newAttachmentState.alphaBlendState.blendDstFactor, - ); - currentAttachmentState.rgbBlendState.blendSrcFactor = - newAttachmentState.rgbBlendState.blendSrcFactor; - currentAttachmentState.alphaBlendState.blendSrcFactor = - newAttachmentState.alphaBlendState.blendSrcFactor; - currentAttachmentState.rgbBlendState.blendDstFactor = - newAttachmentState.rgbBlendState.blendDstFactor; - currentAttachmentState.alphaBlendState.blendDstFactor = - newAttachmentState.alphaBlendState.blendDstFactor; - } - } - - private setMegaState(newMegaState: MegaStateDescriptor): void { - const gl = this.gl; - const currentMegaState = this.currentMegaState; - - if (this.OES_draw_buffers_indexed !== null) { - for (let i = 0; i < newMegaState.attachmentsState.length; i++) - this.applyAttachmentStateIndexed( - i, - currentMegaState.attachmentsState[0], - newMegaState.attachmentsState[0], - ); - } else { - assert(newMegaState.attachmentsState.length === 1); - this.applyAttachmentState( - currentMegaState.attachmentsState[0], - newMegaState.attachmentsState[0], - ); - } - - if ( - !colorEqual(currentMegaState.blendConstant, newMegaState.blendConstant) - ) { - gl.blendColor( - newMegaState.blendConstant.r, - newMegaState.blendConstant.g, - newMegaState.blendConstant.b, - newMegaState.blendConstant.a, - ); - colorCopy(currentMegaState.blendConstant, newMegaState.blendConstant); - } - - if (currentMegaState.depthCompare !== newMegaState.depthCompare) { - gl.depthFunc(newMegaState.depthCompare); - currentMegaState.depthCompare = newMegaState.depthCompare; - } - - if (!!currentMegaState.depthWrite !== !!newMegaState.depthWrite) { - gl.depthMask(newMegaState.depthWrite); - currentMegaState.depthWrite = newMegaState.depthWrite; - } - - if (!!currentMegaState.stencilWrite !== !!newMegaState.stencilWrite) { - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/stencilMask - gl.stencilMask(newMegaState.stencilWrite ? 0xff : 0x00); - currentMegaState.stencilWrite = newMegaState.stencilWrite; - } - - if (currentMegaState.stencilPassOp !== newMegaState.stencilPassOp) { - gl.stencilOp(gl.KEEP, gl.KEEP, newMegaState.stencilPassOp); - currentMegaState.stencilPassOp = newMegaState.stencilPassOp; - } - - if ( - currentMegaState.stencilRef !== newMegaState.stencilRef || - currentMegaState.stencilCompare !== newMegaState.stencilCompare - ) { - currentMegaState.stencilCompare = newMegaState.stencilCompare; - this.setStencilRef(newMegaState.stencilRef); - } - - if (currentMegaState.cullMode !== newMegaState.cullMode) { - if (currentMegaState.cullMode === CullMode.NONE) { - gl.enable(gl.CULL_FACE); - } else if (newMegaState.cullMode === CullMode.NONE) { - gl.disable(gl.CULL_FACE); - } - - if (newMegaState.cullMode === CullMode.BACK) { - gl.cullFace(gl.BACK); - } else if (newMegaState.cullMode === CullMode.FRONT) { - gl.cullFace(gl.FRONT); - } else if (newMegaState.cullMode === CullMode.FRONT_AND_BACK) { - gl.cullFace(gl.FRONT_AND_BACK); - } - currentMegaState.cullMode = newMegaState.cullMode; - } - - if (currentMegaState.frontFace !== newMegaState.frontFace) { - gl.frontFace(newMegaState.frontFace); - currentMegaState.frontFace = newMegaState.frontFace; - } - - if (currentMegaState.polygonOffset !== newMegaState.polygonOffset) { - if (newMegaState.polygonOffset) { - gl.polygonOffset(1, 1); - gl.enable(gl.POLYGON_OFFSET_FILL); - } else { - gl.disable(gl.POLYGON_OFFSET_FILL); - } - currentMegaState.polygonOffset = newMegaState.polygonOffset; - } - } - - private validatePipelineFormats(pipeline: RenderPipeline_GL): void { - for (let i = 0; i < this.currentColorAttachments.length; i++) { - const attachment = this.currentColorAttachments[i]; - if (attachment === null) continue; - assert(attachment.pixelFormat === pipeline.colorAttachmentFormats[i]); - } - - if (this.currentDepthStencilAttachment) { - assert( - this.currentDepthStencilAttachment.pixelFormat === - pipeline.depthStencilAttachmentFormat, - ); - } - - if (this.currentSampleCount !== -1) { - assert(this.currentSampleCount === pipeline.sampleCount); - } - } - - setPipeline(o: RenderPipeline): void { - this.currentPipeline = o as RenderPipeline_GL; - this.validatePipelineFormats(this.currentPipeline); - - // We allow users to use "non-ready" pipelines for emergencies. In this case, there can be a bit of stuttering. - // assert(this.queryPipelineReady(this.currentPipeline)); - - this.setMegaState(this.currentPipeline.megaState); - - const program = this.currentPipeline.program; - this.useProgram(program); - - if (program.compileState === ProgramCompileState_GL.NeedsBind) { - const gl = this.gl; - const prog = program.gl_program!; - const deviceProgram = program.descriptor; - - const uniformBlocks = findall( - deviceProgram.vertex.glsl, - /uniform (\w+) {([^]*?)}/g, - ); - - if (isWebGL2(gl)) { - for (let i = 0; i < uniformBlocks.length; i++) { - const [, blockName] = uniformBlocks[i]; - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/getUniformBlockIndex - const blockIdx = gl.getUniformBlockIndex(prog, blockName); - if (blockIdx !== -1 && blockIdx !== 0xffffffff) { - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformBlockBinding - gl.uniformBlockBinding(prog, blockIdx, i); - } - } - } - - const samplers = findall( - deviceProgram.vertex.glsl, - /^uniform .*sampler\S+ (\w+);\s* \/\/ BINDING=(\d+)$/gm, - ); - for (let i = 0; i < samplers.length; i++) { - const [, name, location] = samplers[i]; - const samplerUniformLocation = gl.getUniformLocation(prog, name); - gl.uniform1i(samplerUniformLocation, parseInt(location)); - } - - program.compileState = ProgramCompileState_GL.ReadyToUse; - } - } - - setVertexInput( - inputLayout_: InputLayout | null, - vertexBuffers: (VertexBufferDescriptor | null)[] | null, - indexBuffer: IndexBufferDescriptor | null, - ): void { - if (inputLayout_ !== null) { - assert(this.currentPipeline.inputLayout === inputLayout_); - const inputLayout = inputLayout_ as InputLayout_GL; - - this.bindVAO(inputLayout.vao); - - const gl = this.gl; - for (let i = 0; i < inputLayout.vertexAttributeDescriptors.length; i++) { - const attr = inputLayout.vertexAttributeDescriptors[i]; - - // find location by name in WebGL1 - const location = isWebGL2(gl) - ? attr.location - : inputLayout.program.attributes[attr.location]?.location; - - if (!isNil(location)) { - const vertexBuffer = vertexBuffers![attr.bufferIndex]; - - if (vertexBuffer === null) continue; - - const format = inputLayout.vertexBufferFormats[i]; - - gl.bindBuffer( - gl.ARRAY_BUFFER, - getPlatformBuffer(vertexBuffer.buffer), - ); - - const bufferOffset = - (vertexBuffer.byteOffset || 0) + attr.bufferByteOffset; - - const inputLayoutBuffer = - inputLayout.vertexBufferDescriptors[attr.bufferIndex]!; - gl.vertexAttribPointer( - location, - format.size, - format.type, - format.normalized, - inputLayoutBuffer.byteStride, - bufferOffset, - ); - } - } - - assert( - (indexBuffer !== null) === (inputLayout.indexBufferFormat !== null), - ); - if (indexBuffer !== null) { - const buffer = indexBuffer.buffer as Buffer_GL; - assert(buffer.usage === BufferUsage.INDEX); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, getPlatformBuffer(buffer)); - this.currentIndexBufferByteOffset = indexBuffer.byteOffset; - } else { - this.currentIndexBufferByteOffset = null; - } - } else { - assert(this.currentPipeline.inputLayout === null); - assert(indexBuffer === null); - this.bindVAO(null); - this.currentIndexBufferByteOffset = 0; - } - } - - setStencilRef(value: number): void { - if (this.currentStencilRef === value) { - return; - } - this.currentStencilRef = value; - this.applyStencil(); - } - - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpurendercommandsmixin-draw - */ - draw( - vertexCount: number, - instanceCount?: number, - firstVertex?: number, - firstInstance?: number, - ) { - const gl = this.gl; - const pipeline = this.currentPipeline; - if (instanceCount) { - const params: [number, number, number, number] = [ - pipeline.drawMode, - firstVertex || 0, - vertexCount, - instanceCount, - ]; - if (isWebGL2(gl)) { - gl.drawArraysInstanced(...params); - } else { - this.ANGLE_instanced_arrays.drawArraysInstancedANGLE(...params); - } - } else { - gl.drawArrays(pipeline.drawMode, firstVertex, vertexCount); - } - - this.debugGroupStatisticsDrawCall(); - this.debugGroupStatisticsTriangles( - (vertexCount / 3) * Math.max(instanceCount, 1), - ); - } - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpurendercommandsmixin-drawindexed - */ - drawIndexed( - indexCount: number, - instanceCount?: number, - firstIndex?: number, - baseVertex?: number, - firstInstance?: number, - ) { - const gl = this.gl; - const pipeline = this.currentPipeline, - inputLayout = assertExists(pipeline.inputLayout); - const byteOffset = - assertExists(this.currentIndexBufferByteOffset) + - firstIndex * inputLayout.indexBufferCompByteSize!; - if (instanceCount) { - const params: [number, number, number, number, number] = [ - pipeline.drawMode, - indexCount, - inputLayout.indexBufferType!, - byteOffset, - instanceCount, - ]; - if (isWebGL2(gl)) { - gl.drawElementsInstanced(...params); - } else { - this.ANGLE_instanced_arrays.drawElementsInstancedANGLE(...params); - } - } else { - gl.drawElements( - pipeline.drawMode, - indexCount, - inputLayout.indexBufferType!, - byteOffset, - ); - } - - this.debugGroupStatisticsDrawCall(); - this.debugGroupStatisticsTriangles( - (indexCount / 3) * Math.max(instanceCount, 1), - ); - } - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpurendercommandsmixin-drawindirect - */ - drawIndirect(indirectBuffer: Buffer, indirectOffset: number) { - // TODO - } - - beginOcclusionQuery(dstOffs: number): void { - const gl = this.gl; - if (isWebGL2(gl)) { - const queryPool = this.currentRenderPassDescriptor - .occlusionQueryPool as QueryPool_GL; - gl.beginQuery(queryPool.gl_query_type, queryPool.gl_query[dstOffs]); - } - } - - endOcclusionQuery(dstOffs: number): void { - const gl = this.gl; - if (isWebGL2(gl)) { - const queryPool = this.currentRenderPassDescriptor! - .occlusionQueryPool as QueryPool_GL; - gl.endQuery(queryPool.gl_query_type); - } - } - - pipelineQueryReady(o: RenderPipeline): boolean { - const pipeline = o as RenderPipeline_GL; - return this.queryProgramReady(pipeline.program); - } - - pipelineForceReady(o: RenderPipeline): void { - // No need to do anything; it will be forced to compile when used naturally. - } - - private endPass(): void { - const gl = this.gl; - - let didUnbindDraw = false; - - for (let i = 0; i < this.currentColorAttachments.length; i++) { - const colorResolveFrom = this.currentColorAttachments[i]; - - if (colorResolveFrom !== null) { - const colorResolveTo = this.currentColorResolveTos[i]; - let didBindRead = false; - - if (colorResolveTo !== null) { - assert( - colorResolveFrom.width === colorResolveTo.width && - colorResolveFrom.height === colorResolveTo.height, - ); - assert(colorResolveFrom.pixelFormat === colorResolveTo.pixelFormat); - - this.setScissorEnabled(false); - if (isWebGL2(gl)) { - gl.bindFramebuffer( - gl.READ_FRAMEBUFFER, - this.resolveColorReadFramebuffer, - ); - } - if (this.resolveColorAttachmentsChanged) { - if (isWebGL2(gl)) { - this.bindFramebufferAttachment( - gl.READ_FRAMEBUFFER, - gl.COLOR_ATTACHMENT0, - colorResolveFrom, - this.currentColorAttachmentLevels[i], - ); - } - } - didBindRead = true; - - // Special case: Blitting to the on-screen. - if (colorResolveTo === this.scTexture) { - gl.bindFramebuffer( - isWebGL2(gl) ? GL.DRAW_FRAMEBUFFER : GL.FRAMEBUFFER, - this.scPlatformFramebuffer, - ); - } else { - gl.bindFramebuffer( - isWebGL2(gl) ? GL.DRAW_FRAMEBUFFER : GL.FRAMEBUFFER, - this.resolveColorDrawFramebuffer, - ); - if (this.resolveColorAttachmentsChanged) - gl.framebufferTexture2D( - isWebGL2(gl) ? GL.DRAW_FRAMEBUFFER : GL.FRAMEBUFFER, - gl.COLOR_ATTACHMENT0, - gl.TEXTURE_2D, - colorResolveTo.gl_texture, - this.currentColorResolveToLevels[i], - ); - } - - if (isWebGL2(gl)) { - gl.blitFramebuffer( - 0, - 0, - colorResolveFrom.width, - colorResolveFrom.height, - 0, - 0, - colorResolveTo.width, - colorResolveTo.height, - gl.COLOR_BUFFER_BIT, - gl.LINEAR, - ); - gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null); - } else { - // need an extra render pass in WebGL1 - this.submitBlitRenderPass(colorResolveFrom, colorResolveTo); - } - didUnbindDraw = true; - } - - if (!this.currentRenderPassDescriptor.colorStore[i]) { - if (!didBindRead) { - gl.bindFramebuffer( - isWebGL2(gl) ? GL.READ_FRAMEBUFFER : GL.FRAMEBUFFER, - this.resolveColorReadFramebuffer, - ); - if (this.resolveColorAttachmentsChanged) - this.bindFramebufferAttachment( - isWebGL2(gl) ? GL.READ_FRAMEBUFFER : GL.FRAMEBUFFER, - gl.COLOR_ATTACHMENT0, - colorResolveFrom, - this.currentColorAttachmentLevels[i], - ); - } - - if (isWebGL2(gl)) { - gl.invalidateFramebuffer(gl.READ_FRAMEBUFFER, [ - gl.COLOR_ATTACHMENT0, - ]); - } - } - - gl.bindFramebuffer( - isWebGL2(gl) ? GL.READ_FRAMEBUFFER : GL.FRAMEBUFFER, - null, - ); - } - } - - this.resolveColorAttachmentsChanged = false; - - const depthStencilResolveFrom = this.currentDepthStencilAttachment; - if (depthStencilResolveFrom) { - const depthStencilResolveTo = this.currentDepthStencilResolveTo; - let didBindRead = false; - - if (depthStencilResolveTo) { - assert( - depthStencilResolveFrom.width === depthStencilResolveTo.width && - depthStencilResolveFrom.height === depthStencilResolveTo.height, - ); - - this.setScissorEnabled(false); - - gl.bindFramebuffer( - isWebGL2(gl) ? GL.READ_FRAMEBUFFER : GL.FRAMEBUFFER, - this.resolveDepthStencilReadFramebuffer, - ); - gl.bindFramebuffer( - isWebGL2(gl) ? GL.DRAW_FRAMEBUFFER : GL.FRAMEBUFFER, - this.resolveDepthStencilDrawFramebuffer, - ); - if (this.resolveDepthStencilAttachmentsChanged) { - this.bindFramebufferDepthStencilAttachment( - isWebGL2(gl) ? GL.READ_FRAMEBUFFER : GL.FRAMEBUFFER, - depthStencilResolveFrom, - ); - this.bindFramebufferDepthStencilAttachment( - isWebGL2(gl) ? GL.DRAW_FRAMEBUFFER : GL.FRAMEBUFFER, - depthStencilResolveTo, - ); - } - didBindRead = true; - - if (isWebGL2(gl)) { - gl.blitFramebuffer( - 0, - 0, - depthStencilResolveFrom.width, - depthStencilResolveFrom.height, - 0, - 0, - depthStencilResolveTo.width, - depthStencilResolveTo.height, - gl.DEPTH_BUFFER_BIT, - gl.NEAREST, - ); - } else { - } - gl.bindFramebuffer( - isWebGL2(gl) ? GL.DRAW_FRAMEBUFFER : GL.FRAMEBUFFER, - null, - ); - didUnbindDraw = true; - } - - if (!this.currentRenderPassDescriptor!.depthStencilStore) { - if (!didBindRead) { - gl.bindFramebuffer( - isWebGL2(gl) ? GL.READ_FRAMEBUFFER : GL.FRAMEBUFFER, - this.resolveDepthStencilReadFramebuffer, - ); - if (this.resolveDepthStencilAttachmentsChanged) - this.bindFramebufferDepthStencilAttachment( - isWebGL2(gl) ? GL.READ_FRAMEBUFFER : GL.FRAMEBUFFER, - depthStencilResolveFrom, - ); - didBindRead = true; - } - - if (isWebGL2(gl)) { - gl.invalidateFramebuffer(gl.READ_FRAMEBUFFER, [ - gl.DEPTH_STENCIL_ATTACHMENT, - ]); - } - } - - if (didBindRead) - gl.bindFramebuffer( - isWebGL2(gl) ? GL.READ_FRAMEBUFFER : GL.FRAMEBUFFER, - null, - ); - - this.resolveDepthStencilAttachmentsChanged = false; - } - - if (!didUnbindDraw) { - // If we did not unbind from a resolve, then we need to unbind our render pass draw FBO here. - gl.bindFramebuffer( - isWebGL2(gl) ? GL.DRAW_FRAMEBUFFER : GL.FRAMEBUFFER, - null, - ); - } - } - - private setScissorEnabled(v: boolean): void { - if (this.currentScissorEnabled === v) { - return; - } - - const gl = this.gl; - if (v) { - gl.enable(gl.SCISSOR_TEST); - } else { - gl.disable(gl.SCISSOR_TEST); - } - this.currentScissorEnabled = v; - } - - private applyStencil(): void { - if (isNil(this.currentStencilRef)) { - return; - } - this.gl.stencilFunc( - this.currentMegaState.stencilCompare, - this.currentStencilRef, - 0xff, - ); - } - - private getFallbackTexture( - samplerEntry: BindingLayoutSamplerDescriptor_GL, - ): WebGLTexture { - const gl_target = samplerEntry.gl_target, - formatKind = samplerEntry.formatKind; - if (gl_target === GL.TEXTURE_2D) - return formatKind === SamplerFormatKind.Depth - ? this.fallbackTexture2DDepth - : this.fallbackTexture2D; - else if (gl_target === GL.TEXTURE_2D_ARRAY) - return this.fallbackTexture2DArray; - else if (gl_target === GL.TEXTURE_3D) return this.fallbackTexture3D; - else if (gl_target === GL.TEXTURE_CUBE_MAP) return this.fallbackTextureCube; - else throw new Error('whoops'); - } - - private submitBlitRenderPass( - resolveFrom: RenderTarget_GL, - resolveTo: Texture_GL, - ) { - if (!this.blitRenderPipeline) { - const program = new CopyProgram(); - this.blitProgram = this.createProgram({ - vertex: { - glsl: program.vert, - }, - fragment: { - glsl: program.frag, - }, - }); - this.blitVertexBuffer = makeDataBuffer( - this, - BufferUsage.VERTEX | BufferUsage.COPY_DST, - new Float32Array([-4, -4, 4, -4, 0, 4]).buffer, - ); - this.blitInputLayout = this.createInputLayout({ - vertexBufferDescriptors: [ - { byteStride: 4 * 2, stepMode: VertexStepMode.VERTEX }, - ], - vertexAttributeDescriptors: [ - { - format: Format.F32_RG, - bufferIndex: 0, - bufferByteOffset: 4 * 0, - location: 0, - }, - ], - indexBufferFormat: null, - program: this.blitProgram, - }); - const bindingLayouts: BindingLayoutDescriptor[] = [ - { numSamplers: 1, numUniformBuffers: 0 }, - ]; - this.blitRenderPipeline = this.createRenderPipeline({ - topology: PrimitiveTopology.TRIANGLES, - sampleCount: 1, - program: this.blitProgram, - bindingLayouts, - colorAttachmentFormats: [Format.U8_RGBA_RT], - depthStencilAttachmentFormat: null, - inputLayout: this.blitInputLayout, - megaStateDescriptor: copyMegaState(defaultMegaState), - }); - - this.blitBindings = this.createBindings({ - bindingLayout: bindingLayouts[0], - samplerBindings: [ - { - sampler: null, - texture: resolveFrom.texture, - }, - ], - uniformBufferBindings: [], - }); - - this.blitProgram.setUniformsLegacy({ - u_Texture: resolveFrom, - }); - } - - // save currentRenderPassDescriptor since we're already in a render pass - const currentRenderPassDescriptor = this.currentRenderPassDescriptor; - this.currentRenderPassDescriptor = null; - - this.inBlitRenderPass = true; - - const blitRenderPass = this.createRenderPass({ - colorAttachment: [resolveFrom], - colorResolveTo: [resolveTo], - colorClearColor: [TransparentWhite], - }); - - const { width, height } = this.getCanvas() as HTMLCanvasElement; - blitRenderPass.setPipeline(this.blitRenderPipeline); - blitRenderPass.setBindings(0, this.blitBindings, [0]); - blitRenderPass.setVertexInput( - this.blitInputLayout, - [{ buffer: this.blitVertexBuffer }], - null, - ); - blitRenderPass.setViewport(0, 0, width, height); - - // disable blending for blit - this.gl.disable(this.gl.BLEND); - blitRenderPass.draw(3, 0); - this.gl.enable(this.gl.BLEND); - - // restore - this.currentRenderPassDescriptor = currentRenderPassDescriptor; - this.inBlitRenderPass = false; - } -} diff --git a/packages/g-plugin-webgl-device/src/platform/InputLayout.ts b/packages/g-plugin-webgl-device/src/platform/InputLayout.ts deleted file mode 100644 index c4e2f7905..000000000 --- a/packages/g-plugin-webgl-device/src/platform/InputLayout.ts +++ /dev/null @@ -1,160 +0,0 @@ -import { - Format, - ResourceType, - VertexStepMode, - assert, - assertExists, - getFormatCompByteSize, -} from '@antv/g-plugin-device-renderer'; -import type { - InputLayout, - InputLayoutBufferDescriptor, - InputLayoutDescriptor, - VertexAttributeDescriptor, -} from '@antv/g-plugin-device-renderer'; -import { isNil } from '@antv/util'; -import type { Device_GL } from './Device'; -import { ResourceBase_GL } from './ResourceBase'; -import { - getPlatformBuffer, - isFormatSizedInteger, - isWebGL2, - translateIndexFormat, - translateVertexFormat, -} from './utils'; -import { Program_GL } from './Program'; - -export class InputLayout_GL extends ResourceBase_GL implements InputLayout { - type: ResourceType.InputLayout = ResourceType.InputLayout; - - vertexAttributeDescriptors: VertexAttributeDescriptor[]; - vertexBufferDescriptors: (InputLayoutBufferDescriptor | null)[]; - vertexBufferFormats: ReturnType[]; - indexBufferFormat: Format | null; - indexBufferType: GLenum | null; - indexBufferCompByteSize: number | null; - vao: WebGLVertexArrayObject; - program: Program_GL; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: Device_GL; - descriptor: InputLayoutDescriptor; - }) { - super({ id, device }); - - const { - vertexAttributeDescriptors, - vertexBufferDescriptors, - indexBufferFormat, - program, - } = descriptor; - assert( - indexBufferFormat === Format.U16_R || - indexBufferFormat === Format.U32_R || - indexBufferFormat === null, - ); - const indexBufferType = - indexBufferFormat !== null - ? translateIndexFormat(indexBufferFormat) - : null; - const indexBufferCompByteSize = - indexBufferFormat !== null - ? getFormatCompByteSize(indexBufferFormat) - : null; - - const gl = this.device.gl; - const vao = this.device.ensureResourceExists( - isWebGL2(gl) - ? gl.createVertexArray() - : device.OES_vertex_array_object.createVertexArrayOES(), - ); - if (isWebGL2(gl)) { - gl.bindVertexArray(vao); - } else { - device.OES_vertex_array_object.bindVertexArrayOES(vao); - } - - gl.bindBuffer( - gl.ARRAY_BUFFER, - getPlatformBuffer(this.device['fallbackVertexBuffer']), - ); - - const vertexBufferFormats = []; - for (let i = 0; i < vertexAttributeDescriptors.length; i++) { - const attr = vertexAttributeDescriptors[i]; - - const { format, divisor = 1, bufferIndex } = attr; - // find location by name in WebGL1 - const location = isWebGL2(gl) - ? attr.location - : (program as Program_GL).attributes[attr.location]?.location; - - const vertexFormat = translateVertexFormat(format); - vertexBufferFormats.push(vertexFormat); - - if (!isNil(location)) { - if (isFormatSizedInteger(format)) { - // See https://groups.google.com/d/msg/angleproject/yQb5DaCzcWg/Ova0E3wcAQAJ for more info. - // console.warn("Vertex format uses sized integer types; this will cause a shader recompile on ANGLE platforms"); - // debugger; - } - - const { size, type, normalized } = vertexFormat; - - const inputLayoutBuffer = assertExists( - vertexBufferDescriptors[bufferIndex], - ); - - gl.vertexAttribPointer(location, size, type, normalized, 0, 0); - - if (inputLayoutBuffer.stepMode === VertexStepMode.INSTANCE) { - if (isWebGL2(gl)) { - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/vertexAttribDivisor - gl.vertexAttribDivisor(location, divisor); - } else { - device.ANGLE_instanced_arrays.vertexAttribDivisorANGLE( - location, - divisor, - ); - } - } - - gl.enableVertexAttribArray(location); - } - } - - if (isWebGL2(gl)) { - gl.bindVertexArray(null); - } else { - device.OES_vertex_array_object.bindVertexArrayOES(null); - } - - this.vertexAttributeDescriptors = vertexAttributeDescriptors; - this.vertexBufferDescriptors = vertexBufferDescriptors; - this.vao = vao; - this.vertexBufferFormats = vertexBufferFormats; - this.indexBufferFormat = indexBufferFormat; - this.indexBufferType = indexBufferType; - this.indexBufferCompByteSize = indexBufferCompByteSize; - this.program = program as Program_GL; - } - - destroy() { - super.destroy(); - if (this.device['currentBoundVAO'] === this.vao) { - if (isWebGL2(this.device.gl)) { - this.device.gl.bindVertexArray(null); - this.device.gl.deleteVertexArray(this.vao); - } else { - this.device.OES_vertex_array_object.bindVertexArrayOES(null); - this.device.OES_vertex_array_object.deleteVertexArrayOES(this.vao); - } - this.device['currentBoundVAO'] = null; - } - } -} diff --git a/packages/g-plugin-webgl-device/src/platform/Program.ts b/packages/g-plugin-webgl-device/src/platform/Program.ts deleted file mode 100644 index 24980546c..000000000 --- a/packages/g-plugin-webgl-device/src/platform/Program.ts +++ /dev/null @@ -1,221 +0,0 @@ -import type { - Program, - ProgramDescriptor, -} from '@antv/g-plugin-device-renderer'; -import { - assert, - getAttributeLocations, - getDefines, - getUniformSetter, - parseUniformName, - ResourceType, -} from '@antv/g-plugin-device-renderer'; -import { isNil } from '@antv/util'; -import type { Device_GL } from './Device'; -import { ResourceBase_GL } from './ResourceBase'; -import { Texture_GL } from './Texture'; -import { isWebGL2 } from './utils'; - -// const quadVert = ` -// layout(location = 0) in vec2 a_Position; - -// out vec2 v_TexCoord; - -// void main() { -// v_TexCoord = 0.5 * (a_Position + 1.0); -// gl_Position = vec4(a_Position, 0., 1.); - -// #ifdef VIEWPORT_ORIGIN_TL -// v_TexCoord.y = 1.0 - v_TexCoord.y; -// #endif -// } -// `; - -export enum ProgramCompileState_GL { - NeedsCompile, - Compiling, - NeedsBind, - ReadyToUse, -} - -export class Program_GL extends ResourceBase_GL implements Program { - type: ResourceType.Program = ResourceType.Program; - - gl_program: WebGLProgram; - gl_shader_vert: WebGLShader | null; - gl_shader_frag: WebGLShader | null; - compileState: ProgramCompileState_GL; - descriptor: ProgramDescriptor; - - uniformSetters: Record = {}; - attributes: { - name: string; - location: number; // getAttribLocation() - type: number; - size: number; - }[] = []; - - constructor( - { - id, - device, - descriptor, - }: { - id: number; - device: Device_GL; - descriptor: ProgramDescriptor; - }, - private rawVertexGLSL: string, - ) { - super({ id, device }); - - const gl = this.device.gl; - - this.descriptor = descriptor; - this.gl_program = this.device.ensureResourceExists(gl.createProgram()); - this.gl_shader_vert = null; - this.gl_shader_frag = null; - this.compileState = ProgramCompileState_GL.NeedsCompile; - - this.tryCompileProgram(); - } - - destroy() { - super.destroy(); - this.device.gl.deleteProgram(this.gl_program); - this.device.gl.deleteShader(this.gl_shader_vert); - this.device.gl.deleteShader(this.gl_shader_frag); - } - - private tryCompileProgram(): void { - assert(this.compileState === ProgramCompileState_GL.NeedsCompile); - - const descriptor = this.descriptor; - - const gl = this.device.gl; - if (this.gl_shader_vert !== null) gl.deleteShader(this.gl_shader_vert); - if (this.gl_shader_frag !== null) gl.deleteShader(this.gl_shader_frag); - - // if (descriptor.compute) { - // this.gl_shader_vert = this.compileShader( - // preprocessShader_GLSL(this.device.queryVendorInfo(), 'vert', quadVert), - // gl.VERTEX_SHADER, - // ); - // this.gl_shader_frag = this.compileShader( - // descriptor.preprocessedCompute, - // gl.FRAGMENT_SHADER, - // ); - // } else { - this.gl_shader_vert = this.compileShader( - descriptor.vertex.glsl, - gl.VERTEX_SHADER, - ); - this.gl_shader_frag = this.compileShader( - descriptor.fragment.glsl, - gl.FRAGMENT_SHADER, - ); - // } - - gl.attachShader(this.gl_program, this.gl_shader_vert); - gl.attachShader(this.gl_program, this.gl_shader_frag); - gl.linkProgram(this.gl_program); - - this.compileState = ProgramCompileState_GL.Compiling; - - if (!isWebGL2(gl)) { - // extract uniforms - this.readUniformLocationsFromLinkedProgram(); - // extract attributes - this.readAttributesFromLinkedProgram(); - } - } - - private readAttributesFromLinkedProgram() { - const gl = this.device.gl; - const count = gl.getProgramParameter(this.gl_program, gl.ACTIVE_ATTRIBUTES); - - const defines = getDefines(this.descriptor.vertex.glsl); - const locations = getAttributeLocations( - // Use raw GLSL - this.rawVertexGLSL, - defines, - ); - for (let index = 0; index < count; index++) { - const { name, type, size } = gl.getActiveAttrib(this.gl_program, index); - const location = gl.getAttribLocation(this.gl_program, name); - - const definedLocation = locations.find((l) => l.name === name)?.location; - // Add only user provided attributes, for built-in attributes like - // `gl_InstanceID` locaiton will be < 0 - if (location >= 0 && !isNil(definedLocation)) { - this.attributes[definedLocation] = { - name, - location, - type, - size, - }; - } - } - } - - private readUniformLocationsFromLinkedProgram() { - const gl = this.device.gl; - const numUniforms = gl.getProgramParameter( - this.gl_program, - gl.ACTIVE_UNIFORMS, - ); - - for (let i = 0; i < numUniforms; i++) { - const info = gl.getActiveUniform(this.gl_program, i); - const { name } = parseUniformName(info.name); - let location = gl.getUniformLocation(this.gl_program, name); - this.uniformSetters[name] = getUniformSetter(gl, location, info); - if (info && info.size > 1) { - for (let l = 0; l < info.size; l++) { - location = gl.getUniformLocation(this.gl_program, `${name}[${l}]`); - this.uniformSetters[`${name}[${l}]`] = getUniformSetter( - gl, - location, - info, - ); - } - } - } - } - - private compileShader(contents: string, type: GLenum): WebGLShader { - const gl = this.device.gl; - const shader: WebGLShader = this.device.ensureResourceExists( - gl.createShader(type), - ); - gl.shaderSource(shader, contents); - gl.compileShader(shader); - return shader; - } - - setUniformsLegacy(uniforms: Record = {}) { - const gl = this.device.gl; - - if (!isWebGL2(gl)) { - let programUsed = false; - for (const uniformName in uniforms) { - if (!programUsed) { - gl.useProgram(this.gl_program); - programUsed = true; - } - - const uniform = uniforms[uniformName]; - const uniformSetter = this.uniformSetters[uniformName]; - if (uniformSetter) { - let value = uniform; - if (value instanceof Texture_GL) { - value = value.textureIndex; - } - uniformSetter(value); - } - } - } - - return this; - } -} diff --git a/packages/g-plugin-webgl-device/src/platform/QueryPool.ts b/packages/g-plugin-webgl-device/src/platform/QueryPool.ts deleted file mode 100644 index 349c6cd69..000000000 --- a/packages/g-plugin-webgl-device/src/platform/QueryPool.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type { QueryPool, QueryPoolType } from '@antv/g-plugin-device-renderer'; -import { ResourceType, nArray } from '@antv/g-plugin-device-renderer'; -import type { Device_GL } from './Device'; -import { ResourceBase_GL } from './ResourceBase'; -import { isWebGL2, translateQueryPoolType } from './utils'; - -export class QueryPool_GL extends ResourceBase_GL implements QueryPool { - type: ResourceType.QueryPool = ResourceType.QueryPool; - - gl_query_type: number; - gl_query: WebGLQuery[]; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: Device_GL; - descriptor: { - elemCount: number; - type: QueryPoolType; - }; - }) { - super({ id, device }); - - const gl = this.device.gl; - - if (isWebGL2(gl)) { - const { elemCount, type } = descriptor; - this.gl_query = nArray(elemCount, () => this.device.ensureResourceExists(gl.createQuery())); - this.gl_query_type = translateQueryPoolType(type); - } - } - - queryResultOcclusion(dstOffs: number): boolean | null { - const gl = this.device.gl; - if (isWebGL2(gl)) { - const gl_query = this.gl_query[dstOffs]; - - if (!gl.getQueryParameter(gl_query, gl.QUERY_RESULT_AVAILABLE)) { - return null; - } - return !!gl.getQueryParameter(gl_query, gl.QUERY_RESULT); - } - return null; - } - - destroy() { - super.destroy(); - const gl = this.device.gl; - if (isWebGL2(gl)) { - for (let i = 0; i < this.gl_query.length; i++) { - gl.deleteQuery(this.gl_query[i]); - } - } - } -} diff --git a/packages/g-plugin-webgl-device/src/platform/Readback.ts b/packages/g-plugin-webgl-device/src/platform/Readback.ts deleted file mode 100644 index ea19d6308..000000000 --- a/packages/g-plugin-webgl-device/src/platform/Readback.ts +++ /dev/null @@ -1,220 +0,0 @@ -import { - Buffer, - Readback, - Texture, - getFormatByteSize, -} from '@antv/g-plugin-device-renderer'; -import { GL, ResourceType } from '@antv/g-plugin-device-renderer'; -import { clamp } from '@antv/util'; -import type { Device_GL } from './Device'; -import { ResourceBase_GL } from './ResourceBase'; -import type { Texture_GL } from './Texture'; -import { getPlatformBuffer, isWebGL2 } from './utils'; - -export class Readback_GL extends ResourceBase_GL implements Readback { - type: ResourceType.Readback = ResourceType.Readback; - - gl_pbo: WebGLBuffer | null = null; - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLSync - gl_sync: WebGLSync | null = null; - - constructor({ id, device }: { id: number; device: Device_GL }) { - super({ id, device }); - } - - private clientWaitAsync( - sync: WebGLSync, - flags = 0, - interval_ms = 10, - ): Promise { - const gl = this.device.gl as WebGL2RenderingContext; - return new Promise((resolve, reject) => { - function test() { - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clientWaitSync - const res = gl.clientWaitSync(sync, flags, 0); - if (res == gl.WAIT_FAILED) { - reject(); - return; - } - if (res == gl.TIMEOUT_EXPIRED) { - setTimeout( - test, - clamp(interval_ms, 0, gl.MAX_CLIENT_WAIT_TIMEOUT_WEBGL), - ); - return; - } - resolve(); - } - test(); - }); - } - - private async getBufferSubDataAsync( - target: number, - buffer: WebGLBuffer, - srcByteOffset: number, - dstBuffer: ArrayBufferView, - dstOffset = 0, - length = dstBuffer.byteLength || 0, - ) { - const gl = this.device.gl; - if (isWebGL2(gl)) { - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/fenceSync - this.gl_sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0); - gl.flush(); - - await this.clientWaitAsync(this.gl_sync, 0, 10); - - gl.bindBuffer(target, buffer); - gl.getBufferSubData(target, srcByteOffset, dstBuffer, dstOffset, length); - gl.bindBuffer(target, null); - - return dstBuffer; - } - } - - /** - * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#use_non-blocking_async_data_readback - */ - async readTexture( - t: Texture, - x: number, - y: number, - width: number, - height: number, - dstBuffer: ArrayBufferView, - dstOffset = 0, - length = dstBuffer.byteLength || 0, - ): Promise { - const gl = this.device.gl; - - const texture = t as Texture_GL; - const gl_format = this.device.translateTextureFormat(texture.pixelFormat); - const gl_type = this.device.translateTextureType(texture.pixelFormat); - const formatByteSize = getFormatByteSize(texture.pixelFormat); - - if (isWebGL2(gl)) { - this.gl_pbo = this.device.ensureResourceExists(gl.createBuffer()); - // PIXEL_PACK_BUFFER: Buffer used for pixel transfer operations - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindBuffer - gl.bindBuffer(gl.PIXEL_PACK_BUFFER, this.gl_pbo); - // STREAM_READ: The contents are intended to be specified once by reading data from WebGL, and queried at most a few times by the application - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData - gl.bufferData(gl.PIXEL_PACK_BUFFER, length, gl.STREAM_READ); - gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null); - - gl.bindFramebuffer( - GL.READ_FRAMEBUFFER, - this.device['readbackFramebuffer'], - ); - gl.framebufferTexture2D( - GL.READ_FRAMEBUFFER, - GL.COLOR_ATTACHMENT0, - GL.TEXTURE_2D, - texture.gl_texture, - 0, - ); - - gl.bindBuffer(gl.PIXEL_PACK_BUFFER, this.gl_pbo); - gl.readPixels( - x, - y, - width, - height, - gl_format, - gl_type, - dstOffset * formatByteSize, - ); - gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null); - - return this.getBufferSubDataAsync( - gl.PIXEL_PACK_BUFFER, - this.gl_pbo, - 0, - dstBuffer, - dstOffset, - length, - ); - } else { - gl.bindFramebuffer(GL.FRAMEBUFFER, this.device['readbackFramebuffer']); - gl.framebufferTexture2D( - GL.FRAMEBUFFER, - GL.COLOR_ATTACHMENT0, - GL.TEXTURE_2D, - texture.gl_texture, - 0, - ); - // slow requires roundtrip to GPU - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/pixelStorei - gl.pixelStorei(gl.PACK_ALIGNMENT, 4); - gl.readPixels(x, y, width, height, gl.RGBA, gl_type, dstBuffer); - return dstBuffer; - } - } - - readTextureSync( - t: Texture, - x: number, - y: number, - width: number, - height: number, - dstBuffer: ArrayBufferView, - dstOffset = 0, - length = dstBuffer.byteLength || 0, - ): ArrayBufferView { - const gl = this.device.gl; - - const texture = t as Texture_GL; - const gl_type = this.device.translateTextureType(texture.pixelFormat); - - gl.bindFramebuffer(GL.FRAMEBUFFER, this.device['readbackFramebuffer']); - gl.framebufferTexture2D( - GL.FRAMEBUFFER, - GL.COLOR_ATTACHMENT0, - GL.TEXTURE_2D, - texture.gl_texture, - 0, - ); - // slow requires roundtrip to GPU - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/pixelStorei - gl.pixelStorei(gl.PACK_ALIGNMENT, 4); - gl.readPixels(x, y, width, height, gl.RGBA, gl_type, dstBuffer); - return dstBuffer; - } - - async readBuffer( - b: Buffer, - srcByteOffset: number, - dstBuffer: ArrayBufferView, - dstOffset?: number, - length?: number, - ): Promise { - const gl = this.device.gl; - if (isWebGL2(gl)) { - return this.getBufferSubDataAsync( - gl.ARRAY_BUFFER, - getPlatformBuffer(b, srcByteOffset), - srcByteOffset, - dstBuffer, - dstOffset, - length, - ); - } - - // TODO: WebGL1 - return Promise.reject(); - } - - destroy() { - super.destroy(); - if (isWebGL2(this.device.gl)) { - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/deleteSync - if (this.gl_sync !== null) { - this.device.gl.deleteSync(this.gl_sync); - } - if (this.gl_pbo !== null) { - this.device.gl.deleteBuffer(this.gl_pbo); - } - } - } -} diff --git a/packages/g-plugin-webgl-device/src/platform/RenderPipeline.ts b/packages/g-plugin-webgl-device/src/platform/RenderPipeline.ts deleted file mode 100644 index 3403493fb..000000000 --- a/packages/g-plugin-webgl-device/src/platform/RenderPipeline.ts +++ /dev/null @@ -1,126 +0,0 @@ -import type { - Format, - BindingLayoutDescriptor, - MegaStateDescriptor, - RenderPipeline, - RenderPipelineDescriptor, -} from '@antv/g-plugin-device-renderer'; -import { - defaultBindingLayoutSamplerDescriptor, - ResourceType, - assert, - PrimitiveTopology, - defaultMegaState, - copyMegaState, -} from '@antv/g-plugin-device-renderer'; -import type { Device_GL } from './Device'; -import type { InputLayout_GL } from './InputLayout'; -import type { BindingLayoutSamplerDescriptor_GL } from './interfaces'; -import type { Program_GL } from './Program'; -import { ResourceBase_GL } from './ResourceBase'; -import { translatePrimitiveTopology, translateTextureDimension } from './utils'; - -export interface BindingLayoutTable_GL { - firstUniformBuffer: number; - numUniformBuffers: number; - firstSampler: number; - numSamplers: number; - samplerEntries: BindingLayoutSamplerDescriptor_GL[]; -} - -export interface BindingLayouts_GL { - numSamplers: number; - numUniformBuffers: number; - bindingLayoutTables: BindingLayoutTable_GL[]; -} - -export class RenderPipeline_GL - extends ResourceBase_GL - implements RenderPipeline -{ - type: ResourceType.RenderPipeline = ResourceType.RenderPipeline; - - bindingLayouts: BindingLayouts_GL; - program: Program_GL; - drawMode: GLenum; - megaState: MegaStateDescriptor; - inputLayout: InputLayout_GL | null; - - // Attachment data. - colorAttachmentFormats: (Format | null)[]; - depthStencilAttachmentFormat: Format | null; - sampleCount: number; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: Device_GL; - descriptor: RenderPipelineDescriptor; - }) { - super({ id, device }); - - this.bindingLayouts = this.createBindingLayouts(descriptor.bindingLayouts); - this.drawMode = translatePrimitiveTopology( - descriptor.topology ?? PrimitiveTopology.TRIANGLES, - ); - this.program = descriptor.program as Program_GL; - this.inputLayout = descriptor.inputLayout as InputLayout_GL | null; - - this.megaState = { - ...copyMegaState(defaultMegaState), - ...descriptor.megaStateDescriptor, - }; - - this.colorAttachmentFormats = descriptor.colorAttachmentFormats.slice(); - this.depthStencilAttachmentFormat = descriptor.depthStencilAttachmentFormat; - this.sampleCount = descriptor.sampleCount ?? 1; - } - - private createBindingLayouts( - bindingLayouts: BindingLayoutDescriptor[] = [], - ): BindingLayouts_GL { - let firstUniformBuffer = 0; - let firstSampler = 0; - const bindingLayoutTables: BindingLayoutTable_GL[] = []; - for (let i = 0; i < bindingLayouts.length; i++) { - const { numUniformBuffers, numSamplers, samplerEntries } = - bindingLayouts[i]; - - const bindingSamplerEntries: BindingLayoutSamplerDescriptor_GL[] = []; - - if (samplerEntries !== undefined) { - assert(samplerEntries.length === numSamplers); - } - - for (let j = 0; j < numSamplers; j++) { - const samplerEntry = - samplerEntries !== undefined - ? samplerEntries[j] - : defaultBindingLayoutSamplerDescriptor; - const { dimension, formatKind } = samplerEntry; - bindingSamplerEntries.push({ - gl_target: translateTextureDimension(dimension), - formatKind, - }); - } - - bindingLayoutTables.push({ - firstUniformBuffer, - numUniformBuffers, - firstSampler, - numSamplers, - samplerEntries: bindingSamplerEntries, - }); - firstUniformBuffer += numUniformBuffers; - firstSampler += numSamplers; - } - return { - numUniformBuffers: firstUniformBuffer, - numSamplers: firstSampler, - bindingLayoutTables, - }; - } -} diff --git a/packages/g-plugin-webgl-device/src/platform/RenderTarget.ts b/packages/g-plugin-webgl-device/src/platform/RenderTarget.ts deleted file mode 100644 index f0bc76902..000000000 --- a/packages/g-plugin-webgl-device/src/platform/RenderTarget.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { GL, ResourceType } from '@antv/g-plugin-device-renderer'; -import { - Format, - RenderTarget, - RenderTargetDescriptor, - Texture, -} from '@antv/g-plugin-device-renderer'; -import type { Device_GL } from './Device'; -import { ResourceBase_GL } from './ResourceBase'; -import { isWebGL2 } from './utils'; - -export class RenderTarget_GL extends ResourceBase_GL implements RenderTarget { - type: ResourceType.RenderTarget = ResourceType.RenderTarget; - gl_renderbuffer: WebGLRenderbuffer | null = null; - texture: Texture | null = null; - pixelFormat: Format; - width: number; - height: number; - sampleCount: number; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: Device_GL; - descriptor: RenderTargetDescriptor; - }) { - super({ id, device }); - - const gl = this.device.gl; - - const { pixelFormat, width, height, sampleCount = 1, texture } = descriptor; - - let useRenderbuffer = false; - // @see https://blog.tojicode.com/2012/07/using-webgldepthtexture.html - if ( - (pixelFormat === Format.D32F || pixelFormat === Format.D24_S8) && - texture && - !isWebGL2(gl) && - !device.WEBGL_depth_texture - ) { - texture.destroy(); - this.texture = null; - useRenderbuffer = true; - } - - if (!useRenderbuffer && texture) { - this.texture = texture; - } else { - this.gl_renderbuffer = this.device.ensureResourceExists( - gl.createRenderbuffer(), - ); - gl.bindRenderbuffer(gl.RENDERBUFFER, this.gl_renderbuffer); - - const gl_format = this.device.translateTextureInternalFormat( - pixelFormat, - true, - ); - - if (isWebGL2(gl)) { - // @see https://github.com/shrekshao/MoveWebGL1EngineToWebGL2/blob/master/Move-a-WebGL-1-Engine-To-WebGL-2-Blog-2.md#multisampled-renderbuffers - gl.renderbufferStorageMultisample( - GL.RENDERBUFFER, - sampleCount, - gl_format, - width, - height, - ); - } else { - // WebGL1 can only use FXAA or other post-processing methods - gl.renderbufferStorage(GL.RENDERBUFFER, gl_format, width, height); - } - } - this.pixelFormat = pixelFormat; - this.width = width; - this.height = height; - this.sampleCount = sampleCount; - } - - destroy() { - super.destroy(); - if (this.gl_renderbuffer !== null) { - this.device.gl.deleteRenderbuffer(this.gl_renderbuffer); - } - if (this.texture) { - this.texture.destroy(); - } - } -} diff --git a/packages/g-plugin-webgl-device/src/platform/ResourceBase.ts b/packages/g-plugin-webgl-device/src/platform/ResourceBase.ts deleted file mode 100644 index 5b3926938..000000000 --- a/packages/g-plugin-webgl-device/src/platform/ResourceBase.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { - Disposable, - Resource, - ResourceBase, -} from '@antv/g-plugin-device-renderer'; -import EventEmitter from 'eventemitter3'; -import type { Device_GL } from './Device'; - -export class ResourceBase_GL - extends EventEmitter - implements ResourceBase, Disposable -{ - id: number; - - name: string; - - device: Device_GL; - - constructor({ id, device }: { id: number; device: Device_GL }) { - super(); - - this.id = id; - this.device = device; - - if (this.device['resourceCreationTracker'] !== null) { - this.device['resourceCreationTracker'].trackResourceCreated( - this as unknown as Resource, - ); - } - } - - destroy() { - if (this.device['resourceCreationTracker'] !== null) { - this.device['resourceCreationTracker'].trackResourceDestroyed( - this as unknown as Resource, - ); - } - } -} diff --git a/packages/g-plugin-webgl-device/src/platform/ResourceCreationTracker.ts b/packages/g-plugin-webgl-device/src/platform/ResourceCreationTracker.ts deleted file mode 100644 index 70ecb45eb..000000000 --- a/packages/g-plugin-webgl-device/src/platform/ResourceCreationTracker.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { Resource } from '@antv/g-plugin-device-renderer'; - -export class ResourceCreationTracker { - liveObjects = new Set(); - creationStacks = new Map(); - deletionStacks = new Map(); - - trackResourceCreated(o: Resource): void { - this.creationStacks.set(o, new Error().stack!); - this.liveObjects.add(o); - } - - trackResourceDestroyed(o: Resource): void { - if (this.deletionStacks.has(o)) - console.warn( - `Object double freed:`, - o, - `\n\nCreation stack: `, - this.creationStacks.get(o), - `\n\nDeletion stack: `, - this.deletionStacks.get(o), - `\n\nThis stack: `, - new Error().stack!, - ); - this.deletionStacks.set(o, new Error().stack!); - this.liveObjects.delete(o); - } - - checkForLeaks(): void { - for (const o of this.liveObjects.values()) - console.warn('Object leaked:', o, 'Creation stack:', this.creationStacks.get(o)); - } - - setResourceLeakCheck(o: Resource, v: boolean): void { - if (v) { - this.liveObjects.add(o); - } else { - this.liveObjects.delete(o); - } - } -} diff --git a/packages/g-plugin-webgl-device/src/platform/Sampler.ts b/packages/g-plugin-webgl-device/src/platform/Sampler.ts deleted file mode 100644 index 5ac72efc0..000000000 --- a/packages/g-plugin-webgl-device/src/platform/Sampler.ts +++ /dev/null @@ -1,183 +0,0 @@ -import { - GL, - MipFilterMode, - ResourceType, - TexFilterMode, - assert, - isPowerOfTwo, -} from '@antv/g-plugin-device-renderer'; -import type { - Sampler, - SamplerDescriptor, -} from '@antv/g-plugin-device-renderer'; -import type { Device_GL } from './Device'; -import { ResourceBase_GL } from './ResourceBase'; -import { - getPlatformSampler, - isWebGL2, - translateFilterMode, - translateWrapMode, -} from './utils'; - -/** - * In WebGL 1 texture image data and sampling information are both stored in texture objects - * @see https://github.com/shrekshao/MoveWebGL1EngineToWebGL2/blob/master/Move-a-WebGL-1-Engine-To-WebGL-2-Blog-2.md#sampler-objects - */ -export class Sampler_GL extends ResourceBase_GL implements Sampler { - type: ResourceType.Sampler = ResourceType.Sampler; - - gl_sampler: WebGLSampler; - descriptor: SamplerDescriptor; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: Device_GL; - descriptor: SamplerDescriptor; - }) { - super({ id, device }); - - const gl = this.device.gl; - - if (isWebGL2(gl)) { - const gl_sampler = this.device.ensureResourceExists(gl.createSampler()); - gl.samplerParameteri( - gl_sampler, - GL.TEXTURE_WRAP_S, - translateWrapMode(descriptor.wrapS), - ); - gl.samplerParameteri( - gl_sampler, - GL.TEXTURE_WRAP_T, - translateWrapMode(descriptor.wrapT), - ); - gl.samplerParameteri( - gl_sampler, - GL.TEXTURE_WRAP_R, - translateWrapMode(descriptor.wrapQ ?? descriptor.wrapS), - ); - gl.samplerParameteri( - gl_sampler, - GL.TEXTURE_MIN_FILTER, - translateFilterMode(descriptor.minFilter, descriptor.mipFilter), - ); - gl.samplerParameteri( - gl_sampler, - GL.TEXTURE_MAG_FILTER, - translateFilterMode(descriptor.magFilter, MipFilterMode.NO_MIP), - ); - - if (descriptor.minLOD !== undefined) { - gl.samplerParameterf(gl_sampler, GL.TEXTURE_MIN_LOD, descriptor.minLOD); - } - if (descriptor.maxLOD !== undefined) { - gl.samplerParameterf(gl_sampler, GL.TEXTURE_MAX_LOD, descriptor.maxLOD); - } - if (descriptor.compareMode !== undefined) { - gl.samplerParameteri( - gl_sampler, - gl.TEXTURE_COMPARE_MODE, - gl.COMPARE_REF_TO_TEXTURE, - ); - gl.samplerParameteri( - gl_sampler, - gl.TEXTURE_COMPARE_FUNC, - descriptor.compareMode, - ); - } - - const maxAnisotropy = descriptor.maxAnisotropy ?? 1; - if ( - maxAnisotropy > 1 && - this.device.EXT_texture_filter_anisotropic !== null - ) { - assert( - descriptor.minFilter === TexFilterMode.BILINEAR && - descriptor.magFilter === TexFilterMode.BILINEAR && - descriptor.mipFilter === MipFilterMode.LINEAR, - ); - gl.samplerParameterf( - gl_sampler, - this.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT, - maxAnisotropy, - ); - } - - this.gl_sampler = gl_sampler; - } else { - // use later in WebGL1 - this.descriptor = descriptor; - } - } - - setTextureParameters(gl_target: number, width: number, height: number): void { - const gl = this.device.gl; - const descriptor = this.descriptor; - - // @see https://developer.mozilla.org/zh-CN/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL#%E9%9D%9E2%E7%9A%84%E5%B9%82%E7%BA%B9%E7%90%86 - if (this.isNPOT(width, height)) { - gl.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MIN_FILTER, GL.LINEAR); - } else { - gl.texParameteri( - gl_target, - GL.TEXTURE_MIN_FILTER, - translateFilterMode(descriptor.minFilter, descriptor.mipFilter), - ); - } - gl.texParameteri( - GL.TEXTURE_2D, - GL.TEXTURE_WRAP_S, - translateWrapMode(descriptor.wrapS), - ); - gl.texParameteri( - GL.TEXTURE_2D, - GL.TEXTURE_WRAP_T, - translateWrapMode(descriptor.wrapT), - ); - - gl.texParameteri( - gl_target, - GL.TEXTURE_MAG_FILTER, - translateFilterMode(descriptor.magFilter, MipFilterMode.NO_MIP), - ); - - // if (descriptor.minLOD !== undefined) { - // gl.texParameterf(gl_target, GL.TEXTURE_MIN_LOD, descriptor.minLOD); - // } - // if (descriptor.maxLOD !== undefined) { - // gl.texParameterf(gl_target, GL.TEXTURE_MAX_LOD, descriptor.maxLOD); - // } - - const maxAnisotropy = descriptor.maxAnisotropy ?? 1; - if ( - maxAnisotropy > 1 && - this.device.EXT_texture_filter_anisotropic !== null - ) { - assert( - descriptor.minFilter === TexFilterMode.BILINEAR && - descriptor.magFilter === TexFilterMode.BILINEAR && - descriptor.mipFilter === MipFilterMode.LINEAR, - ); - gl.texParameteri( - gl_target, - this.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT, - maxAnisotropy, - ); - } - } - - destroy() { - super.destroy(); - - if (isWebGL2(this.device.gl)) { - this.device.gl.deleteSampler(getPlatformSampler(this)); - } - } - - isNPOT(width: number, height: number): boolean { - return !isPowerOfTwo(width) || !isPowerOfTwo(height); - } -} diff --git a/packages/g-plugin-webgl-device/src/platform/Texture.ts b/packages/g-plugin-webgl-device/src/platform/Texture.ts deleted file mode 100644 index f577d77a7..000000000 --- a/packages/g-plugin-webgl-device/src/platform/Texture.ts +++ /dev/null @@ -1,414 +0,0 @@ -import { - Format, - FormatTypeFlags, - GL, - ResourceType, - SamplerFormatKind, - Texture, - TextureDescriptor, - TextureDimension, - assert, - getFormatSamplerKind, - getFormatTypeFlags, - isPowerOfTwo, -} from '@antv/g-plugin-device-renderer'; -import type { Device_GL } from './Device'; -import { ResourceBase_GL } from './ResourceBase'; -import { - getPlatformTexture, - // isTextureFormatCompressed, - isWebGL2, -} from './utils'; - -export class Texture_GL extends ResourceBase_GL implements Texture { - type: ResourceType.Texture = ResourceType.Texture; - gl_texture: WebGLTexture; - gl_target: GLenum; - pixelFormat: Format; - width: number; - height: number; - depth: number; - numLevels: number; - immutable: boolean; - // @see https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/pixelStorei - pixelStore: Partial<{ - packAlignment: number; - unpackAlignment: number; - unpackFlipY: boolean; - }>; - mipmaps: boolean; - formatKind: SamplerFormatKind; - textureIndex: number; // used in WebGL1 - - constructor({ - id, - device, - descriptor, - fake, - }: { - id: number; - device: Device_GL; - descriptor: TextureDescriptor; - fake?: boolean; - }) { - super({ id, device }); - - // Default values. - descriptor = { - dimension: TextureDimension.TEXTURE_2D, - depth: 1, - numLevels: 1, - ...descriptor, - }; - - const gl = this.device.gl; - let gl_target: GLenum; - let gl_texture: WebGLTexture; - const numLevels = this.clampNumLevels(descriptor); - this.immutable = descriptor.immutable ?? true; - this.pixelStore = descriptor.pixelStore; - this.pixelFormat = descriptor.pixelFormat; - this.formatKind = getFormatSamplerKind(descriptor.pixelFormat); - this.width = descriptor.width; - this.height = descriptor.height; - this.depth = descriptor.depth; - this.mipmaps = numLevels >= 1; - - if (!fake) { - gl_texture = this.device.ensureResourceExists(gl.createTexture()); - const gl_type = this.device.translateTextureType(descriptor.pixelFormat); - - const internalformat = this.device.translateTextureInternalFormat( - descriptor.pixelFormat, - ); - this.device.setActiveTexture(gl.TEXTURE0); - this.device['currentTextures'][0] = null; - - this.preprocessImage(); - - if (descriptor.dimension === TextureDimension.TEXTURE_2D) { - gl_target = GL.TEXTURE_2D; - gl.bindTexture(gl_target, gl_texture); - if (this.immutable) { - if (isWebGL2(gl)) { - // texStorage2D will create an immutable texture(fixed size) - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texStorage2D - // @see https://github.com/visgl/luma.gl/issues/193 - // @see https://github.com/WebGLSamples/WebGL2Samples/blob/master/samples/texture_immutable.html - gl.texStorage2D( - gl_target, - numLevels, - internalformat, - descriptor.width, - descriptor.height, - ); - } else { - // texImage2D: level must be 0 for DEPTH_COMPONENT format - // const level = internalformat === GL.DEPTH_COMPONENT || this.isNPOT() ? 0 : numLevels; - const level = - internalformat === GL.DEPTH_COMPONENT || this.isNPOT() ? 0 : 0; - - if ( - (this.pixelFormat === Format.D32F || - this.pixelFormat === Format.D24_S8) && - !isWebGL2(gl) && - !device.WEBGL_depth_texture - ) { - } else { - // if (!isWebGL2(gl)) { - // if (internalformat === GL.RGBA4) { - // internalformat = GL.RGBA; - // } - // } - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D - gl.texImage2D( - gl_target, - level, - internalformat, - descriptor.width, - descriptor.height, - 0, - internalformat, - gl_type, - null, - ); - - // @see https://stackoverflow.com/questions/21954036/dartweb-gl-render-warning-texture-bound-to-texture-unit-0-is-not-renderable - // [.WebGL-0x106ad0400]RENDER WARNING: texture bound to texture unit 0 is not renderable. It might be non-power-of-2 or have incompatible texture filtering (maybe)? - if (this.mipmaps && this.isNPOT()) { - this.mipmaps = false; - gl.texParameteri( - GL.TEXTURE_2D, - GL.TEXTURE_MIN_FILTER, - GL.LINEAR, - ); - gl.texParameteri( - GL.TEXTURE_2D, - GL.TEXTURE_WRAP_S, - GL.CLAMP_TO_EDGE, - ); - gl.texParameteri( - GL.TEXTURE_2D, - GL.TEXTURE_WRAP_T, - GL.CLAMP_TO_EDGE, - ); - } - } - } - } - - assert(descriptor.depth === 1); - } else if (descriptor.dimension === TextureDimension.TEXTURE_2D_ARRAY) { - gl_target = GL.TEXTURE_2D_ARRAY; - gl.bindTexture(gl_target, gl_texture); - - if (isWebGL2(gl)) { - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texStorage3D - gl.texStorage3D( - gl_target, - numLevels, - internalformat, - descriptor.width, - descriptor.height, - descriptor.depth, - ); - } - } else if (descriptor.dimension === TextureDimension.TEXTURE_3D) { - gl_target = GL.TEXTURE_3D; - gl.bindTexture(gl_target, gl_texture); - - if (isWebGL2(gl)) { - gl.texStorage3D( - gl_target, - numLevels, - internalformat, - descriptor.width, - descriptor.height, - descriptor.depth, - ); - } - } else if (descriptor.dimension === TextureDimension.TEXTURE_CUBE_MAP) { - gl_target = GL.TEXTURE_CUBE_MAP; - gl.bindTexture(gl_target, gl_texture); - if (isWebGL2(gl)) { - gl.texStorage2D( - gl_target, - numLevels, - internalformat, - descriptor.width, - descriptor.height, - ); - } - assert(descriptor.depth === 6); - } else { - throw new Error('whoops'); - } - } - - this.gl_texture = gl_texture; - this.gl_target = gl_target; - this.numLevels = numLevels; - } - - setImageData( - levelDatas: (TexImageSource | ArrayBufferView)[], - firstMipLevel = 0, - ) { - // const maxMipLevel = Math.min( - // firstMipLevel + levelDatas.length, - // this.numLevels, - // ); - - const gl = this.device.gl; - // const isCompressed = isTextureFormatCompressed(this.pixelFormat); - // const is3D = - // this.gl_target === GL.TEXTURE_3D || - // this.gl_target === GL.TEXTURE_2D_ARRAY; - // const isCube = this.gl_target === GL.TEXTURE_CUBE_MAP; - // @ts-ignore - const isTypedArray = levelDatas[0].buffer; - - this.device.setActiveTexture(gl.TEXTURE0); - this.device['currentTextures'][0] = null; - - const data = levelDatas[0]; - - let width: number; - let height: number; - if (isTypedArray) { - width = this.width; - height = this.height; - } else { - // FIXME: Property 'width' does not exist on type 'TexImageSource'. - // Property 'width' does not exist on type 'VideoFrame'. - // @ts-ignore - width = (data as TexImageSource).width; - // @ts-ignore - height = (data as TexImageSource).height; - // update size - this.width = width; - this.height = height; - } - - gl.bindTexture(this.gl_target, this.gl_texture); - - const gl_format = this.device.translateTextureFormat(this.pixelFormat); - const gl_type = this.device.translateTextureType(this.pixelFormat); - - this.preprocessImage(); - - // for (let i = 0, levelDatasIdx = 0; i < maxMipLevel; i++) { - // if (i >= firstMipLevel) { - // const levelData = levelDatas[levelDatasIdx++] as Uint8Array; - // const sliceElementSize = levelData.length / this.depth; - - // if (isCube) { - - // } else if (is3D) { - - // } else if (isArray) { - - // } else { - - // } - // } - // } - - if (this.immutable) { - // must use texSubImage2D instead of texImage2D, since texture is immutable - // @see https://stackoverflow.com/questions/56123201/unity-plugin-texture-is-immutable?rq=1 - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texSubImage2D - gl.texSubImage2D( - this.gl_target, - 0, - 0, - 0, - width, - height, - gl_format, - gl_type, - // @ts-ignore - data, - ); - } else { - if (isWebGL2(gl)) { - // @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D - gl.texImage2D( - this.gl_target, - // level, - 0, - gl_format, - width, - height, - 0, // border must be 0 - gl_format, // TODO: can be different with gl_format - gl_type, - // @ts-ignore - data, - ); - } else { - // WebGL1: upload Array & Image separately - if (isTypedArray) { - (gl as WebGLRenderingContext).texImage2D( - this.gl_target, - 0, - gl_format, - width, - height, - 0, - gl_format, - gl_type, - // @ts-ignore - data, - ); - } else { - (gl as WebGLRenderingContext).texImage2D( - this.gl_target, - 0, - gl_format, - gl_format, - gl_type, - data as TexImageSource, - ); - } - } - } - - if (this.mipmaps) { - this.generateMipmap(); - } - } - - destroy() { - super.destroy(); - this.device.gl.deleteTexture(getPlatformTexture(this)); - } - - private clampNumLevels(descriptor: TextureDescriptor): number { - if ( - descriptor.dimension === TextureDimension.TEXTURE_2D_ARRAY && - descriptor.depth > 1 - ) { - const typeFlags: FormatTypeFlags = getFormatTypeFlags( - descriptor.pixelFormat, - ); - if (typeFlags === FormatTypeFlags.BC1) { - // Chrome/ANGLE seems to have issues with compressed miplevels of size 1/2, so clamp before they arrive... - // https://bugs.chromium.org/p/angleproject/issues/detail?id=4056 - let w = descriptor.width, - h = descriptor.height; - for (let i = 0; i < descriptor.numLevels; i++) { - if (w <= 2 || h <= 2) return i - 1; - - w = Math.max((w / 2) | 0, 1); - h = Math.max((h / 2) | 0, 1); - } - } - } - - return descriptor.numLevels; - } - - private preprocessImage() { - const gl = this.device.gl; - if (this.pixelStore) { - if (this.pixelStore.unpackFlipY) { - gl.pixelStorei(GL.UNPACK_FLIP_Y_WEBGL, true); - } - if (this.pixelStore.packAlignment) { - gl.pixelStorei(GL.PACK_ALIGNMENT, this.pixelStore.packAlignment); - } - if (this.pixelStore.unpackAlignment) { - gl.pixelStorei(GL.UNPACK_ALIGNMENT, this.pixelStore.unpackAlignment); - } - } - } - - private generateMipmap(): this { - const gl = this.device.gl; - if (!isWebGL2(gl) && this.isNPOT()) { - return this; - } - - if (this.gl_texture && this.gl_target) { - gl.bindTexture(this.gl_target, this.gl_texture); - gl.generateMipmap(this.gl_target); - gl.texParameteri( - GL.TEXTURE_2D, - GL.TEXTURE_MIN_FILTER, - GL.NEAREST_MIPMAP_LINEAR, - ); - gl.bindTexture(this.gl_target, null); - } - return this; - } - - private isNPOT(): boolean { - const gl = this.device.gl; - if (isWebGL2(gl)) { - // NPOT restriction is only for WebGL1 - return false; - } - return !isPowerOfTwo(this.width) || !isPowerOfTwo(this.height); - } -} diff --git a/packages/g-plugin-webgl-device/src/platform/interfaces.ts b/packages/g-plugin-webgl-device/src/platform/interfaces.ts deleted file mode 100644 index 60770b4a3..000000000 --- a/packages/g-plugin-webgl-device/src/platform/interfaces.ts +++ /dev/null @@ -1,59 +0,0 @@ -import type { SamplerFormatKind } from '@antv/g-plugin-device-renderer'; - -export interface EXT_texture_compression_rgtc { - COMPRESSED_RED_RGTC1_EXT: GLenum; - COMPRESSED_SIGNED_RED_RGTC1_EXT: GLenum; - COMPRESSED_RED_GREEN_RGTC2_EXT: GLenum; - COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: GLenum; -} - -export interface OES_draw_buffers_indexed { - enableiOES: (target: GLuint, index: GLuint) => void; - disableiOES: (target: GLenum, index: GLuint) => void; - blendEquationiOES: (buf: GLuint, mode: GLenum) => void; - blendEquationSeparateiOES: ( - buf: GLuint, - modeRGB: GLenum, - modeAlpha: GLenum, - ) => void; - blendFunciOES: (buf: GLuint, src: GLenum, dst: GLenum) => void; - blendFuncSeparateiOES: ( - buf: GLuint, - srcRGB: GLenum, - dstRGB: GLenum, - srcAlpha: GLenum, - dstAlpha: GLenum, - ) => void; - colorMaskiOES: ( - buf: GLuint, - r: GLboolean, - g: GLboolean, - b: GLboolean, - a: GLboolean, - ) => void; -} - -export interface KHR_parallel_shader_compile { - COMPLETION_STATUS_KHR: number; -} - -export interface EXT_texture_norm16 { - R16_EXT: GLenum; - RG16_EXT: GLenum; - RGB16_EXT: GLenum; - RGBA16_EXT: GLenum; - R16_SNORM_EXT: GLenum; - RG16_SNORM_EXT: GLenum; - RGB16_SNORM_EXT: GLenum; - RGBA16_SNORM_EXT: GLenum; -} - -export class GPlatformWebGL2Config { - public trackResources = false; - public shaderDebug = false; -} - -export interface BindingLayoutSamplerDescriptor_GL { - gl_target: GLenum; - formatKind: SamplerFormatKind; -} diff --git a/packages/g-plugin-webgl-device/src/platform/utils.ts b/packages/g-plugin-webgl-device/src/platform/utils.ts deleted file mode 100644 index 8b7244b5c..000000000 --- a/packages/g-plugin-webgl-device/src/platform/utils.ts +++ /dev/null @@ -1,296 +0,0 @@ -import { - GL, - FormatCompFlags, - FormatFlags, - FormatTypeFlags, - getFormatCompFlags, - getFormatFlags, - getFormatTypeFlags, - Format, - BlendFactor, - BlendMode, - BufferFrequencyHint, - BufferUsage, - MipFilterMode, - PrimitiveTopology, - QueryPoolType, - TexFilterMode, - TextureDimension, - WrapMode, -} from '@antv/g-plugin-device-renderer'; -import type { - Buffer, - ChannelBlendState, - Sampler, - Texture, -} from '@antv/g-plugin-device-renderer'; -import type { Buffer_GL } from './Buffer'; -import type { Sampler_GL } from './Sampler'; -import type { Texture_GL } from './Texture'; - -// @see https://github.com/visgl/luma.gl/blob/30a1039573576d73641de7c1ba222e8992eb526e/modules/gltools/src/utils/webgl-checks.ts#L22 -export function isWebGL2( - gl: WebGL2RenderingContext | WebGLRenderingContext, -): gl is WebGL2RenderingContext { - if ( - typeof WebGL2RenderingContext !== 'undefined' && - gl instanceof WebGL2RenderingContext - ) { - return true; - } - // Look for debug contexts, headless gl etc - // @ts-ignore - return Boolean(gl && gl._version === 2); -} - -export function isTextureFormatCompressed(fmt: Format): boolean { - const typeFlags: FormatTypeFlags = getFormatTypeFlags(fmt); - switch (typeFlags) { - case FormatTypeFlags.BC1: - case FormatTypeFlags.BC2: - case FormatTypeFlags.BC3: - case FormatTypeFlags.BC4_UNORM: - case FormatTypeFlags.BC4_SNORM: - case FormatTypeFlags.BC5_UNORM: - case FormatTypeFlags.BC5_SNORM: - return true; - default: - return false; - } -} - -export function isFormatSizedInteger(fmt: Format): boolean { - const flags = getFormatFlags(fmt); - if (flags & FormatFlags.Normalized) return false; - - const typeFlags = getFormatTypeFlags(fmt); - // Check for integer types. - if ( - typeFlags === FormatTypeFlags.S8 || - typeFlags === FormatTypeFlags.S16 || - typeFlags === FormatTypeFlags.S32 - ) - return true; - if ( - typeFlags === FormatTypeFlags.U8 || - typeFlags === FormatTypeFlags.U16 || - typeFlags === FormatTypeFlags.U32 - ) - return true; - - return false; -} - -export function translateBufferHint(hint: BufferFrequencyHint): GLenum { - switch (hint) { - case BufferFrequencyHint.STATIC: - return GL.STATIC_DRAW; - case BufferFrequencyHint.DYNAMIC: - return GL.DYNAMIC_DRAW; - } -} - -export function translateBufferUsageToTarget(usage: BufferUsage): GLenum { - if (usage & BufferUsage.INDEX) { - return GL.ELEMENT_ARRAY_BUFFER; - } else if (usage & BufferUsage.VERTEX) { - return GL.ARRAY_BUFFER; - } else if (usage & BufferUsage.UNIFORM) { - return GL.UNIFORM_BUFFER; - } -} - -export function translatePrimitiveTopology( - topology: PrimitiveTopology, -): GLenum { - switch (topology) { - case PrimitiveTopology.TRIANGLES: - return GL.TRIANGLES; - case PrimitiveTopology.POINTS: - return GL.POINTS; - case PrimitiveTopology.TRIANGLE_STRIP: - return GL.TRIANGLE_STRIP; - case PrimitiveTopology.LINES: - return GL.LINES; - case PrimitiveTopology.LINE_STRIP: - return GL.LINE_STRIP; - default: - throw new Error('Unknown primitive topology mode'); - } -} - -function translateType(flags: FormatTypeFlags): GLenum { - switch (flags) { - case FormatTypeFlags.U8: - return GL.UNSIGNED_BYTE; - case FormatTypeFlags.U16: - return GL.UNSIGNED_SHORT; - case FormatTypeFlags.U32: - return GL.UNSIGNED_INT; - case FormatTypeFlags.S8: - return GL.BYTE; - case FormatTypeFlags.S16: - return GL.SHORT; - case FormatTypeFlags.S32: - return GL.INT; - case FormatTypeFlags.F16: - return GL.HALF_FLOAT; - case FormatTypeFlags.F32: - return GL.FLOAT; - default: - throw new Error('whoops'); - } -} -function translateSize(flags: FormatCompFlags): number { - switch (flags) { - case FormatCompFlags.R: - return 1; - case FormatCompFlags.RG: - return 2; - case FormatCompFlags.RGB: - return 3; - case FormatCompFlags.RGBA: - return 4; - default: - return 1; - } -} -export function translateVertexFormat(fmt: Format): { - size: number; - type: GLenum; - normalized: boolean; -} { - const typeFlags = getFormatTypeFlags(fmt); - const compFlags = getFormatCompFlags(fmt); - const flags = getFormatFlags(fmt); - - const type = translateType(typeFlags); - const size = translateSize(compFlags); - const normalized = !!(flags & FormatFlags.Normalized); - return { size, type, normalized }; -} - -export function translateIndexFormat(format: Format): GLenum { - switch (format) { - case Format.U8_R: - return GL.UNSIGNED_BYTE; - case Format.U16_R: - return GL.UNSIGNED_SHORT; - case Format.U32_R: - return GL.UNSIGNED_INT; - default: - throw new Error('whoops'); - } -} - -export function translateWrapMode(wrapMode: WrapMode): GLenum { - switch (wrapMode) { - case WrapMode.CLAMP: - return GL.CLAMP_TO_EDGE; - case WrapMode.REPEAT: - return GL.REPEAT; - case WrapMode.MIRROR: - return GL.MIRRORED_REPEAT; - default: - throw new Error('whoops'); - } -} - -export function translateFilterMode( - filter: TexFilterMode, - mipFilter: MipFilterMode, -): GLenum { - if (mipFilter === MipFilterMode.LINEAR && filter === TexFilterMode.BILINEAR) { - return GL.LINEAR_MIPMAP_LINEAR; - } - if (mipFilter === MipFilterMode.LINEAR && filter === TexFilterMode.POINT) { - return GL.NEAREST_MIPMAP_LINEAR; - } - if ( - mipFilter === MipFilterMode.NEAREST && - filter === TexFilterMode.BILINEAR - ) { - return GL.LINEAR_MIPMAP_NEAREST; - } - if (mipFilter === MipFilterMode.NEAREST && filter === TexFilterMode.POINT) { - return GL.NEAREST_MIPMAP_NEAREST; - } - if (mipFilter === MipFilterMode.NO_MIP && filter === TexFilterMode.BILINEAR) { - return GL.LINEAR; - } - if (mipFilter === MipFilterMode.NO_MIP && filter === TexFilterMode.POINT) { - return GL.NEAREST; - } - throw new Error('Unknown texture filter mode'); -} - -export function getPlatformBuffer( - buffer_: Buffer, - byteOffset = 0, -): WebGLBuffer { - const buffer = buffer_ as Buffer_GL; - return buffer.gl_buffer_pages[(byteOffset / buffer.pageByteSize) | 0]; -} - -export function getPlatformTexture(texture_: Texture): WebGLTexture { - const texture = texture_ as Texture_GL; - return texture.gl_texture; -} - -export function getPlatformSampler(sampler_: Sampler): WebGLSampler { - const sampler = sampler_ as Sampler_GL; - return sampler.gl_sampler; -} - -export function assignPlatformName(o: any, name: string): void { - o.name = name; - o.__SPECTOR_Metadata = { name }; -} - -export function findall(haystack: string, needle: RegExp): RegExpExecArray[] { - const results: RegExpExecArray[] = []; - while (true) { - const result = needle.exec(haystack); - if (!result) break; - results.push(result); - } - return results; -} - -export function isBlendStateNone(blendState: ChannelBlendState): boolean { - return ( - blendState.blendMode == BlendMode.ADD && - blendState.blendSrcFactor == BlendFactor.ONE && - blendState.blendDstFactor === BlendFactor.ZERO - ); -} - -export function translateQueryPoolType(type: QueryPoolType): GLenum { - switch (type) { - case QueryPoolType.OcclusionConservative: - return GL.ANY_SAMPLES_PASSED_CONSERVATIVE; - default: - throw new Error('whoops'); - } -} - -export function translateTextureDimension(dimension: TextureDimension): GLenum { - if (dimension === TextureDimension.TEXTURE_2D) return GL.TEXTURE_2D; - else if (dimension === TextureDimension.TEXTURE_2D_ARRAY) - return GL.TEXTURE_2D_ARRAY; - else if (dimension === TextureDimension.TEXTURE_CUBE_MAP) - return GL.TEXTURE_CUBE_MAP; - else if (dimension === TextureDimension.TEXTURE_3D) return GL.TEXTURE_3D; - else throw new Error('whoops'); -} - -export function isBlockCompressSized( - w: number, - h: number, - bw: number, - bh: number, -): boolean { - if (w % bw !== 0) return false; - if (h % bh !== 0) return false; - return true; -} diff --git a/packages/g-plugin-webgl-device/tsconfig.json b/packages/g-plugin-webgl-device/tsconfig.json deleted file mode 100644 index edf14785b..000000000 --- a/packages/g-plugin-webgl-device/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "include": ["src/**/*"], - "exclude": ["node_modules"] -} \ No newline at end of file diff --git a/packages/g-plugin-webgpu-device/CHANGELOG.md b/packages/g-plugin-webgpu-device/CHANGELOG.md deleted file mode 100644 index cf69c492b..000000000 --- a/packages/g-plugin-webgpu-device/CHANGELOG.md +++ /dev/null @@ -1,169 +0,0 @@ -# @antv/g-plugin-webgpu-device - -## 1.9.17 - -### Patch Changes - -- c54cc6fb: Antialiasing SDF & Text. -- 568ec0f4: Export Device API in webgl & webgpu. -- Updated dependencies [c54cc6fb] -- Updated dependencies [568ec0f4] - - @antv/g-plugin-device-renderer@1.9.17 - -## 1.9.16 - -### Patch Changes - -- Updated dependencies [be1f91bf] - - @antv/g-plugin-device-renderer@1.9.16 - -## 1.9.15 - -### Patch Changes - -- Updated dependencies [e5d69c70] - - @antv/g-plugin-device-renderer@1.9.15 - - @antv/g-lite@1.2.13 - -## 1.9.14 - -### Patch Changes - -- Updated dependencies [eb61cba4] -- Updated dependencies [eb61cba4] - - @antv/g-lite@1.2.12 - - @antv/g-plugin-device-renderer@1.9.14 - -## 1.9.13 - -### Patch Changes - -- Updated dependencies [d63ea0bf] - - @antv/g-lite@1.2.11 - - @antv/g-plugin-device-renderer@1.9.13 - -## 1.9.12 - -### Patch Changes - -- Updated dependencies [414d08d9] - - @antv/g-plugin-device-renderer@1.9.12 - - @antv/g-lite@1.2.10 - -## 1.9.11 - -### Patch Changes - -- Updated dependencies [3856560c] - - @antv/g-plugin-device-renderer@1.9.11 - - @antv/g-lite@1.2.9 - -## 1.9.10 - -### Patch Changes - -- Updated dependencies [3d4f5da7] -- Updated dependencies [3d4f5da7] -- Updated dependencies [3d4f5da7] - - @antv/g-plugin-device-renderer@1.9.10 - - @antv/g-lite@1.2.8 - -## 1.9.9 - -### Patch Changes - -- Updated dependencies [d9e769f2] -- Updated dependencies [d9e769f2] -- Updated dependencies [d9e769f2] - - @antv/g-plugin-device-renderer@1.9.9 - -## 1.9.8 - -### Patch Changes - -- Updated dependencies [06bcc557] - - @antv/g-plugin-device-renderer@1.9.8 - -## 1.9.7 - -### Patch Changes - -- 70aa0b32: Retrieve runtime from context instead of global. -- 789bd4c9: Split a path containing multiple segments into subpaths. -- Updated dependencies [70aa0b32] -- Updated dependencies [789bd4c9] - - @antv/g-plugin-device-renderer@1.9.7 - - @antv/g-lite@1.2.7 - -## 1.9.6 - -### Patch Changes - -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] -- Updated dependencies [1b0901ba] - - @antv/g-plugin-device-renderer@1.9.6 - - @antv/g-lite@1.2.6 - -## 1.9.5 - -### Patch Changes - -- Updated dependencies [ff2f4585] -- Updated dependencies [6fa21f84] - - @antv/g-plugin-device-renderer@1.9.5 - - @antv/g-lite@1.2.5 - -## 1.9.4 - -### Patch Changes - -- Updated dependencies [6757ccbd] -- Updated dependencies [6757ccbd] - - @antv/g-plugin-device-renderer@1.9.4 - - @antv/g-lite@1.2.4 - -## 1.9.3 - -### Patch Changes - -- 6cbaae4d: Change picking process from async to sync way -- Updated dependencies [6cbaae4d] - - @antv/g-plugin-device-renderer@1.9.3 - - @antv/g-lite@1.2.3 - -## 1.9.2 - -### Patch Changes - -- 0eb5142d: Avoid overriding defXY when parsing path -- 71990540: Make picking process async for WebGL2 & WebGPU implementations -- Updated dependencies [0eb5142d] -- Updated dependencies [71990540] - - @antv/g-plugin-device-renderer@1.9.2 - - @antv/g-lite@1.2.2 - -## 1.9.1 - -### Patch Changes - -- b0dd4788: Remove this syntax in @antv/g-math since it's already an ESM now -- Updated dependencies [b0dd4788] - - @antv/g-plugin-device-renderer@1.9.1 - - @antv/g-lite@1.2.1 - -## 1.9.0 - -### Minor Changes - -- Remove default export in @antv/g-math - -### Patch Changes - -- Updated dependencies - - @antv/g-lite@1.2.0 - - @antv/g-plugin-device-renderer@1.9.0 diff --git a/packages/g-plugin-webgpu-device/LICENSE b/packages/g-plugin-webgpu-device/LICENSE deleted file mode 100644 index 778560b1b..000000000 --- a/packages/g-plugin-webgpu-device/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 AntV team - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/packages/g-plugin-webgpu-device/README.md b/packages/g-plugin-webgpu-device/README.md deleted file mode 100644 index 0d8aeae44..000000000 --- a/packages/g-plugin-webgpu-device/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# g-plugin-webgpu-device - -使用 WebGPU 提供 GPUDevice 能力。 - -目前通过 Open trial token 使用: https://developer.chrome.com/origintrials/#/registration/3817785846614982657 - -Vertex / Fragment Shader 使用 wgpu naga 生成 wasm,运行时异步加载,将 GLSL 300 转译成 WGSL。 Compute Shader 直接使用 WGSL。 diff --git a/packages/g-plugin-webgpu-device/package.json b/packages/g-plugin-webgpu-device/package.json deleted file mode 100644 index b90280169..000000000 --- a/packages/g-plugin-webgpu-device/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "@antv/g-plugin-webgpu-device", - "version": "1.9.17", - "description": "A G plugin implements GPUDevice interface with WebGPU API", - "keywords": [ - "antv", - "g", - "webgpu" - ], - "homepage": "https://github.com/antvis/g#readme", - "bugs": { - "url": "https://github.com/antvis/g/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/antvis/g.git" - }, - "license": "MIT", - "author": "https://github.com/orgs/antvis/people", - "exports": { - "types": "./dist/index.d.ts", - "import": "./dist/index.esm.js", - "default": "./dist/index.js" - }, - "main": "dist/index.js", - "unpkg": "dist/index.umd.min.js", - "module": "dist/index.esm.js", - "types": "dist/index.d.ts", - "files": [ - "package.json", - "dist", - "LICENSE", - "README.md" - ], - "scripts": { - "build": "npm run clean && rollup -c", - "clean": "rimraf dist", - "sync": "tnpm sync", - "watch": "rollup -c -w" - }, - "dependencies": { - "@antv/g-lite": "workspace:*", - "@antv/g-plugin-device-renderer": "workspace:*", - "@antv/util": "^3.3.4", - "@webgpu/types": "^0.1.33", - "eventemitter3": "^5.0.1", - "tslib": "^2.5.3" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/packages/g-plugin-webgpu-device/rollup.config.mjs b/packages/g-plugin-webgpu-device/rollup.config.mjs deleted file mode 100644 index 65f3b43b9..000000000 --- a/packages/g-plugin-webgpu-device/rollup.config.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { readFileSync } from 'fs'; -import { createConfig } from '../../rollup.config.mjs'; - -export default createConfig({ - pkg: JSON.parse( - readFileSync(new URL('./package.json', import.meta.url), 'utf8'), - ), - umdName: 'G.WebGPUDevice', - external: ['@antv/g-lite', '@antv/g-plugin-device-renderer'], - globals: { - '@antv/g-lite': 'window.G', - '@antv/g-plugin-device-renderer': 'window.G.DeviceRenderer', - }, -}); diff --git a/packages/g-plugin-webgpu-device/src/WebGPUDeviceContribution.ts b/packages/g-plugin-webgpu-device/src/WebGPUDeviceContribution.ts deleted file mode 100644 index 5518d5ea2..000000000 --- a/packages/g-plugin-webgpu-device/src/WebGPUDeviceContribution.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { GlobalRuntime } from '@antv/g-lite'; -import type { DeviceContribution } from '@antv/g-plugin-device-renderer'; -import init, { glsl_compile } from '../../../rust/pkg/glsl_wgsl_compiler'; -import type { WebGPUDeviceOptions } from './interfaces'; -import { Device_WebGPU } from './platform/Device'; - -export class WebGPUDeviceContribution implements DeviceContribution { - constructor( - private pluginOptions: Partial, - private runtime: GlobalRuntime, - ) {} - - async createSwapChain($canvas: HTMLCanvasElement) { - if ((this.runtime.globalThis.navigator as any).gpu === undefined) - return null; - - let adapter = null; - try { - adapter = await ( - this.runtime.globalThis.navigator as any - ).gpu.requestAdapter(); - } catch (e) { - console.log(e); - } - - if (adapter === null) return null; - - // @see https://www.w3.org/TR/webgpu/#dom-gpudevicedescriptor-requiredfeatures - const optionalFeatures: GPUFeatureName[] = [ - // 'depth24unorm-stencil8', - 'depth32float-stencil8', - 'texture-compression-bc', - ]; - const requiredFeatures = optionalFeatures.filter((feature) => - adapter.features.has(feature), - ); - const device = await adapter.requestDevice({ requiredFeatures }); - - if (device) { - // @see https://github.com/gpuweb/gpuweb/blob/main/design/ErrorHandling.md#fatal-errors-requestadapter-requestdevice-and-devicelost - const { onContextLost } = this.pluginOptions; - device.lost.then(() => { - if (onContextLost) { - onContextLost(); - } - }); - } - - if (device === null) return null; - - const context = $canvas.getContext('webgpu'); - - if (!context) return null; - - try { - await init(this.pluginOptions.shaderCompilerPath); - } catch (e) {} - - // @ts-ignore - return new Device_WebGPU(adapter, device, $canvas, context, glsl_compile); - } -} diff --git a/packages/g-plugin-webgpu-device/src/index.ts b/packages/g-plugin-webgpu-device/src/index.ts deleted file mode 100644 index c696d7f18..000000000 --- a/packages/g-plugin-webgpu-device/src/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { AbstractRendererPlugin, GlobalRuntime } from '@antv/g-lite'; -import type { WebGPUDeviceOptions } from './interfaces'; -import { WebGPUDeviceContribution } from './WebGPUDeviceContribution'; - -export { WebGPUDeviceContribution }; -export class Plugin extends AbstractRendererPlugin { - name = 'webgpu-device'; - constructor(private options: Partial = {}) { - super(); - } - - init(runtime: GlobalRuntime): void { - this.context.deviceContribution = new WebGPUDeviceContribution( - { - shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', - ...this.options, - }, - runtime, - ); - } - destroy(): void { - delete this.context.deviceContribution; - } -} diff --git a/packages/g-plugin-webgpu-device/src/interfaces.ts b/packages/g-plugin-webgpu-device/src/interfaces.ts deleted file mode 100644 index 6818692ff..000000000 --- a/packages/g-plugin-webgpu-device/src/interfaces.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface WebGPUDeviceOptions { - shaderCompilerPath: string; - onContextLost: () => void; -} diff --git a/packages/g-plugin-webgpu-device/src/platform/Bindings.ts b/packages/g-plugin-webgpu-device/src/platform/Bindings.ts deleted file mode 100644 index 0a3583e32..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/Bindings.ts +++ /dev/null @@ -1,121 +0,0 @@ -import type { - BindingLayoutDescriptor, - Bindings, - BindingsDescriptor, -} from '@antv/g-plugin-device-renderer'; -import { - getFormatSamplerKind, - ResourceType, - assert, - defaultBindingLayoutSamplerDescriptor, -} from '@antv/g-plugin-device-renderer'; -import { getPlatformBuffer, getPlatformSampler } from './utils'; -import type { BindGroupLayout, IDevice_WebGPU } from './interfaces'; -import { ResourceBase_WebGPU } from './ResourceBase'; -import type { Texture_WebGPU } from './Texture'; -import { ComputePipeline_WebGPU } from './ComputePipeline'; - -export class Bindings_WebGPU extends ResourceBase_WebGPU implements Bindings { - type: ResourceType.Bindings = ResourceType.Bindings; - - bindingLayout: BindingLayoutDescriptor; - gpuBindGroup: GPUBindGroup[]; - bindGroupLayout: BindGroupLayout; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: IDevice_WebGPU; - descriptor: BindingsDescriptor; - }) { - super({ id, device }); - - const { pipeline, bindingLayout } = descriptor; - assert(!!pipeline); - - const bindGroupLayout = this.device['createBindGroupLayout'](bindingLayout); - - // entries orders: Storage(read-only storage) Uniform Sampler - const gpuBindGroupEntries: GPUBindGroupEntry[][] = [[], []]; - let numBindings = 0; - - if (bindingLayout.storageEntries) { - for (let i = 0; i < bindingLayout.storageEntries.length; i++) { - const binding = descriptor.storageBufferBindings[i]; - assert(binding.wordCount > 0); - const gpuBufferBinding: GPUBufferBinding = { - buffer: getPlatformBuffer(binding.buffer), - offset: 0, - size: binding.wordCount << 2, - }; - gpuBindGroupEntries[0].push({ - binding: numBindings++, - resource: gpuBufferBinding, - }); - } - } - - for (let i = 0; i < bindingLayout.numUniformBuffers; i++) { - const binding = descriptor.uniformBufferBindings[i]; - assert(binding.wordCount > 0); - const gpuBufferBinding: GPUBufferBinding = { - buffer: getPlatformBuffer(binding.buffer), - offset: 0, - size: binding.wordCount << 2, - }; - gpuBindGroupEntries[0].push({ - binding: numBindings++, - resource: gpuBufferBinding, - }); - } - - numBindings = 0; - for (let i = 0; i < bindingLayout.numSamplers; i++) { - const samplerEntry = - bindingLayout.samplerEntries !== undefined - ? bindingLayout.samplerEntries[i] - : defaultBindingLayoutSamplerDescriptor; - - const binding = descriptor.samplerBindings[i]; - const texture = - binding.texture !== null - ? binding.texture - : this.device['getFallbackTexture'](samplerEntry); - assert(samplerEntry.dimension === (texture as Texture_WebGPU).dimension); - assert( - samplerEntry.formatKind === - getFormatSamplerKind((texture as Texture_WebGPU).pixelFormat), - ); - const gpuTextureView = (texture as Texture_WebGPU).gpuTextureView; - gpuBindGroupEntries[1].push({ - binding: numBindings++, - resource: gpuTextureView, - }); - - const sampler = - binding.sampler !== null - ? binding.sampler - : this.device['getFallbackSampler'](samplerEntry); - const gpuSampler = getPlatformSampler(sampler); - gpuBindGroupEntries[1].push({ - binding: numBindings++, - resource: gpuSampler, - }); - } - - this.gpuBindGroup = gpuBindGroupEntries - .filter((entries) => entries.length > 0) - .map((gpuBindGroupEntries, i) => - this.device.device.createBindGroup({ - // layout: bindGroupLayout.gpuBindGroupLayout[i], - layout: (pipeline as ComputePipeline_WebGPU).getBindGroupLayout(i), - entries: gpuBindGroupEntries, - }), - ); - this.bindingLayout = descriptor.bindingLayout; - this.bindGroupLayout = bindGroupLayout; - } -} diff --git a/packages/g-plugin-webgpu-device/src/platform/Buffer.ts b/packages/g-plugin-webgpu-device/src/platform/Buffer.ts deleted file mode 100644 index 195205cc0..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/Buffer.ts +++ /dev/null @@ -1,135 +0,0 @@ -import { - Buffer, - BufferDescriptor, - align, -} from '@antv/g-plugin-device-renderer'; -import { BufferUsage, ResourceType } from '@antv/g-plugin-device-renderer'; -import type { IDevice_WebGPU } from './interfaces'; -import { ResourceBase_WebGPU } from './ResourceBase'; -import { translateBufferUsage } from './utils'; -import { isNumber } from '@antv/util'; - -export class Buffer_WebGPU extends ResourceBase_WebGPU implements Buffer { - type: ResourceType.Buffer = ResourceType.Buffer; - /** - * @see https://www.w3.org/TR/webgpu/#gpubuffer - */ - gpuBuffer: GPUBuffer; - - /** - * size in bytes - */ - size: number; - - view: ArrayBufferView | null; - - usage: BufferUsage; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: IDevice_WebGPU; - descriptor: BufferDescriptor; - }) { - super({ id, device }); - - const { usage, viewOrSize } = descriptor; - const useMapRead = !!(usage & BufferUsage.MAP_READ); - - this.usage = translateBufferUsage(usage); - - // Buffer usages (BufferUsage::(MapRead|CopyDst|Storage)) is invalid. If a buffer usage contains BufferUsage::MapRead the only other allowed usage is BufferUsage::CopyDst. - // @see https://www.w3.org/TR/webgpu/#dom-gpubufferusage-copy_dst - if (useMapRead) { - this.usage = BufferUsage.MAP_READ | BufferUsage.COPY_DST; - } - - const mapBuffer = !isNumber(viewOrSize); - - // this.size = isView(viewOrSize) ? viewOrSize.byteLength : viewOrSize * 4; - this.view = !isNumber(viewOrSize) ? viewOrSize : null; - - // 4 bytes alignments (because of the upload which requires this) - this.size = isNumber(viewOrSize) - ? align(viewOrSize, 4) - : align(viewOrSize.byteLength, 4); - - if (!isNumber(viewOrSize)) { - this.gpuBuffer = this.device.device.createBuffer({ - usage: this.usage, - size: this.size, - mappedAtCreation: true, - }); - - const ctor = (viewOrSize && viewOrSize.constructor) || Float32Array; - // @ts-ignore - new ctor(this.gpuBuffer.getMappedRange()).set(viewOrSize); - this.gpuBuffer.unmap(); - } else { - this.gpuBuffer = this.device.device.createBuffer({ - usage: this.usage, - size: this.size, - mappedAtCreation: useMapRead ? mapBuffer : false, - }); - } - } - - setSubData( - dstByteOffset: number, - src: Uint8Array, - srcByteOffset = 0, - byteLength = 0, - ): void { - const buffer = this.gpuBuffer; - - byteLength = byteLength || src.byteLength; - byteLength = Math.min(byteLength, this.size - dstByteOffset); - - // After Migration to Canary - let chunkStart = src.byteOffset + srcByteOffset; - let chunkEnd = chunkStart + byteLength; - - // 4 bytes alignments for upload - const alignedLength = (byteLength + 3) & ~3; - if (alignedLength !== byteLength) { - const tempView = new Uint8Array(src.buffer.slice(chunkStart, chunkEnd)); - src = new Uint8Array(alignedLength); - (src as Uint8Array).set(tempView); - srcByteOffset = 0; - chunkStart = 0; - chunkEnd = alignedLength; - byteLength = alignedLength; - } - - // Chunk - const maxChunk = 1024 * 1024 * 15; - let offset = 0; - while (chunkEnd - (chunkStart + offset) > maxChunk) { - this.device.device.queue.writeBuffer( - buffer, - dstByteOffset + offset, - src.buffer, - chunkStart + offset, - maxChunk, - ); - offset += maxChunk; - } - - this.device.device.queue.writeBuffer( - buffer, - dstByteOffset + offset, - src.buffer, - chunkStart + offset, - byteLength - offset, - ); - } - - destroy() { - super.destroy(); - // @see https://www.w3.org/TR/webgpu/#dom-gpubuffer-destroy - this.gpuBuffer.destroy(); - } -} diff --git a/packages/g-plugin-webgpu-device/src/platform/ComputePass.ts b/packages/g-plugin-webgpu-device/src/platform/ComputePass.ts deleted file mode 100644 index 47287100d..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/ComputePass.ts +++ /dev/null @@ -1,89 +0,0 @@ -import type { - Buffer, - Bindings, - ComputePass, - ComputePipeline, -} from '@antv/g-plugin-device-renderer'; -import { assert, assertExists } from '@antv/g-plugin-device-renderer'; -import type { Buffer_WebGPU } from './Buffer'; -import type { Bindings_WebGPU } from './Bindings'; -import type { ComputePipeline_WebGPU } from './ComputePipeline'; - -export class ComputePass_WebGPU implements ComputePass { - commandEncoder: GPUCommandEncoder | null = null; - private gpuComputePassDescriptor: GPUComputePassDescriptor; - private gpuComputePassEncoder: GPUComputePassEncoder | null = null; - - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpucomputepassencoder-dispatchworkgroups - */ - dispatchWorkgroups( - workgroupCountX: number, - workgroupCountY?: number, - workgroupCountZ?: number, - ): void { - this.gpuComputePassEncoder.dispatchWorkgroups( - workgroupCountX, - workgroupCountY, - workgroupCountZ, - ); - } - - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpucomputepassencoder-dispatchworkgroupsindirect - */ - dispatchWorkgroupsIndirect(indirectBuffer: Buffer, indirectOffset: number) { - this.gpuComputePassEncoder.dispatchWorkgroupsIndirect( - (indirectBuffer as Buffer_WebGPU).gpuBuffer, - indirectOffset, - ); - } - - finish() { - this.gpuComputePassEncoder.end(); - this.gpuComputePassEncoder = null; - - return this.commandEncoder.finish(); - } - - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpucommandencoder-begincomputepass - */ - beginComputePass(): void { - assert(this.gpuComputePassEncoder === null); - this.gpuComputePassEncoder = this.commandEncoder.beginComputePass( - this.gpuComputePassDescriptor, - ); - } - - setPipeline(pipeline_: ComputePipeline): void { - const pipeline = pipeline_ as ComputePipeline_WebGPU; - const gpuComputePipeline = assertExists(pipeline.gpuComputePipeline); - this.gpuComputePassEncoder.setPipeline(gpuComputePipeline); - } - - setBindings( - bindingLayoutIndex: number, - bindings_: Bindings, - dynamicByteOffsets: number[], - ): void { - const bindings = bindings_ as Bindings_WebGPU; - this.gpuComputePassEncoder.setBindGroup( - bindingLayoutIndex, - bindings.gpuBindGroup[0], - dynamicByteOffsets, - ); - } - - pushDebugGroup(name: string): void { - this.gpuComputePassEncoder.pushDebugGroup(name); - } - - popDebugGroup(): void { - this.gpuComputePassEncoder.popDebugGroup(); - } - - insertDebugMarker(markerLabel: string) { - this.gpuComputePassEncoder.insertDebugMarker(markerLabel); - } -} diff --git a/packages/g-plugin-webgpu-device/src/platform/ComputePipeline.ts b/packages/g-plugin-webgpu-device/src/platform/ComputePipeline.ts deleted file mode 100644 index 4968c7b00..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/ComputePipeline.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { - ComputePipeline, - ComputePipelineDescriptor, -} from '@antv/g-plugin-device-renderer'; -import { ResourceType } from '@antv/g-plugin-device-renderer'; -import type { IDevice_WebGPU } from './interfaces'; -import type { Program_WebGPU } from './Program'; -import { ResourceBase_WebGPU } from './ResourceBase'; - -export class ComputePipeline_WebGPU - extends ResourceBase_WebGPU - implements ComputePipeline -{ - type: ResourceType.ComputePipeline = ResourceType.ComputePipeline; - - descriptor: ComputePipelineDescriptor; - gpuComputePipeline: GPUComputePipeline | null = null; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: IDevice_WebGPU; - descriptor: ComputePipelineDescriptor; - }) { - super({ id, device }); - - this.descriptor = descriptor; - - const program = descriptor.program as Program_WebGPU; - const computeStage = program.computeStage; - if (computeStage === null) return; - - const gpuComputePipeline: GPUComputePipelineDescriptor = { - layout: 'auto', - compute: { - ...computeStage, - }, - }; - - // @see https://www.w3.org/TR/webgpu/#dom-gpudevice-createrenderpipeline - this.gpuComputePipeline = - this.device.device.createComputePipeline(gpuComputePipeline); - - if (this.name !== undefined) { - this.gpuComputePipeline.label = this.name; - } - } - - getBindGroupLayout(index: number) { - return this.gpuComputePipeline.getBindGroupLayout(index); - } -} diff --git a/packages/g-plugin-webgpu-device/src/platform/Device.ts b/packages/g-plugin-webgpu-device/src/platform/Device.ts deleted file mode 100644 index 2e54180a6..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/Device.ts +++ /dev/null @@ -1,871 +0,0 @@ -import type { - BindingLayoutDescriptor, - BindingLayoutSamplerDescriptor, - Bindings, - BindingsDescriptor, - Buffer, - BufferDescriptor, - ComputePass, - ComputePipeline, - ComputePipelineDescriptor, - Device, - DeviceLimits, - InputLayout, - InputLayoutDescriptor, - Program, - ProgramDescriptor, - QueryPool, - QueryPoolType, - Readback, - RenderPass, - RenderPassDescriptor, - RenderPipeline, - RenderPipelineDescriptor, - RenderTarget, - RenderTargetDescriptor, - Resource, - Sampler, - SamplerDescriptor, - SwapChain, - Texture, - TextureDescriptor, - VendorInfo, -} from '@antv/g-plugin-device-renderer'; -import { - assert, - bindingLayoutDescriptorEqual, - ClipSpaceNearZ, - defaultBindingLayoutSamplerDescriptor, - Format, - HashMap, - MipFilterMode, - nullHashFunc, - ResourceType, - SamplerFormatKind, - TexFilterMode, - TextureDimension, - TextureUsage, - ViewportOrigin, - WrapMode, - CompareMode, - preprocessShader_GLSL, - defaultMegaState, - PrimitiveTopology, - copyMegaState, -} from '@antv/g-plugin-device-renderer'; -import type { glsl_compile as glsl_compile_ } from '../../../../rust/pkg/glsl_wgsl_compiler'; -import { Bindings_WebGPU } from './Bindings'; -import { Buffer_WebGPU } from './Buffer'; -import { ComputePass_WebGPU } from './ComputePass'; -import { ComputePipeline_WebGPU } from './ComputePipeline'; -import { GPUTextureUsage } from './constants'; -import { InputLayout_WebGPU } from './InputLayout'; -import type { - Attachment_WebGPU, - BindGroupLayout, - IDevice_WebGPU, - TextureSharedDescriptor, - TextureShared_WebGPU, -} from './interfaces'; -import { Program_WebGPU } from './Program'; -import { QueryPool_WebGPU } from './QueryPool'; -import { Readback_WebGPU } from './Readback'; -import { RenderPass_WebGPU } from './RenderPass'; -import { RenderPipeline_WebGPU } from './RenderPipeline'; -import { Sampler_WebGPU } from './Sampler'; -import { Texture_WebGPU } from './Texture'; -import { - getFormatBlockSize, - isFormatTextureCompressionBC, - translateBindGroupSamplerBinding, - translateBindGroupTextureBinding, - translateDepthStencilState, - translatePrimitiveState, - translateTargets, - translateTextureDimension, - translateTextureFormat, - translateTextureUsage, -} from './utils'; - -export class Device_WebGPU implements SwapChain, IDevice_WebGPU { - private swapChainWidth = 0; - private swapChainHeight = 0; - private swapChainFormat: GPUTextureFormat; - private swapChainTextureUsage = - GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_DST; - private _resourceUniqueId = 0; - - private renderPassPool: RenderPass_WebGPU[] = []; - private computePassPool: ComputePass_WebGPU[] = []; - - bindGroupLayoutCache = new HashMap( - bindingLayoutDescriptorEqual, - nullHashFunc, - ); - // private frameCommandEncoder: GPUCommandEncoder | null = null; - // private queryPoolsSubmitted: QueryPool_WebGPU[] = []; - - private fallbackTexture2D: Texture_WebGPU; - private fallbackTexture2DDepth: Texture_WebGPU; - private fallbackTexture2DArray: Texture_WebGPU; - private fallbackTexture3D: Texture_WebGPU; - private fallbackTextureCube: Texture_WebGPU; - private fallbackSamplerFiltering: Sampler; - private fallbackSamplerComparison: Sampler; - private featureTextureCompressionBC = false; - - // VendorInfo - readonly platformString: string = 'WebGPU'; - readonly glslVersion = `#version 440`; - readonly explicitBindingLocations = true; - readonly separateSamplerTextures = true; - readonly viewportOrigin = ViewportOrigin.UPPER_LEFT; - readonly clipSpaceNearZ = ClipSpaceNearZ.ZERO; - readonly supportsSyncPipelineCompilation: boolean = false; - readonly supportMRT: boolean = true; - - device: GPUDevice; - private canvas: HTMLCanvasElement | OffscreenCanvas; - private canvasContext: GPUCanvasContext; - private glsl_compile: typeof glsl_compile_; - - constructor( - adapter: GPUAdapter, - device: GPUDevice, - canvas: HTMLCanvasElement | OffscreenCanvas, - canvasContext: GPUCanvasContext, - glsl_compile: typeof glsl_compile_, - ) { - this.device = device; - this.canvas = canvas; - this.canvasContext = canvasContext; - this.glsl_compile = glsl_compile; - - this.fallbackTexture2D = this.createFallbackTexture( - TextureDimension.TEXTURE_2D, - SamplerFormatKind.Float, - ); - this.setResourceName(this.fallbackTexture2D, 'Fallback Texture2D'); - - this.fallbackTexture2DDepth = this.createFallbackTexture( - TextureDimension.TEXTURE_2D, - SamplerFormatKind.Depth, - ); - this.setResourceName( - this.fallbackTexture2DDepth, - 'Fallback Depth Texture2D', - ); - - this.fallbackTexture2DArray = this.createFallbackTexture( - TextureDimension.TEXTURE_2D_ARRAY, - SamplerFormatKind.Float, - ); - this.setResourceName( - this.fallbackTexture2DArray, - 'Fallback Texture2DArray', - ); - - this.fallbackTexture3D = this.createFallbackTexture( - TextureDimension.TEXTURE_3D, - SamplerFormatKind.Float, - ); - this.setResourceName(this.fallbackTexture3D, 'Fallback Texture3D'); - - this.fallbackTextureCube = this.createFallbackTexture( - TextureDimension.TEXTURE_CUBE_MAP, - SamplerFormatKind.Float, - ); - this.setResourceName(this.fallbackTextureCube, 'Fallback TextureCube'); - - this.fallbackSamplerFiltering = this.createSampler({ - wrapS: WrapMode.REPEAT, - wrapT: WrapMode.REPEAT, - minFilter: TexFilterMode.POINT, - magFilter: TexFilterMode.POINT, - mipFilter: MipFilterMode.NEAREST, - }); - this.setResourceName( - this.fallbackSamplerFiltering, - 'Fallback Sampler Filtering', - ); - - this.fallbackSamplerComparison = this.createSampler({ - wrapS: WrapMode.REPEAT, - wrapT: WrapMode.REPEAT, - minFilter: TexFilterMode.POINT, - magFilter: TexFilterMode.POINT, - mipFilter: MipFilterMode.NEAREST, - compareMode: CompareMode.ALWAYS, - }); - this.setResourceName( - this.fallbackSamplerComparison, - 'Fallback Sampler Comparison Filtering', - ); - - // Firefox doesn't support GPUDevice.features yet... - if (this.device.features) { - this.featureTextureCompressionBC = this.device.features.has( - 'texture-compression-bc', - ); - } - - this.device.onuncapturederror = (event) => { - console.error(event.error); - }; - - this.swapChainFormat = navigator.gpu.getPreferredCanvasFormat(); - // @see https://www.w3.org/TR/webgpu/#canvas-configuration - this.canvasContext.configure({ - device: this.device, - format: this.swapChainFormat, - usage: this.swapChainTextureUsage, - // @see https://www.w3.org/TR/webgpu/#gpucanvasalphamode - // alphaMode: 'opaque', - alphaMode: 'premultiplied', - }); - } - - destroy(): void {} - - // SwapChain - configureSwapChain(width: number, height: number): void { - if (this.swapChainWidth === width && this.swapChainHeight === height) - return; - this.swapChainWidth = width; - this.swapChainHeight = height; - } - - getOnscreenTexture(): Texture { - // @see https://www.w3.org/TR/webgpu/#dom-gpucanvascontext-getcurrenttexture - const gpuTexture = this.canvasContext.getCurrentTexture(); - const gpuTextureView = gpuTexture.createView(); - - const texture = new Texture_WebGPU({ - id: 0, - device: this, - descriptor: { - pixelFormat: Format.U8_RGBA_RT, - width: this.swapChainWidth, - height: this.swapChainHeight, - depth: 0, - dimension: TextureDimension.TEXTURE_2D, - numLevels: 1, - usage: this.swapChainTextureUsage, - }, - skipCreate: true, - }); - - texture.depthOrArrayLayers = 1; - texture.sampleCount = 1; - texture.gpuTexture = gpuTexture; - texture.gpuTextureView = gpuTextureView; - texture.name = 'Onscreen'; - this.setResourceName(texture, 'Onscreen Texture'); - - return texture; - } - - getDevice(): Device { - return this; - } - - getCanvas(): HTMLCanvasElement | OffscreenCanvas { - return this.canvas; - } - - beginFrame(): void { - // assert(this.frameCommandEncoder === null); - // this.frameCommandEncoder = this.device.createCommandEncoder(); - } - - endFrame(): void { - // assert(this.frameCommandEncoder !== null); - // this.device.queue.submit([this.frameCommandEncoder.finish()]); - // this.frameCommandEncoder = null; - // for (let i = 0; i < this.queryPoolsSubmitted.length; i++) { - // const queryPool = this.queryPoolsSubmitted[i]; - // queryPool.cpuBuffer.mapAsync(GPUMapMode.READ).then(() => { - // queryPool.results = new BigUint64Array( - // queryPool.cpuBuffer.getMappedRange(), - // ); - // }); - // } - // this.queryPoolsSubmitted.length = 0; - } - - private getNextUniqueId(): number { - return ++this._resourceUniqueId; - } - - createBuffer(descriptor: BufferDescriptor): Buffer { - return new Buffer_WebGPU({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - createTexture(descriptor: TextureDescriptor): Texture { - return new Texture_WebGPU({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpudevice-createsampler - * @see https://www.w3.org/TR/webgpu/#GPUSamplerDescriptor - */ - createSampler(descriptor: SamplerDescriptor): Sampler { - return new Sampler_WebGPU({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - createRenderTarget(descriptor: RenderTargetDescriptor): RenderTarget { - const texture = new Texture_WebGPU({ - id: this.getNextUniqueId(), - device: this, - descriptor: { - ...descriptor, - dimension: TextureDimension.TEXTURE_2D, - numLevels: 1, - depth: 1, - usage: TextureUsage.RENDER_TARGET, - }, - sampleCount: descriptor.sampleCount, - }) as unknown as Attachment_WebGPU; - - texture.depthOrArrayLayers = 1; - // @ts-ignore - texture.type = ResourceType.RenderTarget; - return texture as unknown as RenderTarget; - } - - createRenderTargetFromTexture(texture: Texture): RenderTarget { - const { - pixelFormat, - width, - height, - depthOrArrayLayers, - sampleCount, - numLevels, - gpuTexture, - gpuTextureView, - usage, - } = texture as Texture_WebGPU; - - assert(!!(usage & GPUTextureUsage.RENDER_ATTACHMENT)); - - const attachment = new Texture_WebGPU({ - id: this.getNextUniqueId(), - device: this, - descriptor: { - pixelFormat, - width, - height, - depth: depthOrArrayLayers, - dimension: TextureDimension.TEXTURE_2D, - numLevels, - usage, - }, - skipCreate: true, - }) as unknown as Attachment_WebGPU; - - attachment.depthOrArrayLayers = depthOrArrayLayers; - attachment.sampleCount = sampleCount; - attachment.gpuTexture = gpuTexture; - attachment.gpuTextureView = gpuTextureView; - return attachment as unknown as RenderTarget; - } - - createProgram(descriptor: ProgramDescriptor): Program { - // preprocess GLSL first - if (descriptor.vertex?.glsl) { - descriptor.vertex.glsl = preprocessShader_GLSL( - this.queryVendorInfo(), - 'vert', - descriptor.vertex.glsl, - ); - } - if (descriptor.fragment?.glsl) { - descriptor.fragment.glsl = preprocessShader_GLSL( - this.queryVendorInfo(), - 'frag', - descriptor.fragment.glsl, - ); - } - - return new Program_WebGPU({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - createTextureShared( - descriptor: TextureSharedDescriptor, - texture: TextureShared_WebGPU, - skipCreate: boolean, - ) { - const size: GPUExtent3D = { - width: descriptor.width, - height: descriptor.height, - depthOrArrayLayers: descriptor.depthOrArrayLayers, - }; - const mipLevelCount = descriptor.numLevels; - const format = translateTextureFormat(descriptor.pixelFormat); - const dimension = translateTextureDimension(descriptor.dimension); - const usage = translateTextureUsage(descriptor.usage); - - texture.format = format; - texture.dimension = descriptor.dimension; - texture.pixelFormat = descriptor.pixelFormat; - texture.width = descriptor.width; - texture.height = descriptor.height; - texture.depthOrArrayLayers = descriptor.depthOrArrayLayers; - texture.numLevels = mipLevelCount; - texture.usage = usage; - texture.sampleCount = descriptor.sampleCount; - - if (!skipCreate) { - const gpuTexture = this.device.createTexture({ - size, - mipLevelCount, - format, - dimension, - sampleCount: descriptor.sampleCount, - usage, - }); - const gpuTextureView = gpuTexture.createView(); - texture.gpuTexture = gpuTexture; - texture.gpuTextureView = gpuTextureView; - } - } - - getFallbackSampler(samplerEntry: BindingLayoutSamplerDescriptor): Sampler { - const formatKind = samplerEntry.formatKind; - if (formatKind === SamplerFormatKind.Depth && samplerEntry.comparison) { - return this.fallbackSamplerComparison; - } else { - return this.fallbackSamplerFiltering; - } - } - - getFallbackTexture(samplerEntry: BindingLayoutSamplerDescriptor): Texture { - const dimension = samplerEntry.dimension, - formatKind = samplerEntry.formatKind; - if (dimension === TextureDimension.TEXTURE_2D) - return formatKind === SamplerFormatKind.Depth - ? this.fallbackTexture2DDepth - : this.fallbackTexture2D; - else if (dimension === TextureDimension.TEXTURE_2D_ARRAY) - return this.fallbackTexture2DArray; - else if (dimension === TextureDimension.TEXTURE_3D) - return this.fallbackTexture3D; - else if (dimension === TextureDimension.TEXTURE_CUBE_MAP) - return this.fallbackTextureCube; - else throw new Error('whoops'); - } - - private createFallbackTexture( - dimension: TextureDimension, - formatKind: SamplerFormatKind, - ): Texture_WebGPU { - const depth = dimension === TextureDimension.TEXTURE_CUBE_MAP ? 6 : 1; - const pixelFormat = - formatKind === SamplerFormatKind.Float ? Format.U8_RGBA_NORM : Format.D24; - return this.createTexture({ - dimension, - pixelFormat, - usage: TextureUsage.SAMPLED, - width: 1, - height: 1, - depth, - numLevels: 1, - }) as Texture_WebGPU; - } - - createBindings(descriptor: BindingsDescriptor): Bindings { - return new Bindings_WebGPU({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - createInputLayout(descriptor: InputLayoutDescriptor): InputLayout { - return new InputLayout_WebGPU({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - createComputePipeline( - descriptor: ComputePipelineDescriptor, - ): ComputePipeline { - return new ComputePipeline_WebGPU({ - id: this.getNextUniqueId(), - device: this, - descriptor, - }); - } - - createRenderPipeline(descriptor: RenderPipelineDescriptor): RenderPipeline { - return new RenderPipeline_WebGPU({ - id: this.getNextUniqueId(), - device: this, - descriptor: { - ...descriptor, - // isCreatingAsync: false, - }, - }); - } - - createQueryPool(type: QueryPoolType, elemCount: number): QueryPool { - return new QueryPool_WebGPU({ - id: this.getNextUniqueId(), - device: this, - descriptor: { - type, - elemCount, - }, - }); - } - - private createBindGroupLayout( - bindingLayout: BindingLayoutDescriptor, - ): BindGroupLayout { - let gpuBindGroupLayout = this.bindGroupLayoutCache.get(bindingLayout); - if (gpuBindGroupLayout === null) { - gpuBindGroupLayout = this._createBindGroupLayoutInternal(bindingLayout); - this.bindGroupLayoutCache.add(bindingLayout, gpuBindGroupLayout); - } - return gpuBindGroupLayout; - } - - private _createBindGroupLayoutInternal( - bindingLayout: BindingLayoutDescriptor, - ): BindGroupLayout { - const entries: GPUBindGroupLayoutEntry[][] = [[], []]; - - if (bindingLayout.storageEntries) { - for (let i = 0; i < bindingLayout.storageEntries.length; i++) { - entries[0].push({ - binding: entries[0].length, - visibility: GPUShaderStage.COMPUTE, - buffer: { type: bindingLayout.storageEntries[i].type }, - }); - } - } - - for (let i = 0; i < bindingLayout.numUniformBuffers; i++) - entries[0].push({ - binding: entries[0].length, - visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT, - buffer: { type: 'uniform', hasDynamicOffset: true }, - }); - - for (let i = 0; i < bindingLayout.numSamplers; i++) { - const samplerEntry = - bindingLayout.samplerEntries !== undefined - ? bindingLayout.samplerEntries[i] - : defaultBindingLayoutSamplerDescriptor; - entries[1].push({ - binding: entries[1].length, - visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT, - texture: translateBindGroupTextureBinding(samplerEntry), - }); - entries[1].push({ - binding: entries[1].length, - visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT, - sampler: translateBindGroupSamplerBinding(samplerEntry), - }); - } - - const gpuBindGroupLayout = entries - .map((entries) => - entries.length ? this.device.createBindGroupLayout({ entries }) : null, - ) - .filter((layout) => !!layout); - return { gpuBindGroupLayout }; - } - - private _createPipelineLayout( - bindingLayouts: BindingLayoutDescriptor[], - ): GPUPipelineLayout { - const bindGroupLayouts = bindingLayouts.flatMap( - (bindingLayout) => - this.createBindGroupLayout(bindingLayout).gpuBindGroupLayout, - ); - return this.device.createPipelineLayout({ bindGroupLayouts }); - } - - private createRenderPipelineInternal( - renderPipeline: RenderPipeline_WebGPU, - async = false, - ) { - // if (this.device.createRenderPipelineAsync === undefined) { - // async = false; - // } - - // // If we're already in the process of creating a the pipeline async, no need to kick the process off again... - // if (async && renderPipeline.isCreatingAsync) { - // return; - // } - - if (renderPipeline.gpuRenderPipeline !== null) { - return; - } - - const descriptor = renderPipeline.descriptor; - const program = descriptor.program as Program_WebGPU; - const vertexStage = program.vertexStage, - fragmentStage = program.fragmentStage; - if (vertexStage === null || fragmentStage === null) return; - - descriptor.megaStateDescriptor = { - ...copyMegaState(defaultMegaState), - ...descriptor.megaStateDescriptor, - }; - - const layout = this._createPipelineLayout(descriptor.bindingLayouts || []); - const primitive = translatePrimitiveState( - descriptor.topology ?? PrimitiveTopology.TRIANGLES, - descriptor.megaStateDescriptor, - ); - const targets = translateTargets( - descriptor.colorAttachmentFormats, - descriptor.megaStateDescriptor, - ); - const depthStencil = translateDepthStencilState( - descriptor.depthStencilAttachmentFormat, - descriptor.megaStateDescriptor, - ); - - let buffers: GPUVertexBufferLayout[] | undefined = undefined; - if (descriptor.inputLayout !== null) - buffers = (descriptor.inputLayout as InputLayout_WebGPU).buffers; - const sampleCount = descriptor.sampleCount; - - // renderPipeline.isCreatingAsync = true; - - const gpuRenderPipelineDescriptor: GPURenderPipelineDescriptor = { - layout, - // layout: 'auto', - vertex: { - ...vertexStage, - buffers, - }, - primitive, - depthStencil, - multisample: { - count: sampleCount, - }, - fragment: { - ...fragmentStage, - targets, - }, - }; - - // TODO: async creation - // @see https://www.w3.org/TR/webgpu/#dom-gpudevice-createrenderpipeline - // renderPipeline.gpuRenderPipeline = - // this.device.createRenderPipeline(gpuRenderPipeline); - - // if (renderPipeline.name !== undefined) - // renderPipeline.gpuRenderPipeline.label = renderPipeline.name; - - // if (async) { - // const gpuRenderPipeline = await this.device.createRenderPipelineAsync( - // gpuRenderPipelineDescriptor, - // ); - - // // We might have created a sync pipeline while we were async building; no way to cancel the async - // // pipeline build at this point, so just chuck it out :/ - // if (renderPipeline.gpuRenderPipeline === null) - // renderPipeline.gpuRenderPipeline = gpuRenderPipeline; - // } else { - renderPipeline.gpuRenderPipeline = this.device.createRenderPipeline( - gpuRenderPipelineDescriptor, - ); - // } - - // // if (renderPipeline.ResourceName !== undefined) - // // renderPipeline.gpuRenderPipeline.label = renderPipeline.ResourceName; - - // renderPipeline.isCreatingAsync = false; - } - - createReadback(): Readback { - return new Readback_WebGPU({ - id: this.getNextUniqueId(), - device: this, - }); - } - - createRenderPass(renderPassDescriptor: RenderPassDescriptor): RenderPass { - let pass = this.renderPassPool.pop(); - if (pass === undefined) { - pass = new RenderPass_WebGPU(); - } - pass.commandEncoder = this.device.createCommandEncoder(); - pass.beginRenderPass(renderPassDescriptor); - return pass; - } - - createComputePass(): ComputePass { - let pass = this.computePassPool.pop(); - if (pass === undefined) pass = new ComputePass_WebGPU(); - pass.commandEncoder = this.device.createCommandEncoder(); - pass.beginComputePass(); - return pass; - } - - submitPass(_pass: RenderPass | ComputePass): void { - const queue = this.device.queue; - - const pass = _pass as RenderPass_WebGPU | ComputePass_WebGPU; - const commands = pass.finish(); - queue.submit([commands]); - pass.commandEncoder = null; - - // if (pass instanceof RenderPass_WebGPU) { - // pass.finish(); - // this.renderPassPool.push(pass); - - // if (pass.occlusionQueryPool !== null) { - // this.queryPoolsSubmitted.push(pass.occlusionQueryPool); - // } - // } else if (pass instanceof ComputePass_WebGPU) { - // pass.finish(); - // this.computePassPool.push(pass); - // } - } - - copySubTexture2D( - dst_: Texture, - dstX: number, - dstY: number, - src_: Texture, - srcX: number, - srcY: number, - ): void { - const cmd = this.device.createCommandEncoder(); - - const dst = dst_ as Texture_WebGPU; - const src = src_ as Texture_WebGPU; - const srcCopy: GPUImageCopyTexture = { - texture: src.gpuTexture, - origin: [srcX, srcY, 0], - }; - const dstCopy: GPUImageCopyTexture = { - texture: dst.gpuTexture, - origin: [dstX, dstY, 0], - }; - assert(!!(src.usage & GPUTextureUsage.COPY_SRC)); - assert(!!(dst.usage & GPUTextureUsage.COPY_DST)); - cmd.copyTextureToTexture(srcCopy, dstCopy, [src.width, src.height, 1]); - - this.device.queue.submit([cmd.finish()]); - } - - queryLimits(): DeviceLimits { - // GPUAdapter.limits - // @see https://www.w3.org/TR/webgpu/#gpu-supportedlimits - return { - uniformBufferMaxPageWordSize: - this.device.limits.maxUniformBufferBindingSize >>> 2, - uniformBufferWordAlignment: - this.device.limits.minUniformBufferOffsetAlignment >>> 2, - supportedSampleCounts: [1], - occlusionQueriesRecommended: true, - computeShadersSupported: true, - }; - } - - queryTextureFormatSupported( - format: Format, - width: number, - height: number, - ): boolean { - if (isFormatTextureCompressionBC(format)) { - if (!this.featureTextureCompressionBC) return false; - - const bb = getFormatBlockSize(format); - if (width % bb !== 0 || height % bb !== 0) return false; - return this.featureTextureCompressionBC; - } - - switch (format) { - case Format.U16_RGBA_NORM: - return false; - case Format.F32_RGBA: - return false; // unfilterable - } - - return true; - } - - queryPlatformAvailable(): boolean { - // TODO: should listen to lost event - return true; - } - - queryVendorInfo(): VendorInfo { - return this; - } - - queryRenderPass(o: RenderPass): Readonly { - const pass = o as RenderPass_WebGPU; - return pass.descriptor; - } - - queryRenderTarget(o: RenderTarget): Readonly { - const attachment = o as unknown as Attachment_WebGPU; - return attachment; - } - - setResourceName(o: Resource, s: string): void { - o.name = s; - - if (o.type === ResourceType.Buffer) { - const r = o as Buffer_WebGPU; - r.gpuBuffer.label = s; - } else if (o.type === ResourceType.Texture) { - const r = o as Texture_WebGPU; - r.gpuTexture.label = s; - r.gpuTextureView.label = s; - } else if (o.type === ResourceType.RenderTarget) { - const r = o as unknown as Attachment_WebGPU; - r.gpuTexture.label = s; - r.gpuTextureView.label = s; - } else if (o.type === ResourceType.Sampler) { - const r = o as Sampler_WebGPU; - r.gpuSampler.label = s; - } else if (o.type === ResourceType.RenderPipeline) { - const r = o as RenderPipeline_WebGPU; - if (r.gpuRenderPipeline !== null) r.gpuRenderPipeline.label = s; - } - } - - setResourceLeakCheck(o: Resource, v: boolean): void {} - - checkForLeaks(): void {} - - programPatched(o: Program): void {} - - pipelineQueryReady(o: RenderPipeline): boolean { - const renderPipeline = o as RenderPipeline_WebGPU; - return renderPipeline.gpuRenderPipeline !== null; - } - - pipelineForceReady(o: RenderPipeline): void { - const renderPipeline = o as RenderPipeline_WebGPU; - this.createRenderPipelineInternal(renderPipeline, false); - } -} diff --git a/packages/g-plugin-webgpu-device/src/platform/InputLayout.ts b/packages/g-plugin-webgpu-device/src/platform/InputLayout.ts deleted file mode 100644 index 1776a8062..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/InputLayout.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { - InputLayout, - InputLayoutDescriptor, -} from '@antv/g-plugin-device-renderer'; -import { assertExists, ResourceType } from '@antv/g-plugin-device-renderer'; -import type { IDevice_WebGPU } from './interfaces'; -import { ResourceBase_WebGPU } from './ResourceBase'; -import { - translateIndexFormat, - translateVertexStepMode, - translateVertexFormat, -} from './utils'; - -export class InputLayout_WebGPU - extends ResourceBase_WebGPU - implements InputLayout -{ - type: ResourceType.InputLayout = ResourceType.InputLayout; - - buffers: GPUVertexBufferLayout[]; - indexFormat: GPUIndexFormat | undefined; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: IDevice_WebGPU; - descriptor: InputLayoutDescriptor; - }) { - super({ id, device }); - - const buffers: GPUVertexBufferLayout[] = []; - for (let i = 0; i < descriptor.vertexAttributeDescriptors.length; i++) { - const attr = descriptor.vertexAttributeDescriptors[i]; - - const attribute: GPUVertexAttribute = { - shaderLocation: attr.location, - format: translateVertexFormat(attr.format), - offset: attr.bufferByteOffset, - }; - - if (buffers[attr.bufferIndex] !== undefined) { - (buffers[attr.bufferIndex].attributes as GPUVertexAttribute[]).push( - attribute, - ); - } else { - const b = assertExists( - descriptor.vertexBufferDescriptors[attr.bufferIndex], - ); - const arrayStride = b.byteStride; - const stepMode = translateVertexStepMode(b.stepMode); - const attributes: GPUVertexAttribute[] = [attribute]; - buffers[attr.bufferIndex] = { arrayStride, stepMode, attributes }; - } - } - - this.indexFormat = translateIndexFormat(descriptor.indexBufferFormat); - this.buffers = buffers; - } -} diff --git a/packages/g-plugin-webgpu-device/src/platform/Program.ts b/packages/g-plugin-webgpu-device/src/platform/Program.ts deleted file mode 100644 index 216ac18cf..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/Program.ts +++ /dev/null @@ -1,89 +0,0 @@ -import type { - Program, - ProgramDescriptor, -} from '@antv/g-plugin-device-renderer'; -import { ResourceType } from '@antv/g-plugin-device-renderer'; -import type { Device_WebGPU } from './Device'; -import type { IDevice_WebGPU } from './interfaces'; -import { ResourceBase_WebGPU } from './ResourceBase'; - -export class Program_WebGPU extends ResourceBase_WebGPU implements Program { - type: ResourceType.Program = ResourceType.Program; - descriptor: ProgramDescriptor; - vertexStage: GPUProgrammableStage | null = null; - fragmentStage: GPUProgrammableStage | null = null; - computeStage: GPUProgrammableStage | null = null; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: IDevice_WebGPU; - descriptor: ProgramDescriptor; - }) { - super({ id, device }); - - this.descriptor = descriptor; - if (descriptor.vertex) { - this.vertexStage = this.createShaderStage(descriptor.vertex, 'vertex'); - } - if (descriptor.fragment) { - this.fragmentStage = this.createShaderStage( - descriptor.fragment, - 'fragment', - ); - } - if (descriptor.compute) { - // Only support WGSL now - this.computeStage = this.createShaderStage(descriptor.compute, 'compute'); - } - } - - setUniformsLegacy(uniforms: Record = {}) {} - - private createShaderStage( - shader: { - glsl?: string; - wgsl?: string; - }, - shaderStage: 'vertex' | 'fragment' | 'compute', - ): GPUProgrammableStage { - const validationEnabled = false; - - // Use user-defined WGSL first. - let code = shader.wgsl; - if (!code) { - try { - code = (this.device as Device_WebGPU)['glsl_compile']( - shader.glsl, - shaderStage, - validationEnabled, - ); - } catch (e) { - console.error(e, shader.glsl); - throw new Error('whoops'); - } - } - - // Workaround for https://github.com/gfx-rs/naga/issues/1355 - for (const depthTextureName of ['u_TextureFramebufferDepth']) { - if (!code.includes(depthTextureName)) continue; - - code = code.replace( - `var T_${depthTextureName}: texture_2d;`, - `var T_${depthTextureName}: texture_depth_2d;`, - ); - code = code.replace( - new RegExp(`textureSample\\\(T_${depthTextureName}(.*)\\\);$`, 'gm'), - (sub, cap) => { - return `vec4(textureSample(T_${depthTextureName}${cap}), 0.0, 0.0, 0.0);`; - }, - ); - } - // @see https://www.w3.org/TR/webgpu/#dom-gpudevice-createshadermodule - const shaderModule = this.device.device.createShaderModule({ code }); - return { module: shaderModule, entryPoint: 'main' }; - } -} diff --git a/packages/g-plugin-webgpu-device/src/platform/QueryPool.ts b/packages/g-plugin-webgpu-device/src/platform/QueryPool.ts deleted file mode 100644 index c49d6695b..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/QueryPool.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { QueryPool, QueryPoolType } from '@antv/g-plugin-device-renderer'; -import { ResourceType } from '@antv/g-plugin-device-renderer'; -import type { IDevice_WebGPU } from './interfaces'; -import { ResourceBase_WebGPU } from './ResourceBase'; -import { translateQueryPoolType } from './utils'; - -export class QueryPool_WebGPU extends ResourceBase_WebGPU implements QueryPool { - type: ResourceType.QueryPool = ResourceType.QueryPool; - - querySet: GPUQuerySet; - resolveBuffer: GPUBuffer; - cpuBuffer: GPUBuffer; - results: BigUint64Array | null; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: IDevice_WebGPU; - descriptor: { - elemCount: number; - type: QueryPoolType; - }; - }) { - super({ id, device }); - const { elemCount, type } = descriptor; - - this.querySet = this.device.device.createQuerySet({ - type: translateQueryPoolType(type), - count: elemCount, - }); - - this.resolveBuffer = this.device.device.createBuffer({ - size: elemCount * 8, - usage: GPUBufferUsage.QUERY_RESOLVE | GPUBufferUsage.COPY_SRC, - }); - this.cpuBuffer = this.device.device.createBuffer({ - size: elemCount * 8, - usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ, - }); - this.results = null; - } - - queryResultOcclusion(dstOffs: number): boolean | null { - if (this.results === null) return null; - return this.results[dstOffs] !== BigInt(0); - } - - destroy(): void { - super.destroy(); - this.querySet.destroy(); - this.resolveBuffer.destroy(); - this.cpuBuffer.destroy(); - } -} diff --git a/packages/g-plugin-webgpu-device/src/platform/Readback.ts b/packages/g-plugin-webgpu-device/src/platform/Readback.ts deleted file mode 100644 index 9648ec000..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/Readback.ts +++ /dev/null @@ -1,369 +0,0 @@ -import { ERROR_MSG_METHOD_NOT_IMPLEMENTED } from '@antv/g-lite'; -import type { Buffer, Readback, Texture } from '@antv/g-plugin-device-renderer'; -import { - BufferFrequencyHint, - BufferUsage, - Format, - getFormatCompByteSize, - ResourceType, -} from '@antv/g-plugin-device-renderer'; -import type { Buffer_WebGPU } from './Buffer'; -import { GPUMapMode } from './constants'; -import type { IDevice_WebGPU } from './interfaces'; -import { ResourceBase_WebGPU } from './ResourceBase'; -import type { Texture_WebGPU } from './Texture'; -import { allocateAndCopyTypedBuffer, halfFloat2Number } from './utils'; - -export class Readback_WebGPU extends ResourceBase_WebGPU implements Readback { - type: ResourceType.Readback = ResourceType.Readback; - - constructor({ id, device }: { id: number; device: IDevice_WebGPU }) { - super({ id, device }); - } - - async readTexture( - t: Texture, - x: number, - y: number, - width: number, - height: number, - dst: ArrayBufferView, - dstOffset = 0, - length = 0, - ): Promise { - const texture = t as Texture_WebGPU; - - // FIXME: default to 0 for now - const faceIndex = 0; - - const blockInformation = this.getBlockInformationFromFormat(texture.format); - - const bytesPerRow = - Math.ceil(width / blockInformation.width) * blockInformation.length; - - // bytesPerRow (4) is not a multiple of 256, so we need to align it to 256. - const bytesPerRowAligned = Math.ceil(bytesPerRow / 256) * 256; - - const size = bytesPerRowAligned * height; - - const buffer = this.device.createBuffer({ - usage: BufferUsage.STORAGE | BufferUsage.MAP_READ | BufferUsage.COPY_DST, - hint: BufferFrequencyHint.STATIC, - viewOrSize: size, - }) as Buffer_WebGPU; - - const commandEncoder = this.device.device.createCommandEncoder(); - - // @see https://www.w3.org/TR/webgpu/#dom-gpucommandencoder-copytexturetobuffer - commandEncoder.copyTextureToBuffer( - { - texture: texture.gpuTexture, - mipLevel: 0, - origin: { - x, - y, - z: Math.max(faceIndex, 0), - }, - }, - { - buffer: buffer.gpuBuffer, - offset: 0, - bytesPerRow: bytesPerRowAligned, - }, - { - width, - height, - depthOrArrayLayers: 1, - }, - ); - - this.device.device.queue.submit([commandEncoder.finish()]); - - return this.readBuffer( - buffer, - 0, - dst.byteLength === size ? dst : null, - dstOffset, - size, - texture.pixelFormat, - ); - } - - readTextureSync( - t: Texture, - x: number, - y: number, - width: number, - height: number, - dst: ArrayBufferView, - dstOffset = 0, - length = 0, - ): ArrayBufferView { - throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED); - } - - readBuffer( - b: Buffer, - srcByteOffset = 0, - dstArrayBufferView: ArrayBufferView = null, - dstOffset = 0, - _size = 0, - type: Format = Format.U8_RGB, - noDataConversion = false, - destroy = false, - // bytesPerRow: number, - // bytesPerRowAligned: number, - ): Promise { - const buffer = b as Buffer_WebGPU; - - const size = _size || buffer.size; - const dst = dstArrayBufferView || buffer.view; - const floatFormat = - // @ts-ignore - (dst && dst.constructor && dst.constructor.BYTES_PER_ELEMENT) || - getFormatCompByteSize(type); - - let gpuReadBuffer: Buffer_WebGPU = buffer; - - // can read buffer directly? - if ( - !( - buffer.usage & BufferUsage.MAP_READ && - buffer.usage & BufferUsage.COPY_DST - ) - ) { - const commandEncoder = this.device.device.createCommandEncoder(); - - gpuReadBuffer = this.device.createBuffer({ - usage: - BufferUsage.STORAGE | BufferUsage.MAP_READ | BufferUsage.COPY_DST, - hint: BufferFrequencyHint.STATIC, - viewOrSize: size, - }) as Buffer_WebGPU; - - // Encode commands for copying buffer to buffer. - commandEncoder.copyBufferToBuffer( - buffer.gpuBuffer /* source buffer */, - srcByteOffset /* source offset */, - gpuReadBuffer.gpuBuffer /* destination buffer */, - 0 /* destination offset */, - size /* size */, - ); - - this.device.device.queue.submit([commandEncoder.finish()]); - } - - return new Promise((resolve, reject) => { - gpuReadBuffer.gpuBuffer - .mapAsync(GPUMapMode.READ, srcByteOffset, size) - .then( - () => { - const copyArrayBuffer = gpuReadBuffer.gpuBuffer.getMappedRange( - srcByteOffset, - size, - ); - let data = dst; - if (noDataConversion) { - if (data === null) { - data = allocateAndCopyTypedBuffer( - type, - size, - true, - copyArrayBuffer, - ); - } else { - // @ts-ignore - data = allocateAndCopyTypedBuffer( - type, - data.buffer, - undefined, - copyArrayBuffer, - ); - } - } else { - if (data === null) { - switch (floatFormat) { - case 1: // byte format - data = new Uint8Array(size); - (data as Uint8Array).set(new Uint8Array(copyArrayBuffer)); - break; - case 2: // half float - // TODO WEBGPU use computer shaders (or render pass) to make the conversion? - data = this.getHalfFloatAsFloatRGBAArrayBuffer( - size / 2, - copyArrayBuffer, - ); - break; - case 4: // float - data = new Float32Array(size / 4); - (data as Float32Array).set( - new Float32Array(copyArrayBuffer), - ); - break; - } - } else { - switch (floatFormat) { - case 1: // byte format - data = new Uint8Array(data.buffer); - (data as Uint8Array).set(new Uint8Array(copyArrayBuffer)); - break; - case 2: // half float - // TODO WEBGPU use computer shaders (or render pass) to make the conversion? - data = this.getHalfFloatAsFloatRGBAArrayBuffer( - size / 2, - copyArrayBuffer, - dst as Float32Array, - ); - break; - case 4: // float - const ctor = (dst && dst.constructor) || Float32Array; - - // @ts-ignore - data = new ctor(data.buffer); - // @ts-ignore - (data as ctor).set(new ctor(copyArrayBuffer)); - break; - } - } - } - // if (bytesPerRow !== bytesPerRowAligned) { - // // TODO WEBGPU use computer shaders (or render pass) to build the final buffer data? - // if (floatFormat === 1 && !noDataConversion) { - // // half float have been converted to float above - // bytesPerRow *= 2; - // bytesPerRowAligned *= 2; - // } - // const data2 = new Uint8Array(data!.buffer); - // let offset = bytesPerRow, - // offset2 = 0; - // for (let y = 1; y < height; ++y) { - // offset2 = y * bytesPerRowAligned; - // for (let x = 0; x < bytesPerRow; ++x) { - // data2[offset++] = data2[offset2++]; - // } - // } - // if (floatFormat !== 0 && !noDataConversion) { - // data = new Float32Array(data2.buffer, 0, offset / 4); - // } else { - // data = new Uint8Array(data2.buffer, 0, offset); - // } - // } - gpuReadBuffer.gpuBuffer.unmap(); - - resolve(data!); - }, - (reason) => reject(reason), - ); - }); - } - - private getHalfFloatAsFloatRGBAArrayBuffer( - dataLength: number, - arrayBuffer: ArrayBuffer, - destArray?: Float32Array, - ): Float32Array { - if (!destArray) { - destArray = new Float32Array(dataLength); - } - const srcData = new Uint16Array(arrayBuffer); - while (dataLength--) { - destArray[dataLength] = halfFloat2Number(srcData[dataLength]); - } - - return destArray; - } - - private getBlockInformationFromFormat(format: GPUTextureFormat): { - width: number; - height: number; - length: number; - } { - switch (format) { - // 8 bits formats - case 'r8unorm': - case 'r8snorm': - case 'r8uint': - case 'r8sint': - return { width: 1, height: 1, length: 1 }; - - // 16 bits formats - case 'r16uint': - case 'r16sint': - case 'r16float': - case 'rg8unorm': - case 'rg8snorm': - case 'rg8uint': - case 'rg8sint': - return { width: 1, height: 1, length: 2 }; - - // 32 bits formats - case 'r32uint': - case 'r32sint': - case 'r32float': - case 'rg16uint': - case 'rg16sint': - case 'rg16float': - case 'rgba8unorm': - case 'rgba8unorm-srgb': - case 'rgba8snorm': - case 'rgba8uint': - case 'rgba8sint': - case 'bgra8unorm': - case 'bgra8unorm-srgb': - case 'rgb9e5ufloat': - case 'rgb10a2unorm': - case 'rg11b10ufloat': - return { width: 1, height: 1, length: 4 }; - // 64 bits formats - case 'rg32uint': - case 'rg32sint': - case 'rg32float': - case 'rgba16uint': - case 'rgba16sint': - case 'rgba16float': - return { width: 1, height: 1, length: 8 }; - - // 128 bits formats - case 'rgba32uint': - case 'rgba32sint': - case 'rgba32float': - return { width: 1, height: 1, length: 16 }; - // Depth and stencil formats - case 'stencil8': - throw new Error('No fixed size for Stencil8 format!'); - case 'depth16unorm': - return { width: 1, height: 1, length: 2 }; - case 'depth24plus': - throw new Error('No fixed size for Depth24Plus format!'); - case 'depth24plus-stencil8': - throw new Error('No fixed size for Depth24PlusStencil8 format!'); - case 'depth32float': - return { width: 1, height: 1, length: 4 }; - // case 'depth24unorm-stencil8': - // return { width: 1, height: 1, length: 4 }; - case 'depth32float-stencil8': - return { width: 1, height: 1, length: 5 }; - // BC compressed formats usable if "texture-compression-bc" is both - // supported by the device/user agent and enabled in requestDevice. - case 'bc7-rgba-unorm': - case 'bc7-rgba-unorm-srgb': - case 'bc6h-rgb-ufloat': - case 'bc6h-rgb-float': - case 'bc2-rgba-unorm': - case 'bc2-rgba-unorm-srgb': - case 'bc3-rgba-unorm': - case 'bc3-rgba-unorm-srgb': - case 'bc5-rg-unorm': - case 'bc5-rg-snorm': - return { width: 4, height: 4, length: 16 }; - - case 'bc4-r-unorm': - case 'bc4-r-snorm': - case 'bc1-rgba-unorm': - case 'bc1-rgba-unorm-srgb': - return { width: 4, height: 4, length: 8 }; - default: - return { width: 1, height: 1, length: 4 }; - } - } -} diff --git a/packages/g-plugin-webgpu-device/src/platform/RenderPass.ts b/packages/g-plugin-webgpu-device/src/platform/RenderPass.ts deleted file mode 100644 index a0f5db22a..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/RenderPass.ts +++ /dev/null @@ -1,401 +0,0 @@ -import { - Bindings, - Buffer, - IndexBufferDescriptor, - InputLayout, - RenderPass, - RenderPassDescriptor, - RenderPipeline, - VertexBufferDescriptor, -} from '@antv/g-plugin-device-renderer'; -import { - assert, - assertExists, - FormatFlags, - getFormatFlags, -} from '@antv/g-plugin-device-renderer'; -import { isNil } from '@antv/util'; -import type { Bindings_WebGPU } from './Bindings'; -import { GPUTextureUsage } from './constants'; -import type { InputLayout_WebGPU } from './InputLayout'; -import type { Attachment_WebGPU, TextureShared_WebGPU } from './interfaces'; -import type { RenderPipeline_WebGPU } from './RenderPipeline'; -import type { Texture_WebGPU } from './Texture'; -import { getPlatformBuffer, getPlatformQuerySet } from './utils'; - -export class RenderPass_WebGPU implements RenderPass { - commandEncoder: GPUCommandEncoder | null = null; - descriptor: RenderPassDescriptor; - private gpuRenderPassEncoder: GPURenderPassEncoder | null = null; - private gpuRenderPassDescriptor: GPURenderPassDescriptor; - private gpuColorAttachments: GPURenderPassColorAttachment[]; - private gpuDepthStencilAttachment: GPURenderPassDepthStencilAttachment; - private gfxColorAttachment: (TextureShared_WebGPU | null)[] = []; - private gfxColorAttachmentLevel: number[] = []; - private gfxColorResolveTo: (TextureShared_WebGPU | null)[] = []; - private gfxColorResolveToLevel: number[] = []; - private gfxDepthStencilAttachment: TextureShared_WebGPU | null = null; - private gfxDepthStencilResolveTo: TextureShared_WebGPU | null = null; - - constructor() { - this.gpuColorAttachments = []; - - this.gpuDepthStencilAttachment = { - view: null, - depthLoadOp: 'load', - depthStoreOp: 'store', - stencilLoadOp: 'load', - stencilStoreOp: 'store', - }; - - this.gpuRenderPassDescriptor = { - colorAttachments: this.gpuColorAttachments, - depthStencilAttachment: this.gpuDepthStencilAttachment, - }; - } - - private getTextureView( - target: TextureShared_WebGPU, - level: number, - ): GPUTextureView { - assert(level < target.numLevels); - if (target.numLevels === 1) return target.gpuTextureView; - else - return target.gpuTexture.createView({ - baseMipLevel: level, - mipLevelCount: 1, - }); - } - - private setRenderPassDescriptor(descriptor: RenderPassDescriptor): void { - this.descriptor = descriptor; - - this.gpuRenderPassDescriptor.colorAttachments = this.gpuColorAttachments; - - const numColorAttachments = descriptor.colorAttachment.length; - this.gfxColorAttachment.length = numColorAttachments; - this.gfxColorResolveTo.length = numColorAttachments; - for (let i = 0; i < descriptor.colorAttachment.length; i++) { - let colorAttachment: TextureShared_WebGPU | null = descriptor - .colorAttachment[i] as unknown as Attachment_WebGPU; - let colorResolveTo: TextureShared_WebGPU | null = descriptor - .colorResolveTo[i] as Texture_WebGPU; - - // Do some dumb juggling... - if (colorAttachment === null && colorResolveTo !== null) { - colorAttachment = colorResolveTo as Texture_WebGPU; - colorResolveTo = null; - } - - this.gfxColorAttachment[i] = colorAttachment; - this.gfxColorResolveTo[i] = colorResolveTo; - - this.gfxColorAttachmentLevel[i] = - descriptor.colorAttachmentLevel?.[i] || 0; - this.gfxColorResolveToLevel[i] = descriptor.colorResolveToLevel?.[i] || 0; - - if (colorAttachment !== null) { - if (this.gpuColorAttachments[i] === undefined) { - this.gpuColorAttachments[i] = {} as GPURenderPassColorAttachment; - } - - const dstAttachment = this.gpuColorAttachments[i]; - dstAttachment.view = this.getTextureView( - colorAttachment, - this.gfxColorAttachmentLevel?.[i] || 0, - ); - const clearColor = descriptor.colorClearColor?.[i] ?? 'load'; - if (clearColor === 'load') { - dstAttachment.loadOp = 'load'; - } else { - dstAttachment.loadOp = 'clear'; - dstAttachment.clearValue = clearColor; - } - dstAttachment.storeOp = descriptor.colorStore?.[i] - ? 'store' - : 'discard'; - dstAttachment.resolveTarget = undefined; - if (colorResolveTo !== null) { - if (colorAttachment.sampleCount > 1) { - dstAttachment.resolveTarget = this.getTextureView( - colorResolveTo, - this.gfxColorResolveToLevel[i], - ); - } else { - dstAttachment.storeOp = 'store'; - } - } - } else { - // https://github.com/gpuweb/gpuweb/issues/1250 - this.gpuColorAttachments.length = i; - this.gfxColorAttachment.length = i; - this.gfxColorResolveTo.length = i; - break; - } - } - - this.gfxDepthStencilAttachment = - descriptor.depthStencilAttachment as unknown as Attachment_WebGPU; - this.gfxDepthStencilResolveTo = - descriptor.depthStencilResolveTo as Texture_WebGPU; - - if (descriptor.depthStencilAttachment) { - const dsAttachment = - descriptor.depthStencilAttachment as unknown as Attachment_WebGPU; - const dstAttachment = this.gpuDepthStencilAttachment; - dstAttachment.view = dsAttachment.gpuTextureView; - - const hasDepth = !!( - getFormatFlags(dsAttachment.pixelFormat) & FormatFlags.Depth - ); - if (hasDepth) { - if (descriptor.depthClearValue === 'load') { - dstAttachment.depthLoadOp = 'load'; - } else { - dstAttachment.depthLoadOp = 'clear'; - dstAttachment.depthClearValue = descriptor.depthClearValue; - } - - if ( - descriptor.depthStencilStore || - this.gfxDepthStencilResolveTo !== null - ) - dstAttachment.depthStoreOp = 'store'; - else dstAttachment.depthStoreOp = 'discard'; - } else { - dstAttachment.depthLoadOp = undefined; - dstAttachment.depthStoreOp = undefined; - } - - const hasStencil = !!( - getFormatFlags(dsAttachment.pixelFormat) & FormatFlags.Stencil - ); - if (hasStencil) { - if (descriptor.stencilClearValue === 'load') { - dstAttachment.stencilLoadOp = 'load'; - } else { - dstAttachment.stencilLoadOp = 'clear'; - dstAttachment.stencilClearValue = descriptor.stencilClearValue; - } - - if ( - descriptor.depthStencilStore || - this.gfxDepthStencilResolveTo !== null - ) - dstAttachment.stencilStoreOp = 'store'; - else dstAttachment.stencilStoreOp = 'discard'; - } else { - dstAttachment.stencilLoadOp = undefined; - dstAttachment.stencilStoreOp = undefined; - } - - this.gpuRenderPassDescriptor.depthStencilAttachment = - this.gpuDepthStencilAttachment; - } else { - this.gpuRenderPassDescriptor.depthStencilAttachment = undefined; - } - - this.gpuRenderPassDescriptor.occlusionQuerySet = !isNil( - descriptor.occlusionQueryPool, - ) - ? getPlatformQuerySet(descriptor.occlusionQueryPool) - : undefined; - } - - beginRenderPass(renderPassDescriptor: RenderPassDescriptor): void { - assert(this.gpuRenderPassEncoder === null); - this.setRenderPassDescriptor(renderPassDescriptor); - this.gpuRenderPassEncoder = this.commandEncoder.beginRenderPass( - this.gpuRenderPassDescriptor, - ); - } - - setViewport(x: number, y: number, w: number, h: number): void { - this.gpuRenderPassEncoder.setViewport(x, y, w, h, 0, 1); - } - - setScissor(x: number, y: number, w: number, h: number): void { - this.gpuRenderPassEncoder.setScissorRect(x, y, w, h); - } - - setPipeline(pipeline_: RenderPipeline): void { - const pipeline = pipeline_ as RenderPipeline_WebGPU; - const gpuRenderPipeline = assertExists(pipeline.gpuRenderPipeline); - this.gpuRenderPassEncoder.setPipeline(gpuRenderPipeline); - } - - setVertexInput( - inputLayout_: InputLayout | null, - vertexBuffers: (VertexBufferDescriptor | null)[] | null, - indexBuffer: IndexBufferDescriptor | null, - ): void { - if (inputLayout_ === null) return; - - const inputLayout = inputLayout_ as InputLayout_WebGPU; - if (indexBuffer !== null) - this.gpuRenderPassEncoder.setIndexBuffer( - getPlatformBuffer(indexBuffer.buffer), - assertExists(inputLayout.indexFormat), - indexBuffer.byteOffset, - ); - - for (let i = 0; i < vertexBuffers!.length; i++) { - const b = vertexBuffers![i]; - if (b === null) continue; - this.gpuRenderPassEncoder.setVertexBuffer( - i, - getPlatformBuffer(b.buffer), - b.byteOffset, - ); - } - } - - setBindings( - bindingLayoutIndex: number, - bindings_: Bindings, - dynamicByteOffsets: number[], - ): void { - const bindings = bindings_ as Bindings_WebGPU; - this.gpuRenderPassEncoder.setBindGroup( - bindingLayoutIndex + 0, - bindings.gpuBindGroup[0], - dynamicByteOffsets.slice(0, bindings.bindingLayout.numUniformBuffers), - ); - if (bindings.gpuBindGroup[1]) { - this.gpuRenderPassEncoder.setBindGroup( - bindingLayoutIndex + 1, - bindings.gpuBindGroup[1], - ); - } - } - - setStencilRef(ref: number): void { - this.gpuRenderPassEncoder.setStencilReference(ref); - } - - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpurendercommandsmixin-draw - */ - draw( - vertexCount: number, - instanceCount?: number, - firstVertex?: number, - firstInstance?: number, - ) { - this.gpuRenderPassEncoder.draw( - vertexCount, - instanceCount, - firstVertex, - firstInstance, - ); - } - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpurendercommandsmixin-drawindexed - */ - drawIndexed( - indexCount: number, - instanceCount?: number, - firstIndex?: number, - baseVertex?: number, - firstInstance?: number, - ) { - this.gpuRenderPassEncoder.drawIndexed( - indexCount, - instanceCount, - firstIndex, - baseVertex, - firstInstance, - ); - } - /** - * @see https://www.w3.org/TR/webgpu/#dom-gpurendercommandsmixin-drawindirect - */ - drawIndirect(indirectBuffer: Buffer, indirectOffset: number) { - // TODO - } - - beginOcclusionQuery(dstOffs: number): void { - this.gpuRenderPassEncoder.beginOcclusionQuery(dstOffs); - } - - endOcclusionQuery(dstOffs: number): void { - this.gpuRenderPassEncoder.endOcclusionQuery(); - } - - pushDebugGroup(name: string): void { - this.gpuRenderPassEncoder.pushDebugGroup(name); - } - - popDebugGroup(): void { - this.gpuRenderPassEncoder.popDebugGroup(); - } - - insertDebugMarker(markerLabel: string) { - this.gpuRenderPassEncoder.insertDebugMarker(markerLabel); - } - - finish(): GPUCommandBuffer { - this.gpuRenderPassEncoder.end(); - this.gpuRenderPassEncoder = null; - - // Fake a resolve with a copy for non-MSAA. - for (let i = 0; i < this.gfxColorAttachment.length; i++) { - const colorAttachment = this.gfxColorAttachment[i]; - const colorResolveTo = this.gfxColorResolveTo[i]; - - if ( - colorAttachment !== null && - colorResolveTo !== null && - colorAttachment.sampleCount === 1 - ) { - this.copyAttachment( - colorResolveTo, - this.gfxColorAttachmentLevel[i], - colorAttachment, - this.gfxColorResolveToLevel[i], - ); - } - } - - if (this.gfxDepthStencilAttachment && this.gfxDepthStencilResolveTo) { - if (this.gfxDepthStencilAttachment.sampleCount > 1) { - // TODO(jstpierre): MSAA depth resolve (requires shader) - } else { - this.copyAttachment( - this.gfxDepthStencilResolveTo, - 0, - this.gfxDepthStencilAttachment, - 0, - ); - } - } - - return this.commandEncoder.finish(); - } - - private copyAttachment( - dst: TextureShared_WebGPU, - dstLevel: number, - src: TextureShared_WebGPU, - srcLevel: number, - ): void { - assert(src.sampleCount === 1); - const srcCopy: GPUImageCopyTexture = { - texture: src.gpuTexture, - mipLevel: srcLevel, - }; - const dstCopy: GPUImageCopyTexture = { - texture: dst.gpuTexture, - mipLevel: dstLevel, - }; - assert(src.width >>> srcLevel === dst.width >>> dstLevel); - assert(src.height >>> srcLevel === dst.height >>> dstLevel); - assert(!!(src.usage & GPUTextureUsage.COPY_SRC)); - assert(!!(dst.usage & GPUTextureUsage.COPY_DST)); - this.commandEncoder.copyTextureToTexture(srcCopy, dstCopy, [ - dst.width, - dst.height, - 1, - ]); - } -} diff --git a/packages/g-plugin-webgpu-device/src/platform/RenderPipeline.ts b/packages/g-plugin-webgpu-device/src/platform/RenderPipeline.ts deleted file mode 100644 index e2597954e..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/RenderPipeline.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { - RenderPipeline, - RenderPipelineDescriptor, -} from '@antv/g-plugin-device-renderer'; -import { ResourceType } from '@antv/g-plugin-device-renderer'; -import type { IDevice_WebGPU } from './interfaces'; -import { ResourceBase_WebGPU } from './ResourceBase'; - -export class RenderPipeline_WebGPU - extends ResourceBase_WebGPU - implements RenderPipeline -{ - type: ResourceType.RenderPipeline = ResourceType.RenderPipeline; - - descriptor: RenderPipelineDescriptor; - isCreatingAsync = false; - gpuRenderPipeline: GPURenderPipeline | null = null; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: IDevice_WebGPU; - descriptor: RenderPipelineDescriptor; - }) { - super({ id, device }); - - this.descriptor = descriptor; - this.device['createRenderPipelineInternal'](this, false); - } - - getBindGroupLayout(index: number) { - return this.gpuRenderPipeline.getBindGroupLayout(index); - } -} diff --git a/packages/g-plugin-webgpu-device/src/platform/ResourceBase.ts b/packages/g-plugin-webgpu-device/src/platform/ResourceBase.ts deleted file mode 100644 index 4d7e4618e..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/ResourceBase.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { - Disposable, - ResourceBase, - ResourceType, -} from '@antv/g-plugin-device-renderer'; -import EventEmitter from 'eventemitter3'; -import type { IDevice_WebGPU } from './interfaces'; - -export abstract class ResourceBase_WebGPU - extends EventEmitter - implements ResourceBase, Disposable -{ - type: ResourceType; - - id: number; - - name: string; - - device: IDevice_WebGPU; - - constructor({ id, device }: { id: number; device: IDevice_WebGPU }) { - super(); - this.id = id; - this.device = device; - } - - destroy() {} -} diff --git a/packages/g-plugin-webgpu-device/src/platform/Sampler.ts b/packages/g-plugin-webgpu-device/src/platform/Sampler.ts deleted file mode 100644 index 281833483..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/Sampler.ts +++ /dev/null @@ -1,67 +0,0 @@ -import type { - Sampler, - SamplerDescriptor, -} from '@antv/g-plugin-device-renderer'; -import { - MipFilterMode, - ResourceType, - TexFilterMode, - assert, -} from '@antv/g-plugin-device-renderer'; -import { - translateMinMagFilter, - translateMipFilter, - translateWrapMode, - translateCompareMode, -} from './utils'; -import type { IDevice_WebGPU } from './interfaces'; -import { ResourceBase_WebGPU } from './ResourceBase'; - -export class Sampler_WebGPU extends ResourceBase_WebGPU implements Sampler { - type: ResourceType.Sampler = ResourceType.Sampler; - - // @see https://www.w3.org/TR/webgpu/#gpusampler - gpuSampler: GPUSampler; - - constructor({ - id, - device, - descriptor, - }: { - id: number; - device: IDevice_WebGPU; - descriptor: SamplerDescriptor; - }) { - super({ id, device }); - - const lodMinClamp = descriptor.minLOD; - const lodMaxClamp = - descriptor.mipFilter === MipFilterMode.NO_MIP - ? descriptor.minLOD - : descriptor.maxLOD; - - const maxAnisotropy = descriptor.maxAnisotropy ?? 1; - if (maxAnisotropy > 1) - assert( - descriptor.minFilter === TexFilterMode.BILINEAR && - descriptor.magFilter === TexFilterMode.BILINEAR && - descriptor.mipFilter === MipFilterMode.LINEAR, - ); - - this.gpuSampler = this.device.device.createSampler({ - addressModeU: translateWrapMode(descriptor.wrapS), - addressModeV: translateWrapMode(descriptor.wrapT), - addressModeW: translateWrapMode(descriptor.wrapQ ?? descriptor.wrapS), - lodMinClamp, - lodMaxClamp, - minFilter: translateMinMagFilter(descriptor.minFilter), - magFilter: translateMinMagFilter(descriptor.magFilter), - mipmapFilter: translateMipFilter(descriptor.mipFilter), - compare: - descriptor.compareMode !== undefined - ? translateCompareMode(descriptor.compareMode) - : undefined, - maxAnisotropy, - }); - } -} diff --git a/packages/g-plugin-webgpu-device/src/platform/Texture.ts b/packages/g-plugin-webgpu-device/src/platform/Texture.ts deleted file mode 100644 index 8f16886f2..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/Texture.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { - Format, - Texture, - TextureDescriptor, - TextureDimension, -} from '@antv/g-plugin-device-renderer'; -import { ResourceType } from '@antv/g-plugin-device-renderer'; -import type { IDevice_WebGPU, TextureShared_WebGPU } from './interfaces'; -import { ResourceBase_WebGPU } from './ResourceBase'; - -export class Texture_WebGPU - extends ResourceBase_WebGPU - implements TextureShared_WebGPU, Texture -{ - type: ResourceType.Texture = ResourceType.Texture; - pixelFormat: Format; - dimension: TextureDimension; - format: GPUTextureFormat; - width: number; - height: number; - depthOrArrayLayers: number; - numLevels: number; - sampleCount: number; - usage: GPUTextureUsageFlags; - gpuTexture: GPUTexture; - gpuTextureView: GPUTextureView; - - constructor({ - id, - device, - descriptor, - skipCreate, - sampleCount, - }: { - id: number; - device: IDevice_WebGPU; - descriptor: TextureDescriptor; - skipCreate?: boolean; - sampleCount?: number; - }) { - super({ id, device }); - - this.device.createTextureShared( - { - pixelFormat: descriptor.pixelFormat, - dimension: descriptor.dimension ?? TextureDimension.TEXTURE_2D, - width: descriptor.width, - height: descriptor.height, - depthOrArrayLayers: descriptor.depth ?? 1, - numLevels: descriptor.numLevels ?? 1, - usage: descriptor.usage, - sampleCount: sampleCount ?? 1, - }, - this, - skipCreate, - ); - } - - private textureFromImageBitmapOrCanvas( - device: GPUDevice, - sources: (ImageBitmap | HTMLCanvasElement | OffscreenCanvas)[], - depthOrArrayLayers: number, - ): [GPUTexture, number, number] { - const width = sources[0].width; - const height = sources[0].height; - const textureDescriptor: GPUTextureDescriptor = { - // Unlike in WebGL, the size of our texture must be set at texture creation time. - // This means we have to wait until the image is loaded to create the texture, since we won't - // know the size until then. - size: { width, height, depthOrArrayLayers }, - format: 'rgba8unorm', - usage: - GPUTextureUsage.TEXTURE_BINDING | - GPUTextureUsage.COPY_DST | - GPUTextureUsage.RENDER_ATTACHMENT, - }; - const texture = device.createTexture(textureDescriptor); - - for (let i = 0; i < sources.length; i++) { - const source = sources[0]; - device.queue.copyExternalImageToTexture( - { source }, - { texture, origin: [0, 0, i] }, - [width, height], - ); - } - - return [texture, width, height]; - } - - private isImageBitmapOrCanvases( - datas: (TexImageSource | ArrayBufferView)[], - ): datas is (ImageBitmap | HTMLCanvasElement | OffscreenCanvas)[] { - const data = datas[0]; - return ( - data instanceof ImageBitmap || - data instanceof HTMLCanvasElement || - data instanceof OffscreenCanvas - ); - } - - private isVideo( - datas: (TexImageSource | ArrayBufferView)[], - ): datas is HTMLVideoElement[] { - const data = datas[0]; - return data instanceof HTMLVideoElement; - } - - /** - * @see https://toji.dev/webgpu-best-practices/img-textures - */ - setImageData(datas: (TexImageSource | ArrayBufferView)[], firstMipLevel = 0) { - const { device } = this.device; - let texture: GPUTexture; - let width: number; - let height: number; - - if (this.isImageBitmapOrCanvases(datas)) { - [texture, width, height] = this.textureFromImageBitmapOrCanvas( - device, - datas, - this.depthOrArrayLayers, - ); - } else if (this.isVideo(datas)) { - // @see https://toji.dev/webgpu-best-practices/img-textures#creating-a-texture-from-an-htmlvideoelement-video-tag - texture = device.importExternalTexture({ - source: datas[0], - }) as unknown as GPUTexture; - } else { - // TODO: support ArrayBufferView[] - } - - this.width = width; - this.height = height; - this.gpuTexture = texture; - this.gpuTextureView = texture.createView(); - } - - destroy() { - super.destroy(); - // @see https://www.w3.org/TR/webgpu/#dom-gputexture-destroy - this.gpuTexture.destroy(); - } -} diff --git a/packages/g-plugin-webgpu-device/src/platform/constants.ts b/packages/g-plugin-webgpu-device/src/platform/constants.ts deleted file mode 100644 index 2846e0d99..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/constants.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @see https://github.com/gpuweb/cts/blob/main/src/webgpu/constants.ts - */ - -enum GPUTextureUsage { - COPY_SRC = 0x01, - COPY_DST = 0x02, - TEXTURE_BINDING = 0x04, - // SAMPLED= 0x04, - STORAGE_BINDING = 0x08, - STORAGE = 0x08, - RENDER_ATTACHMENT = 0x10, -} - -// @see https://www.w3.org/TR/webgpu/#typedefdef-gpumapmodeflags -enum GPUMapMode { - READ = 0x0001, - WRITE = 0x0002, -} - -export { GPUTextureUsage, GPUMapMode }; diff --git a/packages/g-plugin-webgpu-device/src/platform/interfaces.ts b/packages/g-plugin-webgpu-device/src/platform/interfaces.ts deleted file mode 100644 index ff1db8ac5..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/interfaces.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { - Format, - TextureDimension, - TextureUsage, - RenderTarget, - Device, -} from '@antv/g-plugin-device-renderer'; - -export interface TextureSharedDescriptor { - dimension: TextureDimension; - pixelFormat: Format; - width: number; - height: number; - depthOrArrayLayers: number; - numLevels: number; - sampleCount: number; - usage: TextureUsage; -} - -export interface TextureShared_WebGPU { - format: GPUTextureFormat; - dimension: TextureDimension; - pixelFormat: Format; - width: number; - height: number; - depthOrArrayLayers: number; - numLevels: number; - sampleCount: number; - usage: GPUTextureUsageFlags; - gpuTexture: GPUTexture; - gpuTextureView: GPUTextureView; -} - -export interface Attachment_WebGPU extends TextureShared_WebGPU, RenderTarget {} - -export interface BindGroupLayout { - gpuBindGroupLayout: GPUBindGroupLayout[]; -} - -export interface IDevice_WebGPU extends Device { - device: GPUDevice; - createTextureShared: ( - descriptor: TextureSharedDescriptor, - texture: TextureShared_WebGPU, - skipCreate: boolean, - ) => void; -} diff --git a/packages/g-plugin-webgpu-device/src/platform/utils.ts b/packages/g-plugin-webgpu-device/src/platform/utils.ts deleted file mode 100644 index 10cb2d26a..000000000 --- a/packages/g-plugin-webgpu-device/src/platform/utils.ts +++ /dev/null @@ -1,603 +0,0 @@ -import { GPUTextureUsage } from './constants'; -import type { - Buffer, - Sampler, - MegaStateDescriptor, - AttachmentState, - ChannelBlendState, - QueryPool, - BindingLayoutSamplerDescriptor, -} from '@antv/g-plugin-device-renderer'; -import { - BufferUsage, - WrapMode, - TexFilterMode, - MipFilterMode, - TextureDimension, - PrimitiveTopology, - CullMode, - FrontFace, - BlendFactor, - BlendMode, - CompareMode, - VertexStepMode, - TextureUsage, - QueryPoolType, - SamplerFormatKind, - align, - Format, - FormatTypeFlags, - getFormatByteSize, - getFormatTypeFlags, -} from '@antv/g-plugin-device-renderer'; -import type { Buffer_WebGPU } from './Buffer'; -import type { Sampler_WebGPU } from './Sampler'; -import type { QueryPool_WebGPU } from './QueryPool'; -import { isNil } from '@antv/util'; - -/** - * @see https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/usage#value - */ -export function translateTextureUsage( - usage: TextureUsage, -): GPUTextureUsageFlags { - let gpuUsage: GPUTextureUsageFlags = 0; - - if (usage & TextureUsage.SAMPLED) - gpuUsage |= GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST; - if (usage & TextureUsage.RENDER_TARGET) - gpuUsage |= - GPUTextureUsage.RENDER_ATTACHMENT | - GPUTextureUsage.TEXTURE_BINDING | - GPUTextureUsage.COPY_SRC | - GPUTextureUsage.COPY_DST; - - return gpuUsage; -} - -export function translateTextureFormat(format: Format): GPUTextureFormat { - if (format === Format.U8_R_NORM) return 'r8unorm'; - else if (format === Format.U8_RG_NORM) return 'rg8unorm'; - else if (format === Format.U8_RGBA_RT) return 'bgra8unorm'; - else if (format === Format.U8_RGBA_RT_SRGB) return 'bgra8unorm-srgb'; - else if (format === Format.U8_RGBA_NORM) return 'rgba8unorm'; - else if (format === Format.U8_RGBA_SRGB) return 'rgba8unorm-srgb'; - else if (format === Format.S8_R_NORM) return 'r8snorm'; - else if (format === Format.S8_RG_NORM) return 'rg8snorm'; - else if (format === Format.S8_RGBA_NORM) return 'rgba8snorm'; - else if (format === Format.U32_R) return 'r32uint'; - else if (format === Format.F16_RGBA) return 'rgba16float'; - else if (format === Format.F32_RGBA) return 'rgba32float'; - else if (format === Format.D24) return 'depth24plus'; - else if (format === Format.D24_S8) return 'depth24plus-stencil8'; - else if (format === Format.D32F) return 'depth32float'; - else if (format === Format.D32F_S8) return 'depth32float-stencil8'; - else if (format === Format.BC1) return 'bc1-rgba-unorm'; - else if (format === Format.BC1_SRGB) return 'bc1-rgba-unorm-srgb'; - else if (format === Format.BC2) return 'bc2-rgba-unorm'; - else if (format === Format.BC2_SRGB) return 'bc2-rgba-unorm-srgb'; - else if (format === Format.BC3) return 'bc3-rgba-unorm'; - else if (format === Format.BC3_SRGB) return 'bc3-rgba-unorm-srgb'; - else if (format === Format.BC4_SNORM) return 'bc4-r-snorm'; - else if (format === Format.BC4_UNORM) return 'bc4-r-unorm'; - else if (format === Format.BC5_SNORM) return 'bc5-rg-snorm'; - else if (format === Format.BC5_UNORM) return 'bc5-rg-unorm'; - else throw 'whoops'; -} - -export function translateTextureDimension( - dimension: TextureDimension, -): GPUTextureDimension { - if (dimension === TextureDimension.TEXTURE_2D) return '2d'; - else if (dimension === TextureDimension.TEXTURE_CUBE_MAP) return '2d'; - else if (dimension === TextureDimension.TEXTURE_2D_ARRAY) return '2d'; - else if (dimension === TextureDimension.TEXTURE_3D) return '3d'; - else throw new Error('whoops'); -} - -export function translateBufferUsage(usage_: BufferUsage): GPUBufferUsageFlags { - let usage = 0; - if (usage_ & BufferUsage.INDEX) usage |= GPUBufferUsage.INDEX; - if (usage_ & BufferUsage.VERTEX) usage |= GPUBufferUsage.VERTEX; - if (usage_ & BufferUsage.UNIFORM) usage |= GPUBufferUsage.UNIFORM; - if (usage_ & BufferUsage.STORAGE) usage |= GPUBufferUsage.STORAGE; - if (usage_ & BufferUsage.COPY_SRC) usage |= GPUBufferUsage.COPY_SRC; - usage |= GPUBufferUsage.COPY_DST; - return usage; -} - -export function translateWrapMode(wrapMode: WrapMode): GPUAddressMode { - if (wrapMode === WrapMode.CLAMP) return 'clamp-to-edge'; - else if (wrapMode === WrapMode.REPEAT) return 'repeat'; - else if (wrapMode === WrapMode.MIRROR) return 'mirror-repeat'; - else throw new Error('whoops'); -} - -export function translateMinMagFilter(texFilter: TexFilterMode): GPUFilterMode { - if (texFilter === TexFilterMode.BILINEAR) return 'linear'; - else if (texFilter === TexFilterMode.POINT) return 'nearest'; - else throw new Error('whoops'); -} - -// @see https://www.w3.org/TR/webgpu/#enumdef-gpumipmapfiltermode -export function translateMipFilter(mipFilter: MipFilterMode): GPUFilterMode { - if (mipFilter === MipFilterMode.LINEAR) return 'linear'; - else if (mipFilter === MipFilterMode.NEAREST) return 'nearest'; - else if (mipFilter === MipFilterMode.NO_MIP) return 'nearest'; - else throw new Error('whoops'); -} - -function translateSampleType(type: SamplerFormatKind): GPUTextureSampleType { - if (type === SamplerFormatKind.Float) return 'float'; - else if (type === SamplerFormatKind.Depth) return 'depth'; - else throw new Error('whoops'); -} - -export function translateBindGroupSamplerBinding( - sampler: BindingLayoutSamplerDescriptor, -): GPUSamplerBindingLayout { - if (sampler.formatKind === SamplerFormatKind.Depth && sampler.comparison) { - return { type: 'comparison' }; - } else if (sampler.formatKind === SamplerFormatKind.Float) { - return { type: 'filtering' }; - } else { - return { type: 'non-filtering' }; - } -} - -function translateViewDimension( - dimension: TextureDimension, -): GPUTextureViewDimension { - if (dimension === TextureDimension.TEXTURE_2D) return '2d'; - else if (dimension === TextureDimension.TEXTURE_2D_ARRAY) return '2d-array'; - else if (dimension === TextureDimension.TEXTURE_3D) return '3d'; - else if (dimension === TextureDimension.TEXTURE_CUBE_MAP) return 'cube'; - else throw new Error('whoops'); -} - -export function translateBindGroupTextureBinding( - sampler: BindingLayoutSamplerDescriptor, -): GPUTextureBindingLayout { - return { - sampleType: translateSampleType(sampler.formatKind), - viewDimension: translateViewDimension(sampler.dimension), - }; -} - -export function getPlatformBuffer(buffer_: Buffer): GPUBuffer { - const buffer = buffer_ as Buffer_WebGPU; - return buffer.gpuBuffer; -} - -export function getPlatformSampler(sampler_: Sampler): GPUSampler { - const sampler = sampler_ as Sampler_WebGPU; - return sampler.gpuSampler; -} - -export function getPlatformQuerySet(queryPool_: QueryPool): GPUQuerySet { - const queryPool = queryPool_ as QueryPool_WebGPU; - return queryPool.querySet; -} - -export function translateQueryPoolType(type: QueryPoolType): GPUQueryType { - if (type === QueryPoolType.OcclusionConservative) return 'occlusion'; - else throw new Error('whoops'); -} - -/** - * @see https://www.w3.org/TR/webgpu/#primitive-state - */ -export function translateTopology( - topology: PrimitiveTopology, -): GPUPrimitiveTopology { - switch (topology) { - case PrimitiveTopology.TRIANGLES: - return 'triangle-list'; - case PrimitiveTopology.POINTS: - return 'point-list'; - case PrimitiveTopology.TRIANGLE_STRIP: - return 'triangle-strip'; - case PrimitiveTopology.LINES: - return 'line-list'; - case PrimitiveTopology.LINE_STRIP: - return 'line-strip'; - default: - throw new Error('Unknown primitive topology mode'); - } -} - -/** - * @see https://www.w3.org/TR/webgpu/#enumdef-gpucullmode - */ -export function translateCullMode(cullMode: CullMode): GPUCullMode { - if (cullMode === CullMode.NONE) return 'none'; - else if (cullMode === CullMode.FRONT) return 'front'; - else if (cullMode === CullMode.BACK) return 'back'; - else throw new Error('whoops'); -} - -/** - * @see https://www.w3.org/TR/webgpu/#enumdef-gpufrontface - */ -export function translateFrontFace(frontFaceMode: FrontFace): GPUFrontFace { - if (frontFaceMode === FrontFace.CCW) return 'ccw'; - else if (frontFaceMode === FrontFace.CW) return 'cw'; - else throw new Error('whoops'); -} - -export function translatePrimitiveState( - topology: PrimitiveTopology, - megaStateDescriptor: MegaStateDescriptor, -): GPUPrimitiveState { - return { - topology: translateTopology(topology), - cullMode: translateCullMode(megaStateDescriptor.cullMode), - frontFace: translateFrontFace(megaStateDescriptor.frontFace), - }; -} - -/** - * @see https://www.w3.org/TR/webgpu/#enumdef-gpublendfactor - */ -export function translateBlendFactor(factor: BlendFactor): GPUBlendFactor { - if (factor === BlendFactor.ZERO) return 'zero'; - else if (factor === BlendFactor.ONE) return 'one'; - else if (factor === BlendFactor.SRC) return 'src'; - else if (factor === BlendFactor.ONE_MINUS_SRC) return 'one-minus-src'; - else if (factor === BlendFactor.DST) return 'dst'; - else if (factor === BlendFactor.ONE_MINUS_DST) return 'one-minus-dst'; - else if (factor === BlendFactor.SRC_ALPHA) return 'src-alpha'; - else if (factor === BlendFactor.ONE_MINUS_SRC_ALPHA) - return 'one-minus-src-alpha'; - else if (factor === BlendFactor.DST_ALPHA) return 'dst-alpha'; - else if (factor === BlendFactor.ONE_MINUS_DST_ALPHA) - return 'one-minus-dst-alpha'; - else if (factor === BlendFactor.CONST) return 'constant'; - else if (factor === BlendFactor.ONE_MINUS_CONSTANT) - return 'one-minus-constant'; - else if (factor === BlendFactor.SRC_ALPHA_SATURATE) - return 'src-alpha-saturated'; - else throw new Error('whoops'); -} - -/** - * @see https://www.w3.org/TR/webgpu/#enumdef-gpublendoperation - */ -export function translateBlendMode(mode: BlendMode): GPUBlendOperation { - if (mode === BlendMode.ADD) return 'add'; - else if (mode === BlendMode.SUBSTRACT) return 'subtract'; - else if (mode === BlendMode.REVERSE_SUBSTRACT) return 'reverse-subtract'; - else if (mode === BlendMode.MIN) return 'min'; - else if (mode === BlendMode.MAX) return 'max'; - else throw new Error('whoops'); -} - -function translateBlendComponent(ch: ChannelBlendState): GPUBlendComponent { - return { - operation: translateBlendMode(ch.blendMode), - srcFactor: translateBlendFactor(ch.blendSrcFactor), - dstFactor: translateBlendFactor(ch.blendDstFactor), - }; -} - -function blendComponentIsNil(ch: ChannelBlendState): boolean { - return ( - ch.blendMode === BlendMode.ADD && - ch.blendSrcFactor === BlendFactor.ONE && - ch.blendDstFactor === BlendFactor.ZERO - ); -} - -function translateBlendState( - attachmentState: AttachmentState, -): GPUBlendState | undefined { - if ( - blendComponentIsNil(attachmentState.rgbBlendState) && - blendComponentIsNil(attachmentState.alphaBlendState) - ) { - return undefined; - } else { - return { - color: translateBlendComponent(attachmentState.rgbBlendState), - alpha: translateBlendComponent(attachmentState.alphaBlendState), - }; - } -} - -export function translateColorState( - attachmentState: AttachmentState, - format: Format, -): GPUColorTargetState { - return { - format: translateTextureFormat(format), - blend: translateBlendState(attachmentState), - writeMask: attachmentState.channelWriteMask, - }; -} - -export function translateTargets( - colorAttachmentFormats: (Format | null)[], - megaStateDescriptor: MegaStateDescriptor, -): GPUColorTargetState[] { - return megaStateDescriptor.attachmentsState!.map((attachmentState, i) => { - return translateColorState(attachmentState, colorAttachmentFormats[i]!); - }); -} - -// @see https://www.w3.org/TR/webgpu/#enumdef-gpucomparefunction -export function translateCompareMode( - compareMode: CompareMode, -): GPUCompareFunction { - if (compareMode === CompareMode.NEVER) return 'never'; - else if (compareMode === CompareMode.LESS) return 'less'; - else if (compareMode === CompareMode.EQUAL) return 'equal'; - else if (compareMode === CompareMode.LEQUAL) return 'less-equal'; - else if (compareMode === CompareMode.GREATER) return 'greater'; - else if (compareMode === CompareMode.NOTEQUAL) return 'not-equal'; - else if (compareMode === CompareMode.GEQUAL) return 'greater-equal'; - else if (compareMode === CompareMode.ALWAYS) return 'always'; - else throw new Error('whoops'); -} - -export function translateDepthStencilState( - format: Format | null, - megaStateDescriptor: MegaStateDescriptor, -): GPUDepthStencilState | undefined { - if (isNil(format)) return undefined; - - return { - format: translateTextureFormat(format), - depthWriteEnabled: !!megaStateDescriptor.depthWrite, - depthCompare: translateCompareMode(megaStateDescriptor.depthCompare), - depthBias: megaStateDescriptor.polygonOffset ? 1 : 0, - depthBiasSlopeScale: megaStateDescriptor.polygonOffset ? 1 : 0, - }; -} - -export function translateIndexFormat( - format: Format | null, -): GPUIndexFormat | undefined { - if (format === null) return undefined; - else if (format === Format.U16_R) return 'uint16'; - else if (format === Format.U32_R) return 'uint32'; - else throw new Error('whoops'); -} - -export function translateVertexStepMode( - stepMode: VertexStepMode, -): GPUVertexStepMode { - if (stepMode === VertexStepMode.VERTEX) return 'vertex'; - else if (stepMode === VertexStepMode.INSTANCE) return 'instance'; - else throw new Error('whoops'); -} - -export function translateVertexFormat(format: Format): GPUVertexFormat { - if (format === Format.U8_R) return 'uint8x2'; - else if (format === Format.U8_RG) return 'uint8x2'; - else if (format === Format.U8_RGB) return 'uint8x4'; - else if (format === Format.U8_RGBA) return 'uint8x4'; - else if (format === Format.U8_RG_NORM) return 'unorm8x2'; - else if (format === Format.U8_RGBA_NORM) return 'unorm8x4'; - else if (format === Format.S8_RGB_NORM) return 'snorm8x4'; - else if (format === Format.S8_RGBA_NORM) return 'snorm8x4'; - else if (format === Format.U16_RG_NORM) return 'unorm16x2'; - else if (format === Format.U16_RGBA_NORM) return 'unorm16x4'; - else if (format === Format.S16_RG_NORM) return 'snorm16x2'; - else if (format === Format.S16_RGBA_NORM) return 'snorm16x4'; - else if (format === Format.S16_RG) return 'uint16x2'; - else if (format === Format.F16_RG) return 'float16x2'; - else if (format === Format.F16_RGBA) return 'float16x4'; - else if (format === Format.F32_R) return 'float32'; - else if (format === Format.F32_RG) return 'float32x2'; - else if (format === Format.F32_RGB) return 'float32x3'; - else if (format === Format.F32_RGBA) return 'float32x4'; - else throw 'whoops'; -} - -export function isFormatTextureCompressionBC(format: Format): boolean { - const formatTypeFlags = getFormatTypeFlags(format); - - switch (formatTypeFlags) { - case FormatTypeFlags.BC1: - case FormatTypeFlags.BC2: - case FormatTypeFlags.BC3: - case FormatTypeFlags.BC4_SNORM: - case FormatTypeFlags.BC4_UNORM: - case FormatTypeFlags.BC5_SNORM: - case FormatTypeFlags.BC5_UNORM: - return true; - default: - return false; - } -} - -export function getFormatByteSizePerBlock(format: Format): number { - const formatTypeFlags = getFormatTypeFlags(format); - - switch (formatTypeFlags) { - case FormatTypeFlags.BC1: - case FormatTypeFlags.BC4_SNORM: - case FormatTypeFlags.BC4_UNORM: - return 8; - case FormatTypeFlags.BC2: - case FormatTypeFlags.BC3: - case FormatTypeFlags.BC5_SNORM: - case FormatTypeFlags.BC5_UNORM: - return 16; - default: - return getFormatByteSize(format); - } -} - -export function getFormatBlockSize(format: Format): number { - const formatTypeFlags = getFormatTypeFlags(format); - - switch (formatTypeFlags) { - case FormatTypeFlags.BC1: - case FormatTypeFlags.BC2: - case FormatTypeFlags.BC3: - case FormatTypeFlags.BC4_SNORM: - case FormatTypeFlags.BC4_UNORM: - case FormatTypeFlags.BC5_SNORM: - case FormatTypeFlags.BC5_UNORM: - return 4; - default: - return 1; - } -} - -export function translateImageLayout( - layout: GPUImageDataLayout, - format: Format, - mipWidth: number, - mipHeight: number, -): void { - const blockSize = getFormatBlockSize(format); - - const numBlocksX = align(mipWidth, blockSize); - const numBlocksY = align(mipHeight, blockSize); - - layout.bytesPerRow = numBlocksX * getFormatByteSizePerBlock(format); - layout.rowsPerImage = numBlocksY; -} - -export function allocateAndCopyTypedBuffer( - type: Format, - sizeOrDstBuffer: number | ArrayBuffer, - sizeInBytes = false, - copyBuffer?: ArrayBuffer, -): ArrayBufferView { - switch (type) { - case Format.S8_R: - case Format.S8_R_NORM: - case Format.S8_RG_NORM: - case Format.S8_RGB_NORM: - case Format.S8_RGBA_NORM: { - const buffer = - sizeOrDstBuffer instanceof ArrayBuffer - ? new Int8Array(sizeOrDstBuffer) - : new Int8Array(sizeOrDstBuffer); - if (copyBuffer) { - buffer.set(new Int8Array(copyBuffer)); - } - return buffer; - } - case Format.U8_R: - case Format.U8_R_NORM: - case Format.U8_RG: - case Format.U8_RG_NORM: - case Format.U8_RGB: - case Format.U8_RGB_NORM: - case Format.U8_RGB_SRGB: - case Format.U8_RGBA: - case Format.U8_RGBA_NORM: - case Format.U8_RGBA_SRGB: { - const buffer = - sizeOrDstBuffer instanceof ArrayBuffer - ? new Uint8Array(sizeOrDstBuffer) - : new Uint8Array(sizeOrDstBuffer); - if (copyBuffer) { - buffer.set(new Uint8Array(copyBuffer)); - } - return buffer; - } - case Format.S16_R: - case Format.S16_RG: - case Format.S16_RG_NORM: - case Format.S16_RGB_NORM: - case Format.S16_RGBA: - case Format.S16_RGBA_NORM: { - const buffer = - sizeOrDstBuffer instanceof ArrayBuffer - ? new Int16Array(sizeOrDstBuffer) - : new Int16Array(sizeInBytes ? sizeOrDstBuffer / 2 : sizeOrDstBuffer); - if (copyBuffer) { - buffer.set(new Int16Array(copyBuffer)); - } - return buffer; - } - case Format.U16_R: - case Format.U16_RGB: - case Format.U16_RGBA_5551: - case Format.U16_RGBA_NORM: - case Format.U16_RG_NORM: - case Format.U16_R_NORM: { - const buffer = - sizeOrDstBuffer instanceof ArrayBuffer - ? new Uint16Array(sizeOrDstBuffer) - : new Uint16Array( - sizeInBytes ? sizeOrDstBuffer / 2 : sizeOrDstBuffer, - ); - if (copyBuffer) { - buffer.set(new Uint16Array(copyBuffer)); - } - return buffer; - } - case Format.S32_R: { - const buffer = - sizeOrDstBuffer instanceof ArrayBuffer - ? new Int32Array(sizeOrDstBuffer) - : new Int32Array(sizeInBytes ? sizeOrDstBuffer / 4 : sizeOrDstBuffer); - if (copyBuffer) { - buffer.set(new Int32Array(copyBuffer)); - } - return buffer; - } - case Format.U32_R: - case Format.U32_RG: { - const buffer = - sizeOrDstBuffer instanceof ArrayBuffer - ? new Uint32Array(sizeOrDstBuffer) - : new Uint32Array( - sizeInBytes ? sizeOrDstBuffer / 4 : sizeOrDstBuffer, - ); - if (copyBuffer) { - buffer.set(new Uint32Array(copyBuffer)); - } - return buffer; - } - case Format.F32_R: - case Format.F32_RG: - case Format.F32_RGB: - case Format.F32_RGBA: { - const buffer = - sizeOrDstBuffer instanceof ArrayBuffer - ? new Float32Array(sizeOrDstBuffer) - : new Float32Array( - sizeInBytes ? sizeOrDstBuffer / 4 : sizeOrDstBuffer, - ); - if (copyBuffer) { - buffer.set(new Float32Array(copyBuffer)); - } - return buffer; - } - } - - const buffer = - sizeOrDstBuffer instanceof ArrayBuffer - ? new Uint8Array(sizeOrDstBuffer) - : new Uint8Array(sizeOrDstBuffer); - if (copyBuffer) { - buffer.set(new Uint8Array(copyBuffer)); - } - return buffer; -} - -/** - * Converts a half float to a number - * @param value half float to convert - * @returns converted half float - */ -export function halfFloat2Number(value: number): number { - const s = (value & 0x8000) >> 15; - const e = (value & 0x7c00) >> 10; - const f = value & 0x03ff; - - if (e === 0) { - return (s ? -1 : 1) * Math.pow(2, -14) * (f / Math.pow(2, 10)); - } else if (e == 0x1f) { - return f ? NaN : (s ? -1 : 1) * Infinity; - } - - return (s ? -1 : 1) * Math.pow(2, e - 15) * (1 + f / Math.pow(2, 10)); -} diff --git a/packages/g-plugin-webgpu-device/tsconfig.json b/packages/g-plugin-webgpu-device/tsconfig.json deleted file mode 100644 index 22f1249b4..000000000 --- a/packages/g-plugin-webgpu-device/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "types": ["@webgpu/types"], - }, - "include": ["src/**/*"], - "exclude": ["node_modules"] -} \ No newline at end of file diff --git a/packages/g-web-components/CHANGELOG.md b/packages/g-web-components/CHANGELOG.md index 51dd8bc0e..19749628c 100644 --- a/packages/g-web-components/CHANGELOG.md +++ b/packages/g-web-components/CHANGELOG.md @@ -1,5 +1,12 @@ # @antv/g-web-components +## 1.9.21 + +### Patch Changes + +- Updated dependencies [83195bb7] + - @antv/g-webgl@1.9.21 + ## 1.9.20 ### Patch Changes diff --git a/packages/g-web-components/package.json b/packages/g-web-components/package.json index d680b4686..b2d3c4a8e 100644 --- a/packages/g-web-components/package.json +++ b/packages/g-web-components/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g-web-components", - "version": "1.9.20", + "version": "1.9.21", "description": "A declarative usage for G implemented with WebComponents", "keywords": [ "antv", diff --git a/packages/g-webgl/CHANGELOG.md b/packages/g-webgl/CHANGELOG.md index 0ab424deb..afaf938d3 100644 --- a/packages/g-webgl/CHANGELOG.md +++ b/packages/g-webgl/CHANGELOG.md @@ -1,5 +1,14 @@ # @antv/g-webgl +## 1.9.21 + +### Patch Changes + +- 83195bb7: Use @antv/g-device-api. +- Updated dependencies [83195bb7] +- Updated dependencies [769480aa] + - @antv/g-plugin-device-renderer@1.9.18 + ## 1.9.20 ### Patch Changes diff --git a/packages/g-webgl/package.json b/packages/g-webgl/package.json index c8b69b0da..e74892a40 100644 --- a/packages/g-webgl/package.json +++ b/packages/g-webgl/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g-webgl", - "version": "1.9.20", + "version": "1.9.21", "description": "A renderer implemented by WebGL1/2", "keywords": [ "antv", @@ -43,8 +43,8 @@ "@antv/g-plugin-dom-interaction": "workspace:*", "@antv/g-plugin-html-renderer": "workspace:*", "@antv/g-plugin-image-loader": "workspace:*", - "@antv/g-plugin-webgl-device": "workspace:*", "@antv/util": "^3.3.4", + "@antv/g-device-api": "^1.2.2", "tslib": "^2.5.3" }, "devDependencies": { diff --git a/packages/g-webgl/src/ContextRegisterPlugin.ts b/packages/g-webgl/src/ContextRegisterPlugin.ts index 17ddd206b..aa1947a9a 100644 --- a/packages/g-webgl/src/ContextRegisterPlugin.ts +++ b/packages/g-webgl/src/ContextRegisterPlugin.ts @@ -1,18 +1,35 @@ import { AbstractRendererPlugin } from '@antv/g-lite'; import type * as DeviceRenderer from '@antv/g-plugin-device-renderer'; import { WebGLContextService } from './WebGLContextService'; +import { WebGLDeviceContribution } from '@antv/g-device-api'; +import { WebGLRendererConfig } from '.'; export class ContextRegisterPlugin extends AbstractRendererPlugin { name = 'webgl-context-register'; - constructor(private rendererPlugin: DeviceRenderer.Plugin) { + constructor( + private rendererPlugin: DeviceRenderer.Plugin, + private config: Partial, + ) { super(); } init(): void { this.context.ContextService = WebGLContextService; - // @ts-ignore this.context.deviceRendererPlugin = this.rendererPlugin; + const config = this.config; + this.context.deviceContribution = new WebGLDeviceContribution({ + ...(config?.targets + ? { + targets: config.targets, + } + : { + targets: ['webgl2', 'webgl1'], + }), + onContextLost: config?.onContextLost, + onContextRestored: config?.onContextRestored, + onContextCreationError: config?.onContextCreationError, + }); } destroy(): void { delete this.context.ContextService; diff --git a/packages/g-webgl/src/index.ts b/packages/g-webgl/src/index.ts index 72922b886..6e787db7a 100644 --- a/packages/g-webgl/src/index.ts +++ b/packages/g-webgl/src/index.ts @@ -4,12 +4,11 @@ import * as DeviceRenderer from '@antv/g-plugin-device-renderer'; import * as DomInteraction from '@antv/g-plugin-dom-interaction'; import * as HTMLRenderer from '@antv/g-plugin-html-renderer'; import * as ImageLoader from '@antv/g-plugin-image-loader'; -import * as WebGLDevice from '@antv/g-plugin-webgl-device'; import { ContextRegisterPlugin } from './ContextRegisterPlugin'; -export { DomInteraction, DeviceRenderer, WebGLDevice, HTMLRenderer }; +export { DomInteraction, DeviceRenderer, HTMLRenderer }; -interface WebGLRendererConfig extends RendererConfig { +export interface WebGLRendererConfig extends RendererConfig { targets: ('webgl1' | 'webgl2')[]; onContextLost: (e: Event) => void; onContextRestored: (e: Event) => void; @@ -23,22 +22,10 @@ export class Renderer extends AbstractRenderer { const deviceRendererPlugin = new DeviceRenderer.Plugin(config); - this.registerPlugin(new ContextRegisterPlugin(deviceRendererPlugin)); - this.registerPlugin(new ImageLoader.Plugin()); this.registerPlugin( - new WebGLDevice.Plugin({ - ...(config?.targets - ? { - targets: config.targets, - } - : { - targets: ['webgl2', 'webgl1'], - }), - onContextLost: config?.onContextLost, - onContextRestored: config?.onContextRestored, - onContextCreationError: config?.onContextCreationError, - }), + new ContextRegisterPlugin(deviceRendererPlugin, config), ); + this.registerPlugin(new ImageLoader.Plugin()); this.registerPlugin(deviceRendererPlugin); this.registerPlugin(new DomInteraction.Plugin()); this.registerPlugin(new HTMLRenderer.Plugin()); diff --git a/packages/g-webgpu/CHANGELOG.md b/packages/g-webgpu/CHANGELOG.md index f37763779..4b5754ab9 100644 --- a/packages/g-webgpu/CHANGELOG.md +++ b/packages/g-webgpu/CHANGELOG.md @@ -1,5 +1,14 @@ # @antv/g-webgpu +## 1.9.21 + +### Patch Changes + +- 83195bb7: Use @antv/g-device-api. +- Updated dependencies [83195bb7] +- Updated dependencies [769480aa] + - @antv/g-plugin-device-renderer@1.9.18 + ## 1.9.20 ### Patch Changes diff --git a/packages/g-webgpu/package.json b/packages/g-webgpu/package.json index 3d3a4d875..0e46b5e17 100644 --- a/packages/g-webgpu/package.json +++ b/packages/g-webgpu/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g-webgpu", - "version": "1.9.20", + "version": "1.9.21", "description": "A renderer implemented by WebGPU", "keywords": [ "antv", @@ -43,7 +43,7 @@ "@antv/g-plugin-dom-interaction": "workspace:*", "@antv/g-plugin-html-renderer": "workspace:*", "@antv/g-plugin-image-loader": "workspace:*", - "@antv/g-plugin-webgpu-device": "workspace:*", + "@antv/g-device-api": "^1.2.2", "@antv/util": "^3.3.4", "@webgpu/types": "^0.1.6", "tslib": "^2.5.3" diff --git a/packages/g-webgpu/src/ContextRegisterPlugin.ts b/packages/g-webgpu/src/ContextRegisterPlugin.ts index 8fb3c89a1..1bbace469 100644 --- a/packages/g-webgpu/src/ContextRegisterPlugin.ts +++ b/packages/g-webgpu/src/ContextRegisterPlugin.ts @@ -1,17 +1,26 @@ import { AbstractRendererPlugin } from '@antv/g-lite'; import type * as DeviceRenderer from '@antv/g-plugin-device-renderer'; import { WebGPUContextService } from './WebGPUContextService'; +import { WebGPUDeviceContribution } from '@antv/g-device-api'; +import { WebGPURendererConfig } from '.'; export class ContextRegisterPlugin extends AbstractRendererPlugin { name = 'webgpu-context-register'; - constructor(private rendererPlugin: DeviceRenderer.Plugin) { + constructor( + private rendererPlugin: DeviceRenderer.Plugin, + private config: Partial, + ) { super(); } init(): void { this.context.ContextService = WebGPUContextService; - // @ts-ignore this.context.deviceRendererPlugin = this.rendererPlugin; + const config = this.config; + this.context.deviceContribution = new WebGPUDeviceContribution({ + shaderCompilerPath: config?.shaderCompilerPath, + onContextLost: config?.onContextLost, + }); } destroy(): void { delete this.context.ContextService; diff --git a/packages/g-webgpu/src/index.ts b/packages/g-webgpu/src/index.ts index 879ecbd1a..0f3c575d0 100644 --- a/packages/g-webgpu/src/index.ts +++ b/packages/g-webgpu/src/index.ts @@ -3,12 +3,11 @@ import * as DeviceRenderer from '@antv/g-plugin-device-renderer'; import * as DomInteraction from '@antv/g-plugin-dom-interaction'; import * as HTMLRenderer from '@antv/g-plugin-html-renderer'; import * as ImageLoader from '@antv/g-plugin-image-loader'; -import * as WebGPUDevice from '@antv/g-plugin-webgpu-device'; import { ContextRegisterPlugin } from './ContextRegisterPlugin'; -export { DomInteraction, DeviceRenderer, WebGPUDevice, HTMLRenderer }; +export { DomInteraction, DeviceRenderer, HTMLRenderer }; -interface WebGPURendererConfig extends RendererConfig { +export interface WebGPURendererConfig extends RendererConfig { shaderCompilerPath: string; onContextLost: () => void; } @@ -20,14 +19,10 @@ export class Renderer extends AbstractRenderer { super(config); const deviceRendererPlugin = new DeviceRenderer.Plugin(); - this.registerPlugin(new ContextRegisterPlugin(deviceRendererPlugin)); - this.registerPlugin(new ImageLoader.Plugin()); this.registerPlugin( - new WebGPUDevice.Plugin({ - shaderCompilerPath: config?.shaderCompilerPath, - onContextLost: config?.onContextLost, - }), + new ContextRegisterPlugin(deviceRendererPlugin, config), ); + this.registerPlugin(new ImageLoader.Plugin()); this.registerPlugin(deviceRendererPlugin); this.registerPlugin(new DomInteraction.Plugin()); this.registerPlugin(new HTMLRenderer.Plugin()); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6f95bef0a..2938e3a16 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,37 +21,40 @@ importers: version: 9.1.2 '@rollup/plugin-babel': specifier: ^6.0.3 - version: 6.0.3(@babel/core@7.22.5)(rollup@3.25.1) + version: 6.0.3(@babel/core@7.22.20)(rollup@3.29.2) '@rollup/plugin-commonjs': specifier: ^21.1.0 - version: 21.1.0(rollup@3.25.1) + version: 21.1.0(rollup@3.29.2) '@rollup/plugin-node-resolve': - specifier: ^15.1.0 - version: 15.1.0(rollup@3.25.1) + specifier: ^15.2.1 + version: 15.2.1(rollup@3.29.2) '@rollup/plugin-terser': specifier: ^0.4.3 - version: 0.4.3(rollup@3.25.1) + version: 0.4.3(rollup@3.29.2) '@rollup/plugin-typescript': - specifier: ^11.1.1 - version: 11.1.1(rollup@3.25.1)(typescript@5.1.3) + specifier: ^11.1.3 + version: 11.1.3(rollup@3.29.2)(typescript@5.2.2) + '@types/gl': + specifier: ^6.0.2 + version: 6.0.2 '@types/jest': specifier: ^26.0.24 version: 26.0.24 '@types/node': - specifier: ^14.18.51 - version: 14.18.51 + specifier: ^14.18.61 + version: 14.18.61 '@typescript-eslint/eslint-plugin': - specifier: ^5.0.0 - version: 5.48.1(@typescript-eslint/parser@5.48.1)(eslint@7.32.0)(typescript@5.1.3) + specifier: ^5.62.0 + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@7.32.0)(typescript@5.2.2) '@typescript-eslint/parser': - specifier: ^5.0.0 - version: 5.48.1(eslint@7.32.0)(typescript@5.1.3) + specifier: ^5.62.0 + version: 5.62.0(eslint@7.32.0)(typescript@5.2.2) canvas: specifier: ^2.11.2 version: 2.11.2 case-police: - specifier: ^0.5.10 - version: 0.5.10 + specifier: ^0.5.14 + version: 0.5.14 cross-env: specifier: ^6.0.3 version: 6.0.3 @@ -63,7 +66,7 @@ importers: version: 7.32.0 eslint-plugin-jest: specifier: 24.3.6 - version: 24.3.6(@typescript-eslint/eslint-plugin@5.48.1)(eslint@7.32.0)(typescript@5.1.3) + version: 24.3.6(@typescript-eslint/eslint-plugin@5.62.0)(eslint@7.32.0)(typescript@5.2.2) get-pixels: specifier: 3.3.3 version: 3.3.3 @@ -119,26 +122,26 @@ importers: specifier: ^4.4.1 version: 4.4.1 rollup: - specifier: ^3.25.1 - version: 3.25.1 + specifier: ^3.29.2 + version: 3.29.2 rollup-plugin-polyfill-node: specifier: ^0.8.0 - version: 0.8.0(rollup@3.25.1) + version: 0.8.0(rollup@3.29.2) rollup-plugin-visualizer: specifier: ^5.9.2 - version: 5.9.2(rollup@3.25.1) + version: 5.9.2(rollup@3.29.2) sinon: specifier: ^11.1.2 version: 11.1.2 ts-jest: specifier: ^26.5.6 - version: 26.5.6(jest@26.6.3)(typescript@5.1.3) + version: 26.5.6(jest@26.6.3)(typescript@5.2.2) typescript: - specifier: ^5.1.3 - version: 5.1.3 + specifier: ^5.2.2 + version: 5.2.2 vite: specifier: ^3.2.7 - version: 3.2.7(@types/node@14.18.51) + version: 3.2.7(@types/node@14.18.61) xmlserializer: specifier: ^0.6.1 version: 0.6.1 @@ -443,6 +446,9 @@ importers: packages/g-mobile-webgl: dependencies: + '@antv/g-device-api': + specifier: ^1.2.2 + version: 1.2.2 '@antv/g-lite': specifier: workspace:* version: link:../g-lite @@ -461,9 +467,6 @@ importers: '@antv/g-plugin-mobile-interaction': specifier: workspace:* version: link:../g-plugin-mobile-interaction - '@antv/g-plugin-webgl-device': - specifier: workspace:* - version: link:../g-plugin-webgl-device '@antv/util': specifier: ^3.3.4 version: 3.3.4 @@ -492,6 +495,9 @@ importers: packages/g-plugin-3d: dependencies: + '@antv/g-device-api': + specifier: ^1.2.2 + version: 1.2.2 '@antv/g-lite': specifier: workspace:* version: link:../g-lite @@ -671,10 +677,13 @@ importers: devDependencies: '@rollup/plugin-json': specifier: ^6.0.0 - version: 6.0.0(rollup@3.25.1) + version: 6.0.0(rollup@3.29.2) packages/g-plugin-device-renderer: dependencies: + '@antv/g-device-api': + specifier: ^1.2.2 + version: 1.2.2 '@antv/g-lite': specifier: workspace:* version: link:../g-lite @@ -752,18 +761,6 @@ importers: specifier: ^2.5.3 version: 2.5.3 - packages/g-plugin-gpgpu: - dependencies: - '@antv/g-lite': - specifier: workspace:* - version: link:../g-lite - '@antv/g-webgpu': - specifier: workspace:* - version: link:../g-webgpu - tslib: - specifier: ^2.5.3 - version: 2.5.3 - packages/g-plugin-html-renderer: dependencies: '@antv/g-lite': @@ -897,45 +894,6 @@ importers: specifier: ^2.5.3 version: 2.5.3 - packages/g-plugin-webgl-device: - dependencies: - '@antv/g-lite': - specifier: workspace:* - version: link:../g-lite - '@antv/g-plugin-device-renderer': - specifier: workspace:* - version: link:../g-plugin-device-renderer - '@antv/util': - specifier: ^3.3.4 - version: 3.3.4 - eventemitter3: - specifier: ^5.0.1 - version: 5.0.1 - tslib: - specifier: ^2.5.3 - version: 2.5.3 - - packages/g-plugin-webgpu-device: - dependencies: - '@antv/g-lite': - specifier: workspace:* - version: link:../g-lite - '@antv/g-plugin-device-renderer': - specifier: workspace:* - version: link:../g-plugin-device-renderer - '@antv/util': - specifier: ^3.3.4 - version: 3.3.4 - '@webgpu/types': - specifier: ^0.1.33 - version: 0.1.33 - eventemitter3: - specifier: ^5.0.1 - version: 5.0.1 - tslib: - specifier: ^2.5.3 - version: 2.5.3 - packages/g-plugin-yoga: dependencies: '@antv/g-lite': @@ -1062,6 +1020,9 @@ importers: packages/g-webgl: dependencies: + '@antv/g-device-api': + specifier: ^1.2.2 + version: 1.2.2 '@antv/g-lite': specifier: workspace:* version: link:../g-lite @@ -1077,9 +1038,6 @@ importers: '@antv/g-plugin-image-loader': specifier: workspace:* version: link:../g-plugin-image-loader - '@antv/g-plugin-webgl-device': - specifier: workspace:* - version: link:../g-plugin-webgl-device '@antv/util': specifier: ^3.3.4 version: 3.3.4 @@ -1096,6 +1054,9 @@ importers: packages/g-webgpu: dependencies: + '@antv/g-device-api': + specifier: ^1.2.2 + version: 1.2.2 '@antv/g-lite': specifier: workspace:* version: link:../g-lite @@ -1111,9 +1072,6 @@ importers: '@antv/g-plugin-image-loader': specifier: workspace:* version: link:../g-plugin-image-loader - '@antv/g-plugin-webgpu-device': - specifier: workspace:* - version: link:../g-plugin-webgpu-device '@antv/util': specifier: ^3.3.4 version: 3.3.4 @@ -1173,6 +1131,9 @@ importers: '@antv/g-components': specifier: ^1.9.1 version: link:../packages/g-components + '@antv/g-device-api': + specifier: ^1.2.2 + version: 1.2.2 '@antv/g-lite': specifier: ^1.2.12 version: link:../packages/g-lite @@ -1196,7 +1157,7 @@ importers: version: 3.3.4 '@antv/webgpu-graph': specifier: ^1.0.0 - version: 1.0.0(@antv/g-lite@packages+g-lite)(@antv/g-webgpu@packages+g-webgpu) + version: 1.0.0 '@naoak/workerize-transferable': specifier: ^0.1.0 version: 0.1.0(workerize-loader@2.0.2) @@ -1253,7 +1214,7 @@ importers: version: 6.1.0(react@16.13.1) react-i18next: specifier: ^11.1.0 - version: 11.1.0(i18next@23.2.1)(react@16.13.1) + version: 11.1.0(i18next@23.5.1)(react@16.13.1) react-split-pane: specifier: ^0.1.92 version: 0.1.92(react-dom@16.14.0)(react@16.13.1) @@ -1268,7 +1229,7 @@ importers: version: 3.0.2 typedoc: specifier: ^0.17.6 - version: 0.17.6(typescript@5.1.3) + version: 0.17.6(typescript@5.2.2) typedoc-plugin-markdown: specifier: ^2.2.11 version: 2.2.11(typedoc@0.17.6) @@ -1281,57 +1242,62 @@ importers: devDependencies: '@antv/dumi-theme-antv': specifier: ^0.3.18 - version: 0.3.18(@algolia/client-search@4.17.2)(@babel/core@7.22.5)(@types/react@16.9.35)(dumi@2.2.1)(jquery@3.7.0)(react-dom@16.14.0)(react@16.13.1)(search-insights@2.6.0) + version: 0.3.18(@algolia/client-search@4.20.0)(@babel/core@7.22.20)(@types/react@16.9.35)(dumi@2.2.1)(jquery@3.7.1)(react-dom@16.14.0)(react@16.13.1)(search-insights@2.8.2) dumi: specifier: ^2.2.1 - version: 2.2.1(@babel/core@7.22.5)(@types/node@14.18.51)(@types/react@16.9.35)(eslint@7.32.0)(jest@26.6.3)(postcss@8.4.24)(prettier@2.8.8)(react-dom@16.14.0)(react@16.13.1)(rollup@3.25.1)(styled-components@5.3.11)(stylelint@14.16.1)(typescript@5.1.3)(webpack@5.87.0) + version: 2.2.1(@babel/core@7.22.20)(@types/node@14.18.61)(@types/react@16.9.35)(eslint@7.32.0)(jest@26.6.3)(postcss@8.4.30)(prettier@2.8.8)(react-dom@16.14.0)(react@16.13.1)(rollup@3.29.2)(styled-components@6.0.8)(stylelint@14.16.1)(typescript@5.2.2)(webpack@5.88.2) workerize-loader: specifier: ^2.0.2 - version: 2.0.2(webpack@5.87.0) + version: 2.0.2(webpack@5.88.2) packages: - /@algolia/autocomplete-core@1.9.3(@algolia/client-search@4.17.2)(algoliasearch@4.17.2)(search-insights@2.6.0): + /@aashutoshrathi/word-wrap@1.2.6: + resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} + engines: {node: '>=0.10.0'} + dev: true + + /@algolia/autocomplete-core@1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.17.2)(search-insights@2.8.2): resolution: {integrity: sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw==} dependencies: - '@algolia/autocomplete-plugin-algolia-insights': 1.9.3(@algolia/client-search@4.17.2)(algoliasearch@4.17.2)(search-insights@2.6.0) - '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.17.2)(algoliasearch@4.17.2) + '@algolia/autocomplete-plugin-algolia-insights': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.17.2)(search-insights@2.8.2) + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.17.2) transitivePeerDependencies: - '@algolia/client-search' - algoliasearch - search-insights dev: true - /@algolia/autocomplete-plugin-algolia-insights@1.9.3(@algolia/client-search@4.17.2)(algoliasearch@4.17.2)(search-insights@2.6.0): + /@algolia/autocomplete-plugin-algolia-insights@1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.17.2)(search-insights@2.8.2): resolution: {integrity: sha512-a/yTUkcO/Vyy+JffmAnTWbr4/90cLzw+CC3bRbhnULr/EM0fGNvM13oQQ14f2moLMcVDyAx/leczLlAOovhSZg==} peerDependencies: search-insights: '>= 1 < 3' dependencies: - '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.17.2)(algoliasearch@4.17.2) - search-insights: 2.6.0 + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.17.2) + search-insights: 2.8.2 transitivePeerDependencies: - '@algolia/client-search' - algoliasearch dev: true - /@algolia/autocomplete-preset-algolia@1.9.3(@algolia/client-search@4.17.2)(algoliasearch@4.17.2): + /@algolia/autocomplete-preset-algolia@1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.17.2): resolution: {integrity: sha512-d4qlt6YmrLMYy95n5TB52wtNDr6EgAIPH81dvvvW8UmuWRgxEtY0NJiPwl/h95JtG2vmRM804M0DSwMCNZlzRA==} peerDependencies: '@algolia/client-search': '>= 4.9.1 < 6' algoliasearch: '>= 4.9.1 < 6' dependencies: - '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.17.2)(algoliasearch@4.17.2) - '@algolia/client-search': 4.17.2 + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.17.2) + '@algolia/client-search': 4.20.0 algoliasearch: 4.17.2 dev: true - /@algolia/autocomplete-shared@1.9.3(@algolia/client-search@4.17.2)(algoliasearch@4.17.2): + /@algolia/autocomplete-shared@1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.17.2): resolution: {integrity: sha512-Wnm9E4Ye6Rl6sTTqjoymD+l8DjSTHsHboVRYrKgEt8Q7UHm9nYbqhN/i0fhUYA3OAEH7WA8x3jfpnmJm3rKvaQ==} peerDependencies: '@algolia/client-search': '>= 4.9.1 < 6' algoliasearch: '>= 4.9.1 < 6' dependencies: - '@algolia/client-search': 4.17.2 + '@algolia/client-search': 4.20.0 algoliasearch: 4.17.2 dev: true @@ -1345,6 +1311,10 @@ packages: resolution: {integrity: sha512-fojbhYIS8ovfYs6hwZpy1O4mBfVRxNgAaZRqsdVQd54hU4MxYDYFCxagYX28lOBz7btcDHld6BMoWXvjzkx6iQ==} dev: true + /@algolia/cache-common@4.20.0: + resolution: {integrity: sha512-vCfxauaZutL3NImzB2G9LjLt36vKAckc6DhMp05An14kVo8F1Yofb6SIl6U3SaEz8pG2QOB9ptwM5c+zGevwIQ==} + dev: true + /@algolia/cache-in-memory@4.17.2: resolution: {integrity: sha512-UYQcMzPurNi+cPYkuPemTZkjKAjdgAS1hagC5irujKbrYnN4yscK4TkOI5tX+O8/KegtJt3kOK07OIrJ2QDAAw==} dependencies: @@ -1375,6 +1345,13 @@ packages: '@algolia/transporter': 4.17.2 dev: true + /@algolia/client-common@4.20.0: + resolution: {integrity: sha512-P3WgMdEss915p+knMMSd/fwiHRHKvDu4DYRrCRaBrsfFw7EQHon+EbRSm4QisS9NYdxbS04kcvNoavVGthyfqQ==} + dependencies: + '@algolia/requester-common': 4.20.0 + '@algolia/transporter': 4.20.0 + dev: true + /@algolia/client-personalization@4.17.2: resolution: {integrity: sha512-wc4UgOWxSYWz5wpuelNmlt895jA9twjZWM2ms17Ws8qCvBHF7OVGdMGgbysPB8790YnfvvDnSsWOv3CEj26Eow==} dependencies: @@ -1391,10 +1368,22 @@ packages: '@algolia/transporter': 4.17.2 dev: true + /@algolia/client-search@4.20.0: + resolution: {integrity: sha512-zgwqnMvhWLdpzKTpd3sGmMlr4c+iS7eyyLGiaO51zDZWGMkpgoNVmltkzdBwxOVXz0RsFMznIxB9zuarUv4TZg==} + dependencies: + '@algolia/client-common': 4.20.0 + '@algolia/requester-common': 4.20.0 + '@algolia/transporter': 4.20.0 + dev: true + /@algolia/logger-common@4.17.2: resolution: {integrity: sha512-EfXuweUE+1HiSMsQidaDWA5Lv4NnStYIlh7PO5pLkI+sdhbMX0e5AO5nUAMIFM1VkEANes70RA8fzhP6OqCqQQ==} dev: true + /@algolia/logger-common@4.20.0: + resolution: {integrity: sha512-xouigCMB5WJYEwvoWW5XDv7Z9f0A8VoXJc3VKwlHJw/je+3p2RcDXfksLI4G4lIVncFUYMZx30tP/rsdlvvzHQ==} + dev: true + /@algolia/logger-console@4.17.2: resolution: {integrity: sha512-JuG8HGVlJ+l/UEDK4h2Y8q/IEmRjQz1J0aS9tf6GPNbGYiSvMr1DDdZ+hqV3bb1XE6wU8Ypex56HisWMSpnG0A==} dependencies: @@ -1411,6 +1400,10 @@ packages: resolution: {integrity: sha512-Rfim23ztAhYpE9qm+KCfCRo+YLJCjiiTG+IpDdzUjMpYPhUtirQT0A35YEd/gKn86YNyydxS9w8iRSjwKh+L0A==} dev: true + /@algolia/requester-common@4.20.0: + resolution: {integrity: sha512-9h6ye6RY/BkfmeJp7Z8gyyeMrmmWsMOCRBXQDs4mZKKsyVlfIVICpcSibbeYcuUdurLhIlrOUkH3rQEgZzonng==} + dev: true + /@algolia/requester-node-http@4.17.2: resolution: {integrity: sha512-E0b0kyCDMvUIhQmDNd/mH4fsKJdEEX6PkMKrYJjzm6moo+rP22tqpq4Rfe7DZD8OB6/LsDD3zs3Kvd+L+M5wwQ==} dependencies: @@ -1425,12 +1418,20 @@ packages: '@algolia/requester-common': 4.17.2 dev: true + /@algolia/transporter@4.20.0: + resolution: {integrity: sha512-Lsii1pGWOAISbzeyuf+r/GPhvHMPHSPrTDWNcIzOE1SG1inlJHICaVe2ikuoRjcpgxZNU54Jl+if15SUCsaTUg==} + dependencies: + '@algolia/cache-common': 4.20.0 + '@algolia/logger-common': 4.20.0 + '@algolia/requester-common': 4.20.0 + dev: true + /@ampproject/remapping@2.2.1: resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} engines: {node: '>=6.0.0'} dependencies: '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.19 dev: true /@ant-design/colors@4.0.5: @@ -1493,16 +1494,16 @@ packages: resolution: {integrity: sha512-TGwPyFoAu4+iEJd0y1l0gHdBXCbUj8a4gR7P3GzZRfEfRnWfk+gswApzOSTd7c6HP402JOEF64PAJQKxQgSPSQ==} dependencies: '@antv/util': 2.0.17 - tslib: 2.5.3 + tslib: 2.6.2 dev: false /@antv/dom-util@2.0.4: resolution: {integrity: sha512-2shXUl504fKwt82T3GkuT4Uoc6p9qjCKnJ8gXGLSW4T1W37dqf9AV28aCfoVPHp2BUXpSsB+PAJX2rG/jLHsLQ==} dependencies: - tslib: 2.5.3 + tslib: 2.6.2 dev: false - /@antv/dumi-theme-antv@0.3.18(@algolia/client-search@4.17.2)(@babel/core@7.22.5)(@types/react@16.9.35)(dumi@2.2.1)(jquery@3.7.0)(react-dom@16.14.0)(react@16.13.1)(search-insights@2.6.0): + /@antv/dumi-theme-antv@0.3.18(@algolia/client-search@4.20.0)(@babel/core@7.22.20)(@types/react@16.9.35)(dumi@2.2.1)(jquery@3.7.1)(react-dom@16.14.0)(react@16.13.1)(search-insights@2.8.2): resolution: {integrity: sha512-o5G5mltYCYFc3TL2eeuoz4Fq0bvFxPJ2Zjt0oAnwFABzyF/ngczjuMdda+XyrZh4d9fNS+8cD7JnHmQ9MRc/AQ==} peerDependencies: dumi: ^2.0.0 @@ -1510,10 +1511,10 @@ packages: react-dom: '>=16.9.0' dependencies: '@ant-design/icons': 4.8.0(react-dom@16.14.0)(react@16.13.1) - '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.22.5) + '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.22.20) '@babel/standalone': 7.22.5 '@docsearch/css': 3.5.1 - '@docsearch/react': 3.5.1(@algolia/client-search@4.17.2)(@types/react@16.9.35)(react-dom@16.14.0)(react@16.13.1)(search-insights@2.6.0) + '@docsearch/react': 3.5.1(@algolia/client-search@4.20.0)(@types/react@16.9.35)(react-dom@16.14.0)(react@16.13.1)(search-insights@2.8.2) '@monaco-editor/react': 4.5.1(monaco-editor@0.25.2)(react-dom@16.14.0)(react@16.13.1) '@stackblitz/sdk': 1.9.0 antd: 4.24.10(react-dom@16.14.0)(react@16.13.1) @@ -1521,7 +1522,7 @@ packages: codesandbox: 2.2.3 d3-dsv: 3.0.1 docsearch.js: 2.6.3 - dumi: 2.2.1(@babel/core@7.22.5)(@types/node@14.18.51)(@types/react@16.9.35)(eslint@7.32.0)(jest@26.6.3)(postcss@8.4.24)(prettier@2.8.8)(react-dom@16.14.0)(react@16.13.1)(rollup@3.25.1)(styled-components@5.3.11)(stylelint@14.16.1)(typescript@5.1.3)(webpack@5.87.0) + dumi: 2.2.1(@babel/core@7.22.20)(@types/node@14.18.61)(@types/react@16.9.35)(eslint@7.32.0)(jest@26.6.3)(postcss@8.4.30)(prettier@2.8.8)(react-dom@16.14.0)(react@16.13.1)(rollup@3.29.2)(styled-components@6.0.8)(stylelint@14.16.1)(typescript@5.2.2)(webpack@5.88.2) front-matter: 4.0.2 fs-extra: 10.1.0 glob: 8.1.0 @@ -1546,7 +1547,7 @@ packages: reading-time: 1.5.0 semver: 7.5.3 size-sensor: 1.0.1 - slick-carousel: 1.8.1(jquery@3.7.0) + slick-carousel: 1.8.1(jquery@3.7.1) unified: 10.1.2 unist-util-visit: 4.1.2 uri-parse: 1.0.0 @@ -1577,17 +1578,16 @@ packages: d3-interpolate: 3.0.1 d3-timer: 1.0.10 detect-browser: 5.3.0 - tslib: 2.5.3 + tslib: 2.6.2 dev: false - /@antv/g-camera-api@1.0.40(@antv/g-lite@1.2.12): - resolution: {integrity: sha512-GhhNdrPlT+Pw9RtBqMsBEQxrXhbR8nbva4WxJ381/o4gTdSzF+DBEt4uND3u5mv910HeC2iNbq+8itQhMFvlTw==} - peerDependencies: - '@antv/g-lite': ^1.0.0 + /@antv/g-camera-api@1.2.13: + resolution: {integrity: sha512-grKT2auGRTm7YzCueP43VNxOhFnlN4KkVaEm2UCGNcu6WIpqoPMmCmCy9FPe7uOqrH+Rwhw1eXPLEczAVaFPkw==} dependencies: - '@antv/g-lite': 1.2.12 + '@antv/g-lite': 1.2.13 '@antv/util': 3.3.4 gl-matrix: 3.4.3 + tslib: 2.6.2 dev: false /@antv/g-canvas@0.5.14: @@ -1599,43 +1599,35 @@ packages: '@antv/path-util': 2.0.15 '@antv/util': 2.0.17 gl-matrix: 3.4.3 - tslib: 2.5.3 - dev: false - - /@antv/g-css-layout-api@1.0.38(@antv/g-lite@1.2.12): - resolution: {integrity: sha512-2KFNXOXVN20hVVFSyDiShLdFF1Bnc2whPDNQpfUgWlwlBTeUDx3Bd1tnNEuPg6MDQkV4luPE/1rEe8o6fOE3zg==} - peerDependencies: - '@antv/g-lite': ^1.0.0 - dependencies: - '@antv/g-lite': 1.2.12 + tslib: 2.6.2 dev: false - /@antv/g-css-typed-om-api@1.0.38(@antv/g-lite@1.2.12): - resolution: {integrity: sha512-eDLGxlzMyoJGdbORHeajC23JNXV3TjVInegFZdiZdYmS4jNBQzK/8Y7HKdlelfGTJZs4m19i5diHCSyQebNJoQ==} - peerDependencies: - '@antv/g-lite': ^1.0.0 + /@antv/g-device-api@1.2.2: + resolution: {integrity: sha512-JLcQT7uFvg0sV9x8CsUyHYtH8RqK4Gxsn02jsZxVkvcCYJzIvMo2ptLUhFye6ADgE+X22xniBUfCEZh/KvUazQ==} dependencies: - '@antv/g-lite': 1.2.12 + '@antv/util': 3.3.4 + '@webgpu/types': 0.1.34 + eventemitter3: 5.0.1 + gl-matrix: 3.4.3 + tslib: 2.6.2 dev: false - /@antv/g-dom-mutation-observer-api@1.0.38(@antv/g-lite@1.2.12): - resolution: {integrity: sha512-RIuXxTh5cFZz6OWc0D3n0ExlCEqBO/s5EQmLRB7QQTCBjrhBTqvJT7AV8Bp6reeBkCLyZ8eBjwIjc2LX9iWFnw==} - peerDependencies: - '@antv/g-lite': ^1.0.0 + /@antv/g-dom-mutation-observer-api@1.2.13: + resolution: {integrity: sha512-Ca0MKwRwKMlQS24akfYb9wZDQidW0SRPQmi4N/C0cwYj5dYkr9I4W1bBnyu0sZZFbzDeeLvT+9vx7kLKHEOIUw==} dependencies: - '@antv/g-lite': 1.2.12 + '@antv/g-lite': 1.2.13 dev: false - /@antv/g-lite@1.2.12: - resolution: {integrity: sha512-YHuOUyGZvWF8fj7c43MvWUigT++QuB+72tmTQckYzycS3PzN9FJMYEeI6jMuyC/HBgCSadizShpD2OVHHJ8suA==} + /@antv/g-lite@1.2.13: + resolution: {integrity: sha512-UnjyH/tpzjndfD7KxLASknMIJdrJ7O82NrAaN7z3s9REo9d6yb3yv7z38BZ414LiE1QW2T/D1DBOjq+9DI/eEw==} dependencies: '@antv/g-math': 2.0.2 '@antv/util': 3.3.4 - d3-color: 1.4.0 + d3-color: 1.4.1 eventemitter3: 5.0.1 gl-matrix: 3.4.3 rbush: 3.0.1 - tslib: 2.5.3 + tslib: 2.6.2 dev: false /@antv/g-math@0.1.9: @@ -1650,75 +1642,80 @@ packages: dependencies: '@antv/util': 3.3.4 gl-matrix: 3.4.3 - tslib: 2.5.3 + tslib: 2.6.2 dev: false - /@antv/g-plugin-device-renderer@1.9.14: - resolution: {integrity: sha512-w3ytNxZRulWYMmdjTKuD24/QlGtQLiqQypYmxLwKwV52JqE6zQz/9P8aC3zcgeB70C3CCKtHYC9Q/7bSl0UpcA==} + /@antv/g-plugin-device-renderer@1.9.17: + resolution: {integrity: sha512-X5RVUPxR/M71xfhUK+GHwKaXuGT1GSMOS/C3HNRH5KL/6AwlHi4sG9C2NQCuiu1J8QGHkWO6opqQL1k6V1LNWQ==} dependencies: - '@antv/g-lite': 1.2.12 + '@antv/g-lite': 1.2.13 '@antv/g-math': 2.0.2 - '@antv/g-plugin-image-loader': 1.3.12 - '@antv/g-shader-components': 1.8.4 + '@antv/g-plugin-image-loader': 1.3.13 + '@antv/g-shader-components': 1.8.5 '@antv/util': 3.3.4 - '@webgpu/types': 0.1.33 - earcut: 2.2.3 + '@webgpu/types': 0.1.34 + earcut: 2.2.4 eventemitter3: 5.0.1 gl-matrix: 3.4.3 - tslib: 2.5.3 + tslib: 2.6.2 dev: false - /@antv/g-plugin-dom-interaction@1.9.12: - resolution: {integrity: sha512-5amraSN4uxS5tXLg4oN/arhMJCJn+JxeWoS9gWqJXMwerQY/YPFAU0ujAOGlyofp8V/L5B5/HFqxhExHZuSr5A==} + /@antv/g-plugin-dom-interaction@1.9.13: + resolution: {integrity: sha512-StGNQv8wCWlRrQ8tYfTggHCSCmEgAhqDGhgkujYrgT0PqTH7nIbTlnVFvMq4afYiuW+2r5Yh1veTY7hunRJ7+w==} dependencies: - '@antv/g-lite': 1.2.12 - tslib: 2.5.3 + '@antv/g-lite': 1.2.13 + tslib: 2.6.2 dev: false - /@antv/g-plugin-gpgpu@1.7.50(@antv/g-lite@packages+g-lite)(@antv/g-webgpu@packages+g-webgpu): - resolution: {integrity: sha512-PR9449lG9omTBSHKyYiT4Z8LQtreQScHBX19A168tMwf7Nih5FNCJjFxzp/tLsZi2iY9j6VGk3PRxRAf3zF8AA==} - peerDependencies: - '@antv/g-lite': ^1.0.0 - '@antv/g-webgpu': ^1.0.1 + /@antv/g-plugin-gpgpu@1.9.20: + resolution: {integrity: sha512-5Pu90bX5cTF8b72oynpvXVoyrtv72CZ8mjgGqGf2PuMk2PYXcoWioeGb97E/Piiiqj/3t4ObpdF1Oxtg1OgSoQ==} dependencies: - '@antv/g-lite': link:packages/g-lite - '@antv/g-webgpu': link:packages/g-webgpu - tslib: 2.5.3 + '@antv/g-lite': 1.2.13 + '@antv/g-webgpu': 1.9.20 + tslib: 2.6.2 dev: false - /@antv/g-plugin-html-renderer@1.9.15: - resolution: {integrity: sha512-gZXqx+KWsDoOSLgSh8o7iCqu4Bt08XMePlep2hxVfHilPq6vVWFiWNVdIKq59jlIR3Ltx0Kzl9o1XDpPu/bPXg==} + /@antv/g-plugin-html-renderer@1.9.16: + resolution: {integrity: sha512-VdD1ahJejRu7ty9yqLvZPJJM67jz9yWSeSG6Yhm6SU/6oBkMgtjqiF55Vu1AZZ2XpeDD9hEibtwx4encjaT1zA==} dependencies: - '@antv/g-lite': 1.2.12 + '@antv/g-lite': 1.2.13 '@antv/util': 3.3.4 gl-matrix: 3.4.3 - tslib: 2.5.3 + tslib: 2.6.2 dev: false - /@antv/g-plugin-image-loader@1.3.12: - resolution: {integrity: sha512-2j8n/hE7efJ81hTa+BzleIGUyVJWoxI2gaXQJg3owp9e+kkDfHuqwKi0tvzPzYIX7H+TF4vQGmJibrWi+lNk/g==} + /@antv/g-plugin-image-loader@1.3.13: + resolution: {integrity: sha512-JIT+bADisGoaAmwa9Zq3S4HgkcyYjdiE8uiVGvjWif6uVplOuzxmLaXycIk7v/QevDhypfy0PhsW7n2D7Rh9BQ==} dependencies: - '@antv/g-lite': 1.2.12 + '@antv/g-lite': 1.2.13 '@antv/util': 3.3.4 gl-matrix: 3.4.3 - tslib: 2.5.3 + tslib: 2.6.2 dev: false - /@antv/g-plugin-webgl-device@1.7.54(@antv/g-lite@packages+g-lite)(@antv/g-plugin-device-renderer@1.9.14): - resolution: {integrity: sha512-1Bnf+eb5HcK7plBYSBAKQDc+KWW0VZ3paFv8rEfJCnp7nTt4kHH2j9wdjwHztft4eOaxdRH1hdV1Aom05sahqg==} - peerDependencies: - '@antv/g-lite': ^1.0.0 - '@antv/g-plugin-device-renderer': ^1.0.0 + /@antv/g-plugin-webgl-device@1.9.17: + resolution: {integrity: sha512-GVDbj9B92eiD82i4MfM738G3H9nyYBWDlLAHNAPeUTTLlJpEVwlUXO3X7udgFUnaZBVmBUIX9uY9e5edsPIJLA==} dependencies: - '@antv/g-lite': link:packages/g-lite - '@antv/g-plugin-device-renderer': 1.9.14 + '@antv/g-lite': 1.2.13 + '@antv/g-plugin-device-renderer': 1.9.17 '@antv/util': 3.3.4 - eventemitter3: 4.0.7 - tslib: 2.5.3 + eventemitter3: 5.0.1 + tslib: 2.6.2 + dev: false + + /@antv/g-plugin-webgpu-device@1.9.17: + resolution: {integrity: sha512-iK/xOactLqZph+iaGb/vyrSB2u213qC3EE6oDKyFo4TfCmK+5kObLjIbfPzbCwuqy+ILq6U+JYetHZbCKrcisA==} + dependencies: + '@antv/g-lite': 1.2.13 + '@antv/g-plugin-device-renderer': 1.9.17 + '@antv/util': 3.3.4 + '@webgpu/types': 0.1.34 + eventemitter3: 5.0.1 + tslib: 2.6.2 dev: false - /@antv/g-shader-components@1.8.4: - resolution: {integrity: sha512-QEuQQUw+hMR2PvvsDOo0iWNO9GzkVRwX5OHH7TNu3XXneSdRn9JnZiqYAexm72uK35fKU1O+kF4P61cI9UmN8A==} + /@antv/g-shader-components@1.8.5: + resolution: {integrity: sha512-MkVkTQBfA9mJ5jR75XA8yI96jcq4WC+p3VqxMNiiJ4mP7Oqb+oNqKJzxyX7Hfuu6IQ6PC2AOonE27OhR0z/5zg==} dev: false /@antv/g-svg@0.5.7: @@ -1728,30 +1725,28 @@ packages: '@antv/g-math': 0.1.9 '@antv/util': 2.0.17 detect-browser: 5.3.0 - tslib: 2.5.3 + tslib: 2.6.2 dev: false - /@antv/g-web-animations-api@1.0.39(@antv/g-lite@1.2.12): - resolution: {integrity: sha512-0QXVzjk8kKrVokxHLLphkJsMPvbhLgcQN8/eVUdPaj+A0Yf6Cpg/hquYaGBBuqzwoMVB0ROUsIvwXgRtoXQONA==} - peerDependencies: - '@antv/g-lite': ^1.0.0 + /@antv/g-web-animations-api@1.2.13: + resolution: {integrity: sha512-wrbGfYvdnHxvlMs2Mi176kE7uydwkMjOSi1n0pVmXM5OHNqnRY8CvKX7WF9HfnHBMGHEgFaw7fZRjIkv+Cyzww==} dependencies: - '@antv/g-lite': 1.2.12 + '@antv/g-lite': 1.2.13 '@antv/util': 3.3.4 + tslib: 2.6.2 dev: false - /@antv/g-webgl@1.7.74(@antv/g-lite@packages+g-lite): - resolution: {integrity: sha512-efi5NjuUWcIQt1kxp9kQSPIC9xwVzHbKiXSjrl6SkZ7rXWekBWfPsfnRca0zEzZQ91M90/F0jvdRLe6uXXqrIQ==} - peerDependencies: - '@antv/g-lite': ^1.0.0 + /@antv/g-webgl@1.9.20: + resolution: {integrity: sha512-Fm7yRLi44wbjVIpjzP7eh2OcOT8tsce54Lo3yEDeT5psNx+vWJ+1RzNJVhRHf1U9KhVpWOPoWLDzH3976/okSg==} dependencies: - '@antv/g-lite': link:packages/g-lite - '@antv/g-plugin-device-renderer': 1.9.14 - '@antv/g-plugin-dom-interaction': 1.9.12 - '@antv/g-plugin-html-renderer': 1.9.15 - '@antv/g-plugin-image-loader': 1.3.12 - '@antv/g-plugin-webgl-device': 1.7.54(@antv/g-lite@packages+g-lite)(@antv/g-plugin-device-renderer@1.9.14) + '@antv/g-lite': 1.2.13 + '@antv/g-plugin-device-renderer': 1.9.17 + '@antv/g-plugin-dom-interaction': 1.9.13 + '@antv/g-plugin-html-renderer': 1.9.16 + '@antv/g-plugin-image-loader': 1.3.13 + '@antv/g-plugin-webgl-device': 1.9.17 '@antv/util': 3.3.4 + tslib: 2.6.2 dev: false /@antv/g-webgpu-core@0.5.6: @@ -1797,6 +1792,20 @@ packages: reflect-metadata: 0.1.13 dev: false + /@antv/g-webgpu@1.9.20: + resolution: {integrity: sha512-WU6C0L5nPnOQFAOP30hhbWvXBYLINNL+FWbD6H9PQRU1R84PoXc8YmvHTMnCPtyCT0+aJBbqYIxr/5japeKlkg==} + dependencies: + '@antv/g-lite': 1.2.13 + '@antv/g-plugin-device-renderer': 1.9.17 + '@antv/g-plugin-dom-interaction': 1.9.13 + '@antv/g-plugin-html-renderer': 1.9.16 + '@antv/g-plugin-image-loader': 1.3.13 + '@antv/g-plugin-webgpu-device': 1.9.17 + '@antv/util': 3.3.4 + '@webgpu/types': 0.1.34 + tslib: 2.6.2 + dev: false + /@antv/g6-core@0.5.2: resolution: {integrity: sha512-4aYJXLDV75ezkmlITQh4y60Gasua8VpUQdh1BSHeiKTrYS3H9oY48DKXby+sTNyIzSX+8BA/mGhpNvGgIO46+g==} dependencies: @@ -1809,7 +1818,7 @@ packages: '@antv/path-util': 2.0.15 '@antv/util': 2.0.17 ml-matrix: 6.10.4 - tslib: 2.5.3 + tslib: 2.6.2 dev: false /@antv/g6-element@0.5.2: @@ -1866,15 +1875,13 @@ packages: '@antv/g6-pc': 0.5.2 dev: false - /@antv/g@5.16.33: - resolution: {integrity: sha512-11F82JsrXeJZTZSREiaPhnILkzoHqajkebA4fkPQ4XXjpoAcpIEow//NF8LbJOr3c1hogTyDh+aofwFeY+JnMw==} + /@antv/g@5.18.14: + resolution: {integrity: sha512-y7RX0URkj8DbwAvYE48SjktgOsNSj1oDmn4ShUpltNW85tG8DV8l39JWIioVeMn4k6XQBQbogv0n0r3dE62SPQ==} dependencies: - '@antv/g-camera-api': 1.0.40(@antv/g-lite@1.2.12) - '@antv/g-css-layout-api': 1.0.38(@antv/g-lite@1.2.12) - '@antv/g-css-typed-om-api': 1.0.38(@antv/g-lite@1.2.12) - '@antv/g-dom-mutation-observer-api': 1.0.38(@antv/g-lite@1.2.12) - '@antv/g-lite': 1.2.12 - '@antv/g-web-animations-api': 1.0.39(@antv/g-lite@1.2.12) + '@antv/g-camera-api': 1.2.13 + '@antv/g-dom-mutation-observer-api': 1.2.13 + '@antv/g-lite': 1.2.13 + '@antv/g-web-animations-api': 1.2.13 dev: false /@antv/hierarchy@0.6.11: @@ -1897,7 +1904,7 @@ packages: dependencies: '@antv/util': 2.0.17 gl-matrix: 3.4.3 - tslib: 2.5.3 + tslib: 2.6.2 dev: false /@antv/matrix-util@3.1.0-beta.3: @@ -1905,7 +1912,7 @@ packages: dependencies: '@antv/util': 2.0.17 gl-matrix: 3.4.3 - tslib: 2.5.3 + tslib: 2.6.2 dev: false /@antv/path-util@2.0.15: @@ -1913,7 +1920,7 @@ packages: dependencies: '@antv/matrix-util': 3.0.4 '@antv/util': 2.0.17 - tslib: 2.5.3 + tslib: 2.6.2 dev: false /@antv/scale@0.3.18: @@ -1921,14 +1928,14 @@ packages: dependencies: '@antv/util': 2.0.17 fecha: 4.2.3 - tslib: 2.5.3 + tslib: 2.6.2 dev: false /@antv/util@2.0.17: resolution: {integrity: sha512-o6I9hi5CIUvLGDhth0RxNSFDRwXeywmt6ExR4+RmVAzIi48ps6HUy+svxOCayvrPBN37uE6TAc2KDofRo0nK9Q==} dependencies: csstype: 3.1.2 - tslib: 2.5.3 + tslib: 2.6.2 dev: false /@antv/util@3.3.4: @@ -1936,33 +1943,63 @@ packages: dependencies: fast-deep-equal: 3.1.3 gl-matrix: 3.4.3 - tslib: 2.5.3 + tslib: 2.6.2 - /@antv/webgpu-graph@1.0.0(@antv/g-lite@packages+g-lite)(@antv/g-webgpu@packages+g-webgpu): + /@antv/webgpu-graph@1.0.0: resolution: {integrity: sha512-zE9lyg+uJkOe/1O7EdfOesuqD6svKRhQCNMocpFwA7cka4jdBY5h6iE60FiHNGPza6/Cy7mXVDYuGT/t+8/F1g==} dependencies: - '@antv/g': 5.16.33 - '@antv/g-plugin-gpgpu': 1.7.50(@antv/g-lite@packages+g-lite)(@antv/g-webgpu@packages+g-webgpu) - '@antv/g-webgl': 1.7.74(@antv/g-lite@packages+g-lite) + '@antv/g': 5.18.14 + '@antv/g-plugin-gpgpu': 1.9.20 + '@antv/g-webgl': 1.9.20 '@types/offscreencanvas': 2019.6.4 '@webgpu/types': 0.1.33 tslib: 2.5.3 - transitivePeerDependencies: - - '@antv/g-lite' - - '@antv/g-webgpu' dev: false + /@babel/cli@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-prtg5f6zCERIaECeTZzd2fMtVjlfjhUcO+fBLQ6DXXdq5FljN+excVitJ2nogsusdf31LeqkjAfXZ7Xq+HmN8g==} + engines: {node: '>=6.9.0'} + hasBin: true + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@jridgewell/trace-mapping': 0.3.19 + commander: 4.1.1 + convert-source-map: 1.9.0 + fs-readdir-recursive: 1.1.0 + glob: 7.2.3 + make-dir: 2.1.0 + slash: 2.0.0 + optionalDependencies: + '@nicolo-ribaudo/chokidar-2': 2.1.8-no-fsevents.3 + chokidar: 3.5.3 + dev: true + /@babel/code-frame@7.12.11: resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==} dependencies: - '@babel/highlight': 7.22.5 + '@babel/highlight': 7.22.20 + dev: true + + /@babel/code-frame@7.22.13: + resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.22.20 + chalk: 2.4.2 dev: true /@babel/code-frame@7.22.5: resolution: {integrity: sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/highlight': 7.22.5 + '@babel/highlight': 7.22.20 + dev: true + + /@babel/compat-data@7.22.20: + resolution: {integrity: sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw==} + engines: {node: '>=6.9.0'} dev: true /@babel/compat-data@7.22.5: @@ -1974,20 +2011,20 @@ packages: resolution: {integrity: sha512-aeLaqcqThRNZYmbMqtulsetOQZ/5gbR/dWruUCJcpas4Qoyy+QeagfDsPdMrqwsPRDNxJvBlRiZxxX7THO7qtA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.5 + '@babel/code-frame': 7.22.13 '@babel/generator': 7.22.5 '@babel/helper-compilation-targets': 7.22.5(@babel/core@7.16.7) '@babel/helper-module-transforms': 7.22.5 '@babel/helpers': 7.22.5 '@babel/parser': 7.22.5 '@babel/template': 7.22.5 - '@babel/traverse': 7.22.5(supports-color@5.5.0) - '@babel/types': 7.22.5 + '@babel/traverse': 7.22.20 + '@babel/types': 7.22.19 convert-source-map: 1.9.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.3 - semver: 6.3.0 + semver: 6.3.1 source-map: 0.5.7 transitivePeerDependencies: - supports-color @@ -1998,20 +2035,43 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.22.5 + '@babel/code-frame': 7.22.13 '@babel/generator': 7.22.5 '@babel/helper-compilation-targets': 7.22.5(@babel/core@7.21.0) '@babel/helper-module-transforms': 7.22.5 '@babel/helpers': 7.22.5 '@babel/parser': 7.22.5 '@babel/template': 7.22.5 - '@babel/traverse': 7.22.5(supports-color@5.5.0) - '@babel/types': 7.22.5 + '@babel/traverse': 7.22.5 + '@babel/types': 7.22.19 convert-source-map: 1.9.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.3 - semver: 6.3.0 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/core@7.22.20: + resolution: {integrity: sha512-Y6jd1ahLubuYweD/zJH+vvOY141v4f9igNQAQ+MBgq9JlHS2iTsZKn1aMsb3vGccZsXI16VzTBw52Xx0DWmtnA==} + engines: {node: '>=6.9.0'} + dependencies: + '@ampproject/remapping': 2.2.1 + '@babel/code-frame': 7.22.13 + '@babel/generator': 7.22.15 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-module-transforms': 7.22.20(@babel/core@7.22.20) + '@babel/helpers': 7.22.15 + '@babel/parser': 7.22.16 + '@babel/template': 7.22.15 + '@babel/traverse': 7.22.20 + '@babel/types': 7.22.19 + convert-source-map: 1.9.0 + debug: 4.3.4 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true @@ -2028,13 +2088,13 @@ packages: '@babel/helpers': 7.22.5 '@babel/parser': 7.22.5 '@babel/template': 7.22.5 - '@babel/traverse': 7.22.5(supports-color@5.5.0) + '@babel/traverse': 7.22.5 '@babel/types': 7.22.5 convert-source-map: 1.9.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.3 - semver: 6.3.0 + semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true @@ -2050,7 +2110,17 @@ packages: '@nicolo-ribaudo/eslint-scope-5-internals': 5.1.1-v1 eslint: 7.32.0 eslint-visitor-keys: 2.1.0 - semver: 6.3.0 + semver: 6.3.1 + dev: true + + /@babel/generator@7.22.15: + resolution: {integrity: sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.19 + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.19 + jsesc: 2.5.2 dev: true /@babel/generator@7.22.5: @@ -2059,7 +2129,7 @@ packages: dependencies: '@babel/types': 7.22.5 '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.19 jsesc: 2.5.2 dev: true @@ -2070,6 +2140,24 @@ packages: '@babel/types': 7.22.5 dev: true + /@babel/helper-builder-binary-assignment-operator-visitor@7.22.15: + resolution: {integrity: sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.19 + dev: true + + /@babel/helper-compilation-targets@7.22.15: + resolution: {integrity: sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/compat-data': 7.22.20 + '@babel/helper-validator-option': 7.22.15 + browserslist: 4.21.10 + lru-cache: 5.1.1 + semver: 6.3.1 + dev: true + /@babel/helper-compilation-targets@7.22.5(@babel/core@7.16.7): resolution: {integrity: sha512-Ji+ywpHeuqxB8WDxraCiqR0xfhYjiDE/e6k7FuIaANnoOFxAHskHChz4vA1mJC9Lbm01s1PVAGhQY4FUKSkGZw==} engines: {node: '>=6.9.0'} @@ -2081,7 +2169,7 @@ packages: '@babel/helper-validator-option': 7.22.5 browserslist: 4.21.9 lru-cache: 5.1.1 - semver: 6.3.0 + semver: 6.3.1 dev: true /@babel/helper-compilation-targets@7.22.5(@babel/core@7.21.0): @@ -2095,7 +2183,7 @@ packages: '@babel/helper-validator-option': 7.22.5 browserslist: 4.21.9 lru-cache: 5.1.1 - semver: 6.3.0 + semver: 6.3.1 dev: true /@babel/helper-compilation-targets@7.22.5(@babel/core@7.22.5): @@ -2109,21 +2197,71 @@ packages: '@babel/helper-validator-option': 7.22.5 browserslist: 4.21.9 lru-cache: 5.1.1 - semver: 6.3.0 + semver: 6.3.1 + dev: true + + /@babel/helper-create-class-features-plugin@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-jKkwA59IXcvSaiK2UN45kKwSC9o+KuoXsBDvHvU/7BecYIp8GQ2UwrVvFgJASUT+hBnwJx6MhvMCuMzwZZ7jlg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.22.5 + '@babel/helper-member-expression-to-functions': 7.22.15 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.22.20) + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + semver: 6.3.1 + dev: true + + /@babel/helper-create-regexp-features-plugin@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-annotate-as-pure': 7.22.5 + regexpu-core: 5.3.2 + semver: 6.3.1 dev: true - /@babel/helper-create-regexp-features-plugin@7.22.6(@babel/core@7.22.5): + /@babel/helper-create-regexp-features-plugin@7.22.6(@babel/core@7.22.20): resolution: {integrity: sha512-nBookhLKxAWo/TUCmhnaEJyLz2dekjQvv5SRpE9epWQBcpedWLKt8aZdsuT9XV5ovzR3fENLjRXVT0GsSlGGhA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@babel/helper-annotate-as-pure': 7.22.5 '@nicolo-ribaudo/semver-v6': 6.3.3 regexpu-core: 5.3.2 dev: true + /@babel/helper-define-polyfill-provider@0.4.2(@babel/core@7.22.20): + resolution: {integrity: sha512-k0qnnOqHn5dK9pZpfD5XXZ9SojAITdCKRn2Lp6rnDGzIbaP0rHyMPk/4wsSxVBVz4RfN0q6VpXWP2pDGIoQ7hw==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + debug: 4.3.4 + lodash.debounce: 4.0.8 + resolve: 1.22.6 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-environment-visitor@7.22.20: + resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/helper-environment-visitor@7.22.5: resolution: {integrity: sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==} engines: {node: '>=6.9.0'} @@ -2133,22 +2271,43 @@ packages: resolution: {integrity: sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.22.5 - '@babel/types': 7.22.5 + '@babel/template': 7.22.15 + '@babel/types': 7.22.19 dev: true /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.5 + '@babel/types': 7.22.19 dev: true - /@babel/helper-module-imports@7.22.5: - resolution: {integrity: sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==} + /@babel/helper-member-expression-to-functions@7.22.15: + resolution: {integrity: sha512-qLNsZbgrNh0fDQBCPocSL8guki1hcPvltGDv/NxvUoABwFq7GkKSu1nRXeJkVZc+wJvne2E0RKQz+2SQrz6eAA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.5 + '@babel/types': 7.22.19 + dev: true + + /@babel/helper-module-imports@7.22.15: + resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.19 + dev: true + + /@babel/helper-module-transforms@7.22.20(@babel/core@7.22.20): + resolution: {integrity: sha512-dLT7JVWIUUxKOs1UnJUBR3S70YK+pKX6AbJgB2vMIvEkZkrfJDbYDJesnPshtKV4LhDOR3Oc5YULeDizRek+5A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-simple-access': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-validator-identifier': 7.22.20 dev: true /@babel/helper-module-transforms@7.22.5: @@ -2156,22 +2315,53 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/helper-environment-visitor': 7.22.5 - '@babel/helper-module-imports': 7.22.5 + '@babel/helper-module-imports': 7.22.15 '@babel/helper-simple-access': 7.22.5 '@babel/helper-split-export-declaration': 7.22.5 '@babel/helper-validator-identifier': 7.22.5 '@babel/template': 7.22.5 - '@babel/traverse': 7.22.5(supports-color@5.5.0) + '@babel/traverse': 7.22.5 '@babel/types': 7.22.5 transitivePeerDependencies: - supports-color dev: true + /@babel/helper-optimise-call-expression@7.22.5: + resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.19 + dev: true + /@babel/helper-plugin-utils@7.22.5: resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} engines: {node: '>=6.9.0'} dev: true + /@babel/helper-remap-async-to-generator@7.22.20(@babel/core@7.22.20): + resolution: {integrity: sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-wrap-function': 7.22.20 + dev: true + + /@babel/helper-replace-supers@7.22.20(@babel/core@7.22.20): + resolution: {integrity: sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-member-expression-to-functions': 7.22.15 + '@babel/helper-optimise-call-expression': 7.22.5 + dev: true + /@babel/helper-simple-access@7.22.5: resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} @@ -2179,6 +2369,13 @@ packages: '@babel/types': 7.22.5 dev: true + /@babel/helper-skip-transparent-expression-wrappers@7.22.5: + resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.19 + dev: true + /@babel/helper-split-export-declaration@7.22.5: resolution: {integrity: sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==} engines: {node: '>=6.9.0'} @@ -2186,201 +2383,1113 @@ packages: '@babel/types': 7.22.5 dev: true + /@babel/helper-split-export-declaration@7.22.6: + resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.19 + dev: true + /@babel/helper-string-parser@7.22.5: resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} engines: {node: '>=6.9.0'} dev: true + /@babel/helper-validator-identifier@7.22.20: + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/helper-validator-identifier@7.22.5: resolution: {integrity: sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==} engines: {node: '>=6.9.0'} dev: true + /@babel/helper-validator-option@7.22.15: + resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/helper-validator-option@7.22.5: resolution: {integrity: sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==} engines: {node: '>=6.9.0'} dev: true - /@babel/helpers@7.22.5: - resolution: {integrity: sha512-pSXRmfE1vzcUIDFQcSGA5Mr+GxBV9oiRKDuDxXvWQQBCh8HoIjs/2DlDB7H8smac1IVrB9/xdXj2N3Wol9Cr+Q==} + /@babel/helper-wrap-function@7.22.20: + resolution: {integrity: sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.22.5 - '@babel/traverse': 7.22.5(supports-color@5.5.0) - '@babel/types': 7.22.5 - transitivePeerDependencies: + '@babel/helper-function-name': 7.22.5 + '@babel/template': 7.22.15 + '@babel/types': 7.22.19 + dev: true + + /@babel/helpers@7.22.15: + resolution: {integrity: sha512-7pAjK0aSdxOwR+CcYAqgWOGy5dcfvzsTIfFTb2odQqW47MDfv14UaJDY6eng8ylM2EaeKXdxaSWESbkmaQHTmw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.22.15 + '@babel/traverse': 7.22.20 + '@babel/types': 7.22.19 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helpers@7.22.5: + resolution: {integrity: sha512-pSXRmfE1vzcUIDFQcSGA5Mr+GxBV9oiRKDuDxXvWQQBCh8HoIjs/2DlDB7H8smac1IVrB9/xdXj2N3Wol9Cr+Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.22.5 + '@babel/traverse': 7.22.5 + '@babel/types': 7.22.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/highlight@7.22.20: + resolution: {integrity: sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.22.20 + chalk: 2.4.2 + js-tokens: 4.0.0 + dev: true + + /@babel/parser@7.22.16: + resolution: {integrity: sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.22.19 + dev: true + + /@babel/parser@7.22.5: + resolution: {integrity: sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.22.5 + dev: true + + /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-FB9iYlz7rURmRJyXRKEnalYPPdn87H5no108cyuQQyMwlpJ2SJtpIUBI27kdTin956pz+LPypkPVPUTlxOmrsg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-Hyph9LseGvAeeXzikV88bczhsrLrIZqDPxO+sSmAunMPaGrBGhfMWzCPYTtiW9t+HzSE2wtV8e5cc5P6r1xMDQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.13.0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/plugin-transform-optional-chaining': 7.22.15(@babel/core@7.22.20) + dev: true + + /@babel/plugin-external-helpers@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-ngnNEWxmykPk82mH4ajZT0qTztr3Je6hrMuKAslZVM8G1YZTENJSYwrIGtt6KOtznug3exmAtF4so/nPqJuA4A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.22.20): + resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} + engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.22.20) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.22.20): + resolution: {integrity: sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==} + engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead. + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.22.20 + '@babel/core': 7.22.20 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-transform-parameters': 7.22.15(@babel/core@7.22.20) + dev: true + + /@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.22.20): + resolution: {integrity: sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + dev: true + + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.22.20): + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.22.20): + resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.22.20): + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.22.20): + resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.22.20): + resolution: {integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.22.20): + resolution: {integrity: sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-import-assertions@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-import-attributes@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-KwvoWDeNKPETmozyFE0P2rOLqh39EoQHNjqizrI5B8Vt0ZNS7M56s7dAiAqbYfiAYOuIzIh96z3iR2ktgu3tEg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.22.20): + resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.22.20): + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.22.20): + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.22.20): + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.22.20): + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.22.20): + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.22.20): + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.22.20): + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.22.20): + resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.22.20): + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.22.20): + resolution: {integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-create-regexp-features-plugin': 7.22.6(@babel/core@7.22.20) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-arrow-functions@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-async-generator-functions@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-jBm1Es25Y+tVoTi5rfd5t1KLmL8ogLKpXszboWOTTtGFGz2RKnQe2yn7HbZ+kb/B8N0FVSGQo874NSlOU1T4+w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.22.20) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-async-to-generator@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-block-scoped-functions@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-block-scoping@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-G1czpdJBZCtngoK1sJgloLiOHUnkb/bLZwqVZD8kXmq0ZnVfTTWUcs9OWtp0mBtYJ+4LQY1fllqBkOIPhXmFmw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-class-properties@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.22.20) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-class-static-block@7.22.11(@babel/core@7.22.20): + resolution: {integrity: sha512-GMM8gGmqI7guS/llMFk1bJDkKfn3v3C4KHK9Yg1ey5qcHcOlKb0QvcMrgzvxo+T03/4szNh5lghY+fEC98Kq9g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.12.0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.22.20) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-classes@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-VbbC3PGjBdE0wAWDdHM9G8Gm977pnYI0XpqMd6LrKISj8/DJXEsWqgRuTYaNE9Bv0JGhTZUzHDlMk18IpOuoqw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.22.5 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.22.20) + '@babel/helper-split-export-declaration': 7.22.6 + globals: 11.12.0 + dev: true + + /@babel/plugin-transform-computed-properties@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/template': 7.22.15 + dev: true + + /@babel/plugin-transform-destructuring@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-HzG8sFl1ZVGTme74Nw+X01XsUTqERVQ6/RLHo3XjGRzm7XD6QTtfS3NJotVgCGy8BzkDqRjRBD8dAyJn5TuvSQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-dotall-regex@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.22.20) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-duplicate-keys@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-dynamic-import@7.22.11(@babel/core@7.22.20): + resolution: {integrity: sha512-g/21plo58sfteWjaO0ZNVb+uEOkJNjAaHhbejrnBmu011l/eNDScmkbjCC3l4FKb10ViaGU4aOkFznSu2zRHgA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-exponentiation-operator@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-builder-binary-assignment-operator-visitor': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-export-namespace-from@7.22.11(@babel/core@7.22.20): + resolution: {integrity: sha512-xa7aad7q7OiT8oNZ1mU7NrISjlSkVdMbNxn9IuLZyL9AJEhs1Apba3I+u5riX1dIkdptP5EKDG5XDPByWxtehw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-for-of@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-me6VGeHsx30+xh9fbDLLPi0J1HzmeIIyenoOQHuw2D4m2SAU3NrspX5XxJLBpqn5yrLzrlw2Iy3RA//Bx27iOA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-function-name@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-function-name': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-json-strings@7.22.11(@babel/core@7.22.20): + resolution: {integrity: sha512-CxT5tCqpA9/jXFlme9xIBCc5RPtdDq3JpkkhgHQqtDdiTnTI0jtZ0QzXhr5DILeYifDPp2wvY2ad+7+hLMW5Pw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-literals@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-logical-assignment-operators@7.22.11(@babel/core@7.22.20): + resolution: {integrity: sha512-qQwRTP4+6xFCDV5k7gZBF3C31K34ut0tbEcTKxlX/0KXxm9GLcO14p570aWxFvVzx6QAfPgq7gaeIHXJC8LswQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-member-expression-literals@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-modules-amd@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-R+PTfLTcYEmb1+kK7FNkhQ1gP4KgjpSO6HfH9+f8/yfp2Nt3ggBjiVpRwmwTlfqZLafYKJACy36yDXlEmI9HjQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-module-transforms': 7.22.20(@babel/core@7.22.20) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-modules-commonjs@7.21.2(@babel/core@7.22.20): + resolution: {integrity: sha512-Cln+Yy04Gxua7iPdj6nOV96smLGjpElir5YwzF0LBPKoPlLDNJePNlrGGaybAJkd0zKRnOVXOgizSqPYMNYkzA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-module-transforms': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-simple-access': 7.22.5 + transitivePeerDependencies: - supports-color dev: true - /@babel/highlight@7.22.5: - resolution: {integrity: sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==} + /@babel/plugin-transform-modules-commonjs@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-jWL4eh90w0HQOTKP2MoXXUpVxilxsB2Vl4ji69rSjS3EcZ/v4sBmn+A3NpepuJzBhOaEBbR7udonlHHn5DWidg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-module-transforms': 7.22.20(@babel/core@7.22.20) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-simple-access': 7.22.5 + dev: true + + /@babel/plugin-transform-modules-systemjs@7.22.11(@babel/core@7.22.20): + resolution: {integrity: sha512-rIqHmHoMEOhI3VkVf5jQ15l539KrwhzqcBO6wdCNWPWc/JWt9ILNYNUssbRpeq0qWns8svuw8LnMNCvWBIJ8wA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-module-transforms': 7.22.20(@babel/core@7.22.20) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-identifier': 7.22.20 + dev: true + + /@babel/plugin-transform-modules-umd@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-module-transforms': 7.22.20(@babel/core@7.22.20) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-named-capturing-groups-regex@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.22.20) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-new-target@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-nullish-coalescing-operator@7.22.11(@babel/core@7.22.20): + resolution: {integrity: sha512-YZWOw4HxXrotb5xsjMJUDlLgcDXSfO9eCmdl1bgW4+/lAGdkjaEvOnQ4p5WKKdUgSzO39dgPl0pTnfxm0OAXcg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-numeric-separator@7.22.11(@babel/core@7.22.20): + resolution: {integrity: sha512-3dzU4QGPsILdJbASKhF/V2TVP+gJya1PsueQCxIPCEcerqF21oEcrob4mzjsp2Py/1nLfF5m+xYNMDpmA8vffg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-object-rest-spread@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-fEB+I1+gAmfAyxZcX1+ZUwLeAuuf8VIg67CTznZE0MqVFumWkh8xWtn58I4dxdVf080wn7gzWoF8vndOViJe9Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.22.20 + '@babel/core': 7.22.20 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-transform-parameters': 7.22.15(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-object-super@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-optional-catch-binding@7.22.11(@babel/core@7.22.20): + resolution: {integrity: sha512-rli0WxesXUeCJnMYhzAglEjLWVDF6ahb45HuprcmQuLidBJFWjNnOzssk2kuc6e33FlLaiZhG/kUIzUMWdBKaQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-optional-chaining@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-ngQ2tBhq5vvSJw2Q2Z9i7ealNkpDMU0rGWnHPKqRZO0tzZ5tlaoz4hDvhXioOoaE0X2vfNss1djwg0DXlfu30A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-parameters@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-private-methods@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-PPjh4gyrQnGe97JTalgRGMuU4icsZFnWkzicB/fUtzlKUqvsWBKEpPPfr5a2JiyirZkHxnAqkQMO5Z5B2kK3fA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.22.20) + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-private-property-in-object@7.22.11(@babel/core@7.22.20): + resolution: {integrity: sha512-sSCbqZDBKHetvjSwpyWzhuHkmW5RummxJBVbYLkGkaiTOWGxml7SXt0iWa03bzxFIx7wOj3g/ILRd0RcJKBeSQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.22.20) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-property-literals@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-react-display-name@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-PVk3WPYudRF5z4GKMEYUrLjPl38fJSKNaEOkFuoprioowGuWN6w2RKznuFNSlJx7pzzXXStPUnNSOEO0jL5EVw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-react-jsx-development@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-bDhuzwWMuInwCYeDeMzyi7TaBgRQei6DqxhbyniL7/VG4RSS7HtSL2QbY4eESy1KJqlWt8g3xeEBGPuo+XqC8A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.20 + '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.22.20) + dev: true + + /@babel/plugin-transform-react-jsx-self@7.22.5(@babel/core@7.22.5): + resolution: {integrity: sha512-nTh2ogNUtxbiSbxaT4Ds6aXnXEipHweN9YRgOX/oNXdf0cCrGn/+2LozFa3lnPV5D90MkjhgckCPBrsoSc1a7g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-transform-react-jsx-source@7.22.5(@babel/core@7.22.5): + resolution: {integrity: sha512-yIiRO6yobeEIaI0RTbIr8iAK9FcBHLtZq0S89ZPjDLQXBA4xvghaKqI0etp/tF3htTM0sazJKKLz9oEiGRtu7w==} engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 dependencies: - '@babel/helper-validator-identifier': 7.22.5 - chalk: 2.4.2 - js-tokens: 4.0.0 + '@babel/core': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/parser@7.22.5: - resolution: {integrity: sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==} - engines: {node: '>=6.0.0'} - hasBin: true + /@babel/plugin-transform-react-jsx@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-oKckg2eZFa8771O/5vi7XeTvmM6+O9cxZu+kanTU7tD4sin5nO/G8jGJhq8Hvt2Z0kUoEDRayuZLaUlYl8QuGA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 dependencies: - '@babel/types': 7.22.5 + '@babel/core': 7.22.20 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.20) + '@babel/types': 7.22.19 dev: true - /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.22.5): - resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + /@babel/plugin-transform-react-pure-annotations@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-gP4k85wx09q+brArVinTXhWiyzLl9UpmGva0+mWyKxk6JZequ05x3eUcIUE+FyttPKJFRRVtAvQaJ6YF9h1ZpA==} + engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 + '@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.22.5): - resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} + /@babel/plugin-transform-regenerator@7.22.10(@babel/core@7.22.20): + resolution: {integrity: sha512-F28b1mDt8KcT5bUyJc/U9nwzw6cV+UmTeRlXYIl2TNqMMJif0Jeey9/RQ3C4NOd2zp0/TRsDns9ttj2L523rsw==} + engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@babel/helper-plugin-utils': 7.22.5 + regenerator-transform: 0.15.2 dev: true - /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.22.5): - resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + /@babel/plugin-transform-reserved-words@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA==} + engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.22.5): - resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + /@babel/plugin-transform-shorthand-properties@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA==} + engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.22.5): - resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + /@babel/plugin-transform-spread@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg==} + engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 dev: true - /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.22.5): - resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + /@babel/plugin-transform-sticky-regex@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw==} + engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.22.5): - resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + /@babel/plugin-transform-template-literals@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA==} + engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.22.5): - resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + /@babel/plugin-transform-typeof-symbol@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA==} + engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.22.5): - resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + /@babel/plugin-transform-typescript@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-1uirS0TnijxvQLnlv5wQBwOX3E1wCFX7ITv+9pBV2wKEk4K+M5tqDaoNXnTH8tjEIYHLO98MwiTWO04Ggz4XuA==} + engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.22.20) '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.22.20) dev: true - /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.22.5): - resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + /@babel/plugin-transform-unicode-escapes@7.22.10(@babel/core@7.22.20): + resolution: {integrity: sha512-lRfaRKGZCBqDlRU3UIFovdp9c9mEvlylmpod0/OatICsSfuQ9YFthRo1tpTkGsklEefZdqlEFdY4A2dwTb6ohg==} + engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.22.5): - resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + /@babel/plugin-transform-unicode-property-regex@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-HCCIb+CbJIAE6sXn5CjFQXMwkCClcOfPCzTlilJ8cUatfzwHlWQkbtV0zD338u9dZskwvuOYTuuaMaA8J5EI5A==} + engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.22.20) '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.22.5): - resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + /@babel/plugin-transform-unicode-regex@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.22.20) '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.22.5): - resolution: {integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==} + /@babel/plugin-transform-unicode-sets-regex@7.22.5(@babel/core@7.22.20): + resolution: {integrity: sha512-lhMfi4FC15j13eKrh3DnYHjpGj6UKQHtNKTbtc1igvAhRy4+kLhV07OpLcsN0VgDEw/MjAvJO4BdMJsHwMhzCg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.5 - '@babel/helper-create-regexp-features-plugin': 7.22.6(@babel/core@7.22.5) + '@babel/core': 7.22.20 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.22.20) '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-modules-commonjs@7.21.2(@babel/core@7.22.5): - resolution: {integrity: sha512-Cln+Yy04Gxua7iPdj6nOV96smLGjpElir5YwzF0LBPKoPlLDNJePNlrGGaybAJkd0zKRnOVXOgizSqPYMNYkzA==} + /@babel/preset-env@7.22.20(@babel/core@7.22.20): + resolution: {integrity: sha512-11MY04gGC4kSzlPHRfvVkNAZhUxOvm7DCJ37hPDnUENwe06npjIRAfInEMTGSb4LZK5ZgDFkv5hw0lGebHeTyg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 - '@babel/helper-module-transforms': 7.22.5 + '@babel/compat-data': 7.22.20 + '@babel/core': 7.22.20 + '@babel/helper-compilation-targets': 7.22.15 '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-simple-access': 7.22.5 + '@babel/helper-validator-option': 7.22.15 + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.22.15(@babel/core@7.22.20) + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.22.15(@babel/core@7.22.20) + '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.22.20) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.22.20) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.22.20) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.22.20) + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-syntax-import-assertions': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-syntax-import-attributes': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.22.20) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.22.20) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.22.20) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.22.20) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.22.20) + '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.22.20) + '@babel/plugin-transform-arrow-functions': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-async-generator-functions': 7.22.15(@babel/core@7.22.20) + '@babel/plugin-transform-async-to-generator': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-block-scoped-functions': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-block-scoping': 7.22.15(@babel/core@7.22.20) + '@babel/plugin-transform-class-properties': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-class-static-block': 7.22.11(@babel/core@7.22.20) + '@babel/plugin-transform-classes': 7.22.15(@babel/core@7.22.20) + '@babel/plugin-transform-computed-properties': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-destructuring': 7.22.15(@babel/core@7.22.20) + '@babel/plugin-transform-dotall-regex': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-duplicate-keys': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-dynamic-import': 7.22.11(@babel/core@7.22.20) + '@babel/plugin-transform-exponentiation-operator': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-export-namespace-from': 7.22.11(@babel/core@7.22.20) + '@babel/plugin-transform-for-of': 7.22.15(@babel/core@7.22.20) + '@babel/plugin-transform-function-name': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-json-strings': 7.22.11(@babel/core@7.22.20) + '@babel/plugin-transform-literals': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-logical-assignment-operators': 7.22.11(@babel/core@7.22.20) + '@babel/plugin-transform-member-expression-literals': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-modules-amd': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-modules-commonjs': 7.22.15(@babel/core@7.22.20) + '@babel/plugin-transform-modules-systemjs': 7.22.11(@babel/core@7.22.20) + '@babel/plugin-transform-modules-umd': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-named-capturing-groups-regex': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-new-target': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-nullish-coalescing-operator': 7.22.11(@babel/core@7.22.20) + '@babel/plugin-transform-numeric-separator': 7.22.11(@babel/core@7.22.20) + '@babel/plugin-transform-object-rest-spread': 7.22.15(@babel/core@7.22.20) + '@babel/plugin-transform-object-super': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-optional-catch-binding': 7.22.11(@babel/core@7.22.20) + '@babel/plugin-transform-optional-chaining': 7.22.15(@babel/core@7.22.20) + '@babel/plugin-transform-parameters': 7.22.15(@babel/core@7.22.20) + '@babel/plugin-transform-private-methods': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-private-property-in-object': 7.22.11(@babel/core@7.22.20) + '@babel/plugin-transform-property-literals': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-regenerator': 7.22.10(@babel/core@7.22.20) + '@babel/plugin-transform-reserved-words': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-shorthand-properties': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-spread': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-sticky-regex': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-template-literals': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-typeof-symbol': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-unicode-escapes': 7.22.10(@babel/core@7.22.20) + '@babel/plugin-transform-unicode-property-regex': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-unicode-regex': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-unicode-sets-regex': 7.22.5(@babel/core@7.22.20) + '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.22.20) + '@babel/types': 7.22.19 + babel-plugin-polyfill-corejs2: 0.4.5(@babel/core@7.22.20) + babel-plugin-polyfill-corejs3: 0.8.3(@babel/core@7.22.20) + babel-plugin-polyfill-regenerator: 0.5.2(@babel/core@7.22.20) + core-js-compat: 3.32.2 + semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true - /@babel/plugin-transform-react-jsx-self@7.22.5(@babel/core@7.22.5): - resolution: {integrity: sha512-nTh2ogNUtxbiSbxaT4Ds6aXnXEipHweN9YRgOX/oNXdf0cCrGn/+2LozFa3lnPV5D90MkjhgckCPBrsoSc1a7g==} + /@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.22.20): + resolution: {integrity: sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==} + peerDependencies: + '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/types': 7.22.19 + esutils: 2.0.3 + dev: true + + /@babel/preset-react@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-Csy1IJ2uEh/PecCBXXoZGAZBeCATTuePzCSB7dLYWS0vOEj6CNpjxIhW4duWwZodBNueH7QO14WbGn8YyeuN9w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.22.15 + '@babel/plugin-transform-react-display-name': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.22.20) + '@babel/plugin-transform-react-jsx-development': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-react-pure-annotations': 7.22.5(@babel/core@7.22.20) dev: true - /@babel/plugin-transform-react-jsx-source@7.22.5(@babel/core@7.22.5): - resolution: {integrity: sha512-yIiRO6yobeEIaI0RTbIr8iAK9FcBHLtZq0S89ZPjDLQXBA4xvghaKqI0etp/tF3htTM0sazJKKLz9oEiGRtu7w==} + /@babel/preset-typescript@7.22.15(@babel/core@7.22.20): + resolution: {integrity: sha512-HblhNmh6yM+cU4VwbBRpxFhxsTdfS1zsvH9W+gEjD0ARV9+8B4sNfpI6GuhePti84nuvhiwKS539jKPFHskA9A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.22.15 + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-transform-modules-commonjs': 7.22.15(@babel/core@7.22.20) + '@babel/plugin-transform-typescript': 7.22.15(@babel/core@7.22.20) dev: true /@babel/regjsgen@0.8.0: @@ -2394,6 +3503,12 @@ packages: regenerator-runtime: 0.13.11 dev: true + /@babel/runtime@7.22.15: + resolution: {integrity: sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.14.0 + /@babel/runtime@7.22.5: resolution: {integrity: sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==} engines: {node: '>=6.9.0'} @@ -2405,20 +3520,47 @@ packages: engines: {node: '>=6.9.0'} dev: true + /@babel/template@7.22.15: + resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.22.13 + '@babel/parser': 7.22.16 + '@babel/types': 7.22.19 + dev: true + /@babel/template@7.22.5: resolution: {integrity: sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.5 + '@babel/code-frame': 7.22.13 '@babel/parser': 7.22.5 '@babel/types': 7.22.5 dev: true - /@babel/traverse@7.22.5(supports-color@5.5.0): + /@babel/traverse@7.22.20: + resolution: {integrity: sha512-eU260mPZbU7mZ0N+X10pxXhQFMGTeLb9eFS0mxehS8HZp9o1uSnFeWQuG1UPrlxgA7QoUzFhOnilHDp0AXCyHw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.22.13 + '@babel/generator': 7.22.15 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.22.5 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/parser': 7.22.16 + '@babel/types': 7.22.19 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/traverse@7.22.5: resolution: {integrity: sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.5 + '@babel/code-frame': 7.22.13 '@babel/generator': 7.22.5 '@babel/helper-environment-visitor': 7.22.5 '@babel/helper-function-name': 7.22.5 @@ -2426,12 +3568,21 @@ packages: '@babel/helper-split-export-declaration': 7.22.5 '@babel/parser': 7.22.5 '@babel/types': 7.22.5 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true + /@babel/types@7.22.19: + resolution: {integrity: sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.22.5 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + dev: true + /@babel/types@7.22.5: resolution: {integrity: sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==} engines: {node: '>=6.9.0'} @@ -2452,7 +3603,7 @@ packages: /@changesets/apply-release-plan@6.1.4: resolution: {integrity: sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 '@changesets/config': 2.3.1 '@changesets/get-version-range-type': 0.3.2 '@changesets/git': 2.0.0 @@ -2464,18 +3615,18 @@ packages: outdent: 0.5.0 prettier: 2.8.8 resolve-from: 5.0.0 - semver: 7.5.3 + semver: 7.5.4 dev: true /@changesets/assemble-release-plan@5.2.4: resolution: {integrity: sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 '@changesets/errors': 0.1.4 '@changesets/get-dependents-graph': 1.3.6 '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 - semver: 7.5.3 + semver: 7.5.4 dev: true /@changesets/changelog-git@0.1.14: @@ -2488,7 +3639,7 @@ packages: resolution: {integrity: sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==} hasBin: true dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 '@changesets/apply-release-plan': 6.1.4 '@changesets/assemble-release-plan': 5.2.4 '@changesets/changelog-git': 0.1.14 @@ -2504,10 +3655,10 @@ packages: '@changesets/write': 0.2.3 '@manypkg/get-packages': 1.1.3 '@types/is-ci': 3.0.0 - '@types/semver': 7.5.0 + '@types/semver': 7.5.2 ansi-colors: 4.1.3 chalk: 2.4.2 - enquirer: 2.3.6 + enquirer: 2.4.1 external-editor: 3.1.0 fs-extra: 7.0.1 human-id: 1.0.2 @@ -2515,9 +3666,9 @@ packages: meow: 6.1.1 outdent: 0.5.0 p-limit: 2.3.0 - preferred-pm: 3.0.3 + preferred-pm: 3.1.2 resolve-from: 5.0.0 - semver: 7.5.3 + semver: 7.5.4 spawndamnit: 2.0.0 term-size: 2.2.1 tty-table: 4.2.1 @@ -2548,13 +3699,13 @@ packages: '@manypkg/get-packages': 1.1.3 chalk: 2.4.2 fs-extra: 7.0.1 - semver: 7.5.3 + semver: 7.5.4 dev: true /@changesets/get-release-plan@3.0.17: resolution: {integrity: sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 '@changesets/assemble-release-plan': 5.2.4 '@changesets/config': 2.3.1 '@changesets/pre': 1.0.14 @@ -2570,7 +3721,7 @@ packages: /@changesets/git@2.0.0: resolution: {integrity: sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 '@changesets/errors': 0.1.4 '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 @@ -2595,7 +3746,7 @@ packages: /@changesets/pre@1.0.14: resolution: {integrity: sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 '@changesets/errors': 0.1.4 '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 @@ -2605,7 +3756,7 @@ packages: /@changesets/read@0.5.9: resolution: {integrity: sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 '@changesets/git': 2.0.0 '@changesets/logger': 0.0.5 '@changesets/parse': 0.3.16 @@ -2626,7 +3777,7 @@ packages: /@changesets/write@0.2.3: resolution: {integrity: sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 '@changesets/types': 5.2.1 fs-extra: 7.0.1 human-id: 1.0.2 @@ -2796,6 +3947,17 @@ packages: postcss-value-parser: 4.2.0 dev: true + /@csstools/postcss-color-function@1.1.1(postcss@8.4.30): + resolution: {integrity: sha512-Bc0f62WmHdtRDjf5f3e2STwRAl89N2CLb+9iAwzrv4L2hncrbDwnQD9PCq0gtAt7pOI2leIV08HIBUd4jxD8cw==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/postcss-progressive-custom-properties': 1.3.0(postcss@8.4.30) + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /@csstools/postcss-font-format-keywords@1.0.1(postcss@8.4.24): resolution: {integrity: sha512-ZgrlzuUAjXIOc2JueK0X5sZDjCtgimVp/O5CEqTcs5ShWBa6smhWYbS0x5cVc/+rycTDbjjzoP0KTDnUneZGOg==} engines: {node: ^12 || ^14 || >=16} @@ -2806,6 +3968,16 @@ packages: postcss-value-parser: 4.2.0 dev: true + /@csstools/postcss-font-format-keywords@1.0.1(postcss@8.4.30): + resolution: {integrity: sha512-ZgrlzuUAjXIOc2JueK0X5sZDjCtgimVp/O5CEqTcs5ShWBa6smhWYbS0x5cVc/+rycTDbjjzoP0KTDnUneZGOg==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /@csstools/postcss-hwb-function@1.0.2(postcss@8.4.24): resolution: {integrity: sha512-YHdEru4o3Rsbjmu6vHy4UKOXZD+Rn2zmkAmLRfPet6+Jz4Ojw8cbWxe1n42VaXQhD3CQUXXTooIy8OkVbUcL+w==} engines: {node: ^12 || ^14 || >=16} @@ -2816,6 +3988,16 @@ packages: postcss-value-parser: 4.2.0 dev: true + /@csstools/postcss-hwb-function@1.0.2(postcss@8.4.30): + resolution: {integrity: sha512-YHdEru4o3Rsbjmu6vHy4UKOXZD+Rn2zmkAmLRfPet6+Jz4Ojw8cbWxe1n42VaXQhD3CQUXXTooIy8OkVbUcL+w==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /@csstools/postcss-ic-unit@1.0.1(postcss@8.4.24): resolution: {integrity: sha512-Ot1rcwRAaRHNKC9tAqoqNZhjdYBzKk1POgWfhN4uCOE47ebGcLRqXjKkApVDpjifL6u2/55ekkpnFcp+s/OZUw==} engines: {node: ^12 || ^14 || >=16} @@ -2827,6 +4009,17 @@ packages: postcss-value-parser: 4.2.0 dev: true + /@csstools/postcss-ic-unit@1.0.1(postcss@8.4.30): + resolution: {integrity: sha512-Ot1rcwRAaRHNKC9tAqoqNZhjdYBzKk1POgWfhN4uCOE47ebGcLRqXjKkApVDpjifL6u2/55ekkpnFcp+s/OZUw==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/postcss-progressive-custom-properties': 1.3.0(postcss@8.4.30) + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /@csstools/postcss-is-pseudo-class@2.0.7(postcss@8.4.24): resolution: {integrity: sha512-7JPeVVZHd+jxYdULl87lvjgvWldYu+Bc62s9vD/ED6/QTGjy0jy0US/f6BG53sVMTBJ1lzKZFpYmofBN9eaRiA==} engines: {node: ^12 || ^14 || >=16} @@ -2838,6 +4031,17 @@ packages: postcss-selector-parser: 6.0.13 dev: true + /@csstools/postcss-is-pseudo-class@2.0.7(postcss@8.4.30): + resolution: {integrity: sha512-7JPeVVZHd+jxYdULl87lvjgvWldYu+Bc62s9vD/ED6/QTGjy0jy0US/f6BG53sVMTBJ1lzKZFpYmofBN9eaRiA==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/selector-specificity': 2.2.0(postcss-selector-parser@6.0.13) + postcss: 8.4.30 + postcss-selector-parser: 6.0.13 + dev: true + /@csstools/postcss-normalize-display-values@1.0.1(postcss@8.4.24): resolution: {integrity: sha512-jcOanIbv55OFKQ3sYeFD/T0Ti7AMXc9nM1hZWu8m/2722gOTxFg7xYu4RDLJLeZmPUVQlGzo4jhzvTUq3x4ZUw==} engines: {node: ^12 || ^14 || >=16} @@ -2848,6 +4052,16 @@ packages: postcss-value-parser: 4.2.0 dev: true + /@csstools/postcss-normalize-display-values@1.0.1(postcss@8.4.30): + resolution: {integrity: sha512-jcOanIbv55OFKQ3sYeFD/T0Ti7AMXc9nM1hZWu8m/2722gOTxFg7xYu4RDLJLeZmPUVQlGzo4jhzvTUq3x4ZUw==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /@csstools/postcss-oklab-function@1.1.1(postcss@8.4.24): resolution: {integrity: sha512-nJpJgsdA3dA9y5pgyb/UfEzE7W5Ka7u0CX0/HIMVBNWzWemdcTH3XwANECU6anWv/ao4vVNLTMxhiPNZsTK6iA==} engines: {node: ^12 || ^14 || >=16} @@ -2859,6 +4073,17 @@ packages: postcss-value-parser: 4.2.0 dev: true + /@csstools/postcss-oklab-function@1.1.1(postcss@8.4.30): + resolution: {integrity: sha512-nJpJgsdA3dA9y5pgyb/UfEzE7W5Ka7u0CX0/HIMVBNWzWemdcTH3XwANECU6anWv/ao4vVNLTMxhiPNZsTK6iA==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/postcss-progressive-custom-properties': 1.3.0(postcss@8.4.30) + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /@csstools/postcss-progressive-custom-properties@1.3.0(postcss@8.4.24): resolution: {integrity: sha512-ASA9W1aIy5ygskZYuWams4BzafD12ULvSypmaLJT2jvQ8G0M3I8PRQhC0h7mG0Z3LI05+agZjqSR9+K9yaQQjA==} engines: {node: ^12 || ^14 || >=16} @@ -2869,6 +4094,16 @@ packages: postcss-value-parser: 4.2.0 dev: true + /@csstools/postcss-progressive-custom-properties@1.3.0(postcss@8.4.30): + resolution: {integrity: sha512-ASA9W1aIy5ygskZYuWams4BzafD12ULvSypmaLJT2jvQ8G0M3I8PRQhC0h7mG0Z3LI05+agZjqSR9+K9yaQQjA==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.3 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /@csstools/postcss-stepped-value-functions@1.0.1(postcss@8.4.24): resolution: {integrity: sha512-dz0LNoo3ijpTOQqEJLY8nyaapl6umbmDcgj4AD0lgVQ572b2eqA1iGZYTTWhrcrHztWDDRAX2DGYyw2VBjvCvQ==} engines: {node: ^12 || ^14 || >=16} @@ -2879,6 +4114,16 @@ packages: postcss-value-parser: 4.2.0 dev: true + /@csstools/postcss-stepped-value-functions@1.0.1(postcss@8.4.30): + resolution: {integrity: sha512-dz0LNoo3ijpTOQqEJLY8nyaapl6umbmDcgj4AD0lgVQ572b2eqA1iGZYTTWhrcrHztWDDRAX2DGYyw2VBjvCvQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /@csstools/postcss-unset-value@1.0.2(postcss@8.4.24): resolution: {integrity: sha512-c8J4roPBILnelAsdLr4XOAR/GsTm0GJi4XpcfvoWk3U6KiTCqiFYc63KhRMQQX35jYMp4Ao8Ij9+IZRgMfJp1g==} engines: {node: ^12 || ^14 || >=16} @@ -2888,6 +4133,15 @@ packages: postcss: 8.4.24 dev: true + /@csstools/postcss-unset-value@1.0.2(postcss@8.4.30): + resolution: {integrity: sha512-c8J4roPBILnelAsdLr4XOAR/GsTm0GJi4XpcfvoWk3U6KiTCqiFYc63KhRMQQX35jYMp4Ao8Ij9+IZRgMfJp1g==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + dev: true + /@csstools/selector-specificity@2.2.0(postcss-selector-parser@6.0.13): resolution: {integrity: sha512-+OJ9konv95ClSTOJCmMZqpd5+YGsB2S+x6w3E1oaM8UuR5j8nTNHYSz8c9BEPGDOCMQYIEEGlVPj/VY64iTbGw==} engines: {node: ^14 || ^16 || >=18} @@ -2912,7 +4166,7 @@ packages: resolution: {integrity: sha512-2Pu9HDg/uP/IT10rbQ+4OrTQuxIWdKVUEdcw9/w7kZJv9NeHS6skJx1xuRiFyoGKwAzcHXnLp7csE99sj+O1YA==} dev: true - /@docsearch/react@3.5.1(@algolia/client-search@4.17.2)(@types/react@16.9.35)(react-dom@16.14.0)(react@16.13.1)(search-insights@2.6.0): + /@docsearch/react@3.5.1(@algolia/client-search@4.20.0)(@types/react@16.9.35)(react-dom@16.14.0)(react@16.13.1)(search-insights@2.8.2): resolution: {integrity: sha512-t5mEODdLzZq4PTFAm/dvqcvZFdPDMdfPE5rJS5SC8OUq9mPzxEy6b+9THIqNM9P0ocCb4UC5jqBrxKclnuIbzQ==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' @@ -2926,8 +4180,8 @@ packages: react-dom: optional: true dependencies: - '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.17.2)(algoliasearch@4.17.2)(search-insights@2.6.0) - '@algolia/autocomplete-preset-algolia': 1.9.3(@algolia/client-search@4.17.2)(algoliasearch@4.17.2) + '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.17.2)(search-insights@2.8.2) + '@algolia/autocomplete-preset-algolia': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.17.2) '@docsearch/css': 3.5.1 '@types/react': 16.9.35 algoliasearch: 4.17.2 @@ -2942,12 +4196,12 @@ packages: resolution: {integrity: sha512-BrZYyL/6m0ZXz/lDxy/nlVhQz+WF+iPS6qXolEU8atw7h6v1aYkjwJZ63m+bJMBTxDE66X+r2tPS4a/8C82sZw==} engines: {node: '>=8.6'} dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 env-paths: 2.2.1 fs-extra: 8.1.0 got: 9.6.0 progress: 2.0.3 - semver: 6.3.0 + semver: 6.3.1 sumchecker: 3.0.1 optionalDependencies: global-agent: 3.0.0 @@ -2966,12 +4220,8 @@ packages: resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} dev: true - /@emotion/stylis@0.8.5: - resolution: {integrity: sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==} - dev: true - - /@emotion/unitless@0.7.5: - resolution: {integrity: sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==} + /@emotion/unitless@0.8.1: + resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} dev: true /@esbuild-kit/cjs-loader@2.4.2: @@ -3218,7 +4468,12 @@ packages: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: eslint: 7.32.0 - eslint-visitor-keys: 3.4.1 + eslint-visitor-keys: 3.4.3 + dev: true + + /@eslint-community/regexpp@4.8.1: + resolution: {integrity: sha512-PWiOzLIUAjN/w5K17PoF4n6sKBw0gqLHPhywmYHP4t1VFQQVYeb1yWsJwnMVEMl3tUHME7X/SJPZLmtG7XBDxQ==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true /@eslint/eslintrc@0.4.3: @@ -3226,9 +4481,9 @@ packages: engines: {node: ^10.12.0 || >=12.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 espree: 7.3.1 - globals: 13.20.0 + globals: 13.21.0 ignore: 4.0.6 import-fresh: 3.3.0 js-yaml: 3.14.1 @@ -3280,13 +4535,13 @@ packages: resolution: {integrity: sha512-6ueQTeJZtwKjmh23bdkq/DMqH4l4bmfvtQH98blOSbiXv/OUiyijSW6jU22IT8BNM1ujCaEvJfTtyCYVH38EMQ==} dependencies: '@formatjs/intl-localematcher': 0.4.0 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /@formatjs/fast-memoize@2.2.0: resolution: {integrity: sha512-hnk/nY8FyrL5YxwP9e4r9dqeM6cAbo8PeU9UjyXojZMNvVad2Z06FAVHyR3Ecw6fza+0GH7vdJgiKIVXTMbSBA==} dependencies: - tslib: 2.5.3 + tslib: 2.6.2 dev: true /@formatjs/icu-messageformat-parser@2.6.0: @@ -3294,14 +4549,14 @@ packages: dependencies: '@formatjs/ecma402-abstract': 1.17.0 '@formatjs/icu-skeleton-parser': 1.6.0 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /@formatjs/icu-skeleton-parser@1.6.0: resolution: {integrity: sha512-eMmxNpoX/J1IPUjPGSZwo0Wh+7CEvdEMddP2Jxg1gQJXfGfht/FdW2D5XDFj3VMbOTUQlDIdZJY7uC6O6gjPoA==} dependencies: '@formatjs/ecma402-abstract': 1.17.0 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /@formatjs/intl-displaynames@6.5.0: @@ -3309,7 +4564,7 @@ packages: dependencies: '@formatjs/ecma402-abstract': 1.17.0 '@formatjs/intl-localematcher': 0.4.0 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /@formatjs/intl-listformat@7.4.0: @@ -3317,16 +4572,16 @@ packages: dependencies: '@formatjs/ecma402-abstract': 1.17.0 '@formatjs/intl-localematcher': 0.4.0 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /@formatjs/intl-localematcher@0.4.0: resolution: {integrity: sha512-bRTd+rKomvfdS4QDlVJ6TA/Jx1F2h/TBVO5LjvhQ7QPPHp19oPNMIum7W2CMEReq/zPxpmCeB31F9+5gl/qtvw==} dependencies: - tslib: 2.5.3 + tslib: 2.6.2 dev: true - /@formatjs/intl@2.9.0(typescript@5.1.3): + /@formatjs/intl@2.9.0(typescript@5.2.2): resolution: {integrity: sha512-Ym0trUoC/VO6wQu4YHa0H1VR2tEixFRmwZgADkDLm7nD+vv1Ob+/88mUAoT0pwvirFqYKgUKEwp1tFepqyqvVA==} peerDependencies: typescript: ^4.7 || 5 @@ -3340,8 +4595,8 @@ packages: '@formatjs/intl-displaynames': 6.5.0 '@formatjs/intl-listformat': 7.4.0 intl-messageformat: 10.5.0 - tslib: 2.5.3 - typescript: 5.1.3 + tslib: 2.6.2 + typescript: 5.2.2 dev: true /@humanwhocodes/config-array@0.5.0: @@ -3349,7 +4604,7 @@ packages: engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -3369,7 +4624,7 @@ packages: '@antfu/install-pkg': 0.1.1 '@antfu/utils': 0.7.4 '@iconify/types': 2.0.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 kolorist: 1.8.0 local-pkg: 0.4.3 transitivePeerDependencies: @@ -3422,7 +4677,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/node': 17.0.45 + '@types/node': 14.18.61 chalk: 4.1.2 jest-message-util: 26.6.2 jest-util: 26.6.2 @@ -3438,7 +4693,7 @@ packages: '@jest/test-result': 26.6.2 '@jest/transform': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 17.0.45 + '@types/node': 14.18.61 ansi-escapes: 4.3.2 chalk: 4.1.2 exit: 0.1.2 @@ -3487,7 +4742,7 @@ packages: dependencies: '@jest/fake-timers': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 17.0.45 + '@types/node': 14.18.61 jest-mock: 26.6.2 dev: true @@ -3508,7 +4763,7 @@ packages: dependencies: '@jest/types': 26.6.2 '@sinonjs/fake-timers': 6.0.1 - '@types/node': 17.0.45 + '@types/node': 14.18.61 jest-message-util: 26.6.2 jest-mock: 26.6.2 jest-util: 26.6.2 @@ -3533,15 +4788,15 @@ packages: '@jest/transform': 26.6.2 '@jest/types': 26.6.2 chalk: 4.1.2 - collect-v8-coverage: 1.0.1 + collect-v8-coverage: 1.0.2 exit: 0.1.2 glob: 7.2.3 graceful-fs: 4.2.11 istanbul-lib-coverage: 3.2.0 istanbul-lib-instrument: 4.0.3 - istanbul-lib-report: 3.0.0 + istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 4.0.1 - istanbul-reports: 3.1.5 + istanbul-reports: 3.1.6 jest-haste-map: 26.6.2 jest-resolve: 26.6.2 jest-util: 26.6.2 @@ -3598,7 +4853,7 @@ packages: '@jest/console': 26.6.2 '@jest/types': 26.6.2 '@types/istanbul-lib-coverage': 2.0.4 - collect-v8-coverage: 1.0.1 + collect-v8-coverage: 1.0.2 dev: true /@jest/test-sequencer@24.9.0(canvas@2.11.2): @@ -3637,7 +4892,7 @@ packages: resolution: {integrity: sha512-TcQUmyNRxV94S0QpMOnZl0++6RMiqpbH/ZMccFB/amku6Uwvyb1cjYX7xkp5nGNkbX4QPH/FcB6q1HBTHynLmQ==} engines: {node: '>= 6'} dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@jest/types': 24.9.0 babel-plugin-istanbul: 5.2.0 chalk: 2.4.2 @@ -3661,7 +4916,7 @@ packages: resolution: {integrity: sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==} engines: {node: '>= 10.14.2'} dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@jest/types': 26.6.2 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 @@ -3718,7 +4973,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 17.0.45 + '@types/node': 14.18.61 '@types/yargs': 15.0.15 chalk: 4.1.2 dev: true @@ -3729,7 +4984,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 17.0.45 + '@types/node': 20.6.2 '@types/yargs': 16.0.5 chalk: 4.1.2 dev: true @@ -3741,7 +4996,7 @@ packages: '@jest/schemas': 29.4.3 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 17.0.45 + '@types/node': 20.6.2 '@types/yargs': 17.0.24 chalk: 4.1.2 dev: true @@ -3752,24 +5007,30 @@ packages: dependencies: '@jridgewell/set-array': 1.1.2 '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.19 /@jridgewell/resolve-uri@3.1.0: resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/resolve-uri@3.1.1: + resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} + engines: {node: '>=6.0.0'} /@jridgewell/set-array@1.1.2: resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} engines: {node: '>=6.0.0'} - /@jridgewell/source-map@0.3.3: - resolution: {integrity: sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==} + /@jridgewell/source-map@0.3.5: + resolution: {integrity: sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==} dependencies: '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.19 /@jridgewell/sourcemap-codec@1.4.14: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + dev: true /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} @@ -3779,6 +5040,13 @@ packages: dependencies: '@jridgewell/resolve-uri': 3.1.0 '@jridgewell/sourcemap-codec': 1.4.14 + dev: true + + /@jridgewell/trace-mapping@0.3.19: + resolution: {integrity: sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==} + dependencies: + '@jridgewell/resolve-uri': 3.1.1 + '@jridgewell/sourcemap-codec': 1.4.15 /@loadable/component@5.15.2(react@16.13.1): resolution: {integrity: sha512-ryFAZOX5P2vFkUdzaAtTG88IGnr9qxSdvLRvJySXcUA4B4xVWurUNADu3AnKPksxOZajljqTrDEDcYjeL4lvLw==} @@ -3786,7 +5054,7 @@ packages: peerDependencies: react: '>=16.3.0' dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.21.0 hoist-non-react-statics: 3.3.2 react: 16.13.1 react-is: 16.13.1 @@ -3798,7 +5066,7 @@ packages: peerDependencies: react: '>=16.3.0' dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.21.0 hoist-non-react-statics: 3.3.2 react: 18.1.0 react-is: 16.13.1 @@ -3816,7 +5084,7 @@ packages: /@manypkg/find-root@1.1.0: resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 '@types/node': 12.20.55 find-up: 4.1.0 fs-extra: 8.1.0 @@ -3825,7 +5093,7 @@ packages: /@manypkg/get-packages@1.1.3: resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 '@changesets/types': 4.1.0 '@manypkg/find-root': 1.1.0 fs-extra: 8.1.0 @@ -3833,19 +5101,19 @@ packages: read-yaml-file: 1.1.0 dev: true - /@mapbox/node-pre-gyp@1.0.10: - resolution: {integrity: sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==} + /@mapbox/node-pre-gyp@1.0.11: + resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} hasBin: true dependencies: - detect-libc: 2.0.1 + detect-libc: 2.0.2 https-proxy-agent: 5.0.1 make-dir: 3.1.0 - node-fetch: 2.6.11 + node-fetch: 2.7.0 nopt: 5.0.0 npmlog: 5.0.1 rimraf: 3.0.2 - semver: 7.5.2 - tar: 6.1.15 + semver: 7.5.4 + tar: 6.2.0 transitivePeerDependencies: - encoding - supports-color @@ -3886,9 +5154,15 @@ packages: peerDependencies: workerize-loader: '*' dependencies: - workerize-loader: 2.0.2(webpack@5.87.0) + workerize-loader: 2.0.2(webpack@5.88.2) dev: false + /@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3: + resolution: {integrity: sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==} + requiresBuild: true + dev: true + optional: true + /@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1: resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} dependencies: @@ -3925,7 +5199,7 @@ packages: resolution: {integrity: sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: - semver: 7.5.3 + semver: 7.5.4 dev: true /@observablehq/plot@0.5.2: @@ -3949,14 +5223,14 @@ packages: engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} dependencies: cross-spawn: 7.0.3 - fast-glob: 3.2.12 + fast-glob: 3.3.1 is-glob: 4.0.3 open: 9.1.0 picocolors: 1.0.0 - tslib: 2.5.3 + tslib: 2.6.2 dev: true - /@pmmmwh/react-refresh-webpack-plugin@0.5.10(react-refresh@0.14.0)(webpack@5.87.0): + /@pmmmwh/react-refresh-webpack-plugin@0.5.10(react-refresh@0.14.0)(webpack@5.88.2): resolution: {integrity: sha512-j0Ya0hCFZPd4x40qLzbhGsh9TMtdb+CJQiso+WxLOPNasohq9cc5SNUcwsZaRH6++Xh91Xkm/xHCkuIiIu0LUA==} engines: {node: '>= 10.13'} peerDependencies: @@ -3992,26 +5266,26 @@ packages: react-refresh: 0.14.0 schema-utils: 3.3.0 source-map: 0.7.4 - webpack: 5.87.0 + webpack: 5.88.2 dev: true /@probe.gl/env@3.6.0: resolution: {integrity: sha512-4tTZYUg/8BICC3Yyb9rOeoKeijKbZHRXBEKObrfPmX4sQmYB15ZOUpoVBhAyJkOYVAM8EkPci6Uw5dLCwx2BEQ==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 dev: false /@probe.gl/log@3.6.0: resolution: {integrity: sha512-hjpyenpEvOdowgZ1qMeCJxfRD4JkKdlXz0RC14m42Un62NtOT+GpWyKA4LssT0+xyLULCByRAtG2fzZorpIAcA==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 '@probe.gl/env': 3.6.0 dev: false /@probe.gl/stats@3.6.0: resolution: {integrity: sha512-JdALQXB44OP4kUBN/UrQgzbJe4qokbVF4Y8lkIA8iVCFnjVowWIgkD/z/0QO65yELT54tTrtepw1jScjKB+rhQ==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 dev: false /@rc-component/portal@1.1.1(react-dom@16.14.0)(react@16.13.1): @@ -4051,7 +5325,7 @@ packages: engines: {node: '>=14'} dev: true - /@rollup/plugin-babel@6.0.3(@babel/core@7.22.5)(rollup@3.25.1): + /@rollup/plugin-babel@6.0.3(@babel/core@7.22.20)(rollup@3.29.2): resolution: {integrity: sha512-fKImZKppa1A/gX73eg4JGo+8kQr/q1HBQaCGKECZ0v4YBBv3lFqi14+7xyApECzvkLTHCifx+7ntcrvtBIRcpg==} engines: {node: '>=14.0.0'} peerDependencies: @@ -4064,40 +5338,40 @@ packages: rollup: optional: true dependencies: - '@babel/core': 7.22.5 - '@babel/helper-module-imports': 7.22.5 - '@rollup/pluginutils': 5.0.2(rollup@3.25.1) - rollup: 3.25.1 + '@babel/core': 7.22.20 + '@babel/helper-module-imports': 7.22.15 + '@rollup/pluginutils': 5.0.4(rollup@3.29.2) + rollup: 3.29.2 dev: true - /@rollup/plugin-commonjs@21.1.0(rollup@3.25.1): + /@rollup/plugin-commonjs@21.1.0(rollup@3.29.2): resolution: {integrity: sha512-6ZtHx3VHIp2ReNNDxHjuUml6ur+WcQ28N1yHgCQwsbNkQg2suhxGMDQGJOn/KuDxKtd1xuZP5xSTwBA4GQ8hbA==} engines: {node: '>= 8.0.0'} peerDependencies: rollup: ^2.38.3 dependencies: - '@rollup/pluginutils': 3.1.0(rollup@3.25.1) + '@rollup/pluginutils': 3.1.0(rollup@3.29.2) commondir: 1.0.1 estree-walker: 2.0.2 glob: 7.2.3 is-reference: 1.2.1 magic-string: 0.25.9 - resolve: 1.22.2 - rollup: 3.25.1 + resolve: 1.22.6 + rollup: 3.29.2 dev: true - /@rollup/plugin-inject@4.0.4(rollup@3.25.1): + /@rollup/plugin-inject@4.0.4(rollup@3.29.2): resolution: {integrity: sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ==} peerDependencies: rollup: ^1.20.0 || ^2.0.0 dependencies: - '@rollup/pluginutils': 3.1.0(rollup@3.25.1) + '@rollup/pluginutils': 3.1.0(rollup@3.29.2) estree-walker: 2.0.2 magic-string: 0.25.9 - rollup: 3.25.1 + rollup: 3.29.2 dev: true - /@rollup/plugin-json@6.0.0(rollup@3.25.1): + /@rollup/plugin-json@6.0.0(rollup@3.29.2): resolution: {integrity: sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==} engines: {node: '>=14.0.0'} peerDependencies: @@ -4106,12 +5380,12 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.25.1) - rollup: 3.25.1 + '@rollup/pluginutils': 5.0.2(rollup@3.29.2) + rollup: 3.29.2 dev: true - /@rollup/plugin-node-resolve@15.1.0(rollup@3.25.1): - resolution: {integrity: sha512-xeZHCgsiZ9pzYVgAo9580eCGqwh/XCEUM9q6iQfGNocjgkufHAqC3exA+45URvhiYV8sBF9RlBai650eNs7AsA==} + /@rollup/plugin-node-resolve@15.2.1(rollup@3.29.2): + resolution: {integrity: sha512-nsbUg588+GDSu8/NS8T4UAshO6xeaOfINNuXeVHcKV02LJtoRaM1SiOacClw4kws1SFiNhdLGxlbMY9ga/zs/w==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^2.78.0||^3.0.0 @@ -4119,16 +5393,16 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.25.1) + '@rollup/pluginutils': 5.0.4(rollup@3.29.2) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-builtin-module: 3.2.1 is-module: 1.0.0 - resolve: 1.22.2 - rollup: 3.25.1 + resolve: 1.22.6 + rollup: 3.29.2 dev: true - /@rollup/plugin-terser@0.4.3(rollup@3.25.1): + /@rollup/plugin-terser@0.4.3(rollup@3.29.2): resolution: {integrity: sha512-EF0oejTMtkyhrkwCdg0HJ0IpkcaVg1MMSf2olHb2Jp+1mnLM04OhjpJWGma4HobiDTF0WCyViWuvadyE9ch2XA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -4137,14 +5411,14 @@ packages: rollup: optional: true dependencies: - rollup: 3.25.1 + rollup: 3.29.2 serialize-javascript: 6.0.1 smob: 1.4.0 - terser: 5.18.1 + terser: 5.19.4 dev: true - /@rollup/plugin-typescript@11.1.1(rollup@3.25.1)(typescript@5.1.3): - resolution: {integrity: sha512-Ioir+x5Bejv72Lx2Zbz3/qGg7tvGbxQZALCLoJaGrkNXak/19+vKgKYJYM3i/fJxvsb23I9FuFQ8CUBEfsmBRg==} + /@rollup/plugin-typescript@11.1.3(rollup@3.29.2)(typescript@5.2.2): + resolution: {integrity: sha512-8o6cNgN44kQBcpsUJTbTXMTtb87oR1O0zgP3Dxm71hrNgparap3VujgofEilTYJo+ivf2ke6uy3/E5QEaiRlDA==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^2.14.0||^3.0.0 @@ -4156,10 +5430,10 @@ packages: tslib: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.25.1) - resolve: 1.22.2 - rollup: 3.25.1 - typescript: 5.1.3 + '@rollup/pluginutils': 5.0.4(rollup@3.29.2) + resolve: 1.22.6 + rollup: 3.29.2 + typescript: 5.2.2 dev: true /@rollup/plugin-wasm@5.1.2(rollup@2.79.1): @@ -4171,20 +5445,35 @@ packages: rollup: 2.79.1 dev: true - /@rollup/pluginutils@3.1.0(rollup@3.25.1): + /@rollup/pluginutils@3.1.0(rollup@3.29.2): resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} peerDependencies: - rollup: ^1.20.0||^2.0.0 + rollup: ^1.20.0||^2.0.0 + dependencies: + '@types/estree': 0.0.39 + estree-walker: 1.0.1 + picomatch: 2.3.1 + rollup: 3.29.2 + dev: true + + /@rollup/pluginutils@5.0.2(rollup@3.29.2): + resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true dependencies: - '@types/estree': 0.0.39 - estree-walker: 1.0.1 + '@types/estree': 1.0.1 + estree-walker: 2.0.2 picomatch: 2.3.1 - rollup: 3.25.1 + rollup: 3.29.2 dev: true - /@rollup/pluginutils@5.0.2(rollup@3.25.1): - resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} + /@rollup/pluginutils@5.0.4(rollup@3.29.2): + resolution: {integrity: sha512-0KJnIoRI8A+a1dqOYLxH8vBf8bphDmty5QvIm2hqm7oFCFYKCAZWWd2hXgMibaPsNDhI0AtpYfQZJG47pt/k4g==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0||^3.0.0 @@ -4195,7 +5484,7 @@ packages: '@types/estree': 1.0.1 estree-walker: 2.0.2 picomatch: 2.3.1 - rollup: 3.25.1 + rollup: 3.29.2 dev: true /@selderee/plugin-htmlparser2@0.6.0: @@ -4279,7 +5568,7 @@ packages: dependencies: '@babel/core': 7.22.5 postcss: 8.4.24 - postcss-syntax: 0.36.2(postcss@8.4.24) + postcss-syntax: 0.36.2(postcss@8.4.30) transitivePeerDependencies: - supports-color dev: true @@ -4565,12 +5854,28 @@ packages: '@types/babel__traverse': 7.20.1 dev: true + /@types/babel__core@7.20.2: + resolution: {integrity: sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA==} + dependencies: + '@babel/parser': 7.22.16 + '@babel/types': 7.22.19 + '@types/babel__generator': 7.6.5 + '@types/babel__template': 7.4.2 + '@types/babel__traverse': 7.20.2 + dev: true + /@types/babel__generator@7.6.4: resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} dependencies: '@babel/types': 7.22.5 dev: true + /@types/babel__generator@7.6.5: + resolution: {integrity: sha512-h9yIuWbJKdOPLJTbmSpPzkF67e659PbQDba7ifWm5BJ8xTv+sDmS7rFmywkWOvXedGTivCdeGSIIX8WLcRTz8w==} + dependencies: + '@babel/types': 7.22.19 + dev: true + /@types/babel__template@7.4.1: resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} dependencies: @@ -4578,12 +5883,25 @@ packages: '@babel/types': 7.22.5 dev: true + /@types/babel__template@7.4.2: + resolution: {integrity: sha512-/AVzPICMhMOMYoSx9MoKpGDKdBRsIXMNByh1PXSZoa+v6ZoLa8xxtsT/uLQ/NJm0XVAWl/BvId4MlDeXJaeIZQ==} + dependencies: + '@babel/parser': 7.22.16 + '@babel/types': 7.22.19 + dev: true + /@types/babel__traverse@7.20.1: resolution: {integrity: sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==} dependencies: '@babel/types': 7.22.5 dev: true + /@types/babel__traverse@7.20.2: + resolution: {integrity: sha512-ojlGK1Hsfce93J0+kn3H5R73elidKUaZonirN33GSmgTUMpzI/MIFfSpF3haANe3G1bEBS9/9/QEqwTzwqFsKw==} + dependencies: + '@babel/types': 7.22.19 + dev: true + /@types/d3-color@3.0.2: resolution: {integrity: sha512-WVx6zBiz4sWlboCy7TCgjeyHpNjMsoF36yaagny1uXfbadc9f+5BeBf7U+lRmQqY3EHbGQpP8UdW8AC+cywSwQ==} dev: true @@ -4609,14 +5927,14 @@ packages: /@types/eslint-scope@3.7.4: resolution: {integrity: sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==} dependencies: - '@types/eslint': 8.40.2 + '@types/eslint': 8.44.2 '@types/estree': 1.0.1 - /@types/eslint@8.40.2: - resolution: {integrity: sha512-PRVjQ4Eh9z9pmmtaq8nTjZjQwKFk7YIHIud3lRoKRBgUQjgjRmoGxxGEPXQkF+lH7QkHJRNr5F4aBgYCW0lqpQ==} + /@types/eslint@8.44.2: + resolution: {integrity: sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg==} dependencies: '@types/estree': 1.0.1 - '@types/json-schema': 7.0.12 + '@types/json-schema': 7.0.13 /@types/estree-jsx@1.0.0: resolution: {integrity: sha512-3qvGd0z8F2ENTGr/GG1yViqfiKmRfrXVx5sJyHGFu3z7m5g5utCQtGp/g29JnjflhtQJBv1WDQukHiT58xPcYQ==} @@ -4634,10 +5952,14 @@ packages: /@types/gl-matrix@2.4.5: resolution: {integrity: sha512-0L8Mq1+oaIW0oVzGUDbSW+HnTjCNb4CmoIQE5BkoHt/A7x20z0MJ1PnwfH3atty/vbWLGgvJwVu2Mz3SKFiEFw==} + /@types/gl@6.0.2: + resolution: {integrity: sha512-5vlkHzpu25w2zJ6i41rYbglH3sSTvkFPi34J5p/kYhlS3hF31GaDGWif1jSiKSy8+UCuFlejXPya0hkLKIn++A==} + dev: true + /@types/graceful-fs@4.1.6: resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==} dependencies: - '@types/node': 17.0.45 + '@types/node': 20.6.2 dev: true /@types/hammerjs@2.0.36: @@ -4708,10 +6030,13 @@ packages: /@types/json-schema@7.0.12: resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} + /@types/json-schema@7.0.13: + resolution: {integrity: sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==} + /@types/keyv@3.1.4: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: - '@types/node': 17.0.45 + '@types/node': 14.18.61 dev: true /@types/matter-js@0.17.7: @@ -4736,13 +6061,17 @@ packages: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true - /@types/node@14.18.51: - resolution: {integrity: sha512-P9bsdGFPpVtofEKlhWMVS2qqx1A/rt9QBfihWlklfHHpUpjtYse5AzFz6j4DWrARLYh6gRnw9+5+DJcrq3KvBA==} + /@types/node@14.18.61: + resolution: {integrity: sha512-1mFT4DqS4/s9tlZbdkwEB/EnSykA9MDeDLIk3FHApGvIMGY//qgstB2gu9GKGESWyW/qiRUO+jhlLJ9bBJ8j+Q==} dev: true /@types/node@17.0.45: resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} + /@types/node@20.6.2: + resolution: {integrity: sha512-Y+/1vGBHV/cYk6OI1Na/LHzwnlNCAfU3ZNGrc1LdRe/LAIbdDPTTv/HU3M7yXN448aTVDq3eKRm2cg7iKLb8gw==} + dev: true + /@types/normalize-package-data@2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} dev: true @@ -4802,7 +6131,7 @@ packages: /@types/responselike@1.0.0: resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} dependencies: - '@types/node': 17.0.45 + '@types/node': 14.18.61 dev: true /@types/sax@1.2.4: @@ -4815,8 +6144,8 @@ packages: resolution: {integrity: sha512-Ru6zqw+j3Rhn6Dgg7j/SSKOC+2Rpm92V6f+tvXMZTZ8KgAqtOdD2fHWUYvcU2zrsciw46oTIWjeJ86Hun9AuZg==} dev: true - /@types/semver@7.5.0: - resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} + /@types/semver@7.5.2: + resolution: {integrity: sha512-7aqorHYgdNO4DM36stTiGO3DvKoex9TQRwsJU6vMaFGyqpBA1MNZkz+PG3gaNUPpTAOYhT1WR7M1JyA3fbS9Cw==} dev: true /@types/stack-utils@1.0.1: @@ -4827,6 +6156,10 @@ packages: resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} dev: true + /@types/stylis@4.2.0: + resolution: {integrity: sha512-n4sx2bqL0mW1tvDf/loQ+aMX7GQD3lc3fkCMC55VFNDu/vBOabO+LTIeXKM14xK0ppk5TUGcWRjiSpIlUpghKw==} + dev: true + /@types/unist@2.0.6: resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==} dev: true @@ -4867,7 +6200,7 @@ packages: resolution: {integrity: sha512-E1nINLaVvxu7N66gANMjhlxMdGL9KqsePa7NyO4p96xeQ7YiAjydVH+eE4W2aLdGyIcLqt+pNMK8l7+gD8c+Wg==} dev: true - /@typescript-eslint/eslint-plugin@5.48.1(@typescript-eslint/parser@5.48.1)(eslint@7.32.0)(typescript@5.1.3): + /@typescript-eslint/eslint-plugin@5.48.1(@typescript-eslint/parser@5.48.1)(eslint@7.32.0)(typescript@5.2.2): resolution: {integrity: sha512-9nY5K1Rp2ppmpb9s9S2aBiF3xo5uExCehMDmYmmFqqyxgenbHJ3qbarcLt4ITgaD6r/2ypdlcFRdcuVPnks+fQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -4878,32 +6211,60 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.48.1(eslint@7.32.0)(typescript@5.1.3) + '@typescript-eslint/parser': 5.48.1(eslint@7.32.0)(typescript@5.2.2) '@typescript-eslint/scope-manager': 5.48.1 - '@typescript-eslint/type-utils': 5.48.1(eslint@7.32.0)(typescript@5.1.3) - '@typescript-eslint/utils': 5.48.1(eslint@7.32.0)(typescript@5.1.3) - debug: 4.3.4(supports-color@5.5.0) + '@typescript-eslint/type-utils': 5.48.1(eslint@7.32.0)(typescript@5.2.2) + '@typescript-eslint/utils': 5.48.1(eslint@7.32.0)(typescript@5.2.2) + debug: 4.3.4 eslint: 7.32.0 ignore: 5.2.4 natural-compare-lite: 1.4.0 regexpp: 3.2.0 - semver: 7.5.2 - tsutils: 3.21.0(typescript@5.1.3) - typescript: 5.1.3 + semver: 7.5.4 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@7.32.0)(typescript@5.2.2): + resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + '@typescript-eslint/parser': ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.8.1 + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.2.2) + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/type-utils': 5.62.0(eslint@7.32.0)(typescript@5.2.2) + '@typescript-eslint/utils': 5.62.0(eslint@7.32.0)(typescript@5.2.2) + debug: 4.3.4 + eslint: 7.32.0 + graphemer: 1.4.0 + ignore: 5.2.4 + natural-compare-lite: 1.4.0 + semver: 7.5.4 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/experimental-utils@4.33.0(eslint@7.32.0)(typescript@5.1.3): + /@typescript-eslint/experimental-utils@4.33.0(eslint@7.32.0)(typescript@5.2.2): resolution: {integrity: sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: eslint: '*' dependencies: - '@types/json-schema': 7.0.12 + '@types/json-schema': 7.0.13 '@typescript-eslint/scope-manager': 4.33.0 '@typescript-eslint/types': 4.33.0 - '@typescript-eslint/typescript-estree': 4.33.0(typescript@5.1.3) + '@typescript-eslint/typescript-estree': 4.33.0(typescript@5.2.2) eslint: 7.32.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0(eslint@7.32.0) @@ -4912,7 +6273,7 @@ packages: - typescript dev: true - /@typescript-eslint/parser@5.48.1(eslint@7.32.0)(typescript@5.1.3): + /@typescript-eslint/parser@5.48.1(eslint@7.32.0)(typescript@5.2.2): resolution: {integrity: sha512-4yg+FJR/V1M9Xoq56SF9Iygqm+r5LMXvheo6DQ7/yUWynQ4YfCRnsKuRgqH4EQ5Ya76rVwlEpw4Xu+TgWQUcdA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -4924,10 +6285,30 @@ packages: dependencies: '@typescript-eslint/scope-manager': 5.48.1 '@typescript-eslint/types': 5.48.1 - '@typescript-eslint/typescript-estree': 5.48.1(typescript@5.1.3) - debug: 4.3.4(supports-color@5.5.0) + '@typescript-eslint/typescript-estree': 5.48.1(typescript@5.2.2) + debug: 4.3.4 + eslint: 7.32.0 + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.2.2): + resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) + debug: 4.3.4 eslint: 7.32.0 - typescript: 5.1.3 + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true @@ -4948,15 +6329,15 @@ packages: '@typescript-eslint/visitor-keys': 5.48.1 dev: true - /@typescript-eslint/scope-manager@5.60.0: - resolution: {integrity: sha512-hakuzcxPwXi2ihf9WQu1BbRj1e/Pd8ZZwVTG9kfbxAMZstKz8/9OoexIwnmLzShtsdap5U/CoQGRCWlSuPbYxQ==} + /@typescript-eslint/scope-manager@5.62.0: + resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.60.0 - '@typescript-eslint/visitor-keys': 5.60.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/visitor-keys': 5.62.0 dev: true - /@typescript-eslint/type-utils@5.48.1(eslint@7.32.0)(typescript@5.1.3): + /@typescript-eslint/type-utils@5.48.1(eslint@7.32.0)(typescript@5.2.2): resolution: {integrity: sha512-Hyr8HU8Alcuva1ppmqSYtM/Gp0q4JOp1F+/JH5D1IZm/bUBrV0edoewQZiEc1r6I8L4JL21broddxK8HAcZiqQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -4966,12 +6347,32 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.48.1(typescript@5.1.3) - '@typescript-eslint/utils': 5.48.1(eslint@7.32.0)(typescript@5.1.3) - debug: 4.3.4(supports-color@5.5.0) + '@typescript-eslint/typescript-estree': 5.48.1(typescript@5.2.2) + '@typescript-eslint/utils': 5.48.1(eslint@7.32.0)(typescript@5.2.2) + debug: 4.3.4 + eslint: 7.32.0 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/type-utils@5.62.0(eslint@7.32.0)(typescript@5.2.2): + resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '*' + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) + '@typescript-eslint/utils': 5.62.0(eslint@7.32.0)(typescript@5.2.2) + debug: 4.3.4 eslint: 7.32.0 - tsutils: 3.21.0(typescript@5.1.3) - typescript: 5.1.3 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true @@ -4986,12 +6387,12 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/types@5.60.0: - resolution: {integrity: sha512-ascOuoCpNZBccFVNJRSC6rPq4EmJ2NkuoKnd6LDNyAQmdDnziAtxbCGWCbefG1CNzmDvd05zO36AmB7H8RzKPA==} + /@typescript-eslint/types@5.62.0: + resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree@4.33.0(typescript@5.1.3): + /@typescript-eslint/typescript-estree@4.33.0(typescript@5.2.2): resolution: {integrity: sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: @@ -5002,17 +6403,17 @@ packages: dependencies: '@typescript-eslint/types': 4.33.0 '@typescript-eslint/visitor-keys': 4.33.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.2 - tsutils: 3.21.0(typescript@5.1.3) - typescript: 5.1.3 + semver: 7.5.4 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/typescript-estree@5.48.1(typescript@5.1.3): + /@typescript-eslint/typescript-estree@5.48.1(typescript@5.2.2): resolution: {integrity: sha512-Hut+Osk5FYr+sgFh8J/FHjqX6HFcDzTlWLrFqGoK5kVUN3VBHF/QzZmAsIXCQ8T/W9nQNBTqalxi1P3LSqWnRA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -5023,18 +6424,18 @@ packages: dependencies: '@typescript-eslint/types': 5.48.1 '@typescript-eslint/visitor-keys': 5.48.1 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.3 - tsutils: 3.21.0(typescript@5.1.3) - typescript: 5.1.3 + semver: 7.5.4 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/typescript-estree@5.60.0(typescript@5.1.3): - resolution: {integrity: sha512-R43thAuwarC99SnvrBmh26tc7F6sPa2B3evkXp/8q954kYL6Ro56AwASYWtEEi+4j09GbiNAHqYwNNZuNlARGQ==} + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.2.2): + resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -5042,53 +6443,53 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.60.0 - '@typescript-eslint/visitor-keys': 5.60.0 - debug: 4.3.4(supports-color@5.5.0) + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/visitor-keys': 5.62.0 + debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.3 - tsutils: 3.21.0(typescript@5.1.3) - typescript: 5.1.3 + semver: 7.5.4 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@5.48.1(eslint@7.32.0)(typescript@5.1.3): + /@typescript-eslint/utils@5.48.1(eslint@7.32.0)(typescript@5.2.2): resolution: {integrity: sha512-SmQuSrCGUOdmGMwivW14Z0Lj8dxG1mOFZ7soeJ0TQZEJcs3n5Ndgkg0A4bcMFzBELqLJ6GTHnEU+iIoaD6hFGA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@types/json-schema': 7.0.12 - '@types/semver': 7.5.0 + '@types/json-schema': 7.0.13 + '@types/semver': 7.5.2 '@typescript-eslint/scope-manager': 5.48.1 '@typescript-eslint/types': 5.48.1 - '@typescript-eslint/typescript-estree': 5.48.1(typescript@5.1.3) + '@typescript-eslint/typescript-estree': 5.48.1(typescript@5.2.2) eslint: 7.32.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0(eslint@7.32.0) - semver: 7.5.2 + semver: 7.5.4 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/utils@5.60.0(eslint@7.32.0)(typescript@5.1.3): - resolution: {integrity: sha512-ba51uMqDtfLQ5+xHtwlO84vkdjrqNzOnqrnwbMHMRY8Tqeme8C2Q8Fc7LajfGR+e3/4LoYiWXUM6BpIIbHJ4hQ==} + /@typescript-eslint/utils@5.62.0(eslint@7.32.0)(typescript@5.2.2): + resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@7.32.0) - '@types/json-schema': 7.0.12 - '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 5.60.0 - '@typescript-eslint/types': 5.60.0 - '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.1.3) + '@types/json-schema': 7.0.13 + '@types/semver': 7.5.2 + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) eslint: 7.32.0 eslint-scope: 5.1.1 - semver: 7.5.3 + semver: 7.5.4 transitivePeerDependencies: - supports-color - typescript @@ -5107,15 +6508,15 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: '@typescript-eslint/types': 5.48.1 - eslint-visitor-keys: 3.4.1 + eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@5.60.0: - resolution: {integrity: sha512-wm9Uz71SbCyhUKgcaPRauBdTegUyY/ZWl8gLwD/i/ybJqscrrdVSFImpvUz16BLPChIeKBK5Fa9s6KDQjsjyWw==} + /@typescript-eslint/visitor-keys@5.62.0: + resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.60.0 - eslint-visitor-keys: 3.4.1 + '@typescript-eslint/types': 5.62.0 + eslint-visitor-keys: 3.4.3 dev: true /@umijs/ast@4.0.71: @@ -5126,14 +6527,14 @@ packages: - supports-color dev: true - /@umijs/babel-preset-umi@4.0.71(styled-components@5.3.11): + /@umijs/babel-preset-umi@4.0.71(styled-components@6.0.8): resolution: {integrity: sha512-8xpDpuSxHDvA2/Z5xow5D+5ny6ZesFvmUUaOeOULATlGdo8DO2BV7V3rZvSm7jvk6r/V6hf/OZePjXu0ZNrymQ==} dependencies: '@babel/runtime': 7.21.0 '@bloomberg/record-tuple-polyfill': 0.0.4 '@umijs/bundler-utils': 4.0.71 '@umijs/utils': 4.0.71 - babel-plugin-styled-components: 2.1.1(styled-components@5.3.11) + babel-plugin-styled-components: 2.1.1(styled-components@6.0.8) core-js: 3.28.0 transitivePeerDependencies: - styled-components @@ -5166,7 +6567,7 @@ packages: - supports-color dev: true - /@umijs/bundler-vite@4.0.71(@types/node@14.18.51)(postcss@8.4.24)(rollup@3.25.1)(sass@1.63.4): + /@umijs/bundler-vite@4.0.71(@types/node@14.18.61)(postcss@8.4.30)(rollup@3.29.2)(sass@1.63.4): resolution: {integrity: sha512-XraQOul7GrkUalSw3lppSuN7TJOAPQitE6iAam2lVdDNiJLWrY5jBd1fE3uwCIIacXwPDBQSyEV7oZey8xaGfg==} hasBin: true dependencies: @@ -5175,9 +6576,9 @@ packages: '@umijs/utils': 4.0.71 '@vitejs/plugin-react': 4.0.0(vite@4.3.1) less: 4.1.3 - postcss-preset-env: 7.5.0(postcss@8.4.24) - rollup-plugin-visualizer: 5.9.0(rollup@3.25.1) - vite: 4.3.1(@types/node@14.18.51)(less@4.1.3)(sass@1.63.4) + postcss-preset-env: 7.5.0(postcss@8.4.30) + rollup-plugin-visualizer: 5.9.0(rollup@3.29.2) + vite: 4.3.1(@types/node@14.18.61)(less@4.1.3)(sass@1.63.4) transitivePeerDependencies: - '@types/node' - postcss @@ -5189,24 +6590,24 @@ packages: - terser dev: true - /@umijs/bundler-webpack@4.0.71(styled-components@5.3.11)(typescript@5.1.3)(webpack@5.87.0): + /@umijs/bundler-webpack@4.0.71(styled-components@6.0.8)(typescript@5.2.2)(webpack@5.88.2): resolution: {integrity: sha512-VeiApfpi2SUC63mhAjOqQhFjORZ8xG7kUNeDnCNxCSRao2MJ5h7vcD9rMcNln69OlN6Urtc1gIS7znKHbm9THA==} hasBin: true dependencies: - '@pmmmwh/react-refresh-webpack-plugin': 0.5.10(react-refresh@0.14.0)(webpack@5.87.0) + '@pmmmwh/react-refresh-webpack-plugin': 0.5.10(react-refresh@0.14.0)(webpack@5.88.2) '@svgr/core': 6.5.1 '@svgr/plugin-jsx': 6.5.1(@svgr/core@6.5.1) '@svgr/plugin-svgo': 6.5.1(@svgr/core@6.5.1) '@types/hapi__joi': 17.1.9 - '@umijs/babel-preset-umi': 4.0.71(styled-components@5.3.11) + '@umijs/babel-preset-umi': 4.0.71(styled-components@6.0.8) '@umijs/bundler-utils': 4.0.71 '@umijs/case-sensitive-paths-webpack-plugin': 1.0.1 '@umijs/mfsu': 4.0.71 '@umijs/utils': 4.0.71 cors: 2.8.5 - css-loader: 6.7.1(webpack@5.87.0) + css-loader: 6.7.1(webpack@5.88.2) es5-imcompatible-versions: 0.1.85 - fork-ts-checker-webpack-plugin: 8.0.0(typescript@5.1.3)(webpack@5.87.0) + fork-ts-checker-webpack-plugin: 8.0.0(typescript@5.2.2)(webpack@5.88.2) jest-worker: 29.4.3 lightningcss: 1.19.0 node-libs-browser: 2.2.1 @@ -5343,24 +6744,24 @@ packages: /@umijs/history@5.3.1: resolution: {integrity: sha512-/e0cEGrR2bIWQD7pRl3dl9dcyRGeC9hoW0OCvUTT/hjY0EfUrkd6G8ZanVghPMpDuY5usxq9GVcvrT8KNXLWvA==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.21.0 query-string: 6.14.1 dev: true - /@umijs/lint@4.0.71(eslint@7.32.0)(jest@26.6.3)(styled-components@5.3.11)(stylelint@14.16.1)(typescript@5.1.3): + /@umijs/lint@4.0.71(eslint@7.32.0)(jest@26.6.3)(styled-components@6.0.8)(stylelint@14.16.1)(typescript@5.2.2): resolution: {integrity: sha512-HdelctsQPBvqHGfb/K5wOQHVoVTK+2b3PsmUIWm5RfaUhpfRhVpWE3j9UvKJlqj1CbL4e7Go4bGWUbOZwEpi8g==} dependencies: '@babel/core': 7.21.0 '@babel/eslint-parser': 7.19.1(@babel/core@7.21.0)(eslint@7.32.0) '@stylelint/postcss-css-in-js': 0.38.0(postcss-syntax@0.36.2)(postcss@8.4.24) - '@typescript-eslint/eslint-plugin': 5.48.1(@typescript-eslint/parser@5.48.1)(eslint@7.32.0)(typescript@5.1.3) - '@typescript-eslint/parser': 5.48.1(eslint@7.32.0)(typescript@5.1.3) - '@umijs/babel-preset-umi': 4.0.71(styled-components@5.3.11) - eslint-plugin-jest: 27.2.1(@typescript-eslint/eslint-plugin@5.48.1)(eslint@7.32.0)(jest@26.6.3)(typescript@5.1.3) + '@typescript-eslint/eslint-plugin': 5.48.1(@typescript-eslint/parser@5.48.1)(eslint@7.32.0)(typescript@5.2.2) + '@typescript-eslint/parser': 5.48.1(eslint@7.32.0)(typescript@5.2.2) + '@umijs/babel-preset-umi': 4.0.71(styled-components@6.0.8) + eslint-plugin-jest: 27.2.1(@typescript-eslint/eslint-plugin@5.48.1)(eslint@7.32.0)(jest@26.6.3)(typescript@5.2.2) eslint-plugin-react: 7.32.2(eslint@7.32.0) eslint-plugin-react-hooks: 4.6.0(eslint@7.32.0) postcss: 8.4.24 - postcss-syntax: 0.36.2(postcss@8.4.24) + postcss-syntax: 0.36.2(postcss@8.4.30) stylelint-config-standard: 25.0.0(stylelint@14.16.1) transitivePeerDependencies: - eslint @@ -5394,17 +6795,17 @@ packages: tsx: 3.12.7 dev: true - /@umijs/preset-umi@4.0.71(@types/node@14.18.51)(@types/react@16.9.35)(postcss@8.4.24)(rollup@3.25.1)(sass@1.63.4)(styled-components@5.3.11)(typescript@5.1.3)(webpack@5.87.0): + /@umijs/preset-umi@4.0.71(@types/node@14.18.61)(@types/react@16.9.35)(postcss@8.4.30)(rollup@3.29.2)(sass@1.63.4)(styled-components@6.0.8)(typescript@5.2.2)(webpack@5.88.2): resolution: {integrity: sha512-+cEluoWaHLpbb1ywEgELJ3O2cMlh7a8I9gf595J2jyqNcuiQ/JzFpWQZZVHCNkENdtqcfWsUJ5u5l1a+yF1bRg==} dependencies: '@iconify/utils': 2.1.1 '@svgr/core': 6.5.1 '@umijs/ast': 4.0.71 - '@umijs/babel-preset-umi': 4.0.71(styled-components@5.3.11) + '@umijs/babel-preset-umi': 4.0.71(styled-components@6.0.8) '@umijs/bundler-esbuild': 4.0.71 '@umijs/bundler-utils': 4.0.71 - '@umijs/bundler-vite': 4.0.71(@types/node@14.18.51)(postcss@8.4.24)(rollup@3.25.1)(sass@1.63.4) - '@umijs/bundler-webpack': 4.0.71(styled-components@5.3.11)(typescript@5.1.3)(webpack@5.87.0) + '@umijs/bundler-vite': 4.0.71(@types/node@14.18.61)(postcss@8.4.30)(rollup@3.29.2)(sass@1.63.4) + '@umijs/bundler-webpack': 4.0.71(styled-components@6.0.8)(typescript@5.2.2)(webpack@5.88.2) '@umijs/core': 4.0.71 '@umijs/did-you-know': 1.0.3 '@umijs/es-module-parser': 0.0.7 @@ -5422,9 +6823,9 @@ packages: current-script-polyfill: 1.0.0 enhanced-resolve: 5.9.3 fast-glob: 3.2.12 - html-webpack-plugin: 5.5.0(webpack@5.87.0) + html-webpack-plugin: 5.5.0(webpack@5.88.2) path-to-regexp: 1.7.0 - postcss-prefix-selector: 1.16.0(postcss@8.4.24) + postcss-prefix-selector: 1.16.0(postcss@8.4.30) react: 18.1.0 react-dom: 18.1.0(react@18.1.0) react-router: 6.3.0(react@18.1.0) @@ -5493,14 +6894,14 @@ packages: - supports-color dev: true - /@umijs/test@4.0.71(@babel/core@7.22.5): + /@umijs/test@4.0.71(@babel/core@7.22.20): resolution: {integrity: sha512-QakGNRFoxuFQ4zkoI5iogHUdEJK8ybZt4xb949klEPlBfCiqUXNYUx8r7e0vlkOgmv44voEIm3B/y6msYt3rqQ==} dependencies: - '@babel/plugin-transform-modules-commonjs': 7.21.2(@babel/core@7.22.5) + '@babel/plugin-transform-modules-commonjs': 7.21.2(@babel/core@7.22.20) '@jest/types': 27.5.1 '@umijs/bundler-utils': 4.0.71 '@umijs/utils': 4.0.71 - babel-jest: 29.5.0(@babel/core@7.22.5) + babel-jest: 29.5.0(@babel/core@7.22.20) esbuild: 0.17.19 identity-obj-proxy: 3.0.0 isomorphic-unfetch: 4.0.2 @@ -5534,7 +6935,7 @@ packages: '@babel/plugin-transform-react-jsx-self': 7.22.5(@babel/core@7.22.5) '@babel/plugin-transform-react-jsx-source': 7.22.5(@babel/core@7.22.5) react-refresh: 0.14.0 - vite: 4.3.1(@types/node@14.18.51)(less@4.1.3)(sass@1.63.4) + vite: 4.3.1(@types/node@14.18.61)(less@4.1.3)(sass@1.63.4) transitivePeerDependencies: - supports-color dev: true @@ -5646,6 +7047,10 @@ packages: resolution: {integrity: sha512-AHabMBacHCvrV/Ru/yfOsMoVCBbT0d7SUNp1MFAzRM/J8HFODRO/LwUuCCcgQn/Rod2hhJfi+NRFUHX8I+0n/w==} dev: false + /@webgpu/types@0.1.34: + resolution: {integrity: sha512-9mXtH+CC8q+Ku7Z+1XazNIte81FvfdXwR2lLRO7Ykzjd/hh1J1krJa0gtnkF1kvP11psUmKEPKo7iMTeEcUpNA==} + dev: false + /@xobotyi/scrollbar-width@1.9.5: resolution: {integrity: sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ==} dev: true @@ -5679,12 +7084,12 @@ packages: acorn-walk: 7.2.0 dev: true - /acorn-import-assertions@1.9.0(acorn@8.9.0): + /acorn-import-assertions@1.9.0(acorn@8.10.0): resolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==} peerDependencies: acorn: ^8 dependencies: - acorn: 8.9.0 + acorn: 8.10.0 /acorn-jsx@5.3.2(acorn@7.4.1): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} @@ -5705,8 +7110,8 @@ packages: hasBin: true dev: true - /acorn@8.9.0: - resolution: {integrity: sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==} + /acorn@8.10.0: + resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} engines: {node: '>=0.4.0'} hasBin: true @@ -5726,7 +7131,7 @@ packages: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 transitivePeerDependencies: - supports-color dev: true @@ -5743,15 +7148,11 @@ packages: humanize-ms: 1.2.1 dev: true - /agentkeepalive@4.3.0: - resolution: {integrity: sha512-7Epl1Blf4Sy37j4v9f9FjICCh4+KAQOyXgHEwlyBiAQLbhKdq/i2QQU3amQalS/wPhdPzDXPL5DMR5bkn+YeWg==} + /agentkeepalive@4.5.0: + resolution: {integrity: sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==} engines: {node: '>= 8.0.0'} dependencies: - debug: 4.3.4(supports-color@5.5.0) - depd: 2.0.0 humanize-ms: 1.2.1 - transitivePeerDependencies: - - supports-color dev: true /aggregate-error@3.1.0: @@ -6027,7 +7428,7 @@ packages: resolution: {integrity: sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==} engines: {node: '>=10'} dependencies: - tslib: 2.5.3 + tslib: 2.6.2 dev: true /arr-diff@4.0.0: @@ -6066,8 +7467,8 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 get-intrinsic: 1.2.1 is-string: 1.0.7 dev: true @@ -6098,13 +7499,13 @@ packages: engines: {node: '>=0.10.0'} dev: true - /array.prototype.flat@1.3.1: - resolution: {integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==} + /array.prototype.flat@1.3.2: + resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 es-shim-unscopables: 1.0.0 dev: true @@ -6113,8 +7514,8 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 es-shim-unscopables: 1.0.0 dev: true @@ -6129,16 +7530,40 @@ packages: is-string: 1.0.7 dev: true + /array.prototype.reduce@1.0.6: + resolution: {integrity: sha512-UW+Mz8LG/sPSU8jRDCjVr6J/ZKAGpHfwrZ6kWTG5qCxIEiXdVshqGnu5vEZA8S1y6X4aCSbQZ0/EEsfvEvBiSg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 + es-array-method-boxes-properly: 1.0.0 + is-string: 1.0.7 + dev: true + /array.prototype.tosorted@1.1.1: resolution: {integrity: sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ==} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 es-shim-unscopables: 1.0.0 get-intrinsic: 1.2.1 dev: true + /arraybuffer.prototype.slice@1.0.2: + resolution: {integrity: sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.0 + call-bind: 1.0.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 + get-intrinsic: 1.2.1 + is-array-buffer: 3.0.2 + is-shared-array-buffer: 1.0.2 + dev: true + /arrify@1.0.1: resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} engines: {node: '>=0.10.0'} @@ -6233,6 +7658,22 @@ packages: postcss-value-parser: 4.2.0 dev: true + /autoprefixer@10.4.14(postcss@8.4.30): + resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==} + engines: {node: ^10 || ^12 || >=14} + hasBin: true + peerDependencies: + postcss: ^8.1.0 + dependencies: + browserslist: 4.21.9 + caniuse-lite: 1.0.30001504 + fraction.js: 4.2.0 + normalize-range: 0.1.2 + picocolors: 1.0.0 + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /available-typed-arrays@1.0.5: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} engines: {node: '>= 0.4'} @@ -6256,36 +7697,36 @@ packages: - supports-color dev: true - /babel-jest@24.9.0(@babel/core@7.22.5): + /babel-jest@24.9.0(@babel/core@7.22.20): resolution: {integrity: sha512-ntuddfyiN+EhMw58PTNL1ph4C9rECiQXjI4nMMBKBaNjXvqLdkXpPRcMSr4iyBrJg/+wz9brFUD6RhOAT6r4Iw==} engines: {node: '>= 6'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@jest/transform': 24.9.0 '@jest/types': 24.9.0 - '@types/babel__core': 7.20.1 + '@types/babel__core': 7.20.2 babel-plugin-istanbul: 5.2.0 - babel-preset-jest: 24.9.0(@babel/core@7.22.5) + babel-preset-jest: 24.9.0(@babel/core@7.22.20) chalk: 2.4.2 slash: 2.0.0 transitivePeerDependencies: - supports-color dev: true - /babel-jest@26.6.3(@babel/core@7.22.5): + /babel-jest@26.6.3(@babel/core@7.22.20): resolution: {integrity: sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==} engines: {node: '>= 10.14.2'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@jest/transform': 26.6.2 '@jest/types': 26.6.2 - '@types/babel__core': 7.20.1 + '@types/babel__core': 7.20.2 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 26.6.2(@babel/core@7.22.5) + babel-preset-jest: 26.6.2(@babel/core@7.22.20) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 @@ -6293,17 +7734,17 @@ packages: - supports-color dev: true - /babel-jest@29.5.0(@babel/core@7.22.5): + /babel-jest@29.5.0(@babel/core@7.22.20): resolution: {integrity: sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.8.0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@jest/transform': 29.5.0 '@types/babel__core': 7.20.1 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.5.0(@babel/core@7.22.5) + babel-preset-jest: 29.5.0(@babel/core@7.22.20) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 @@ -6346,17 +7787,17 @@ packages: resolution: {integrity: sha512-2EMA2P8Vp7lG0RAzr4HXqtYwacfMErOuv1U3wrvxHX6rD1sV6xS3WXG3r8TRQ2r6w8OhvSdWt+z41hQNwNm3Xw==} engines: {node: '>= 6'} dependencies: - '@types/babel__traverse': 7.20.1 + '@types/babel__traverse': 7.20.2 dev: true /babel-plugin-jest-hoist@26.6.2: resolution: {integrity: sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw==} engines: {node: '>= 10.14.2'} dependencies: - '@babel/template': 7.22.5 - '@babel/types': 7.22.5 - '@types/babel__core': 7.20.1 - '@types/babel__traverse': 7.20.1 + '@babel/template': 7.22.15 + '@babel/types': 7.22.19 + '@types/babel__core': 7.20.2 + '@types/babel__traverse': 7.20.2 dev: true /babel-plugin-jest-hoist@29.5.0: @@ -6369,30 +7810,53 @@ packages: '@types/babel__traverse': 7.20.1 dev: true - /babel-plugin-styled-components@2.1.1(styled-components@5.3.11): - resolution: {integrity: sha512-c8lJlszObVQPguHkI+akXv8+Jgb9Ccujx0EetL7oIvwU100LxO6XAGe45qry37wUL40a5U9f23SYrivro2XKhA==} + /babel-plugin-polyfill-corejs2@0.4.5(@babel/core@7.22.20): + resolution: {integrity: sha512-19hwUH5FKl49JEsvyTcoHakh6BE0wgXLLptIyKZ3PijHc/Ci521wygORCUCCred+E/twuqRyAkE02BAWPmsHOg==} peerDependencies: - styled-components: '>= 2' + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 dependencies: - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-module-imports': 7.22.5 - babel-plugin-syntax-jsx: 6.18.0 - lodash: 4.17.21 - picomatch: 2.3.1 - styled-components: 5.3.11(react-dom@16.14.0)(react-is@18.2.0)(react@16.13.1) + '@babel/compat-data': 7.22.20 + '@babel/core': 7.22.20 + '@babel/helper-define-polyfill-provider': 0.4.2(@babel/core@7.22.20) + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-polyfill-corejs3@0.8.3(@babel/core@7.22.20): + resolution: {integrity: sha512-z41XaniZL26WLrvjy7soabMXrfPWARN25PZoriDEiLMxAp50AUW3t35BGQUMg5xK3UrpVTtagIDklxYa+MhiNA==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-define-polyfill-provider': 0.4.2(@babel/core@7.22.20) + core-js-compat: 3.32.2 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-polyfill-regenerator@0.5.2(@babel/core@7.22.20): + resolution: {integrity: sha512-tAlOptU0Xj34V1Y2PNTL4Y0FOJMDB6bZmoW39FeCQIhigGLkqu3Fj6uiXpxIf6Ij274ENdYx64y6Au+ZKlb1IA==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/core': 7.22.20 + '@babel/helper-define-polyfill-provider': 0.4.2(@babel/core@7.22.20) + transitivePeerDependencies: + - supports-color dev: true - /babel-plugin-styled-components@2.1.3(styled-components@5.3.11): - resolution: {integrity: sha512-jBioLwBVHpOMU4NsueH/ADcHrjS0Y/WTpt2eGVmmuSFNEv2DF3XhcMncuZlbbjxQ4vzxg+yEr6E6TNjrIQbsJQ==} + /babel-plugin-styled-components@2.1.1(styled-components@6.0.8): + resolution: {integrity: sha512-c8lJlszObVQPguHkI+akXv8+Jgb9Ccujx0EetL7oIvwU100LxO6XAGe45qry37wUL40a5U9f23SYrivro2XKhA==} peerDependencies: styled-components: '>= 2' dependencies: '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-module-imports': 7.22.5 + '@babel/helper-module-imports': 7.22.15 babel-plugin-syntax-jsx: 6.18.0 lodash: 4.17.21 picomatch: 2.3.1 - styled-components: 5.3.11(react-dom@16.14.0)(react-is@18.2.0)(react@16.13.1) + styled-components: 6.0.8(react-dom@16.14.0)(react@16.13.1) dev: true /babel-plugin-syntax-jsx@6.18.0: @@ -6407,57 +7871,57 @@ packages: regenerator-runtime: 0.10.5 dev: true - /babel-preset-current-node-syntax@1.0.1(@babel/core@7.22.5): + /babel-preset-current-node-syntax@1.0.1(@babel/core@7.22.20): resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.5 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.22.5) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.22.5) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.22.5) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.22.5) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.22.5) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.22.5) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.22.5) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.22.5) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.5) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.22.5) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.22.5) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.22.5) - dev: true - - /babel-preset-jest@24.9.0(@babel/core@7.22.5): + '@babel/core': 7.22.20 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.22.20) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.22.20) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.22.20) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.22.20) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.22.20) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.22.20) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.22.20) + dev: true + + /babel-preset-jest@24.9.0(@babel/core@7.22.20): resolution: {integrity: sha512-izTUuhE4TMfTRPF92fFwD2QfdXaZW08qvWTFCI51V8rW5x00UuPgc3ajRoWofXOuxjfcOM5zzSYsQS3H8KGCAg==} engines: {node: '>= 6'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.5 - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.5) + '@babel/core': 7.22.20 + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.20) babel-plugin-jest-hoist: 24.9.0 dev: true - /babel-preset-jest@26.6.2(@babel/core@7.22.5): + /babel-preset-jest@26.6.2(@babel/core@7.22.20): resolution: {integrity: sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ==} engines: {node: '>= 10.14.2'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 babel-plugin-jest-hoist: 26.6.2 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.5) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.20) dev: true - /babel-preset-jest@29.5.0(@babel/core@7.22.5): + /babel-preset-jest@29.5.0(@babel/core@7.22.20): resolution: {integrity: sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 babel-plugin-jest-hoist: 29.5.0 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.5) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.20) dev: true /babel-runtime@6.26.0: @@ -6725,6 +8189,16 @@ packages: pako: 1.0.11 dev: true + /browserslist@4.21.10: + resolution: {integrity: sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + dependencies: + caniuse-lite: 1.0.30001538 + electron-to-chromium: 1.4.523 + node-releases: 2.0.13 + update-browserslist-db: 1.0.11(browserslist@4.21.10) + /browserslist@4.21.9: resolution: {integrity: sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -6734,6 +8208,7 @@ packages: electron-to-chromium: 1.4.433 node-releases: 2.0.12 update-browserslist-db: 1.0.11(browserslist@4.21.9) + dev: true /bs-logger@0.2.6: resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} @@ -6831,21 +8306,21 @@ packages: y18n: 4.0.3 dev: true - /cacache@17.1.3: - resolution: {integrity: sha512-jAdjGxmPxZh0IipMdR7fK/4sDSrHMLUV0+GvVUsjwyGNKHsh79kW/otg+GkbXwl6Uzvy9wsvHOX4nUoWldeZMg==} + /cacache@17.1.4: + resolution: {integrity: sha512-/aJwG2l3ZMJ1xNAnqbMpA40of9dj/pIH3QfiuQSqjfPJF747VR0J/bHn+/KdNnHKc6XQcWt/AfRSBft82W1d2A==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: '@npmcli/fs': 3.1.0 - fs-minipass: 3.0.2 - glob: 10.2.7 + fs-minipass: 3.0.3 + glob: 10.3.4 lru-cache: 7.18.3 - minipass: 5.0.0 + minipass: 7.0.3 minipass-collect: 1.0.2 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 p-map: 4.0.0 - ssri: 10.0.4 - tar: 6.1.15 + ssri: 10.0.5 + tar: 6.2.0 unique-filename: 3.0.0 dev: true @@ -6930,7 +8405,7 @@ packages: resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==} dependencies: pascal-case: 3.1.2 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /camelcase-keys@4.2.0: @@ -6972,14 +8447,18 @@ packages: /caniuse-lite@1.0.30001504: resolution: {integrity: sha512-5uo7eoOp2mKbWyfMXnGO9rJWOGU8duvzEiYITW+wivukL7yHH4gX9yuRaobu6El4jPxo6jKZfG+N6fB621GD/Q==} + dev: true + + /caniuse-lite@1.0.30001538: + resolution: {integrity: sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw==} /canvas@2.11.2: resolution: {integrity: sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==} engines: {node: '>=6'} requiresBuild: true dependencies: - '@mapbox/node-pre-gyp': 1.0.10 - nan: 2.17.0 + '@mapbox/node-pre-gyp': 1.0.11 + nan: 2.18.0 simple-get: 3.1.1 transitivePeerDependencies: - encoding @@ -7002,8 +8481,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /case-police@0.5.10: - resolution: {integrity: sha512-TCfzHZhQ4n6mfDIfN7si8US5KWilP7onSs8Y7Y0ki5h82ery9q9TJhfXYk6rIynr5kLuyCXCC13TWM0Qu0RtUw==} + /case-police@0.5.14: + resolution: {integrity: sha512-+m4+xJJlqkA6nVYATw+Y2/STB58H5EI9eTUYdMB+okP34wuHe6xrZYVosiZanS5qrYQwVW2/9znT5VRFis5D8w==} hasBin: true dev: true @@ -7080,7 +8559,7 @@ packages: normalize-path: 3.0.0 readdirp: 3.6.0 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /chownr@1.1.4: @@ -7287,8 +8766,8 @@ packages: - supports-color dev: true - /collect-v8-coverage@1.0.1: - resolution: {integrity: sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==} + /collect-v8-coverage@1.0.2: + resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} dev: true /collection-visit@1.0.0: @@ -7356,6 +8835,11 @@ packages: /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + /commander@4.1.1: + resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} + engines: {node: '>= 6'} + dev: true + /commander@6.2.1: resolution: {integrity: sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==} engines: {node: '>= 6'} @@ -7504,6 +8988,12 @@ packages: toggle-selection: 1.0.6 dev: true + /core-js-compat@3.32.2: + resolution: {integrity: sha512-+GjlguTDINOijtVRUxrQOv3kfu9rl+qPNdX2LTbJ/ZyVTuxK+ksVSAGX1nHstu4hrv1En/uPTtWgq2gI5wt4AQ==} + dependencies: + browserslist: 4.21.10 + dev: true + /core-js-pure@3.31.0: resolution: {integrity: sha512-/AnE9Y4OsJZicCzIe97JP5XoPKQJfTuEG43aEVLFJGOJpyqELod+pE6LEl63DfG1Mp8wX97LDaDpy1GmLEUxlg==} requiresBuild: true @@ -7614,7 +9104,7 @@ packages: dependencies: nice-try: 1.0.5 path-key: 2.0.1 - semver: 5.7.1 + semver: 5.7.2 shebang-command: 1.2.0 which: 1.3.1 dev: true @@ -7660,13 +9150,24 @@ packages: postcss-selector-parser: 6.0.13 dev: true + /css-blank-pseudo@3.0.3(postcss@8.4.30): + resolution: {integrity: sha512-VS90XWtsHGqoM0t4KpH053c4ehxZ2E6HtGI7x68YFV0pTo/QmkV/YFA+NnlvK8guxZVNWGQhVNJGC39Q8XF4OQ==} + engines: {node: ^12 || ^14 || >=16} + hasBin: true + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.30 + postcss-selector-parser: 6.0.13 + dev: true + /css-color-keywords@1.0.0: resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} engines: {node: '>=4'} dev: true - /css-functions-list@3.1.0: - resolution: {integrity: sha512-/9lCvYZaUbBGvYUgYGFJ4dcYiyqdhSjG7IPVluoV8A1ILjkF7ilmhp1OGUz8n+nmBcu0RNrQAzgD8B6FJbrt2w==} + /css-functions-list@3.2.0: + resolution: {integrity: sha512-d/jBMPyYybkkLVypgtGv12R+pIFw4/f/IHtCTxWpZc8ofTYOPigIgmA6vu5rMHartZC+WuXhBUHfnyNUIQSYrg==} engines: {node: '>=12.22'} dev: true @@ -7681,6 +9182,17 @@ packages: postcss-selector-parser: 6.0.13 dev: true + /css-has-pseudo@3.0.4(postcss@8.4.30): + resolution: {integrity: sha512-Vse0xpR1K9MNlp2j5w1pgWIJtm1a8qS0JwS9goFYcImjlHEmywP9VUF05aGBXzGpDJF86QXk4L0ypBmwPhGArw==} + engines: {node: ^12 || ^14 || >=16} + hasBin: true + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.30 + postcss-selector-parser: 6.0.13 + dev: true + /css-in-js-utils@3.1.0: resolution: {integrity: sha512-fJAcud6B3rRu+KHYk+Bwf+WFL2MDCJJ1XG9x137tJQ0xYxor7XziQtuGFbWNdqrvF4Tk26O3H73nfVqXt/fW1A==} dependencies: @@ -7693,7 +9205,7 @@ packages: utrie: 1.0.2 dev: false - /css-loader@6.7.1(webpack@5.87.0): + /css-loader@6.7.1(webpack@5.88.2): resolution: {integrity: sha512-yB5CNFa14MbPJcomwNh3wLThtkZgcNyI2bNMRt8iE5Z8Vwl7f8vQXFAzn2HDOJvtDq2NTZBUGMSUNNyrv3/+cw==} engines: {node: '>= 12.13.0'} peerDependencies: @@ -7706,8 +9218,8 @@ packages: postcss-modules-scope: 3.0.0(postcss@8.4.24) postcss-modules-values: 4.0.0(postcss@8.4.24) postcss-value-parser: 4.2.0 - semver: 7.5.3 - webpack: 5.87.0 + semver: 7.5.4 + webpack: 5.88.2 dev: true /css-prefers-color-scheme@6.0.3(postcss@8.4.24): @@ -7720,6 +9232,16 @@ packages: postcss: 8.4.24 dev: true + /css-prefers-color-scheme@6.0.3(postcss@8.4.30): + resolution: {integrity: sha512-4BqMbZksRkJQx2zAjrokiGMd07RqOa2IxIrrN10lyBe9xhn9DEvjUK79J6jkeiv9D9hQFXKb6g1jwU62jziJZA==} + engines: {node: ^12 || ^14 || >=16} + hasBin: true + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.30 + dev: true + /css-select-base-adapter@0.1.1: resolution: {integrity: sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==} dev: true @@ -7931,6 +9453,10 @@ packages: /d3-color@1.4.0: resolution: {integrity: sha512-TzNPeJy2+iEepfiL92LAAB7fvnp/dV2YwANPVHdDWmYMm23qIJBYww3qT8I8C1wXrmrg4UWs7BKc2tKIgyjzHg==} + /d3-color@1.4.1: + resolution: {integrity: sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==} + dev: false + /d3-color@3.1.0: resolution: {integrity: sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==} engines: {node: '>=12'} @@ -8357,7 +9883,7 @@ packages: ms: 2.1.3 dev: true - /debug@4.3.4(supports-color@5.5.0): + /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: @@ -8367,7 +9893,6 @@ packages: optional: true dependencies: ms: 2.1.2 - supports-color: 5.5.0 dev: true /decamelize-keys@1.1.1: @@ -8473,6 +9998,15 @@ packages: resolution: {integrity: sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==} dev: true + /define-data-property@1.1.0: + resolution: {integrity: sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.1 + gopd: 1.0.1 + has-property-descriptors: 1.0.0 + dev: true + /define-lazy-prop@2.0.0: resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==} engines: {node: '>=8'} @@ -8491,6 +10025,15 @@ packages: object-keys: 1.1.1 dev: true + /define-properties@1.2.1: + resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.0 + has-property-descriptors: 1.0.0 + object-keys: 1.1.1 + dev: true + /define-property@0.2.5: resolution: {integrity: sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==} engines: {node: '>=0.10.0'} @@ -8527,11 +10070,6 @@ packages: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} dev: true - /depd@2.0.0: - resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} - engines: {node: '>= 0.8'} - dev: true - /dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} @@ -8564,8 +10102,8 @@ packages: hasBin: true dev: true - /detect-libc@2.0.1: - resolution: {integrity: sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==} + /detect-libc@2.0.2: + resolution: {integrity: sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==} engines: {node: '>=8'} dev: true @@ -8593,7 +10131,7 @@ packages: hasBin: true dependencies: address: 1.2.2 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 transitivePeerDependencies: - supports-color dev: true @@ -8744,7 +10282,7 @@ packages: resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} dependencies: no-case: 3.0.4 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /dot-prop@3.0.0: @@ -8769,7 +10307,7 @@ packages: resolution: {integrity: sha512-a/Y5lf0G6gwsEQ9hop/n03CcjmHsGBk384Cz/AEX6mRYrfSpUx/lQvP9HLoXkCzScl9PL1sSmLPnMkgaXDCZLA==} dev: true - /dumi@2.2.1(@babel/core@7.22.5)(@types/node@14.18.51)(@types/react@16.9.35)(eslint@7.32.0)(jest@26.6.3)(postcss@8.4.24)(prettier@2.8.8)(react-dom@16.14.0)(react@16.13.1)(rollup@3.25.1)(styled-components@5.3.11)(stylelint@14.16.1)(typescript@5.1.3)(webpack@5.87.0): + /dumi@2.2.1(@babel/core@7.22.20)(@types/node@14.18.61)(@types/react@16.9.35)(eslint@7.32.0)(jest@26.6.3)(postcss@8.4.30)(prettier@2.8.8)(react-dom@16.14.0)(react@16.13.1)(rollup@3.29.2)(styled-components@6.0.8)(stylelint@14.16.1)(typescript@5.2.2)(webpack@5.88.2): resolution: {integrity: sha512-9AU79JbFQ+hhkL2Y0XYEuSuwiyz+U2KcqstzI68n9BKYODP9VGs0UlfrHfd8W+8bSbiHTNXNz0eRbBdZBMswgQ==} hasBin: true peerDependencies: @@ -8813,7 +10351,7 @@ packages: prism-react-renderer: 1.3.5(react@16.13.1) prism-themes: 1.9.0 prismjs: 1.29.0 - raw-loader: 4.0.2(webpack@5.87.0) + raw-loader: 4.0.2(webpack@5.88.2) rc-motion: 2.7.3(react-dom@16.14.0)(react@16.13.1) rc-tabs: 12.8.1(react-dom@16.14.0)(react@16.13.1) rc-tree: 5.7.6(react-dom@16.14.0)(react@16.13.1) @@ -8821,7 +10359,7 @@ packages: react-copy-to-clipboard: 5.1.0(react@16.13.1) react-dom: 16.14.0(react@16.13.1) react-error-boundary: 3.1.4(react@16.13.1) - react-intl: 6.4.4(react@16.13.1)(typescript@5.1.3) + react-intl: 6.4.4(react@16.13.1)(typescript@5.2.2) rehype-autolink-headings: 6.1.1 rehype-remove-comments: 5.0.0 rehype-stringify: 9.0.3 @@ -8832,7 +10370,7 @@ packages: remark-rehype: 10.1.0 sass: 1.63.4 sitemap: 7.1.1 - umi: 4.0.71(@babel/core@7.22.5)(@types/node@14.18.51)(@types/react@16.9.35)(eslint@7.32.0)(jest@26.6.3)(postcss@8.4.24)(prettier@2.8.8)(react-dom@16.14.0)(react@16.13.1)(rollup@3.25.1)(sass@1.63.4)(styled-components@5.3.11)(stylelint@14.16.1)(typescript@5.1.3)(webpack@5.87.0) + umi: 4.0.71(@babel/core@7.22.20)(@types/node@14.18.61)(@types/react@16.9.35)(eslint@7.32.0)(jest@26.6.3)(postcss@8.4.30)(prettier@2.8.8)(react-dom@16.14.0)(react@16.13.1)(rollup@3.29.2)(sass@1.63.4)(styled-components@6.0.8)(stylelint@14.16.1)(typescript@5.2.2)(webpack@5.88.2) unified: 10.1.2 unist-util-visit: 4.1.2 unist-util-visit-parents: 5.1.3 @@ -8898,6 +10436,10 @@ packages: resolution: {integrity: sha512-iRDI1QeCQIhMCZk48DRDMVgQSSBDmbzzNhnxIo+pwx3swkfjMh6vh0nWLq1NdvGHLKH6wIrAM3vQWeTj6qeoug==} dev: false + /earcut@2.2.4: + resolution: {integrity: sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==} + dev: false + /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true @@ -8914,11 +10456,15 @@ packages: engines: {node: '>=0.8'} dependencies: errlop: 2.2.0 - semver: 6.3.0 + semver: 6.3.1 dev: true /electron-to-chromium@1.4.433: resolution: {integrity: sha512-MGO1k0w1RgrfdbLVwmXcDhHHuxCn2qRgR7dYsJvWFKDttvYPx6FNzCGG0c/fBBvzK2LDh3UV7Tt9awnHnvAAUQ==} + dev: true + + /electron-to-chromium@1.4.523: + resolution: {integrity: sha512-9AreocSUWnzNtvLcbpng6N+GkXnCcBR80IQkxRC9Dfdyg4gaWNUPBujAHUpKkiUkoSoR9UlhA4zD/IgBklmhzg==} /electron@11.5.0: resolution: {integrity: sha512-WjNDd6lGpxyiNjE3LhnFCAk/D9GIj1rU3GSDealVShhkkkPR3Vh4q8ErXGDl1OAO/faomVa10KoFPUN/pLbNxg==} @@ -9007,11 +10553,12 @@ packages: resolution: {integrity: sha512-/KujNpO+PT63F7Hlpu4h3pE3TokKRHN26JYmQpPyjkRD/N57R7bPDNojMXdi7uveAKjYB7yQnartCxZnFWr0Xw==} dev: true - /enquirer@2.3.6: - resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} + /enquirer@2.4.1: + resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} engines: {node: '>=8.6'} dependencies: ansi-colors: 4.1.3 + strip-ansi: 6.0.1 dev: true /entities@2.2.0: @@ -9074,16 +10621,57 @@ packages: stackframe: 1.3.4 dev: true - /es-abstract@1.21.2: - resolution: {integrity: sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==} + /es-abstract@1.21.2: + resolution: {integrity: sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.0 + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + es-set-tostringtag: 2.0.1 + es-to-primitive: 1.2.1 + function.prototype.name: 1.1.5 + get-intrinsic: 1.2.1 + get-symbol-description: 1.0.0 + globalthis: 1.0.3 + gopd: 1.0.1 + has: 1.0.3 + has-property-descriptors: 1.0.0 + has-proto: 1.0.1 + has-symbols: 1.0.3 + internal-slot: 1.0.5 + is-array-buffer: 3.0.2 + is-callable: 1.2.7 + is-negative-zero: 2.0.2 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 + is-string: 1.0.7 + is-typed-array: 1.1.10 + is-weakref: 1.0.2 + object-inspect: 1.12.3 + object-keys: 1.1.1 + object.assign: 4.1.4 + regexp.prototype.flags: 1.5.0 + safe-regex-test: 1.0.0 + string.prototype.trim: 1.2.7 + string.prototype.trimend: 1.0.6 + string.prototype.trimstart: 1.0.6 + typed-array-length: 1.0.4 + unbox-primitive: 1.0.2 + which-typed-array: 1.1.9 + dev: true + + /es-abstract@1.22.2: + resolution: {integrity: sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA==} engines: {node: '>= 0.4'} dependencies: array-buffer-byte-length: 1.0.0 + arraybuffer.prototype.slice: 1.0.2 available-typed-arrays: 1.0.5 call-bind: 1.0.2 es-set-tostringtag: 2.0.1 es-to-primitive: 1.2.1 - function.prototype.name: 1.1.5 + function.prototype.name: 1.1.6 get-intrinsic: 1.2.1 get-symbol-description: 1.0.0 globalthis: 1.0.3 @@ -9099,19 +10687,23 @@ packages: is-regex: 1.1.4 is-shared-array-buffer: 1.0.2 is-string: 1.0.7 - is-typed-array: 1.1.10 + is-typed-array: 1.1.12 is-weakref: 1.0.2 object-inspect: 1.12.3 object-keys: 1.1.1 object.assign: 4.1.4 - regexp.prototype.flags: 1.5.0 + regexp.prototype.flags: 1.5.1 + safe-array-concat: 1.0.1 safe-regex-test: 1.0.0 - string.prototype.trim: 1.2.7 - string.prototype.trimend: 1.0.6 - string.prototype.trimstart: 1.0.6 + string.prototype.trim: 1.2.8 + string.prototype.trimend: 1.0.7 + string.prototype.trimstart: 1.0.7 + typed-array-buffer: 1.0.0 + typed-array-byte-length: 1.0.0 + typed-array-byte-offset: 1.0.0 typed-array-length: 1.0.4 unbox-primitive: 1.0.2 - which-typed-array: 1.1.9 + which-typed-array: 1.1.11 dev: true /es-array-method-boxes-properly@1.0.0: @@ -9132,8 +10724,8 @@ packages: stop-iteration-iterator: 1.0.0 dev: true - /es-module-lexer@1.3.0: - resolution: {integrity: sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA==} + /es-module-lexer@1.3.1: + resolution: {integrity: sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q==} /es-set-tostringtag@2.0.1: resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} @@ -9454,20 +11046,19 @@ packages: source-map: 0.6.1 dev: true - /escodegen@2.0.0: - resolution: {integrity: sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==} + /escodegen@2.1.0: + resolution: {integrity: sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==} engines: {node: '>=6.0'} hasBin: true dependencies: esprima: 4.0.1 estraverse: 5.3.0 esutils: 2.0.3 - optionator: 0.8.3 optionalDependencies: source-map: 0.6.1 dev: true - /eslint-plugin-jest@24.3.6(@typescript-eslint/eslint-plugin@5.48.1)(eslint@7.32.0)(typescript@5.1.3): + /eslint-plugin-jest@24.3.6(@typescript-eslint/eslint-plugin@5.62.0)(eslint@7.32.0)(typescript@5.2.2): resolution: {integrity: sha512-WOVH4TIaBLIeCX576rLcOgjNXqP+jNlCiEmRgFTfQtJ52DpwnIQKAVGlGPAN7CZ33bW6eNfHD6s8ZbEUTQubJg==} engines: {node: '>=10'} peerDependencies: @@ -9477,15 +11068,15 @@ packages: '@typescript-eslint/eslint-plugin': optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.48.1(@typescript-eslint/parser@5.48.1)(eslint@7.32.0)(typescript@5.1.3) - '@typescript-eslint/experimental-utils': 4.33.0(eslint@7.32.0)(typescript@5.1.3) + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@7.32.0)(typescript@5.2.2) + '@typescript-eslint/experimental-utils': 4.33.0(eslint@7.32.0)(typescript@5.2.2) eslint: 7.32.0 transitivePeerDependencies: - supports-color - typescript dev: true - /eslint-plugin-jest@27.2.1(@typescript-eslint/eslint-plugin@5.48.1)(eslint@7.32.0)(jest@26.6.3)(typescript@5.1.3): + /eslint-plugin-jest@27.2.1(@typescript-eslint/eslint-plugin@5.48.1)(eslint@7.32.0)(jest@26.6.3)(typescript@5.2.2): resolution: {integrity: sha512-l067Uxx7ZT8cO9NJuf+eJHvt6bqJyz2Z29wykyEdz/OtmcELQl2MQGQLX8J94O1cSJWAwUSEvCjwjA7KEK3Hmg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -9498,8 +11089,8 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.48.1(@typescript-eslint/parser@5.48.1)(eslint@7.32.0)(typescript@5.1.3) - '@typescript-eslint/utils': 5.60.0(eslint@7.32.0)(typescript@5.1.3) + '@typescript-eslint/eslint-plugin': 5.48.1(@typescript-eslint/parser@5.48.1)(eslint@7.32.0)(typescript@5.2.2) + '@typescript-eslint/utils': 5.62.0(eslint@7.32.0)(typescript@5.2.2) eslint: 7.32.0 jest: 26.6.3(canvas@2.11.2) transitivePeerDependencies: @@ -9536,7 +11127,7 @@ packages: object.values: 1.1.6 prop-types: 15.8.1 resolve: 2.0.0-next.4 - semver: 6.3.0 + semver: 6.3.1 string.prototype.matchall: 4.0.8 dev: true @@ -9574,8 +11165,8 @@ packages: engines: {node: '>=10'} dev: true - /eslint-visitor-keys@3.4.1: - resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true @@ -9590,9 +11181,9 @@ packages: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 doctrine: 3.0.0 - enquirer: 2.3.6 + enquirer: 2.4.1 escape-string-regexp: 4.0.0 eslint-scope: 5.1.1 eslint-utils: 2.1.0 @@ -9604,7 +11195,7 @@ packages: file-entry-cache: 6.0.1 functional-red-black-tree: 1.0.1 glob-parent: 5.1.2 - globals: 13.20.0 + globals: 13.21.0 ignore: 4.0.6 import-fresh: 3.3.0 imurmurhash: 0.1.4 @@ -9615,15 +11206,15 @@ packages: lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 - optionator: 0.9.1 + optionator: 0.9.3 progress: 2.0.3 regexpp: 3.2.0 - semver: 7.5.2 + semver: 7.5.4 strip-ansi: 6.0.1 strip-json-comments: 3.1.1 table: 6.8.1 text-table: 0.2.0 - v8-compile-cache: 2.3.0 + v8-compile-cache: 2.4.0 transitivePeerDependencies: - supports-color dev: true @@ -9958,6 +11549,17 @@ packages: micromatch: 4.0.5 dev: true + /fast-glob@3.3.1: + resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + dev: true + /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -10034,7 +11636,7 @@ packages: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} dependencies: - flat-cache: 3.0.4 + flat-cache: 3.1.0 dev: true /file-name@0.1.0: @@ -10154,16 +11756,17 @@ packages: pkg-dir: 4.2.0 dev: true - /flat-cache@3.0.4: - resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} - engines: {node: ^10.12.0 || >=12.0.0} + /flat-cache@3.1.0: + resolution: {integrity: sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==} + engines: {node: '>=12.0.0'} dependencies: - flatted: 3.2.7 + flatted: 3.2.9 + keyv: 4.5.3 rimraf: 3.0.2 dev: true - /flatted@3.2.7: - resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} + /flatted@3.2.9: + resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} dev: true /flush-write-stream@1.1.1: @@ -10202,14 +11805,14 @@ packages: engines: {node: '>=14'} dependencies: cross-spawn: 7.0.3 - signal-exit: 4.0.2 + signal-exit: 4.1.0 dev: true /forever-agent@0.6.1: resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} dev: true - /fork-ts-checker-webpack-plugin@8.0.0(typescript@5.1.3)(webpack@5.87.0): + /fork-ts-checker-webpack-plugin@8.0.0(typescript@5.2.2)(webpack@5.88.2): resolution: {integrity: sha512-mX3qW3idpueT2klaQXBzrIM/pHw+T0B/V9KHEvNrqijTq9NFnMZU6oreVxDYcf33P8a5cW+67PjodNHthGnNVg==} engines: {node: '>=12.13.0', yarn: '>=1.0.0'} peerDependencies: @@ -10226,10 +11829,10 @@ packages: minimatch: 3.1.2 node-abort-controller: 3.1.1 schema-utils: 3.3.0 - semver: 7.5.3 + semver: 7.5.4 tapable: 2.2.1 - typescript: 5.1.3 - webpack: 5.87.0 + typescript: 5.2.2 + webpack: 5.88.2 dev: true /form-data@2.3.3: @@ -10354,17 +11957,21 @@ packages: minipass: 3.3.6 dev: true - /fs-minipass@3.0.2: - resolution: {integrity: sha512-2GAfyfoaCDRrM6jaOS3UsBts8yJ55VioXdWcOL7dK9zdAuKT71+WBA4ifnNYqVjYv+4SsPxjK0JT4yIIn4cA/g==} + /fs-minipass@3.0.3: + resolution: {integrity: sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: - minipass: 5.0.0 + minipass: 7.0.3 dev: true /fs-monkey@1.0.4: resolution: {integrity: sha512-INM/fWAxMICjttnD0DX1rBvinKskj5G1w+oy/pnm9u/tSlnBrzFonJMcalKJ30P8RRsPzKcCG7Q8l0jx5Fh9YQ==} dev: true + /fs-readdir-recursive@1.1.0: + resolution: {integrity: sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==} + dev: true + /fs-write-stream-atomic@1.0.10: resolution: {integrity: sha512-gehEzmPn2nAwr39eay+x3X34Ra+M2QlVUTLhkXPjWdeO8RF9kszk116avgBJM3ZyNHgHXBNx+VmPaFC36k0PzA==} dependencies: @@ -10385,12 +11992,12 @@ packages: requiresBuild: true dependencies: bindings: 1.5.0 - nan: 2.17.0 + nan: 2.18.0 dev: true optional: true - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true @@ -10410,6 +12017,16 @@ packages: functions-have-names: 1.2.3 dev: true + /function.prototype.name@1.1.6: + resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 + functions-have-names: 1.2.3 + dev: true + /functional-red-black-tree@1.0.1: resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} dev: true @@ -10651,8 +12268,8 @@ packages: bindings: 1.5.0 bit-twiddle: 1.0.2 glsl-tokenizer: 2.1.5 - nan: 2.17.0 - node-abi: 3.45.0 + nan: 2.18.0 + node-abi: 3.47.0 node-gyp: 9.4.0 prebuild-install: 7.1.1 transitivePeerDependencies: @@ -10669,16 +12286,16 @@ packages: /glob-to-regexp@0.4.1: resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} - /glob@10.2.7: - resolution: {integrity: sha512-jTKehsravOJo8IJxUGfZILnkvVJM/MOfHRs8QcXolVef2zNI9Tqyy5+SeuOAZd3upViEZQLyFpQhYiHLrMUNmA==} + /glob@10.3.4: + resolution: {integrity: sha512-6LFElP3A+i/Q8XQKEvZjkEWEOTgAIALR9AO2rwT8bgPhDd1anmqDJDZ6lLddI4ehxxxR1S5RIqKe1uapMQfYaQ==} engines: {node: '>=16 || 14 >=14.17'} hasBin: true dependencies: foreground-child: 3.1.1 - jackspeak: 2.2.1 - minimatch: 9.0.1 - minipass: 6.0.2 - path-scurry: 1.9.2 + jackspeak: 2.3.3 + minimatch: 9.0.3 + minipass: 7.0.3 + path-scurry: 1.10.1 dev: true /glob@7.2.3: @@ -10720,7 +12337,7 @@ packages: fs.realpath: 1.0.0 minimatch: 8.0.4 minipass: 4.2.8 - path-scurry: 1.9.2 + path-scurry: 1.10.1 dev: true /global-agent@3.0.0: @@ -10732,7 +12349,7 @@ packages: es6-error: 4.1.1 matcher: 3.0.0 roarr: 2.15.4 - semver: 7.5.3 + semver: 7.5.4 serialize-error: 7.0.1 dev: true optional: true @@ -10802,8 +12419,8 @@ packages: engines: {node: '>=4'} dev: true - /globals@13.20.0: - resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==} + /globals@13.21.0: + resolution: {integrity: sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -10822,7 +12439,7 @@ packages: dependencies: array-union: 2.1.0 dir-glob: 3.0.1 - fast-glob: 3.2.12 + fast-glob: 3.3.1 ignore: 5.2.4 merge2: 1.4.1 slash: 3.0.0 @@ -11026,6 +12643,10 @@ packages: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} dev: true + /graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dev: true + /graphlib@2.1.8: resolution: {integrity: sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==} dependencies: @@ -11338,7 +12959,7 @@ packages: /history@5.3.0: resolution: {integrity: sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.21.0 dev: true /hmac-drbg@1.0.1: @@ -11427,7 +13048,7 @@ packages: he: 1.2.0 param-case: 3.0.4 relateurl: 0.2.7 - terser: 5.18.1 + terser: 5.19.4 dev: true /html-parse-stringify2@2.0.1: @@ -11458,7 +13079,7 @@ packages: resolution: {integrity: sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==} dev: true - /html-webpack-plugin@5.5.0(webpack@5.87.0): + /html-webpack-plugin@5.5.0(webpack@5.88.2): resolution: {integrity: sha512-sy88PC2cRTVxvETRgUHFrL4No3UxvcH8G1NepGhqaTT+GXN2kTamqasot0inS5hXeg1cMbFDt27zzo9p35lZVw==} engines: {node: '>=10.13.0'} peerDependencies: @@ -11469,7 +13090,7 @@ packages: lodash: 4.17.21 pretty-error: 4.0.0 tapable: 2.2.1 - webpack: 5.87.0 + webpack: 5.88.2 dev: true /html2canvas@1.4.1: @@ -11531,7 +13152,7 @@ packages: dependencies: '@tootallnate/once': 1.1.2 agent-base: 6.0.2 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 transitivePeerDependencies: - supports-color dev: true @@ -11542,7 +13163,7 @@ packages: dependencies: '@tootallnate/once': 2.0.0 agent-base: 6.0.2 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 transitivePeerDependencies: - supports-color dev: true @@ -11575,7 +13196,7 @@ packages: engines: {node: '>= 6'} dependencies: agent-base: 6.0.2 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 transitivePeerDependencies: - supports-color dev: true @@ -11619,10 +13240,10 @@ packages: resolution: {integrity: sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ==} dev: true - /i18next@23.2.1: - resolution: {integrity: sha512-BAWWqXYM1OtgA2hkGvnXWTs9wg0g3qx0SoiJoVTiL5Ia2EDZK0Veyuq4m2YtZeSs9D/9cwrNFxCKJi2/gdjZ4A==} + /i18next@23.5.1: + resolution: {integrity: sha512-JelYzcaCoFDaa+Ysbfz2JsGAKkrHiMG6S61+HLBUEIPaF40WMwW9hCPymlQGrP+wWawKxKPuSuD71WZscCsWHg==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 dev: false /iconv-lite@0.4.24: @@ -11845,7 +13466,7 @@ packages: '@formatjs/ecma402-abstract': 1.17.0 '@formatjs/fast-memoize': 2.2.0 '@formatjs/icu-messageformat-parser': 2.6.0 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /invariant@2.2.4: @@ -12017,6 +13638,12 @@ packages: dependencies: has: 1.0.3 + /is-core-module@2.13.0: + resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} + dependencies: + has: 1.0.3 + dev: true + /is-data-descriptor@0.1.4: resolution: {integrity: sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==} engines: {node: '>=0.10.0'} @@ -12348,6 +13975,13 @@ packages: has-tostringtag: 1.0.0 dev: true + /is-typed-array@1.1.12: + resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==} + engines: {node: '>= 0.4'} + dependencies: + which-typed-array: 1.1.11 + dev: true + /is-typedarray@1.0.0: resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} dev: true @@ -12457,13 +14091,13 @@ packages: resolution: {integrity: sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==} engines: {node: '>=6'} dependencies: - '@babel/generator': 7.22.5 - '@babel/parser': 7.22.5 - '@babel/template': 7.22.5 - '@babel/traverse': 7.22.5(supports-color@5.5.0) - '@babel/types': 7.22.5 + '@babel/generator': 7.22.15 + '@babel/parser': 7.22.16 + '@babel/template': 7.22.15 + '@babel/traverse': 7.22.20 + '@babel/types': 7.22.19 istanbul-lib-coverage: 2.0.5 - semver: 6.3.0 + semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true @@ -12472,10 +14106,10 @@ packages: resolution: {integrity: sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==} engines: {node: '>=8'} dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 - semver: 6.3.0 + semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true @@ -12488,17 +14122,17 @@ packages: '@babel/parser': 7.22.5 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 - semver: 6.3.0 + semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true - /istanbul-lib-report@3.0.0: - resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==} - engines: {node: '>=8'} + /istanbul-lib-report@3.0.1: + resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} + engines: {node: '>=10'} dependencies: istanbul-lib-coverage: 3.2.0 - make-dir: 3.1.0 + make-dir: 4.0.0 supports-color: 7.2.0 dev: true @@ -12506,19 +14140,19 @@ packages: resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} engines: {node: '>=10'} dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 istanbul-lib-coverage: 3.2.0 source-map: 0.6.1 transitivePeerDependencies: - supports-color dev: true - /istanbul-reports@3.1.5: - resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==} + /istanbul-reports@3.1.6: + resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} engines: {node: '>=8'} dependencies: html-escaper: 2.0.2 - istanbul-lib-report: 3.0.0 + istanbul-lib-report: 3.0.1 dev: true /istextorbinary@2.6.0: @@ -12530,8 +14164,8 @@ packages: textextensions: 2.6.0 dev: true - /jackspeak@2.2.1: - resolution: {integrity: sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw==} + /jackspeak@2.3.3: + resolution: {integrity: sha512-R2bUw+kVZFS/h1AZqBKrSgDmdmjApzgY0AlCPumopFiAlbUxE2gf+SCuBzQ0cP5hHmUmFYF5yw55T97Th5Kstg==} engines: {node: '>=14'} dependencies: '@isaacs/cliui': 8.0.2 @@ -12578,10 +14212,10 @@ packages: resolution: {integrity: sha512-RATtQJtVYQrp7fvWg6f5y3pEFj9I+H8sWw4aKxnDZ96mob5i5SD6ZEGWgMLXQ4LE8UurrjbdlLWdUeo+28QpfQ==} engines: {node: '>= 6'} dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@jest/test-sequencer': 24.9.0(canvas@2.11.2) '@jest/types': 24.9.0 - babel-jest: 24.9.0(@babel/core@7.22.5) + babel-jest: 24.9.0(@babel/core@7.22.20) chalk: 2.4.2 glob: 7.2.3 jest-environment-jsdom: 26.6.2(canvas@2.11.2) @@ -12611,10 +14245,10 @@ packages: ts-node: optional: true dependencies: - '@babel/core': 7.22.5 + '@babel/core': 7.22.20 '@jest/test-sequencer': 26.6.3(canvas@2.11.2) '@jest/types': 26.6.2 - babel-jest: 26.6.3(@babel/core@7.22.5) + babel-jest: 26.6.3(@babel/core@7.22.20) chalk: 4.1.2 deepmerge: 4.3.1 glob: 7.2.3 @@ -12734,7 +14368,7 @@ packages: '@jest/environment': 26.6.2 '@jest/fake-timers': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 17.0.45 + '@types/node': 14.18.61 jest-mock: 26.6.2 jest-util: 26.6.2 jsdom: 16.7.0(canvas@2.11.2) @@ -12765,7 +14399,7 @@ packages: '@jest/environment': 26.6.2 '@jest/fake-timers': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 17.0.45 + '@types/node': 14.18.61 jest-mock: 26.6.2 jest-util: 26.6.2 dev: true @@ -12812,7 +14446,7 @@ packages: dependencies: '@jest/types': 26.6.2 '@types/graceful-fs': 4.1.6 - '@types/node': 17.0.45 + '@types/node': 14.18.61 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -12824,7 +14458,7 @@ packages: sane: 4.1.0 walker: 1.0.8 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 transitivePeerDependencies: - supports-color dev: true @@ -12835,7 +14469,7 @@ packages: dependencies: '@jest/types': 29.5.0 '@types/graceful-fs': 4.1.6 - '@types/node': 17.0.45 + '@types/node': 20.6.2 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -12845,14 +14479,14 @@ packages: micromatch: 4.0.5 walker: 1.0.8 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /jest-jasmine2@24.9.0(canvas@2.11.2): resolution: {integrity: sha512-Cq7vkAgaYKp+PsX+2/JbTarrk0DmNhsEtqBXNwUHkdlbrTBLtMJINADf2mf5FkowNsq8evbPc07/qFO0AdKTzw==} engines: {node: '>= 6'} dependencies: - '@babel/traverse': 7.22.5(supports-color@5.5.0) + '@babel/traverse': 7.22.20 '@jest/environment': 24.9.0 '@jest/test-result': 24.9.0 '@jest/types': 24.9.0 @@ -12879,12 +14513,12 @@ packages: resolution: {integrity: sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg==} engines: {node: '>= 10.14.2'} dependencies: - '@babel/traverse': 7.22.5(supports-color@5.5.0) + '@babel/traverse': 7.22.20 '@jest/environment': 26.6.2 '@jest/source-map': 26.6.2 '@jest/test-result': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 17.0.45 + '@types/node': 14.18.61 chalk: 4.1.2 co: 4.6.0 expect: 26.6.2 @@ -12961,7 +14595,7 @@ packages: resolution: {integrity: sha512-oCj8FiZ3U0hTP4aSui87P4L4jC37BtQwUMqk+zk/b11FR19BJDeZsZAvIHutWnmtw7r85UmR3CEWZ0HWU2mAlw==} engines: {node: '>= 6'} dependencies: - '@babel/code-frame': 7.22.5 + '@babel/code-frame': 7.22.13 '@jest/test-result': 24.9.0 '@jest/types': 24.9.0 '@types/stack-utils': 1.0.1 @@ -12977,7 +14611,7 @@ packages: resolution: {integrity: sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==} engines: {node: '>= 10.14.2'} dependencies: - '@babel/code-frame': 7.22.5 + '@babel/code-frame': 7.22.13 '@jest/types': 26.6.2 '@types/stack-utils': 2.0.1 chalk: 4.1.2 @@ -13000,7 +14634,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/node': 17.0.45 + '@types/node': 14.18.61 dev: true /jest-pnp-resolver@1.2.3(jest-resolve@24.9.0): @@ -13074,7 +14708,7 @@ packages: jest-pnp-resolver: 1.2.3(jest-resolve@26.6.2) jest-util: 26.6.2 read-pkg-up: 7.0.1 - resolve: 1.22.2 + resolve: 1.22.6 slash: 3.0.0 dev: true @@ -13116,7 +14750,7 @@ packages: '@jest/environment': 26.6.2 '@jest/test-result': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 17.0.45 + '@types/node': 14.18.61 chalk: 4.1.2 emittery: 0.7.2 exit: 0.1.2 @@ -13191,7 +14825,7 @@ packages: '@types/yargs': 15.0.15 chalk: 4.1.2 cjs-module-lexer: 0.6.0 - collect-v8-coverage: 1.0.1 + collect-v8-coverage: 1.0.2 exit: 0.1.2 glob: 7.2.3 graceful-fs: 4.2.11 @@ -13224,7 +14858,7 @@ packages: resolution: {integrity: sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==} engines: {node: '>= 10.14.2'} dependencies: - '@types/node': 17.0.45 + '@types/node': 14.18.61 graceful-fs: 4.2.11 dev: true @@ -13232,7 +14866,7 @@ packages: resolution: {integrity: sha512-uI/rszGSs73xCM0l+up7O7a40o90cnrk429LOiK3aeTvfC0HHmldbd81/B7Ix81KSFe1lwkbl7GnBGG4UfuDew==} engines: {node: '>= 6'} dependencies: - '@babel/types': 7.22.5 + '@babel/types': 7.22.19 '@jest/types': 24.9.0 chalk: 2.4.2 expect: 24.9.0 @@ -13244,7 +14878,7 @@ packages: mkdirp: 0.5.6 natural-compare: 1.4.0 pretty-format: 24.9.0 - semver: 6.3.0 + semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true @@ -13253,9 +14887,9 @@ packages: resolution: {integrity: sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og==} engines: {node: '>= 10.14.2'} dependencies: - '@babel/types': 7.22.5 + '@babel/types': 7.22.19 '@jest/types': 26.6.2 - '@types/babel__traverse': 7.20.1 + '@types/babel__traverse': 7.20.2 '@types/prettier': 2.7.3 chalk: 4.1.2 expect: 26.6.2 @@ -13268,7 +14902,7 @@ packages: jest-resolve: 26.6.2 natural-compare: 1.4.0 pretty-format: 26.6.2 - semver: 7.5.2 + semver: 7.5.4 transitivePeerDependencies: - supports-color dev: true @@ -13298,7 +14932,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/node': 17.0.45 + '@types/node': 14.18.61 chalk: 4.1.2 graceful-fs: 4.2.11 is-ci: 2.0.0 @@ -13310,7 +14944,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.5.0 - '@types/node': 17.0.45 + '@types/node': 20.6.2 chalk: 4.1.2 ci-info: 3.8.0 graceful-fs: 4.2.11 @@ -13347,7 +14981,7 @@ packages: dependencies: '@jest/test-result': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 17.0.45 + '@types/node': 14.18.61 ansi-escapes: 4.3.2 chalk: 4.1.2 jest-util: 26.6.2 @@ -13366,7 +15000,7 @@ packages: resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 17.0.45 + '@types/node': 14.18.61 merge-stream: 2.0.0 supports-color: 7.2.0 dev: true @@ -13383,7 +15017,7 @@ packages: resolution: {integrity: sha512-GLHN/GTAAMEy5BFdvpUfzr9Dr80zQqBrh0fz1mtRMe05hqP45+HfQltu7oTBfduD0UeZs09d+maFtFYAXFWvAA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 17.0.45 + '@types/node': 20.6.2 jest-util: 29.5.0 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -13393,7 +15027,7 @@ packages: resolution: {integrity: sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 17.0.45 + '@types/node': 20.6.2 jest-util: 29.5.0 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -13419,8 +15053,8 @@ packages: resolution: {integrity: sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==} dev: true - /jquery@3.7.0: - resolution: {integrity: sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ==} + /jquery@3.7.1: + resolution: {integrity: sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==} dev: true /js-cookie@2.2.1: @@ -13459,7 +15093,7 @@ packages: optional: true dependencies: abab: 2.0.6 - acorn: 8.9.0 + acorn: 8.10.0 acorn-globals: 6.0.0 canvas: 2.11.2 cssom: 0.4.4 @@ -13467,13 +15101,13 @@ packages: data-urls: 2.0.0 decimal.js: 10.4.3 domexception: 2.0.1 - escodegen: 2.0.0 + escodegen: 2.1.0 form-data: 3.0.1 html-encoding-sniffer: 2.0.1 http-proxy-agent: 4.0.1 https-proxy-agent: 5.0.1 is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.5 + nwsapi: 2.2.7 parse5: 6.0.1 saxes: 5.0.1 symbol-tree: 3.2.4 @@ -13502,7 +15136,7 @@ packages: optional: true dependencies: abab: 2.0.6 - acorn: 8.9.0 + acorn: 8.10.0 acorn-globals: 6.0.0 canvas: 2.11.2 cssom: 0.5.0 @@ -13510,13 +15144,13 @@ packages: data-urls: 3.0.2 decimal.js: 10.4.3 domexception: 4.0.0 - escodegen: 2.0.0 + escodegen: 2.1.0 form-data: 4.0.0 html-encoding-sniffer: 3.0.0 http-proxy-agent: 5.0.0 https-proxy-agent: 5.0.1 is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.5 + nwsapi: 2.2.7 parse5: 6.0.1 saxes: 5.0.1 symbol-tree: 3.2.4 @@ -13527,7 +15161,7 @@ packages: whatwg-encoding: 2.0.0 whatwg-mimetype: 3.0.0 whatwg-url: 10.0.0 - ws: 8.13.0 + ws: 8.14.1 xml-name-validator: 4.0.0 transitivePeerDependencies: - bufferutil @@ -13550,6 +15184,10 @@ packages: resolution: {integrity: sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==} dev: true + /json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + dev: true + /json-parse-better-errors@1.0.2: resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} dev: true @@ -13643,6 +15281,12 @@ packages: json-buffer: 3.0.0 dev: true + /keyv@4.5.3: + resolution: {integrity: sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==} + dependencies: + json-buffer: 3.0.1 + dev: true + /kind-of@3.2.2: resolution: {integrity: sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==} engines: {node: '>=0.10.0'} @@ -13704,7 +15348,7 @@ packages: dependencies: copy-anything: 2.0.6 parse-node-version: 1.0.1 - tslib: 2.5.3 + tslib: 2.6.2 optionalDependencies: errno: 0.1.8 graceful-fs: 4.2.11 @@ -13857,11 +15501,11 @@ packages: cli-truncate: 2.1.0 commander: 6.2.1 cosmiconfig: 7.1.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 dedent: 0.7.0 - enquirer: 2.3.6 + enquirer: 2.4.1 execa: 4.1.0 - listr2: 3.14.0(enquirer@2.3.6) + listr2: 3.14.0(enquirer@2.4.1) log-symbols: 4.1.0 micromatch: 4.0.5 normalize-path: 3.0.0 @@ -13872,7 +15516,7 @@ packages: - supports-color dev: true - /listr2@3.14.0(enquirer@2.3.6): + /listr2@3.14.0(enquirer@2.4.1): resolution: {integrity: sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==} engines: {node: '>=10.0.0'} peerDependencies: @@ -13883,7 +15527,7 @@ packages: dependencies: cli-truncate: 2.1.0 colorette: 2.0.20 - enquirer: 2.3.6 + enquirer: 2.4.1 log-update: 4.0.0 p-map: 4.0.0 rfdc: 1.3.0 @@ -14039,7 +15683,7 @@ packages: /lower-case@2.0.2: resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} dependencies: - tslib: 2.5.3 + tslib: 2.6.2 dev: true /lowercase-keys@1.0.1: @@ -14052,6 +15696,11 @@ packages: engines: {node: '>=8'} dev: true + /lru-cache@10.0.1: + resolution: {integrity: sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==} + engines: {node: 14 || >=16.14} + dev: true + /lru-cache@4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} dependencies: @@ -14077,11 +15726,6 @@ packages: engines: {node: '>=12'} dev: true - /lru-cache@9.1.2: - resolution: {integrity: sha512-ERJq3FOzJTxBbFjZ7iDs+NiK4VI9Wz+RdrrAB8dio1oV+YvdPzUEE4QNiT2VD51DkIbCYRUUzCRkssXCHqSnKQ==} - engines: {node: 14 || >=16.14} - dev: true - /lunr@2.3.9: resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==} dev: false @@ -14110,9 +15754,8 @@ packages: requiresBuild: true dependencies: pify: 4.0.1 - semver: 5.7.1 + semver: 5.7.2 dev: true - optional: true /make-dir@3.1.0: resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} @@ -14120,6 +15763,13 @@ packages: dependencies: semver: 6.3.0 + /make-dir@4.0.0: + resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} + engines: {node: '>=10'} + dependencies: + semver: 7.5.4 + dev: true + /make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: true @@ -14128,21 +15778,21 @@ packages: resolution: {integrity: sha512-rLWS7GCSTcEujjVBs2YqG7Y4643u8ucvCJeSRqiLYhesrDuzeuFIk37xREzAsfQaqzl8b9rNCE4m6J8tvX4Q8w==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: - agentkeepalive: 4.3.0 - cacache: 17.1.3 + agentkeepalive: 4.5.0 + cacache: 17.1.4 http-cache-semantics: 4.1.1 http-proxy-agent: 5.0.0 https-proxy-agent: 5.0.1 is-lambda: 1.0.1 lru-cache: 7.18.3 minipass: 5.0.0 - minipass-fetch: 3.0.3 + minipass-fetch: 3.0.4 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 negotiator: 0.6.3 promise-retry: 2.0.1 socks-proxy-agent: 7.0.0 - ssri: 10.0.4 + ssri: 10.0.5 transitivePeerDependencies: - supports-color dev: true @@ -14807,7 +16457,7 @@ packages: resolution: {integrity: sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==} dependencies: '@types/debug': 4.1.8 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 decode-named-character-reference: 1.0.2 micromark-core-commonmark: 1.1.0 micromark-factory-space: 1.1.0 @@ -14956,8 +16606,8 @@ packages: brace-expansion: 2.0.1 dev: true - /minimatch@9.0.1: - resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} + /minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 @@ -14990,11 +16640,11 @@ packages: minipass: 3.3.6 dev: true - /minipass-fetch@3.0.3: - resolution: {integrity: sha512-n5ITsTkDqYkYJZjcRWzZt9qnZKCT7nKCosJhHoj7S7zD+BP4jVbWs+odsniw5TA3E0sLomhTKOKjF86wf11PuQ==} + /minipass-fetch@3.0.4: + resolution: {integrity: sha512-jHAqnA728uUpIaFm7NWsCnqKT6UqZz7GcI/bDpPATuwYyKwJwW0remxSCxUlKiEty+eopHGa3oc8WxgQ1FFJqg==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: - minipass: 5.0.0 + minipass: 7.0.3 minipass-sized: 1.0.3 minizlib: 2.1.2 optionalDependencies: @@ -15039,8 +16689,8 @@ packages: engines: {node: '>=8'} dev: true - /minipass@6.0.2: - resolution: {integrity: sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w==} + /minipass@7.0.3: + resolution: {integrity: sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==} engines: {node: '>=16 || 14 >=14.17'} dev: true @@ -15197,8 +16847,8 @@ packages: resolution: {integrity: sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==} dev: true - /nan@2.17.0: - resolution: {integrity: sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==} + /nan@2.18.0: + resolution: {integrity: sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==} dev: true /nano-css@5.3.5(react-dom@16.14.0)(react@16.13.1): @@ -15324,14 +16974,14 @@ packages: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} dependencies: lower-case: 2.0.2 - tslib: 2.5.3 + tslib: 2.6.2 dev: true - /node-abi@3.45.0: - resolution: {integrity: sha512-iwXuFrMAcFVi/ZoZiqq8BzAdsLw9kxDfTC0HMyjXfSL/6CSDAGD5UmR7azrAgWV1zKYq7dUUMj4owusBWKLsiQ==} + /node-abi@3.47.0: + resolution: {integrity: sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==} engines: {node: '>=10'} dependencies: - semver: 7.5.2 + semver: 7.5.4 dev: true /node-abort-controller@3.1.1: @@ -15358,8 +17008,8 @@ packages: safe-buffer: 5.2.1 dev: true - /node-fetch@2.6.11: - resolution: {integrity: sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==} + /node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} engines: {node: 4.x || >=6.0.0} peerDependencies: encoding: ^0.1.0 @@ -15392,8 +17042,8 @@ packages: nopt: 6.0.0 npmlog: 6.0.2 rimraf: 3.0.2 - semver: 7.5.2 - tar: 6.1.15 + semver: 7.5.4 + tar: 6.2.0 which: 2.0.2 transitivePeerDependencies: - supports-color @@ -15437,7 +17087,7 @@ packages: dependencies: growly: 1.3.0 is-wsl: 2.2.0 - semver: 7.5.3 + semver: 7.5.4 shellwords: 0.1.1 uuid: 8.3.2 which: 2.0.2 @@ -15446,6 +17096,10 @@ packages: /node-releases@2.0.12: resolution: {integrity: sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==} + dev: true + + /node-releases@2.0.13: + resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} /nopt@1.0.10: resolution: {integrity: sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==} @@ -15474,8 +17128,8 @@ packages: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.2 - semver: 5.7.1 + resolve: 1.22.6 + semver: 5.7.2 validate-npm-package-license: 3.0.4 dev: true @@ -15484,8 +17138,8 @@ packages: engines: {node: '>=10'} dependencies: hosted-git-info: 4.1.0 - is-core-module: 2.12.1 - semver: 7.5.3 + is-core-module: 2.13.0 + semver: 7.5.4 validate-npm-package-license: 3.0.4 dev: true @@ -15549,7 +17203,7 @@ packages: pidtree: 0.3.1 read-pkg: 3.0.0 shell-quote: 1.8.1 - string.prototype.padend: 3.1.4 + string.prototype.padend: 3.1.5 dev: true /npm-run-path@2.0.2: @@ -15607,8 +17261,8 @@ packages: dependencies: boolbase: 1.0.0 - /nwsapi@2.2.5: - resolution: {integrity: sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ==} + /nwsapi@2.2.7: + resolution: {integrity: sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==} dev: true /oauth-sign@0.9.0: @@ -15668,8 +17322,8 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 dev: true /object.getownpropertydescriptors@2.1.6: @@ -15683,6 +17337,17 @@ packages: safe-array-concat: 1.0.0 dev: true + /object.getownpropertydescriptors@2.1.7: + resolution: {integrity: sha512-PrJz0C2xJ58FNn11XV2lr4Jt5Gzl94qpy9Lu0JlfEj14z88sqbSBJCBEzdlNUCzY2gburhbrwOZ5BHCmuNUy0g==} + engines: {node: '>= 0.8'} + dependencies: + array.prototype.reduce: 1.0.6 + call-bind: 1.0.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 + safe-array-concat: 1.0.1 + dev: true + /object.getprototypeof@1.0.4: resolution: {integrity: sha512-xV/FkUNM9sHa56AB5deXrlIR+jBtDAHieyfm6XZUuehqlMX+YJPh8CAYtPrXGA/mFLFttasTc9ihhpkPrH7pLw==} engines: {node: '>= 0.4'} @@ -15696,8 +17361,8 @@ packages: /object.hasown@1.1.2: resolution: {integrity: sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw==} dependencies: - define-properties: 1.2.0 - es-abstract: 1.21.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 dev: true /object.pick@1.3.0: @@ -15712,8 +17377,8 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 dev: true /obuf@1.1.2: @@ -15813,16 +17478,16 @@ packages: word-wrap: 1.2.3 dev: true - /optionator@0.9.1: - resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} + /optionator@0.9.3: + resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} dependencies: + '@aashutoshrathi/word-wrap': 1.2.6 deep-is: 0.1.4 fast-levenshtein: 2.0.6 levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 - word-wrap: 1.2.3 dev: true /ora@1.4.0: @@ -16004,7 +17669,7 @@ packages: resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} dependencies: dot-case: 3.0.4 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /parent-module@1.0.1: @@ -16109,7 +17774,7 @@ packages: resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==} dependencies: no-case: 3.0.4 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /pascalcase@0.1.1: @@ -16160,12 +17825,12 @@ packages: /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - /path-scurry@1.9.2: - resolution: {integrity: sha512-qSDLy2aGFPm8i4rsbHd4MNyTcrzHFsLQykrtbuGRknZZCBBVXSv2tSCDN2Cg6Rt/GFRw8GoW9y9Ecw5rIPG1sg==} + /path-scurry@1.10.1: + resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} engines: {node: '>=16 || 14 >=14.17'} dependencies: - lru-cache: 9.1.2 - minipass: 6.0.2 + lru-cache: 10.0.1 + minipass: 7.0.3 dev: true /path-to-regexp@1.7.0: @@ -16366,6 +18031,16 @@ packages: postcss-selector-parser: 6.0.13 dev: true + /postcss-attribute-case-insensitive@5.0.2(postcss@8.4.30): + resolution: {integrity: sha512-XIidXV8fDr0kKt28vqki84fRK8VW8eTuIa4PChv2MqKuT6C9UjmSKzen6KaWhWEoYvwxFCa7n/tC1SZ3tyq4SQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + postcss-selector-parser: 6.0.13 + dev: true + /postcss-clamp@4.1.0(postcss@8.4.24): resolution: {integrity: sha512-ry4b1Llo/9zz+PKC+030KUnPITTJAHeOwjfAyyB60eT0AorGLdzp52s31OsPRHRf8NchkgFoG2y6fCfn1IV1Ow==} engines: {node: '>=7.6.0'} @@ -16376,6 +18051,16 @@ packages: postcss-value-parser: 4.2.0 dev: true + /postcss-clamp@4.1.0(postcss@8.4.30): + resolution: {integrity: sha512-ry4b1Llo/9zz+PKC+030KUnPITTJAHeOwjfAyyB60eT0AorGLdzp52s31OsPRHRf8NchkgFoG2y6fCfn1IV1Ow==} + engines: {node: '>=7.6.0'} + peerDependencies: + postcss: ^8.4.6 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /postcss-color-functional-notation@4.2.4(postcss@8.4.24): resolution: {integrity: sha512-2yrTAUZUab9s6CpxkxC4rVgFEVaR6/2Pipvi6qcgvnYiVqZcbDHEoBDhrXzyb7Efh2CCfHQNtcqWcIruDTIUeg==} engines: {node: ^12 || ^14 || >=16} @@ -16386,6 +18071,16 @@ packages: postcss-value-parser: 4.2.0 dev: true + /postcss-color-functional-notation@4.2.4(postcss@8.4.30): + resolution: {integrity: sha512-2yrTAUZUab9s6CpxkxC4rVgFEVaR6/2Pipvi6qcgvnYiVqZcbDHEoBDhrXzyb7Efh2CCfHQNtcqWcIruDTIUeg==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /postcss-color-hex-alpha@8.0.4(postcss@8.4.24): resolution: {integrity: sha512-nLo2DCRC9eE4w2JmuKgVA3fGL3d01kGq752pVALF68qpGLmx2Qrk91QTKkdUqqp45T1K1XV8IhQpcu1hoAQflQ==} engines: {node: ^12 || ^14 || >=16} @@ -16396,6 +18091,16 @@ packages: postcss-value-parser: 4.2.0 dev: true + /postcss-color-hex-alpha@8.0.4(postcss@8.4.30): + resolution: {integrity: sha512-nLo2DCRC9eE4w2JmuKgVA3fGL3d01kGq752pVALF68qpGLmx2Qrk91QTKkdUqqp45T1K1XV8IhQpcu1hoAQflQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /postcss-color-rebeccapurple@7.1.1(postcss@8.4.24): resolution: {integrity: sha512-pGxkuVEInwLHgkNxUc4sdg4g3py7zUeCQ9sMfwyHAT+Ezk8a4OaaVZ8lIY5+oNqA/BXXgLyXv0+5wHP68R79hg==} engines: {node: ^12 || ^14 || >=16} @@ -16406,6 +18111,16 @@ packages: postcss-value-parser: 4.2.0 dev: true + /postcss-color-rebeccapurple@7.1.1(postcss@8.4.30): + resolution: {integrity: sha512-pGxkuVEInwLHgkNxUc4sdg4g3py7zUeCQ9sMfwyHAT+Ezk8a4OaaVZ8lIY5+oNqA/BXXgLyXv0+5wHP68R79hg==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /postcss-custom-media@8.0.2(postcss@8.4.24): resolution: {integrity: sha512-7yi25vDAoHAkbhAzX9dHx2yc6ntS4jQvejrNcC+csQJAXjj15e7VcWfMgLqBNAbOvqi5uIa9huOVwdHbf+sKqg==} engines: {node: ^12 || ^14 || >=16} @@ -16416,6 +18131,16 @@ packages: postcss-value-parser: 4.2.0 dev: true + /postcss-custom-media@8.0.2(postcss@8.4.30): + resolution: {integrity: sha512-7yi25vDAoHAkbhAzX9dHx2yc6ntS4jQvejrNcC+csQJAXjj15e7VcWfMgLqBNAbOvqi5uIa9huOVwdHbf+sKqg==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.3 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /postcss-custom-properties@12.1.11(postcss@8.4.24): resolution: {integrity: sha512-0IDJYhgU8xDv1KY6+VgUwuQkVtmYzRwu+dMjnmdMafXYv86SWqfxkc7qdDvWS38vsjaEtv8e0vGOUQrAiMBLpQ==} engines: {node: ^12 || ^14 || >=16} @@ -16426,6 +18151,16 @@ packages: postcss-value-parser: 4.2.0 dev: true + /postcss-custom-properties@12.1.11(postcss@8.4.30): + resolution: {integrity: sha512-0IDJYhgU8xDv1KY6+VgUwuQkVtmYzRwu+dMjnmdMafXYv86SWqfxkc7qdDvWS38vsjaEtv8e0vGOUQrAiMBLpQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /postcss-custom-selectors@6.0.3(postcss@8.4.24): resolution: {integrity: sha512-fgVkmyiWDwmD3JbpCmB45SvvlCD6z9CG6Ie6Iere22W5aHea6oWa7EM2bpnv2Fj3I94L3VbtvX9KqwSi5aFzSg==} engines: {node: ^12 || ^14 || >=16} @@ -16436,6 +18171,16 @@ packages: postcss-selector-parser: 6.0.13 dev: true + /postcss-custom-selectors@6.0.3(postcss@8.4.30): + resolution: {integrity: sha512-fgVkmyiWDwmD3JbpCmB45SvvlCD6z9CG6Ie6Iere22W5aHea6oWa7EM2bpnv2Fj3I94L3VbtvX9KqwSi5aFzSg==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.3 + dependencies: + postcss: 8.4.30 + postcss-selector-parser: 6.0.13 + dev: true + /postcss-dir-pseudo-class@6.0.5(postcss@8.4.24): resolution: {integrity: sha512-eqn4m70P031PF7ZQIvSgy9RSJ5uI2171O/OO/zcRNYpJbvaeKFUlar1aJ7rmgiQtbm0FSPsRewjpdS0Oew7MPA==} engines: {node: ^12 || ^14 || >=16} @@ -16446,6 +18191,16 @@ packages: postcss-selector-parser: 6.0.13 dev: true + /postcss-dir-pseudo-class@6.0.5(postcss@8.4.30): + resolution: {integrity: sha512-eqn4m70P031PF7ZQIvSgy9RSJ5uI2171O/OO/zcRNYpJbvaeKFUlar1aJ7rmgiQtbm0FSPsRewjpdS0Oew7MPA==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + postcss-selector-parser: 6.0.13 + dev: true + /postcss-double-position-gradients@3.1.2(postcss@8.4.24): resolution: {integrity: sha512-GX+FuE/uBR6eskOK+4vkXgT6pDkexLokPaz/AbJna9s5Kzp/yl488pKPjhy0obB475ovfT1Wv8ho7U/cHNaRgQ==} engines: {node: ^12 || ^14 || >=16} @@ -16457,6 +18212,17 @@ packages: postcss-value-parser: 4.2.0 dev: true + /postcss-double-position-gradients@3.1.2(postcss@8.4.30): + resolution: {integrity: sha512-GX+FuE/uBR6eskOK+4vkXgT6pDkexLokPaz/AbJna9s5Kzp/yl488pKPjhy0obB475ovfT1Wv8ho7U/cHNaRgQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/postcss-progressive-custom-properties': 1.3.0(postcss@8.4.30) + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /postcss-env-function@4.0.6(postcss@8.4.24): resolution: {integrity: sha512-kpA6FsLra+NqcFnL81TnsU+Z7orGtDTxcOhl6pwXeEq1yFPpRMkCDpHhrz8CFQDr/Wfm0jLiNQ1OsGGPjlqPwA==} engines: {node: ^12 || ^14 || >=16} @@ -16467,6 +18233,16 @@ packages: postcss-value-parser: 4.2.0 dev: true + /postcss-env-function@4.0.6(postcss@8.4.30): + resolution: {integrity: sha512-kpA6FsLra+NqcFnL81TnsU+Z7orGtDTxcOhl6pwXeEq1yFPpRMkCDpHhrz8CFQDr/Wfm0jLiNQ1OsGGPjlqPwA==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /postcss-flexbugs-fixes@5.0.2(postcss@8.4.24): resolution: {integrity: sha512-18f9voByak7bTktR2QgDveglpn9DTbBWPUzSOe9g0N4WR/2eSt6Vrcbf0hmspvMI6YWGywz6B9f7jzpFNJJgnQ==} peerDependencies: @@ -16485,6 +18261,16 @@ packages: postcss-selector-parser: 6.0.13 dev: true + /postcss-focus-visible@6.0.4(postcss@8.4.30): + resolution: {integrity: sha512-QcKuUU/dgNsstIK6HELFRT5Y3lbrMLEOwG+A4s5cA+fx3A3y/JTq3X9LaOj3OC3ALH0XqyrgQIgey/MIZ8Wczw==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.30 + postcss-selector-parser: 6.0.13 + dev: true + /postcss-focus-within@5.0.4(postcss@8.4.24): resolution: {integrity: sha512-vvjDN++C0mu8jz4af5d52CB184ogg/sSxAFS+oUJQq2SuCe7T5U2iIsVJtsCp2d6R4j0jr5+q3rPkBVZkXD9fQ==} engines: {node: ^12 || ^14 || >=16} @@ -16495,21 +18281,48 @@ packages: postcss-selector-parser: 6.0.13 dev: true + /postcss-focus-within@5.0.4(postcss@8.4.30): + resolution: {integrity: sha512-vvjDN++C0mu8jz4af5d52CB184ogg/sSxAFS+oUJQq2SuCe7T5U2iIsVJtsCp2d6R4j0jr5+q3rPkBVZkXD9fQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.30 + postcss-selector-parser: 6.0.13 + dev: true + /postcss-font-variant@5.0.0(postcss@8.4.24): resolution: {integrity: sha512-1fmkBaCALD72CK2a9i468mA/+tr9/1cBxRRMXOUaZqO43oWPR5imcyPjXwuv7PXbCid4ndlP5zWhidQVVa3hmA==} peerDependencies: - postcss: ^8.1.0 + postcss: ^8.1.0 + dependencies: + postcss: 8.4.24 + dev: true + + /postcss-font-variant@5.0.0(postcss@8.4.30): + resolution: {integrity: sha512-1fmkBaCALD72CK2a9i468mA/+tr9/1cBxRRMXOUaZqO43oWPR5imcyPjXwuv7PXbCid4ndlP5zWhidQVVa3hmA==} + peerDependencies: + postcss: ^8.1.0 + dependencies: + postcss: 8.4.30 + dev: true + + /postcss-gap-properties@3.0.5(postcss@8.4.24): + resolution: {integrity: sha512-IuE6gKSdoUNcvkGIqdtjtcMtZIFyXZhmFd5RUlg97iVEvp1BZKV5ngsAjCjrVy+14uhGBQl9tzmi1Qwq4kqVOg==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 dependencies: postcss: 8.4.24 dev: true - /postcss-gap-properties@3.0.5(postcss@8.4.24): + /postcss-gap-properties@3.0.5(postcss@8.4.30): resolution: {integrity: sha512-IuE6gKSdoUNcvkGIqdtjtcMtZIFyXZhmFd5RUlg97iVEvp1BZKV5ngsAjCjrVy+14uhGBQl9tzmi1Qwq4kqVOg==} engines: {node: ^12 || ^14 || >=16} peerDependencies: postcss: ^8.2 dependencies: - postcss: 8.4.24 + postcss: 8.4.30 dev: true /postcss-image-set-function@4.0.7(postcss@8.4.24): @@ -16522,6 +18335,16 @@ packages: postcss-value-parser: 4.2.0 dev: true + /postcss-image-set-function@4.0.7(postcss@8.4.30): + resolution: {integrity: sha512-9T2r9rsvYzm5ndsBE8WgtrMlIT7VbtTfE7b3BQnudUqnBcBo7L758oc+o+pdj/dUV0l5wjwSdjeOH2DZtfv8qw==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /postcss-initial@4.0.1(postcss@8.4.24): resolution: {integrity: sha512-0ueD7rPqX8Pn1xJIjay0AZeIuDoF+V+VvMt/uOnn+4ezUKhZM/NokDeP6DwMNyIoYByuN/94IQnt5FEkaN59xQ==} peerDependencies: @@ -16530,6 +18353,14 @@ packages: postcss: 8.4.24 dev: true + /postcss-initial@4.0.1(postcss@8.4.30): + resolution: {integrity: sha512-0ueD7rPqX8Pn1xJIjay0AZeIuDoF+V+VvMt/uOnn+4ezUKhZM/NokDeP6DwMNyIoYByuN/94IQnt5FEkaN59xQ==} + peerDependencies: + postcss: ^8.0.0 + dependencies: + postcss: 8.4.30 + dev: true + /postcss-lab-function@4.2.1(postcss@8.4.24): resolution: {integrity: sha512-xuXll4isR03CrQsmxyz92LJB2xX9n+pZJ5jE9JgcnmsCammLyKdlzrBin+25dy6wIjfhJpKBAN80gsTlCgRk2w==} engines: {node: ^12 || ^14 || >=16} @@ -16541,6 +18372,17 @@ packages: postcss-value-parser: 4.2.0 dev: true + /postcss-lab-function@4.2.1(postcss@8.4.30): + resolution: {integrity: sha512-xuXll4isR03CrQsmxyz92LJB2xX9n+pZJ5jE9JgcnmsCammLyKdlzrBin+25dy6wIjfhJpKBAN80gsTlCgRk2w==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/postcss-progressive-custom-properties': 1.3.0(postcss@8.4.30) + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /postcss-logical@5.0.4(postcss@8.4.24): resolution: {integrity: sha512-RHXxplCeLh9VjinvMrZONq7im4wjWGlRJAqmAVLXyZaXwfDWP73/oq4NdIp+OZwhQUMj0zjqDfM5Fj7qby+B4g==} engines: {node: ^12 || ^14 || >=16} @@ -16550,6 +18392,15 @@ packages: postcss: 8.4.24 dev: true + /postcss-logical@5.0.4(postcss@8.4.30): + resolution: {integrity: sha512-RHXxplCeLh9VjinvMrZONq7im4wjWGlRJAqmAVLXyZaXwfDWP73/oq4NdIp+OZwhQUMj0zjqDfM5Fj7qby+B4g==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.4 + dependencies: + postcss: 8.4.30 + dev: true + /postcss-media-minmax@5.0.0(postcss@8.4.24): resolution: {integrity: sha512-yDUvFf9QdFZTuCUg0g0uNSHVlJ5X1lSzDZjPSFaiCWvjgsvu8vEVxtahPrLMinIDEEGnx6cBe6iqdx5YWz08wQ==} engines: {node: '>=10.0.0'} @@ -16559,6 +18410,15 @@ packages: postcss: 8.4.24 dev: true + /postcss-media-minmax@5.0.0(postcss@8.4.30): + resolution: {integrity: sha512-yDUvFf9QdFZTuCUg0g0uNSHVlJ5X1lSzDZjPSFaiCWvjgsvu8vEVxtahPrLMinIDEEGnx6cBe6iqdx5YWz08wQ==} + engines: {node: '>=10.0.0'} + peerDependencies: + postcss: ^8.1.0 + dependencies: + postcss: 8.4.30 + dev: true + /postcss-media-query-parser@0.2.3: resolution: {integrity: sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==} dev: true @@ -16615,6 +18475,17 @@ packages: postcss-selector-parser: 6.0.13 dev: true + /postcss-nesting@10.2.0(postcss@8.4.30): + resolution: {integrity: sha512-EwMkYchxiDiKUhlJGzWsD9b2zvq/r2SSubcRrgP+jujMXFzqvANLt16lJANC+5uZ6hjI7lpRmI6O8JIl+8l1KA==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + '@csstools/selector-specificity': 2.2.0(postcss-selector-parser@6.0.13) + postcss: 8.4.30 + postcss-selector-parser: 6.0.13 + dev: true + /postcss-opacity-percentage@1.1.3(postcss@8.4.24): resolution: {integrity: sha512-An6Ba4pHBiDtyVpSLymUUERMo2cU7s+Obz6BTrS+gxkbnSBNKSuD0AVUc+CpBMrpVPKKfoVz0WQCX+Tnst0i4A==} engines: {node: ^12 || ^14 || >=16} @@ -16624,6 +18495,15 @@ packages: postcss: 8.4.24 dev: true + /postcss-opacity-percentage@1.1.3(postcss@8.4.30): + resolution: {integrity: sha512-An6Ba4pHBiDtyVpSLymUUERMo2cU7s+Obz6BTrS+gxkbnSBNKSuD0AVUc+CpBMrpVPKKfoVz0WQCX+Tnst0i4A==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + dev: true + /postcss-overflow-shorthand@3.0.4(postcss@8.4.24): resolution: {integrity: sha512-otYl/ylHK8Y9bcBnPLo3foYFLL6a6Ak+3EQBPOTR7luMYCOsiVTUk1iLvNf6tVPNGXcoL9Hoz37kpfriRIFb4A==} engines: {node: ^12 || ^14 || >=16} @@ -16634,6 +18514,16 @@ packages: postcss-value-parser: 4.2.0 dev: true + /postcss-overflow-shorthand@3.0.4(postcss@8.4.30): + resolution: {integrity: sha512-otYl/ylHK8Y9bcBnPLo3foYFLL6a6Ak+3EQBPOTR7luMYCOsiVTUk1iLvNf6tVPNGXcoL9Hoz37kpfriRIFb4A==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + /postcss-page-break@3.0.4(postcss@8.4.24): resolution: {integrity: sha512-1JGu8oCjVXLa9q9rFTo4MbeeA5FMe00/9C7lN4va606Rdb+HkxXtXsmEDrIraQ11fGz/WvKWa8gMuCKkrXpTsQ==} peerDependencies: @@ -16642,6 +18532,14 @@ packages: postcss: 8.4.24 dev: true + /postcss-page-break@3.0.4(postcss@8.4.30): + resolution: {integrity: sha512-1JGu8oCjVXLa9q9rFTo4MbeeA5FMe00/9C7lN4va606Rdb+HkxXtXsmEDrIraQ11fGz/WvKWa8gMuCKkrXpTsQ==} + peerDependencies: + postcss: ^8 + dependencies: + postcss: 8.4.30 + dev: true + /postcss-place@7.0.5(postcss@8.4.24): resolution: {integrity: sha512-wR8igaZROA6Z4pv0d+bvVrvGY4GVHihBCBQieXFY3kuSuMyOmEnnfFzHl/tQuqHZkfkIVBEbDvYcFfHmpSet9g==} engines: {node: ^12 || ^14 || >=16} @@ -16652,12 +18550,22 @@ packages: postcss-value-parser: 4.2.0 dev: true - /postcss-prefix-selector@1.16.0(postcss@8.4.24): + /postcss-place@7.0.5(postcss@8.4.30): + resolution: {integrity: sha512-wR8igaZROA6Z4pv0d+bvVrvGY4GVHihBCBQieXFY3kuSuMyOmEnnfFzHl/tQuqHZkfkIVBEbDvYcFfHmpSet9g==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + postcss-value-parser: 4.2.0 + dev: true + + /postcss-prefix-selector@1.16.0(postcss@8.4.30): resolution: {integrity: sha512-rdVMIi7Q4B0XbXqNUEI+Z4E+pueiu/CS5E6vRCQommzdQ/sgsS4dK42U7GX8oJR+TJOtT+Qv3GkNo6iijUMp3Q==} peerDependencies: postcss: '>4 <9' dependencies: - postcss: 8.4.24 + postcss: 8.4.30 dev: true /postcss-preset-env@7.5.0(postcss@8.4.24): @@ -16714,6 +18622,60 @@ packages: postcss-value-parser: 4.2.0 dev: true + /postcss-preset-env@7.5.0(postcss@8.4.30): + resolution: {integrity: sha512-0BJzWEfCdTtK2R3EiKKSdkE51/DI/BwnhlnicSW482Ym6/DGHud8K0wGLcdjip1epVX0HKo4c8zzTeV/SkiejQ==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.4 + dependencies: + '@csstools/postcss-color-function': 1.1.1(postcss@8.4.30) + '@csstools/postcss-font-format-keywords': 1.0.1(postcss@8.4.30) + '@csstools/postcss-hwb-function': 1.0.2(postcss@8.4.30) + '@csstools/postcss-ic-unit': 1.0.1(postcss@8.4.30) + '@csstools/postcss-is-pseudo-class': 2.0.7(postcss@8.4.30) + '@csstools/postcss-normalize-display-values': 1.0.1(postcss@8.4.30) + '@csstools/postcss-oklab-function': 1.1.1(postcss@8.4.30) + '@csstools/postcss-progressive-custom-properties': 1.3.0(postcss@8.4.30) + '@csstools/postcss-stepped-value-functions': 1.0.1(postcss@8.4.30) + '@csstools/postcss-unset-value': 1.0.2(postcss@8.4.30) + autoprefixer: 10.4.14(postcss@8.4.30) + browserslist: 4.21.9 + css-blank-pseudo: 3.0.3(postcss@8.4.30) + css-has-pseudo: 3.0.4(postcss@8.4.30) + css-prefers-color-scheme: 6.0.3(postcss@8.4.30) + cssdb: 6.6.3 + postcss: 8.4.30 + postcss-attribute-case-insensitive: 5.0.2(postcss@8.4.30) + postcss-clamp: 4.1.0(postcss@8.4.30) + postcss-color-functional-notation: 4.2.4(postcss@8.4.30) + postcss-color-hex-alpha: 8.0.4(postcss@8.4.30) + postcss-color-rebeccapurple: 7.1.1(postcss@8.4.30) + postcss-custom-media: 8.0.2(postcss@8.4.30) + postcss-custom-properties: 12.1.11(postcss@8.4.30) + postcss-custom-selectors: 6.0.3(postcss@8.4.30) + postcss-dir-pseudo-class: 6.0.5(postcss@8.4.30) + postcss-double-position-gradients: 3.1.2(postcss@8.4.30) + postcss-env-function: 4.0.6(postcss@8.4.30) + postcss-focus-visible: 6.0.4(postcss@8.4.30) + postcss-focus-within: 5.0.4(postcss@8.4.30) + postcss-font-variant: 5.0.0(postcss@8.4.30) + postcss-gap-properties: 3.0.5(postcss@8.4.30) + postcss-image-set-function: 4.0.7(postcss@8.4.30) + postcss-initial: 4.0.1(postcss@8.4.30) + postcss-lab-function: 4.2.1(postcss@8.4.30) + postcss-logical: 5.0.4(postcss@8.4.30) + postcss-media-minmax: 5.0.0(postcss@8.4.30) + postcss-nesting: 10.2.0(postcss@8.4.30) + postcss-opacity-percentage: 1.1.3(postcss@8.4.30) + postcss-overflow-shorthand: 3.0.4(postcss@8.4.30) + postcss-page-break: 3.0.4(postcss@8.4.30) + postcss-place: 7.0.5(postcss@8.4.30) + postcss-pseudo-class-any-link: 7.1.6(postcss@8.4.30) + postcss-replace-overflow-wrap: 4.0.0(postcss@8.4.30) + postcss-selector-not: 5.0.0(postcss@8.4.30) + postcss-value-parser: 4.2.0 + dev: true + /postcss-pseudo-class-any-link@7.1.6(postcss@8.4.24): resolution: {integrity: sha512-9sCtZkO6f/5ML9WcTLcIyV1yz9D1rf0tWc+ulKcvV30s0iZKS/ONyETvoWsr6vnrmW+X+KmuK3gV/w5EWnT37w==} engines: {node: ^12 || ^14 || >=16} @@ -16724,6 +18686,16 @@ packages: postcss-selector-parser: 6.0.13 dev: true + /postcss-pseudo-class-any-link@7.1.6(postcss@8.4.30): + resolution: {integrity: sha512-9sCtZkO6f/5ML9WcTLcIyV1yz9D1rf0tWc+ulKcvV30s0iZKS/ONyETvoWsr6vnrmW+X+KmuK3gV/w5EWnT37w==} + engines: {node: ^12 || ^14 || >=16} + peerDependencies: + postcss: ^8.2 + dependencies: + postcss: 8.4.30 + postcss-selector-parser: 6.0.13 + dev: true + /postcss-replace-overflow-wrap@4.0.0(postcss@8.4.24): resolution: {integrity: sha512-KmF7SBPphT4gPPcKZc7aDkweHiKEEO8cla/GjcBK+ckKxiZslIu3C4GCRW3DNfL0o7yW7kMQu9xlZ1kXRXLXtw==} peerDependencies: @@ -16732,17 +18704,25 @@ packages: postcss: 8.4.24 dev: true + /postcss-replace-overflow-wrap@4.0.0(postcss@8.4.30): + resolution: {integrity: sha512-KmF7SBPphT4gPPcKZc7aDkweHiKEEO8cla/GjcBK+ckKxiZslIu3C4GCRW3DNfL0o7yW7kMQu9xlZ1kXRXLXtw==} + peerDependencies: + postcss: ^8.0.3 + dependencies: + postcss: 8.4.30 + dev: true + /postcss-resolve-nested-selector@0.1.1: resolution: {integrity: sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw==} dev: true - /postcss-safe-parser@6.0.0(postcss@8.4.24): + /postcss-safe-parser@6.0.0(postcss@8.4.30): resolution: {integrity: sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==} engines: {node: '>=12.0'} peerDependencies: postcss: ^8.3.3 dependencies: - postcss: 8.4.24 + postcss: 8.4.30 dev: true /postcss-selector-not@5.0.0(postcss@8.4.24): @@ -16754,6 +18734,15 @@ packages: postcss: 8.4.24 dev: true + /postcss-selector-not@5.0.0(postcss@8.4.30): + resolution: {integrity: sha512-/2K3A4TCP9orP4TNS7u3tGdRFVKqz/E6pX3aGnriPG0jU78of8wsUcqE4QAhWEU0d+WnMSF93Ah3F//vUtK+iQ==} + peerDependencies: + postcss: ^8.1.0 + dependencies: + balanced-match: 1.0.2 + postcss: 8.4.30 + dev: true + /postcss-selector-parser@6.0.13: resolution: {integrity: sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==} engines: {node: '>=4'} @@ -16762,7 +18751,7 @@ packages: util-deprecate: 1.0.2 dev: true - /postcss-syntax@0.36.2(postcss@8.4.24): + /postcss-syntax@0.36.2(postcss@8.4.30): resolution: {integrity: sha512-nBRg/i7E3SOHWxF3PpF5WnJM/jQ1YpY9000OaVXlAQj6Zp/kIqJxEDWIZ67tAd7NLuk7zqN4yqe9nc0oNAOs1w==} peerDependencies: postcss: '>=5.0.0' @@ -16783,7 +18772,7 @@ packages: postcss-scss: optional: true dependencies: - postcss: 8.4.24 + postcss: 8.4.30 dev: true /postcss-value-parser@4.2.0: @@ -16799,18 +18788,27 @@ packages: source-map-js: 1.0.2 dev: true + /postcss@8.4.30: + resolution: {integrity: sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.6 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: true + /prebuild-install@7.1.1: resolution: {integrity: sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==} engines: {node: '>=10'} hasBin: true dependencies: - detect-libc: 2.0.1 + detect-libc: 2.0.2 expand-template: 2.0.3 github-from-package: 0.0.0 minimist: 1.2.8 mkdirp-classic: 0.5.3 napi-build-utils: 1.0.2 - node-abi: 3.45.0 + node-abi: 3.47.0 pump: 3.0.0 rc: 1.2.8 simple-get: 4.0.1 @@ -16818,8 +18816,8 @@ packages: tunnel-agent: 0.6.0 dev: true - /preferred-pm@3.0.3: - resolution: {integrity: sha512-+wZgbxNES/KlJs9q40F/1sfOd/j7f1O9JaHcW5Dsn3aUUOZg3L2bjpVUcKV2jvtElYfoTuQiNeMfQJ4kwUAhCQ==} + /preferred-pm@3.1.2: + resolution: {integrity: sha512-nk7dKrcW8hfCZ4H6klWcdRknBOXWzNQByJ0oJyX97BOupsYD+FzLS4hflgEu/uPUEHZCuRfMxzCBsuWd7OzT8Q==} engines: {node: '>=10'} dependencies: find-up: 5.0.0 @@ -16848,7 +18846,7 @@ packages: engines: {node: '>=4'} dev: true - /prettier-plugin-organize-imports@3.2.2(prettier@2.8.8)(typescript@5.1.3): + /prettier-plugin-organize-imports@3.2.2(prettier@2.8.8)(typescript@5.2.2): resolution: {integrity: sha512-e97lE6odGSiHonHJMTYC0q0iLXQyw0u5z/PJpvP/3vRy6/Zi9kLBwFAbEGjDzIowpjQv8b+J04PDamoUSQbzGA==} peerDependencies: '@volar/vue-language-plugin-pug': ^1.0.4 @@ -16862,7 +18860,7 @@ packages: optional: true dependencies: prettier: 2.8.8 - typescript: 5.1.3 + typescript: 5.2.2 dev: true /prettier-plugin-packagejson@2.4.3(prettier@2.8.8): @@ -16940,7 +18938,7 @@ packages: /probe.gl@3.6.0: resolution: {integrity: sha512-19JydJWI7+DtR4feV+pu4Mn1I5TAc0xojuxVgZdXIyfmTLfUaFnk4OloWK1bKbPtkgGKLr2lnbnCXmpZEcEp9g==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 '@probe.gl/env': 3.6.0 '@probe.gl/log': 3.6.0 '@probe.gl/stats': 3.6.0 @@ -17173,7 +19171,7 @@ packages: safe-buffer: 5.2.1 dev: true - /raw-loader@4.0.2(webpack@5.87.0): + /raw-loader@4.0.2(webpack@5.88.2): resolution: {integrity: sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -17181,7 +19179,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.87.0 + webpack: 5.88.2 dev: true /rbush@3.0.1: @@ -17861,7 +19859,7 @@ packages: react: ^16.6.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.6.0 || ^17.0.0 || ^18.0.0 dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.21.0 invariant: 2.2.4 prop-types: 15.8.1 react: 16.13.1 @@ -17876,7 +19874,7 @@ packages: react: ^16.6.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.6.0 || ^17.0.0 || ^18.0.0 dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.21.0 invariant: 2.2.4 prop-types: 15.8.1 react: 18.1.0 @@ -17896,7 +19894,7 @@ packages: react-fast-compare: 3.2.2 react-side-effect: 2.1.2(react@16.13.1) - /react-i18next@11.1.0(i18next@23.2.1)(react@16.13.1): + /react-i18next@11.1.0(i18next@23.5.1)(react@16.13.1): resolution: {integrity: sha512-FxHNBA6ptW7cygTpbIz5GAN9lrsB89xqgwpD3AzwSB4CDQsd+9i9/Je3Hc3VF6joAb1khFmCUO3ETJFLSrmuwg==} peerDependencies: i18next: '>= 19.0.0' @@ -17904,11 +19902,11 @@ packages: dependencies: '@babel/runtime': 7.22.5 html-parse-stringify2: 2.0.1 - i18next: 23.2.1 + i18next: 23.5.1 react: 16.13.1 dev: false - /react-intl@6.4.4(react@16.13.1)(typescript@5.1.3): + /react-intl@6.4.4(react@16.13.1)(typescript@5.2.2): resolution: {integrity: sha512-/C9Sl/5//ohfkNG6AWlJuf4BhTXsbzyk93K62A4zRhSPANyOGpKZ+fWhN+TLfFd5YjDUHy+exU/09y0w1bO4Xw==} peerDependencies: react: ^16.6.0 || 17 || 18 @@ -17919,7 +19917,7 @@ packages: dependencies: '@formatjs/ecma402-abstract': 1.17.0 '@formatjs/icu-messageformat-parser': 2.6.0 - '@formatjs/intl': 2.9.0(typescript@5.1.3) + '@formatjs/intl': 2.9.0(typescript@5.2.2) '@formatjs/intl-displaynames': 6.5.0 '@formatjs/intl-listformat': 7.4.0 '@types/hoist-non-react-statics': 3.3.1 @@ -17927,8 +19925,8 @@ packages: hoist-non-react-statics: 3.3.2 intl-messageformat: 10.5.0 react: 16.13.1 - tslib: 2.5.3 - typescript: 5.1.3 + tslib: 2.6.2 + typescript: 5.2.2 dev: true /react-is@16.13.1: @@ -17938,10 +19936,6 @@ packages: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} dev: true - /react-is@18.2.0: - resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} - dev: true - /react-lifecycles-compat@3.0.4: resolution: {integrity: sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==} @@ -18070,14 +20064,14 @@ packages: dependencies: prop-types: 15.8.1 - /react-universal-interface@0.6.2(react@16.13.1)(tslib@2.5.3): + /react-universal-interface@0.6.2(react@16.13.1)(tslib@2.6.2): resolution: {integrity: sha512-dg8yXdcQmvgR13RIlZbTRQOoUrDciFVoSBZILwjE2LFISxZZ8loVJKAkuzswl5js8BHda79bIb2b84ehU8IjXw==} peerDependencies: react: '*' tslib: '*' dependencies: react: 16.13.1 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /react-use@17.4.0(react-dom@16.14.0)(react@16.13.1): @@ -18095,13 +20089,13 @@ packages: nano-css: 5.3.5(react-dom@16.14.0)(react@16.13.1) react: 16.13.1 react-dom: 16.14.0(react@16.13.1) - react-universal-interface: 0.6.2(react@16.13.1)(tslib@2.5.3) + react-universal-interface: 0.6.2(react@16.13.1)(tslib@2.6.2) resize-observer-polyfill: 1.5.1 screenfull: 5.2.0 set-harmonic-interval: 1.0.1 throttle-debounce: 3.0.1 ts-easing: 0.2.0 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /react@16.13.1: @@ -18298,6 +20292,15 @@ packages: /regenerator-runtime@0.13.11: resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} + /regenerator-runtime@0.14.0: + resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==} + + /regenerator-transform@0.15.2: + resolution: {integrity: sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==} + dependencies: + '@babel/runtime': 7.22.15 + dev: true + /regex-not@1.0.2: resolution: {integrity: sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==} engines: {node: '>=0.10.0'} @@ -18315,6 +20318,15 @@ packages: functions-have-names: 1.2.3 dev: true + /regexp.prototype.flags@1.5.1: + resolution: {integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.1 + set-function-name: 2.0.1 + dev: true + /regexpp@3.2.0: resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} engines: {node: '>=8'} @@ -18619,11 +20631,20 @@ packages: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + /resolve@1.22.6: + resolution: {integrity: sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==} + hasBin: true + dependencies: + is-core-module: 2.13.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + /resolve@2.0.0-next.4: resolution: {integrity: sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==} hasBin: true dependencies: - is-core-module: 2.12.1 + is-core-module: 2.13.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 dev: true @@ -18711,7 +20732,7 @@ packages: globalthis: 1.0.3 json-stringify-safe: 5.0.1 semver-compare: 1.0.0 - sprintf-js: 1.1.2 + sprintf-js: 1.1.3 dev: true optional: true @@ -18725,16 +20746,16 @@ packages: rollup-pluginutils: 2.8.2 dev: true - /rollup-plugin-polyfill-node@0.8.0(rollup@3.25.1): + /rollup-plugin-polyfill-node@0.8.0(rollup@3.29.2): resolution: {integrity: sha512-C4UeKedOmOBkB3FgR+z/v9kzRwV1Q/H8xWs1u1+CNe4XOV6hINfOrcO+TredKxYvopCmr+WKUSNsFUnD1RLHgQ==} peerDependencies: rollup: ^1.20.0 || ^2.0.0 dependencies: - '@rollup/plugin-inject': 4.0.4(rollup@3.25.1) - rollup: 3.25.1 + '@rollup/plugin-inject': 4.0.4(rollup@3.29.2) + rollup: 3.29.2 dev: true - /rollup-plugin-visualizer@5.9.0(rollup@3.25.1): + /rollup-plugin-visualizer@5.9.0(rollup@3.29.2): resolution: {integrity: sha512-bbDOv47+Bw4C/cgs0czZqfm8L82xOZssk4ayZjG40y9zbXclNk7YikrZTDao6p7+HDiGxrN0b65SgZiVm9k1Cg==} engines: {node: '>=14'} hasBin: true @@ -18746,12 +20767,12 @@ packages: dependencies: open: 8.4.2 picomatch: 2.3.1 - rollup: 3.25.1 + rollup: 3.29.2 source-map: 0.7.4 yargs: 17.7.2 dev: true - /rollup-plugin-visualizer@5.9.2(rollup@3.25.1): + /rollup-plugin-visualizer@5.9.2(rollup@3.29.2): resolution: {integrity: sha512-waHktD5mlWrYFrhOLbti4YgQCn1uR24nYsNuXxg7LkPH8KdTXVWR9DNY1WU0QqokyMixVXJS4J04HNrVTMP01A==} engines: {node: '>=14'} hasBin: true @@ -18763,7 +20784,7 @@ packages: dependencies: open: 8.4.2 picomatch: 2.3.1 - rollup: 3.25.1 + rollup: 3.29.2 source-map: 0.7.4 yargs: 17.7.2 dev: true @@ -18779,15 +20800,15 @@ packages: engines: {node: '>=10.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true - /rollup@3.25.1: - resolution: {integrity: sha512-tywOR+rwIt5m2ZAWSe5AIJcTat8vGlnPFAv15ycCrw33t6iFsXZ6mzHVFh2psSjxQPmI+xgzMZZizUAukBI4aQ==} + /rollup@3.29.2: + resolution: {integrity: sha512-CJouHoZ27v6siztc21eEQGo0kIcE5D1gVPA571ez0mMYb25LGYGKnVNXpEj5MGlepmDWGXNjDB5q7uNiPHC11A==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /roughjs@4.5.2: @@ -18806,7 +20827,7 @@ packages: /rtl-css-js@1.16.1: resolution: {integrity: sha512-lRQgou1mu19e+Ya0LsTvKrVJ5TYUbqCVPAiImX3UfLTenarvPUl1QFdvu5Z3PYmHT9RCcwIfbjRQBntExyj3Zg==} dependencies: - '@babel/runtime': 7.22.5 + '@babel/runtime': 7.22.15 dev: true /run-applescript@5.0.0: @@ -18856,7 +20877,7 @@ packages: /rxjs@7.8.1: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} dependencies: - tslib: 2.5.3 + tslib: 2.6.2 dev: true /sade@1.8.1: @@ -18876,6 +20897,16 @@ packages: isarray: 2.0.5 dev: true + /safe-array-concat@1.0.1: + resolution: {integrity: sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==} + engines: {node: '>=0.4'} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.1 + has-symbols: 1.0.3 + isarray: 2.0.5 + dev: true + /safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} dev: true @@ -18983,9 +21014,8 @@ packages: compute-scroll-into-view: 1.0.20 dev: true - /search-insights@2.6.0: - resolution: {integrity: sha512-vU2/fJ+h/Mkm/DJOe+EaM5cafJv/1rRTZpGJTuFPf/Q5LjzgMDsqPdSaZsAe+GAWHHsfsu+rQSAn6c8IGtBEVw==} - engines: {node: '>=8.16.0'} + /search-insights@2.8.2: + resolution: {integrity: sha512-PxA9M5Q2bpBelVvJ3oDZR8nuY00Z6qwOxL53wNpgzV28M/D6u9WUbImDckjLSILBF8F1hn/mgyuUaOPtjow4Qw==} dev: true /selderee@0.6.0: @@ -19014,20 +21044,30 @@ packages: hasBin: true dev: true + /semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} + hasBin: true + dev: true + /semver@6.3.0: resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} hasBin: true - /semver@7.5.2: - resolution: {integrity: sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==} + /semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + dev: true + + /semver@7.5.3: + resolution: {integrity: sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==} engines: {node: '>=10'} hasBin: true dependencies: lru-cache: 6.0.0 dev: true - /semver@7.5.3: - resolution: {integrity: sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==} + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} engines: {node: '>=10'} hasBin: true dependencies: @@ -19051,6 +21091,15 @@ packages: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} dev: true + /set-function-name@2.0.1: + resolution: {integrity: sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.0 + functions-have-names: 1.2.3 + has-property-descriptors: 1.0.0 + dev: true + /set-harmonic-interval@1.0.1: resolution: {integrity: sha512-AhICkFV84tBP1aWqPwLZqFvAwqEoVA9kxNMniGEUvzOlm4vLmOFLiTT3UZ6bziJTy4bOVpzWGTfSCbmaayGx8g==} engines: {node: '>=6.9'} @@ -19146,8 +21195,8 @@ packages: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true - /signal-exit@4.0.2: - resolution: {integrity: sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==} + /signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} dev: true @@ -19243,12 +21292,12 @@ packages: is-fullwidth-code-point: 3.0.0 dev: true - /slick-carousel@1.8.1(jquery@3.7.0): + /slick-carousel@1.8.1(jquery@3.7.1): resolution: {integrity: sha512-XB9Ftrf2EEKfzoQXt3Nitrt/IPbT+f1fgqBdoxO3W/+JYvtEOW6EgxnWfr9GH6nmULv7Y2tPmEX3koxThVmebA==} peerDependencies: jquery: '>=1.8.0' dependencies: - jquery: 3.7.0 + jquery: 3.7.1 dev: true /smart-buffer@1.1.15: @@ -19266,7 +21315,7 @@ packages: engines: {node: '>=6'} hasBin: true dependencies: - array.prototype.flat: 1.3.1 + array.prototype.flat: 1.3.2 breakword: 1.0.6 grapheme-splitter: 1.0.4 strip-ansi: 6.0.1 @@ -19322,7 +21371,7 @@ packages: engines: {node: '>= 10'} dependencies: agent-base: 6.0.2 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 socks: 2.7.1 transitivePeerDependencies: - supports-color @@ -19462,7 +21511,7 @@ packages: /spdy-transport@3.0.0: resolution: {integrity: sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==} dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 detect-node: 2.1.0 hpack.js: 2.1.6 obuf: 1.1.2 @@ -19476,7 +21525,7 @@ packages: resolution: {integrity: sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==} engines: {node: '>=6.0.0'} dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 handle-thing: 2.0.1 http-deceiver: 1.2.7 select-hose: 2.0.0 @@ -19512,8 +21561,8 @@ packages: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: true - /sprintf-js@1.1.2: - resolution: {integrity: sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==} + /sprintf-js@1.1.3: + resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} dev: true optional: true @@ -19533,11 +21582,11 @@ packages: tweetnacl: 0.14.5 dev: true - /ssri@10.0.4: - resolution: {integrity: sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==} + /ssri@10.0.5: + resolution: {integrity: sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: - minipass: 5.0.0 + minipass: 7.0.3 dev: true /ssri@4.1.6: @@ -19729,8 +21778,8 @@ packages: resolution: {integrity: sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 get-intrinsic: 1.2.1 has-symbols: 1.0.3 internal-slot: 1.0.5 @@ -19738,13 +21787,13 @@ packages: side-channel: 1.0.4 dev: true - /string.prototype.padend@3.1.4: - resolution: {integrity: sha512-67otBXoksdjsnXXRUq+KMVTdlVRZ2af422Y0aTyTjVaoQkGr3mxl2Bc5emi7dOQ3OGVVQQskmLEWwFXwommpNw==} + /string.prototype.padend@3.1.5: + resolution: {integrity: sha512-DOB27b/2UTTD+4myKUFh+/fXWcu/UDyASIXfg+7VzoCNNGOfWvoyU/x5pvVHr++ztyt/oSYI1BcWBBG/hmlNjA==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 dev: true /string.prototype.trim@1.2.7: @@ -19756,6 +21805,15 @@ packages: es-abstract: 1.21.2 dev: true + /string.prototype.trim@1.2.8: + resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 + dev: true + /string.prototype.trimend@1.0.6: resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} dependencies: @@ -19764,6 +21822,14 @@ packages: es-abstract: 1.21.2 dev: true + /string.prototype.trimend@1.0.7: + resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 + dev: true + /string.prototype.trimstart@1.0.6: resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} dependencies: @@ -19772,6 +21838,14 @@ packages: es-abstract: 1.21.2 dev: true + /string.prototype.trimstart@1.0.7: + resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 + dev: true + /string_decoder@0.10.31: resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==} dev: true @@ -19903,27 +21977,40 @@ packages: inline-style-parser: 0.1.1 dev: true - /styled-components@5.3.11(react-dom@16.14.0)(react-is@18.2.0)(react@16.13.1): - resolution: {integrity: sha512-uuzIIfnVkagcVHv9nE0VPlHPSCmXIUGKfJ42LNjxCCTDTL5sgnJ8Z7GZBq0EnLYGln77tPpEpExt2+qa+cZqSw==} - engines: {node: '>=10'} + /styled-components@6.0.8(react-dom@16.14.0)(react@16.13.1): + resolution: {integrity: sha512-AwI02MTWZwqjzfXgR5QcbmcSn5xVjY4N2TLjSuYnmuBGF3y7GicHz3ysbpUq2EMJP5M8/Nc22vcmF3V3WNZDFA==} + engines: {node: '>= 16'} peerDependencies: + babel-plugin-styled-components: '>= 2' react: '>= 16.8.0' react-dom: '>= 16.8.0' - react-is: '>= 16.8.0' + peerDependenciesMeta: + babel-plugin-styled-components: + optional: true dependencies: - '@babel/helper-module-imports': 7.22.5 - '@babel/traverse': 7.22.5(supports-color@5.5.0) + '@babel/cli': 7.22.15(@babel/core@7.22.20) + '@babel/core': 7.22.20 + '@babel/helper-module-imports': 7.22.15 + '@babel/plugin-external-helpers': 7.22.5(@babel/core@7.22.20) + '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.22.20) + '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.22.20) + '@babel/preset-env': 7.22.20(@babel/core@7.22.20) + '@babel/preset-react': 7.22.15(@babel/core@7.22.20) + '@babel/preset-typescript': 7.22.15(@babel/core@7.22.20) + '@babel/traverse': 7.22.20 '@emotion/is-prop-valid': 1.2.1 - '@emotion/stylis': 0.8.5 - '@emotion/unitless': 0.7.5 - babel-plugin-styled-components: 2.1.3(styled-components@5.3.11) + '@emotion/unitless': 0.8.1 + '@types/stylis': 4.2.0 css-to-react-native: 3.2.0 - hoist-non-react-statics: 3.3.2 + csstype: 3.1.2 + postcss: 8.4.30 react: 16.13.1 react-dom: 16.14.0(react@16.13.1) - react-is: 18.2.0 shallowequal: 1.1.0 - supports-color: 5.5.0 + stylis: 4.3.0 + tslib: 2.6.2 + transitivePeerDependencies: + - supports-color dev: true /stylelint-config-recommended@7.0.0(stylelint@14.16.1): @@ -19952,9 +22039,9 @@ packages: balanced-match: 2.0.0 colord: 2.9.3 cosmiconfig: 7.1.0 - css-functions-list: 3.1.0 - debug: 4.3.4(supports-color@5.5.0) - fast-glob: 3.2.12 + css-functions-list: 3.2.0 + debug: 4.3.4 + fast-glob: 3.3.1 fastest-levenshtein: 1.0.16 file-entry-cache: 6.0.1 global-modules: 2.0.0 @@ -19971,10 +22058,10 @@ packages: micromatch: 4.0.5 normalize-path: 3.0.0 picocolors: 1.0.0 - postcss: 8.4.24 + postcss: 8.4.30 postcss-media-query-parser: 0.2.3 postcss-resolve-nested-selector: 0.1.1 - postcss-safe-parser: 6.0.0(postcss@8.4.24) + postcss-safe-parser: 6.0.0(postcss@8.4.30) postcss-selector-parser: 6.0.13 postcss-value-parser: 4.2.0 resolve-from: 5.0.0 @@ -19984,7 +22071,7 @@ packages: supports-hyperlinks: 2.3.0 svg-tags: 1.0.0 table: 6.8.1 - v8-compile-cache: 2.3.0 + v8-compile-cache: 2.4.0 write-file-atomic: 4.0.2 transitivePeerDependencies: - supports-color @@ -19994,11 +22081,15 @@ packages: resolution: {integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==} dev: true + /stylis@4.3.0: + resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} + dev: true + /sumchecker@3.0.1: resolution: {integrity: sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==} engines: {node: '>= 8.0'} dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4 transitivePeerDependencies: - supports-color dev: true @@ -20110,7 +22201,7 @@ packages: engines: {node: ^14.18.0 || >=16.0.0} dependencies: '@pkgr/utils': 2.4.1 - tslib: 2.5.3 + tslib: 2.6.2 dev: true /table@6.8.1: @@ -20170,8 +22261,8 @@ packages: readable-stream: 3.6.2 dev: true - /tar@6.1.15: - resolution: {integrity: sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==} + /tar@6.2.0: + resolution: {integrity: sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==} engines: {node: '>=10'} dependencies: chownr: 2.0.0 @@ -20202,7 +22293,7 @@ packages: supports-hyperlinks: 2.3.0 dev: true - /terser-webpack-plugin@5.3.9(webpack@5.87.0): + /terser-webpack-plugin@5.3.9(webpack@5.88.2): resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -20218,20 +22309,20 @@ packages: uglify-js: optional: true dependencies: - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.19 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.1 - terser: 5.18.1 - webpack: 5.87.0 + terser: 5.19.4 + webpack: 5.88.2 - /terser@5.18.1: - resolution: {integrity: sha512-j1n0Ao919h/Ai5r43VAnfV/7azUYW43GPxK7qSATzrsERfW7+y2QW9Cp9ufnRF5CQUWbnLSo7UJokSWCqg4tsQ==} + /terser@5.19.4: + resolution: {integrity: sha512-6p1DjHeuluwxDXcuT9VR8p64klWJKo1ILiy19s6C9+0Bh2+NWTX6nD9EPppiER4ICkHDVB1RkVpin/YW2nQn/g==} engines: {node: '>=10'} hasBin: true dependencies: - '@jridgewell/source-map': 0.3.3 - acorn: 8.9.0 + '@jridgewell/source-map': 0.3.5 + acorn: 8.10.0 commander: 2.20.3 source-map-support: 0.5.21 @@ -20508,7 +22599,7 @@ packages: resolution: {integrity: sha512-Z86EW+fFFh/IFB1fqQ3/+7Zpf9t2ebOAxNI/V6Wo7r5gqiqtxmgTlQ1qbqQcjLKYeSHPTsEmvlJUDg/EuL0uHQ==} dev: true - /ts-jest@26.5.6(jest@26.6.3)(typescript@5.1.3): + /ts-jest@26.5.6(jest@26.6.3)(typescript@5.2.2): resolution: {integrity: sha512-rua+rCP8DxpA8b4DQD/6X2HQS8Zy/xzViVYfEs2OQu68tkCuKLV0Md8pmX55+W24uRIyAsf/BajRfxOs+R2MKA==} engines: {node: '>= 10'} hasBin: true @@ -20525,8 +22616,8 @@ packages: lodash: 4.17.21 make-error: 1.3.6 mkdirp: 1.0.4 - semver: 7.5.2 - typescript: 5.1.3 + semver: 7.5.4 + typescript: 5.2.2 yargs-parser: 20.2.9 dev: true @@ -20536,15 +22627,19 @@ packages: /tslib@2.5.3: resolution: {integrity: sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==} + dev: false + + /tslib@2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - /tsutils@3.21.0(typescript@5.1.3): + /tsutils@3.21.0(typescript@5.2.2): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 5.1.3 + typescript: 5.2.2 dev: true /tsx@3.12.7: @@ -20555,7 +22650,7 @@ packages: '@esbuild-kit/core-utils': 3.1.0 '@esbuild-kit/esm-loader': 2.5.5 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /tty-browserify@0.0.0: @@ -20641,6 +22736,36 @@ packages: engines: {node: '>=8'} dev: true + /typed-array-buffer@1.0.0: + resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.1 + is-typed-array: 1.1.12 + dev: true + + /typed-array-byte-length@1.0.0: + resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.12 + dev: true + + /typed-array-byte-offset@1.0.0: + resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.12 + dev: true + /typed-array-length@1.0.4: resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} dependencies: @@ -20673,10 +22798,10 @@ packages: typedoc: '>=0.10.0' dependencies: fs-extra: 8.1.0 - typedoc: 0.17.6(typescript@5.1.3) + typedoc: 0.17.6(typescript@5.2.2) dev: false - /typedoc@0.17.6(typescript@5.1.3): + /typedoc@0.17.6(typescript@5.2.2): resolution: {integrity: sha512-pQiYnhG3yJk7939cv2n8uFoTsSgy5Hfiw0dgOQYa9nT9Ya1013dMctQdAXMj8JbNu7KhcauQyq9Zql9D/TziLw==} engines: {node: '>= 8.0.0'} hasBin: true @@ -20693,11 +22818,11 @@ packages: progress: 2.0.3 shelljs: 0.8.5 typedoc-default-themes: 0.10.2 - typescript: 5.1.3 + typescript: 5.2.2 dev: false - /typescript@5.1.3: - resolution: {integrity: sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==} + /typescript@5.2.2: + resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} engines: {node: '>=14.17'} hasBin: true @@ -20713,22 +22838,22 @@ packages: dev: false optional: true - /umi@4.0.71(@babel/core@7.22.5)(@types/node@14.18.51)(@types/react@16.9.35)(eslint@7.32.0)(jest@26.6.3)(postcss@8.4.24)(prettier@2.8.8)(react-dom@16.14.0)(react@16.13.1)(rollup@3.25.1)(sass@1.63.4)(styled-components@5.3.11)(stylelint@14.16.1)(typescript@5.1.3)(webpack@5.87.0): + /umi@4.0.71(@babel/core@7.22.20)(@types/node@14.18.61)(@types/react@16.9.35)(eslint@7.32.0)(jest@26.6.3)(postcss@8.4.30)(prettier@2.8.8)(react-dom@16.14.0)(react@16.13.1)(rollup@3.29.2)(sass@1.63.4)(styled-components@6.0.8)(stylelint@14.16.1)(typescript@5.2.2)(webpack@5.88.2): resolution: {integrity: sha512-ces7OXIJZ3lR1pAEvNhXmPEVv8ADNPUG1imoUAhdc6NTxTXlfgO/UCmX9v6RoJtY7NwOo1OcpLc1NLlwgodOSg==} engines: {node: '>=14'} hasBin: true dependencies: '@babel/runtime': 7.21.0 '@umijs/bundler-utils': 4.0.71 - '@umijs/bundler-webpack': 4.0.71(styled-components@5.3.11)(typescript@5.1.3)(webpack@5.87.0) + '@umijs/bundler-webpack': 4.0.71(styled-components@6.0.8)(typescript@5.2.2)(webpack@5.88.2) '@umijs/core': 4.0.71 - '@umijs/lint': 4.0.71(eslint@7.32.0)(jest@26.6.3)(styled-components@5.3.11)(stylelint@14.16.1)(typescript@5.1.3) - '@umijs/preset-umi': 4.0.71(@types/node@14.18.51)(@types/react@16.9.35)(postcss@8.4.24)(rollup@3.25.1)(sass@1.63.4)(styled-components@5.3.11)(typescript@5.1.3)(webpack@5.87.0) + '@umijs/lint': 4.0.71(eslint@7.32.0)(jest@26.6.3)(styled-components@6.0.8)(stylelint@14.16.1)(typescript@5.2.2) + '@umijs/preset-umi': 4.0.71(@types/node@14.18.61)(@types/react@16.9.35)(postcss@8.4.30)(rollup@3.29.2)(sass@1.63.4)(styled-components@6.0.8)(typescript@5.2.2)(webpack@5.88.2) '@umijs/renderer-react': 4.0.71(react-dom@16.14.0)(react@16.13.1) '@umijs/server': 4.0.71 - '@umijs/test': 4.0.71(@babel/core@7.22.5) + '@umijs/test': 4.0.71(@babel/core@7.22.20) '@umijs/utils': 4.0.71 - prettier-plugin-organize-imports: 3.2.2(prettier@2.8.8)(typescript@5.1.3) + prettier-plugin-organize-imports: 3.2.2(prettier@2.8.8)(typescript@5.2.2) prettier-plugin-packagejson: 2.4.3(prettier@2.8.8) transitivePeerDependencies: - '@babel/core' @@ -20949,6 +23074,16 @@ packages: engines: {node: '>=4'} dev: true + /update-browserslist-db@1.0.11(browserslist@4.21.10): + resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.21.10 + escalade: 3.1.1 + picocolors: 1.0.0 + /update-browserslist-db@1.0.11(browserslist@4.21.9): resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} hasBin: true @@ -20958,6 +23093,7 @@ packages: browserslist: 4.21.9 escalade: 3.1.1 picocolors: 1.0.0 + dev: true /update-notifier@2.5.0: resolution: {integrity: sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==} @@ -21052,12 +23188,12 @@ packages: resolution: {integrity: sha512-PBdZ03m1kBnQ5cjjO0ZvJMJS+QsbyIcFwi4hY4U76OQsCO9JrOYjbCFgIF76ccFg9xnJo7ZHPkqyj1GqmdS7MA==} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 + define-properties: 1.2.1 for-each: 0.3.3 has-proto: 1.0.1 has-symbols: 1.0.3 - object.getownpropertydescriptors: 2.1.6 - safe-array-concat: 1.0.0 + object.getownpropertydescriptors: 2.1.7 + safe-array-concat: 1.0.1 dev: true /util@0.10.3: @@ -21108,6 +23244,10 @@ packages: resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==} dev: true + /v8-compile-cache@2.4.0: + resolution: {integrity: sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==} + dev: true + /v8-to-istanbul@7.1.2: resolution: {integrity: sha512-TxNb7YEUwkLXCQYeudi6lgQ/SZrzNO4kMdlqVxaZPUIUjCv6iSSypUQX70kNBSERpQ8fk48+d61FXk+tgqcWow==} engines: {node: '>=10.10.0'} @@ -21187,7 +23327,7 @@ packages: redux: 4.2.1 dev: true - /vite@3.2.7(@types/node@14.18.51): + /vite@3.2.7(@types/node@14.18.61): resolution: {integrity: sha512-29pdXjk49xAP0QBr0xXqu2s5jiQIXNvE/xwd0vUizYT2Hzqe4BksNNoWllFVXJf4eLZ+UlVQmXfB4lWrc+t18g==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -21212,16 +23352,16 @@ packages: terser: optional: true dependencies: - '@types/node': 14.18.51 + '@types/node': 14.18.61 esbuild: 0.15.18 - postcss: 8.4.24 - resolve: 1.22.2 + postcss: 8.4.30 + resolve: 1.22.6 rollup: 2.79.1 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true - /vite@4.3.1(@types/node@14.18.51)(less@4.1.3)(sass@1.63.4): + /vite@4.3.1(@types/node@14.18.61)(less@4.1.3)(sass@1.63.4): resolution: {integrity: sha512-EPmfPLAI79Z/RofuMvkIS0Yr091T2ReUoXQqc5ppBX/sjFRhHKiPPF/R46cTdoci/XgeQpB23diiJxq5w30vdg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -21246,14 +23386,14 @@ packages: terser: optional: true dependencies: - '@types/node': 14.18.51 + '@types/node': 14.18.61 esbuild: 0.17.19 less: 4.1.3 postcss: 8.4.24 - rollup: 3.25.1 + rollup: 3.29.2 sass: 1.63.4 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /vm-browserify@1.1.2: @@ -21347,8 +23487,8 @@ packages: resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} engines: {node: '>=10.13.0'} - /webpack@5.87.0: - resolution: {integrity: sha512-GOu1tNbQ7p1bDEoFRs2YPcfyGs8xq52yyPBZ3m2VGnXGtV9MxjrkABHm4V9Ia280OefsSLzvbVoXcfLxjKY/Iw==} + /webpack@5.88.2: + resolution: {integrity: sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -21362,12 +23502,12 @@ packages: '@webassemblyjs/ast': 1.11.6 '@webassemblyjs/wasm-edit': 1.11.6 '@webassemblyjs/wasm-parser': 1.11.6 - acorn: 8.9.0 - acorn-import-assertions: 1.9.0(acorn@8.9.0) - browserslist: 4.21.9 + acorn: 8.10.0 + acorn-import-assertions: 1.9.0(acorn@8.10.0) + browserslist: 4.21.10 chrome-trace-event: 1.0.3 enhanced-resolve: 5.15.0 - es-module-lexer: 1.3.0 + es-module-lexer: 1.3.1 eslint-scope: 5.1.1 events: 3.3.0 glob-to-regexp: 0.4.1 @@ -21378,7 +23518,7 @@ packages: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.9(webpack@5.87.0) + terser-webpack-plugin: 5.3.9(webpack@5.88.2) watchpack: 2.4.0 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -21489,6 +23629,17 @@ packages: path-exists: 4.0.0 dev: true + /which-typed-array@1.1.11: + resolution: {integrity: sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.0 + dev: true + /which-typed-array@1.1.9: resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} engines: {node: '>= 0.4'} @@ -21538,13 +23689,13 @@ packages: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} dev: false - /workerize-loader@2.0.2(webpack@5.87.0): + /workerize-loader@2.0.2(webpack@5.88.2): resolution: {integrity: sha512-HoZ6XY4sHWxA2w0WpzgBwUiR3dv1oo7bS+oCwIpb6n54MclQ/7KXdXsVIChTCygyuHtVuGBO1+i3HzTt699UJQ==} peerDependencies: webpack: '*' dependencies: loader-utils: 2.0.4 - webpack: 5.87.0 + webpack: 5.88.2 /wrap-ansi@5.1.0: resolution: {integrity: sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==} @@ -21623,8 +23774,8 @@ packages: optional: true dev: true - /ws@8.13.0: - resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} + /ws@8.14.1: + resolution: {integrity: sha512-4OOseMUq8AzRBI/7SLMUwO+FEDnguetSk7KMb1sHwvF2w2Wv5Hoj0nlifx8vtGsftE/jWHojPy8sMMzYLJ2G/A==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -21692,7 +23843,7 @@ packages: moment: 2.24.0 opn: 5.5.0 rimraf: 2.7.1 - semver: 5.7.1 + semver: 5.7.2 shelljs: 0.8.5 uuid: 3.4.0 transitivePeerDependencies: diff --git a/site/.dumi/global.ts b/site/.dumi/global.ts index 55a6126f2..86947d3be 100644 --- a/site/.dumi/global.ts +++ b/site/.dumi/global.ts @@ -31,7 +31,6 @@ if (window) { (window as any).gPluginCssSelect = require('@antv/g-plugin-css-select'); (window as any).gPlugin3d = require('@antv/g-plugin-3d'); (window as any).gPluginControl = require('@antv/g-plugin-control'); - (window as any).gPluginGpgpu = require('@antv/g-plugin-gpgpu'); (window as any).gPluginPhysx = require('@antv/g-plugin-physx'); (window as any).gPluginBox2d = require('@antv/g-plugin-box2d'); (window as any).gPluginMatterjs = require('@antv/g-plugin-matterjs'); @@ -39,8 +38,6 @@ if (window) { ( window as any ).gPluginDeviceRenderer = require('@antv/g-plugin-device-renderer'); - (window as any).gPluginWebglDevice = require('@antv/g-plugin-webgl-device'); - (window as any).gPluginWebgpuDevice = require('@antv/g-plugin-webgpu-device'); ( window as any ).gPluginRoughCanvasRenderer = require('@antv/g-plugin-rough-canvas-renderer'); @@ -59,6 +56,7 @@ if (window) { (window as any).gPluginA11y = require('@antv/g-plugin-a11y'); (window as any).gPluginAnnotation = require('@antv/g-plugin-annotation'); // compiler for GPGPU + (window as any).gDeviceApi = require('@antv/g-device-api'); (window as any).webgpuGraph = require('@antv/webgpu-graph'); (window as any).gComponents = require('@antv/g-components'); (window as any).gWebComponents = require('@antv/g-web-components'); @@ -74,30 +72,6 @@ if (window) { (window as any).webfontloader = require('webfontloader'); require('../css/demo.css'); - - // // origin trial for WebGPU - // // @see https://developer.chrome.com/origintrials/#/trials/my - // // @see https://github.com/GoogleChrome/OriginTrials/blob/gh-pages/developer-guide.md#16-can-i-provide-tokens-by-running-script - // const tokenElement1 = document.createElement('meta'); - // tokenElement1.httpEquiv = 'origin-trial'; - // tokenElement1.content = - // // https://localhost:8000 - // 'AoSdEiPBm19CVIF6skKpsmzQmAdKAC1oCV6NS2P12Xjtk1da77EZnrm8wSk1ymIsarjl7xHkMQChky3cDi7RdA0AAABJeyJvcmlnaW4iOiJodHRwOi8vbG9jYWxob3N0OjgwMDAiLCJmZWF0dXJlIjoiV2ViR1BVIiwiZXhwaXJ5IjoxNjkxNzExOTk5fQ=='; - // document.head.appendChild(tokenElement1); - - // const tokenElement2 = document.createElement('meta'); - // tokenElement2.httpEquiv = 'origin-trial'; - // tokenElement2.content = - // // https://g-next.antv.vision - // 'Aiq1IshZRuOKWEmA9h5liGM4kZYradTjzi0PiIizN0S2MSVpsY3GZxIBYOM3MkbIaEbY4kZTo/2AhRMCbZKDKAwAAABleyJvcmlnaW4iOiJodHRwczovL2ctbmV4dC5hbnR2LnZpc2lvbjo0NDMiLCJmZWF0dXJlIjoiV2ViR1BVIiwiZXhwaXJ5IjoxNjkxNzExOTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZX0='; - // document.head.appendChild(tokenElement2); - - // const tokenElement3 = document.createElement('meta'); - // tokenElement3.httpEquiv = 'origin-trial'; - // tokenElement3.content = - // // https://g.antv.antgroup.com - // 'Au/LZbSWTC8hhagDyjnu46PChWcCITqE8iS8sTPw9teCa7ptAToyP2KrKls8qN09QjjZSgYsGudQesarc0PxaAcAAABTeyJvcmlnaW4iOiJodHRwczovL2cuYW50di5hbnRncm91cC5jb206NDQzIiwiZmVhdHVyZSI6IldlYkdQVSIsImV4cGlyeSI6MTY5MTcxMTk5OX0='; - // document.head.appendChild(tokenElement3); } if ( diff --git a/site/docs/plugins/device-renderer.en.md b/site/docs/plugins/device-renderer.en.md index edd646a6d..53b32a7ef 100644 --- a/site/docs/plugins/device-renderer.en.md +++ b/site/docs/plugins/device-renderer.en.md @@ -257,7 +257,6 @@ export interface TextureDescriptor { depth: number; numLevels: number; usage: TextureUsage; - immutable?: boolean; pixelStore?: Partial<{ packAlignment: number, unpackAlignment: number, diff --git a/site/docs/plugins/device-renderer.zh.md b/site/docs/plugins/device-renderer.zh.md index f1cc95646..40d901de9 100644 --- a/site/docs/plugins/device-renderer.zh.md +++ b/site/docs/plugins/device-renderer.zh.md @@ -258,7 +258,6 @@ export interface TextureDescriptor { depth: number; numLevels: number; usage: TextureUsage; - immutable?: boolean; pixelStore?: Partial<{ packAlignment: number, unpackAlignment: number, diff --git a/site/examples/3d/device/demo/compute-boids.ts b/site/examples/3d/device/demo/compute-boids.ts deleted file mode 100644 index c15f940a5..000000000 --- a/site/examples/3d/device/demo/compute-boids.ts +++ /dev/null @@ -1,391 +0,0 @@ -import { WebGPUDeviceContribution } from '@antv/g-plugin-webgpu-device'; -import { - VertexStepMode, - Format, - TransparentWhite, - Buffer, - Bindings, - BufferUsage, - BufferFrequencyHint, -} from '@antv/g-plugin-device-renderer'; - -/** - * @see https://webgpu.github.io/webgpu-samples/samples/computeBoids#main.ts - */ - -const deviceContributionWebGPU = new WebGPUDeviceContribution( - { - shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', - }, - // @ts-ignore - { - globalThis: window, - }, -); - -const $container = document.getElementById('container')!; -const $canvasContainer = document.createElement('div'); -$canvasContainer.id = 'canvas'; -$container.appendChild($canvasContainer); - -async function render(deviceContribution: WebGPUDeviceContribution) { - $canvasContainer.innerHTML = ''; - const $canvas = document.createElement('canvas'); - $canvas.width = 1000; - $canvas.height = 1000; - $canvas.style.width = '500px'; - $canvas.style.height = '500px'; - $canvasContainer.appendChild($canvas); - - const numParticles = 1500; - const initialParticleData = new Float32Array(numParticles * 4); - for (let i = 0; i < numParticles; ++i) { - initialParticleData[4 * i + 0] = 2 * (Math.random() - 0.5); - initialParticleData[4 * i + 1] = 2 * (Math.random() - 0.5); - initialParticleData[4 * i + 2] = 2 * (Math.random() - 0.5) * 0.1; - initialParticleData[4 * i + 3] = 2 * (Math.random() - 0.5) * 0.1; - } - - // create swap chain and get device - const swapChain = await deviceContribution.createSwapChain($canvas); - - // TODO: resize - swapChain.configureSwapChain($canvas.width, $canvas.height); - const device = swapChain.getDevice(); - - const program = device.createProgram({ - vertex: { - wgsl: ` -struct VertexOutput { - @builtin(position) position : vec4, - @location(4) color : vec4, -} - -@vertex -fn vert_main( - @location(0) a_particlePos : vec2, - @location(1) a_particleVel : vec2, - @location(2) a_pos : vec2 -) -> VertexOutput { - let angle = -atan2(a_particleVel.x, a_particleVel.y); - let pos = vec2( - (a_pos.x * cos(angle)) - (a_pos.y * sin(angle)), - (a_pos.x * sin(angle)) + (a_pos.y * cos(angle)) - ); - - var output : VertexOutput; - output.position = vec4(pos + a_particlePos, 0.0, 1.0); - output.color = vec4( - 1.0 - sin(angle + 1.0) - a_particleVel.y, - pos.x * 100.0 - a_particleVel.y + 0.1, - a_particleVel.x + cos(angle + 0.5), - 1.0); - return output; -} -`, - }, - fragment: { - wgsl: ` -@fragment -fn frag_main(@location(4) color : vec4) -> @location(0) vec4 { - return color; -} -`, - }, - }); - - const computeProgram = device.createProgram({ - compute: { - wgsl: ` -struct Particle { - pos : vec2, - vel : vec2, -} -struct SimParams { - deltaT : f32, - rule1Distance : f32, - rule2Distance : f32, - rule3Distance : f32, - rule1Scale : f32, - rule2Scale : f32, - rule3Scale : f32, -} -struct Particles { - particles : array, -} -@binding(0) @group(0) var params : SimParams; -@binding(1) @group(0) var particlesA : Particles; -@binding(2) @group(0) var particlesB : Particles; - -// https://github.com/austinEng/Project6-Vulkan-Flocking/blob/master/data/shaders/computeparticles/particle.comp -@compute @workgroup_size(64) -fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3) { - var index = GlobalInvocationID.x; - - var vPos = particlesA.particles[index].pos; - var vVel = particlesA.particles[index].vel; - var cMass = vec2(0.0); - var cVel = vec2(0.0); - var colVel = vec2(0.0); - var cMassCount = 0u; - var cVelCount = 0u; - var pos : vec2; - var vel : vec2; - - for (var i = 0u; i < arrayLength(&particlesA.particles); i++) { - if (i == index) { - continue; - } - - pos = particlesA.particles[i].pos.xy; - vel = particlesA.particles[i].vel.xy; - if (distance(pos, vPos) < params.rule1Distance) { - cMass += pos; - cMassCount++; - } - if (distance(pos, vPos) < params.rule2Distance) { - colVel -= pos - vPos; - } - if (distance(pos, vPos) < params.rule3Distance) { - cVel += vel; - cVelCount++; - } - } - if (cMassCount > 0) { - cMass = (cMass / vec2(f32(cMassCount))) - vPos; - } - if (cVelCount > 0) { - cVel /= f32(cVelCount); - } - vVel += (cMass * params.rule1Scale) + (colVel * params.rule2Scale) + (cVel * params.rule3Scale); - - // clamp velocity for a more pleasing simulation - vVel = normalize(vVel) * clamp(length(vVel), 0.0, 0.1); - // kinematic update - vPos = vPos + (vVel * params.deltaT); - // Wrap around boundary - if (vPos.x < -1.0) { - vPos.x = 1.0; - } - if (vPos.x > 1.0) { - vPos.x = -1.0; - } - if (vPos.y < -1.0) { - vPos.y = 1.0; - } - if (vPos.y > 1.0) { - vPos.y = -1.0; - } - // Write back - particlesB.particles[index].pos = vPos; - particlesB.particles[index].vel = vVel; -} -`, - }, - }); - - const particleBuffers: Buffer[] = []; - for (let i = 0; i < 2; ++i) { - particleBuffers[i] = device.createBuffer({ - viewOrSize: initialParticleData, - usage: BufferUsage.VERTEX | BufferUsage.STORAGE, - }); - } - - const vertexBufferData = new Float32Array([ - -0.01, -0.02, 0.01, -0.02, 0.0, 0.02, - ]); - const spriteVertexBuffer = device.createBuffer({ - viewOrSize: vertexBufferData, - usage: BufferUsage.VERTEX, - }); - - const uniformBuffer = device.createBuffer({ - viewOrSize: 7 * Float32Array.BYTES_PER_ELEMENT, - usage: BufferUsage.UNIFORM | BufferUsage.COPY_DST, - hint: BufferFrequencyHint.DYNAMIC, - }); - - const bindingLayouts = [{ numSamplers: 0, numUniformBuffers: 1 }]; - - const inputLayout = device.createInputLayout({ - vertexBufferDescriptors: [ - { - byteStride: 4 * 4, - stepMode: VertexStepMode.INSTANCE, - }, - { - byteStride: 4 * 2, - stepMode: VertexStepMode.VERTEX, - }, - ], - vertexAttributeDescriptors: [ - { - // instance position - bufferIndex: 0, - location: 0, - bufferByteOffset: 0, - format: Format.F32_RG, - }, - { - // instance velocity - bufferIndex: 0, - location: 1, - bufferByteOffset: 4 * 2, - format: Format.F32_RG, - }, - { - // vertex positions - bufferIndex: 1, - location: 2, - bufferByteOffset: 0, - format: Format.F32_RG, - }, - ], - indexBufferFormat: null, - program, - }); - - const renderPipeline = device.createRenderPipeline({ - inputLayout, - program, - colorAttachmentFormats: [Format.U8_RGBA_RT], - }); - const computePipeline = device.createComputePipeline({ - inputLayout: null, - bindingLayouts: [], - program: computeProgram, - }); - - const simParams = { - deltaT: 0.04, - rule1Distance: 0.1, - rule2Distance: 0.025, - rule3Distance: 0.025, - rule1Scale: 0.02, - rule2Scale: 0.05, - rule3Scale: 0.005, - }; - - const bindings: Bindings[] = []; - for (let i = 0; i < 2; ++i) { - bindings[i] = device.createBindings({ - pipeline: computePipeline, - bindingLayout: { - numUniformBuffers: 1, - storageEntries: [ - { - type: 'storage', - }, - { - type: 'storage', - }, - ], - }, - uniformBufferBindings: [ - { - buffer: uniformBuffer, - wordCount: 7, - }, - ], - storageBufferBindings: [ - { - buffer: particleBuffers[i], - wordCount: initialParticleData.byteLength, - }, - { - buffer: particleBuffers[(i + 1) % 2], - wordCount: initialParticleData.byteLength, - }, - ], - samplerBindings: [], - }); - } - - const renderTarget = device.createRenderTarget({ - pixelFormat: Format.U8_RGBA_RT, - width: $canvas.width, - height: $canvas.height, - }); - device.setResourceName(renderTarget, 'Main Render Target'); - - uniformBuffer.setSubData( - 0, - new Uint8Array( - new Float32Array([ - simParams.deltaT, - simParams.rule1Distance, - simParams.rule2Distance, - simParams.rule3Distance, - simParams.rule1Scale, - simParams.rule2Scale, - simParams.rule3Scale, - ]).buffer, - ), - ); - - let id; - let t = 0; - const frame = () => { - // compute - - /** - * An application should call getCurrentTexture() in the same task that renders to the canvas texture. - * Otherwise, the texture could get destroyed by these steps before the application is finished rendering to it. - */ - const onscreenTexture = swapChain.getOnscreenTexture(); - - const computePass = device.createComputePass(); - computePass.setPipeline(computePipeline); - computePass.setBindings(0, bindings[t % 2], [0]); - computePass.dispatchWorkgroups(Math.ceil(numParticles / 64)); - device.submitPass(computePass); - - // const renderPass = device.createRenderPass({ - // colorAttachment: [renderTarget], - // colorResolveTo: [onscreenTexture], - // colorClearColor: [TransparentWhite], - // }); - - // renderPass.setPipeline(renderPipeline); - // renderPass.setVertexInput( - // inputLayout, - // [ - // { - // buffer: particleBuffers[(t + 1) % 2], - // }, - // { - // buffer: spriteVertexBuffer, - // }, - // ], - // null, - // ); - // renderPass.setViewport(0, 0, $canvas.width, $canvas.height); - // renderPass.draw(3, numParticles); - - // device.submitPass(renderPass); - ++t; - id = requestAnimationFrame(frame); - }; - - frame(); - - return () => { - if (id) { - cancelAnimationFrame(id); - } - program.destroy(); - // vertexBuffer.destroy(); - inputLayout.destroy(); - renderPipeline.destroy(); - renderTarget.destroy(); - device.destroy(); - - // For debug. - device.checkForLeaks(); - }; -} - -(async () => { - await render(deviceContributionWebGPU); -})(); diff --git a/site/examples/3d/device/demo/cubemap.ts b/site/examples/3d/device/demo/cubemap.ts deleted file mode 100644 index 9be4c13fa..000000000 --- a/site/examples/3d/device/demo/cubemap.ts +++ /dev/null @@ -1,418 +0,0 @@ -import { WebGLDeviceContribution } from '@antv/g-plugin-webgl-device'; -import { WebGPUDeviceContribution } from '@antv/g-plugin-webgpu-device'; -import { - VertexStepMode, - Format, - TransparentWhite, - BufferUsage, - BufferFrequencyHint, - BlendMode, - BlendFactor, - TextureUsage, - CullMode, - ChannelWriteMask, - TransparentBlack, - CompareMode, - WrapMode, - TexFilterMode, - MipFilterMode, - TextureDimension, -} from '@antv/g-plugin-device-renderer'; -import * as lil from 'lil-gui'; -import { mat4, vec3 } from 'gl-matrix'; - -/** - * @see https://webgpu.github.io/webgpu-samples/samples/texturedCube - */ - -const deviceContributionWebGL1 = new WebGLDeviceContribution({ - targets: ['webgl1'], - onContextCreationError: () => {}, - onContextLost: () => {}, - onContextRestored(e) {}, -}); -const deviceContributionWebGL2 = new WebGLDeviceContribution({ - targets: ['webgl2', 'webgl1'], - onContextCreationError: () => {}, - onContextLost: () => {}, - onContextRestored(e) {}, -}); -const deviceContributionWebGPU = new WebGPUDeviceContribution( - { - shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', - }, - // @ts-ignore - { - globalThis: window, - }, -); - -const $container = document.getElementById('container')!; -const $canvasContainer = document.createElement('div'); -$canvasContainer.id = 'canvas'; -$container.appendChild($canvasContainer); - -async function loadImage(url: string) { - if (!!window.createImageBitmap) { - const response = await fetch(url); - const imageBitmap = await createImageBitmap(await response.blob()); - return imageBitmap; - } else { - const image = new window.Image(); - return new Promise((res) => { - image.onload = () => res(image); - image.src = url; - image.crossOrigin = 'Anonymous'; - }); - } -} - -async function render( - deviceContribution: WebGLDeviceContribution | WebGPUDeviceContribution, -) { - $canvasContainer.innerHTML = ''; - const $canvas = document.createElement('canvas'); - $canvas.width = 1000; - $canvas.height = 1000; - $canvas.style.width = '500px'; - $canvas.style.height = '500px'; - $canvasContainer.appendChild($canvas); - - // create swap chain and get device - const swapChain = await deviceContribution.createSwapChain($canvas); - - // TODO: resize - swapChain.configureSwapChain($canvas.width, $canvas.height); - const device = swapChain.getDevice(); - - const program = device.createProgram({ - vertex: { - glsl: ` -layout(std140) uniform Uniforms { - mat4 u_ModelViewProjectionMatrix; -}; - -layout(location = 0) in vec4 a_Position; -layout(location = 1) in vec2 a_Uv; - -out vec2 v_Uv; - -void main() { - v_Uv = a_Uv; - gl_Position = u_ModelViewProjectionMatrix * a_Position; -} -`, - }, - fragment: { - glsl: ` -uniform samplerCube u_Texture; -in vec2 v_Uv; -out vec4 outputColor; - -void main() { - outputColor = texture(SAMPLER_Cube(u_Texture), v_Uv); -} -`, - }, - }); - - const cubeVertexSize = 4 * 10; // Byte size of one cube vertex. - const cubePositionOffset = 0; - const cubeColorOffset = 4 * 4; // Byte offset of cube vertex color attribute. - const cubeUVOffset = 4 * 8; - const cubeVertexCount = 36; - - const cubeVertexArray = new Float32Array([ - // float4 position, float4 color, float2 uv, - 1, -1, 1, 1, 1, 0, 1, 1, 0, 1, -1, -1, 1, 1, 0, 0, 1, 1, 1, 1, -1, -1, -1, - 1, 0, 0, 0, 1, 1, 0, 1, -1, -1, 1, 1, 0, 0, 1, 0, 0, 1, -1, 1, 1, 1, 0, 1, - 1, 0, 1, -1, -1, -1, 1, 0, 0, 0, 1, 1, 0, - - 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, -1, -1, 1, - 1, 0, 0, 1, 1, 0, 1, 1, -1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, -1, -1, 1, 1, 0, 0, 1, 1, 0, - - -1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, - 1, 0, 1, 1, 0, -1, 1, -1, 1, 0, 1, 0, 1, 0, 0, -1, 1, 1, 1, 0, 1, 1, 1, 0, - 1, 1, 1, -1, 1, 1, 1, 0, 1, 1, 0, - - -1, -1, 1, 1, 0, 0, 1, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, -1, 1, -1, 1, - 0, 1, 0, 1, 1, 0, -1, -1, -1, 1, 0, 0, 0, 1, 0, 0, -1, -1, 1, 1, 0, 0, 1, 1, - 0, 1, -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, - - 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, -1, -1, 1, 1, - 0, 0, 1, 1, 1, 0, -1, -1, 1, 1, 0, 0, 1, 1, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, - 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, - - 1, -1, -1, 1, 1, 0, 0, 1, 0, 1, -1, -1, -1, 1, 0, 0, 0, 1, 1, 1, -1, 1, -1, - 1, 0, 1, 0, 1, 1, 0, 1, 1, -1, 1, 1, 1, 0, 1, 0, 0, 1, -1, -1, 1, 1, 0, 0, - 1, 0, 1, -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, - ]); - - const vertexBuffer = device.createBuffer({ - viewOrSize: cubeVertexArray, - usage: BufferUsage.VERTEX, - }); - - const uniformBuffer = device.createBuffer({ - viewOrSize: 16 * 4, // mat4 - usage: BufferUsage.UNIFORM | BufferUsage.COPY_DST, - hint: BufferFrequencyHint.DYNAMIC, - }); - - const imgSrcs = [ - '/images/posx.jpg', - '/images/negx.jpg', - '/images/posy.jpg', - '/images/negy.jpg', - '/images/posz.jpg', - '/images/negz.jpg', - ]; - const promises = imgSrcs.map(async (src) => { - return loadImage(src); - }); - const imageBitmaps = await Promise.all(promises); - - const texture = device.createTexture({ - pixelFormat: Format.U8_RGBA_NORM, - width: imageBitmaps[0].width, - height: imageBitmaps[0].height, - depth: 6, - dimension: TextureDimension.TEXTURE_CUBE_MAP, - usage: TextureUsage.SAMPLED, - immutable: false, - }); - texture.setImageData(imageBitmaps); - - const sampler = device.createSampler({ - wrapS: WrapMode.CLAMP, - wrapT: WrapMode.CLAMP, - minFilter: TexFilterMode.POINT, - magFilter: TexFilterMode.BILINEAR, - mipFilter: MipFilterMode.LINEAR, - minLOD: 0, - maxLOD: 0, - }); - - const bindingLayouts = [{ numSamplers: 1, numUniformBuffers: 1 }]; - - const inputLayout = device.createInputLayout({ - vertexBufferDescriptors: [ - { - byteStride: cubeVertexSize, - stepMode: VertexStepMode.VERTEX, - }, - ], - vertexAttributeDescriptors: [ - { - location: 0, - bufferIndex: 0, - bufferByteOffset: cubePositionOffset, - format: Format.F32_RGBA, - }, - { - location: 1, - bufferIndex: 0, - bufferByteOffset: cubeUVOffset, - format: Format.F32_RG, - }, - ], - indexBufferFormat: null, - program, - }); - - const pipeline = device.createRenderPipeline({ - bindingLayouts, - inputLayout, - program, - colorAttachmentFormats: [Format.U8_RGBA_RT], - depthStencilAttachmentFormat: Format.D24_S8, - megaStateDescriptor: { - attachmentsState: [ - { - channelWriteMask: ChannelWriteMask.ALL, - rgbBlendState: { - blendMode: BlendMode.ADD, - blendSrcFactor: BlendFactor.SRC_ALPHA, - blendDstFactor: BlendFactor.ONE_MINUS_SRC_ALPHA, - }, - alphaBlendState: { - blendMode: BlendMode.ADD, - blendSrcFactor: BlendFactor.ONE, - blendDstFactor: BlendFactor.ONE_MINUS_SRC_ALPHA, - }, - }, - ], - blendConstant: TransparentBlack, - depthWrite: true, - depthCompare: CompareMode.LESS, - // Since we are seeing from inside of the cube - // and we are using the regular cube geomtry data with outward-facing normals, - // the cullMode should be 'front' or 'none'. - cullMode: CullMode.NONE, - stencilWrite: false, - }, - }); - - const bindings = device.createBindings({ - pipeline, - bindingLayout: bindingLayouts[0], - uniformBufferBindings: [ - { - buffer: uniformBuffer, - wordCount: 16, - }, - ], - samplerBindings: [ - { - texture, - sampler, - }, - ], - }); - - const mainColorRT = device.createRenderTargetFromTexture( - device.createTexture({ - pixelFormat: Format.U8_RGBA_RT, - width: $canvas.width, - height: $canvas.height, - usage: TextureUsage.RENDER_TARGET, - }), - ); - const mainDepthRT = device.createRenderTargetFromTexture( - device.createTexture({ - pixelFormat: Format.D24_S8, - width: $canvas.width, - height: $canvas.height, - usage: TextureUsage.RENDER_TARGET, - }), - ); - - let id; - const modelMatrix = mat4.fromScaling( - mat4.create(), - vec3.fromValues(1000, 1000, 1000), - ); - const modelViewProjectionMatrix = mat4.create(); - const viewMatrix = mat4.identity(mat4.create()); - const tmpMat4 = mat4.create(); - - const frame = () => { - const aspect = $canvas.width / $canvas.height; - const projectionMatrix = mat4.perspective( - mat4.create(), - (2 * Math.PI) / 5, - aspect, - 1, - 3000, - ); - - const now = Date.now() / 800; - - mat4.rotate( - tmpMat4, - viewMatrix, - (Math.PI / 10) * Math.sin(now), - vec3.fromValues(1, 0, 0), - ); - mat4.rotate(tmpMat4, tmpMat4, now * 0.2, vec3.fromValues(0, 1, 0)); - mat4.multiply(modelViewProjectionMatrix, tmpMat4, modelMatrix); - mat4.multiply( - modelViewProjectionMatrix, - projectionMatrix, - modelViewProjectionMatrix, - ); - uniformBuffer.setSubData( - 0, - new Uint8Array((modelViewProjectionMatrix as Float32Array).buffer), - ); - // WebGL1 need this - program.setUniformsLegacy({ - u_ModelViewProjectionMatrix: modelViewProjectionMatrix, - u_Texture: texture, - }); - - /** - * An application should call getCurrentTexture() in the same task that renders to the canvas texture. - * Otherwise, the texture could get destroyed by these steps before the application is finished rendering to it. - */ - const onscreenTexture = swapChain.getOnscreenTexture(); - - const renderPass = device.createRenderPass({ - colorAttachment: [mainColorRT], - colorResolveTo: [onscreenTexture], - colorClearColor: [TransparentWhite], - depthStencilAttachment: mainDepthRT, - depthClearValue: 1, - }); - - renderPass.setPipeline(pipeline); - renderPass.setVertexInput( - inputLayout, - [ - { - buffer: vertexBuffer, - }, - ], - null, - ); - renderPass.setViewport(0, 0, $canvas.width, $canvas.height); - renderPass.setBindings(0, bindings, [0]); - renderPass.draw(cubeVertexCount, 1, 0, 0); - - device.submitPass(renderPass); - id = requestAnimationFrame(frame); - }; - - frame(); - - return () => { - if (id) { - cancelAnimationFrame(id); - } - program.destroy(); - vertexBuffer.destroy(); - uniformBuffer.destroy(); - inputLayout.destroy(); - bindings.destroy(); - pipeline.destroy(); - mainColorRT.destroy(); - mainDepthRT.destroy(); - texture.destroy(); - sampler.destroy(); - device.destroy(); - - // For debug. - device.checkForLeaks(); - }; -} - -(async () => { - let disposeCallback = await render(deviceContributionWebGPU); - - // GUI - const gui = new lil.GUI({ autoPlace: false }); - $container.appendChild(gui.domElement); - const rendererFolder = gui.addFolder('renderer'); - const rendererConfig = { - renderer: 'webgl2', - }; - rendererFolder - .add(rendererConfig, 'renderer', ['webgl1', 'webgl2', 'webgpu']) - .onChange(async (renderer) => { - if (disposeCallback) { - disposeCallback(); - // @ts-ignore - disposeCallback = undefined; - } - - if (renderer === 'webgl1') { - disposeCallback = await render(deviceContributionWebGL1); - } else if (renderer === 'webgl2') { - disposeCallback = await render(deviceContributionWebGL2); - } else if (renderer === 'webgpu') { - disposeCallback = await render(deviceContributionWebGPU); - } - }); - rendererFolder.open(); -})(); diff --git a/site/examples/3d/device/demo/instanced-cubes.ts b/site/examples/3d/device/demo/instanced-cubes.ts deleted file mode 100644 index 940fdfc0d..000000000 --- a/site/examples/3d/device/demo/instanced-cubes.ts +++ /dev/null @@ -1,367 +0,0 @@ -import { WebGLDeviceContribution } from '@antv/g-plugin-webgl-device'; -import { WebGPUDeviceContribution } from '@antv/g-plugin-webgpu-device'; -import { - VertexStepMode, - Format, - TransparentWhite, - BufferUsage, - BufferFrequencyHint, - BlendMode, - BlendFactor, - TextureUsage, - CullMode, - ChannelWriteMask, - TransparentBlack, - CompareMode, -} from '@antv/g-plugin-device-renderer'; -import * as lil from 'lil-gui'; -import { mat4, vec3 } from 'gl-matrix'; - -/** - * @see https://webgpu.github.io/webgpu-samples/samples/instancedCube#main.ts - */ -const deviceContributionWebGL2 = new WebGLDeviceContribution({ - targets: ['webgl2', 'webgl1'], - onContextCreationError: () => {}, - onContextLost: () => {}, - onContextRestored(e) {}, -}); -const deviceContributionWebGPU = new WebGPUDeviceContribution( - { - shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', - }, - // @ts-ignore - { - globalThis: window, - }, -); - -const $container = document.getElementById('container')!; -const $canvasContainer = document.createElement('div'); -$canvasContainer.id = 'canvas'; -$container.appendChild($canvasContainer); - -async function render( - deviceContribution: WebGLDeviceContribution | WebGPUDeviceContribution, -) { - $canvasContainer.innerHTML = ''; - const $canvas = document.createElement('canvas'); - $canvas.width = 1000; - $canvas.height = 1000; - $canvas.style.width = '500px'; - $canvas.style.height = '500px'; - $canvasContainer.appendChild($canvas); - - // create swap chain and get device - const swapChain = await deviceContribution.createSwapChain($canvas); - - // TODO: resize - swapChain.configureSwapChain($canvas.width, $canvas.height); - const device = swapChain.getDevice(); - - const program = device.createProgram({ - vertex: { - glsl: ` -layout(std140) uniform Uniforms { - mat4 u_ModelViewProjectionMatrix[16]; -}; - -layout(location = 0) in vec3 a_Position; - -out vec4 v_Position; - -void main() { - v_Position = vec4(a_Position, 1.0); - gl_Position = u_ModelViewProjectionMatrix[gl_InstanceID] * vec4(a_Position, 1.0); -} -`, - }, - fragment: { - glsl: ` -in vec4 v_Position; -out vec4 outputColor; - -void main() { - outputColor = v_Position; -} -`, - }, - }); - - const cubeVertexSize = 4 * 10; // Byte size of one cube vertex. - const cubePositionOffset = 0; - const cubeColorOffset = 4 * 4; // Byte offset of cube vertex color attribute. - const cubeUVOffset = 4 * 8; - const cubeVertexCount = 36; - - const cubeVertexArray = new Float32Array([ - // float4 position, float4 color, float2 uv, - 1, -1, 1, 1, 1, 0, 1, 1, 0, 1, -1, -1, 1, 1, 0, 0, 1, 1, 1, 1, -1, -1, -1, - 1, 0, 0, 0, 1, 1, 0, 1, -1, -1, 1, 1, 0, 0, 1, 0, 0, 1, -1, 1, 1, 1, 0, 1, - 1, 0, 1, -1, -1, -1, 1, 0, 0, 0, 1, 1, 0, - - 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, -1, -1, 1, - 1, 0, 0, 1, 1, 0, 1, 1, -1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, -1, -1, 1, 1, 0, 0, 1, 1, 0, - - -1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, - 1, 0, 1, 1, 0, -1, 1, -1, 1, 0, 1, 0, 1, 0, 0, -1, 1, 1, 1, 0, 1, 1, 1, 0, - 1, 1, 1, -1, 1, 1, 1, 0, 1, 1, 0, - - -1, -1, 1, 1, 0, 0, 1, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, -1, 1, -1, 1, - 0, 1, 0, 1, 1, 0, -1, -1, -1, 1, 0, 0, 0, 1, 0, 0, -1, -1, 1, 1, 0, 0, 1, 1, - 0, 1, -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, - - 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, -1, -1, 1, 1, - 0, 0, 1, 1, 1, 0, -1, -1, 1, 1, 0, 0, 1, 1, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, - 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, - - 1, -1, -1, 1, 1, 0, 0, 1, 0, 1, -1, -1, -1, 1, 0, 0, 0, 1, 1, 1, -1, 1, -1, - 1, 0, 1, 0, 1, 1, 0, 1, 1, -1, 1, 1, 1, 0, 1, 0, 0, 1, -1, -1, 1, 1, 0, 0, - 1, 0, 1, -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, - ]); - - const xCount = 4; - const yCount = 4; - const numInstances = xCount * yCount; - const matrixFloatCount = 16; // 4x4 matrix - const matrixSize = 4 * matrixFloatCount; - const uniformBufferSize = numInstances * matrixSize; - - const vertexBuffer = device.createBuffer({ - viewOrSize: cubeVertexArray, - usage: BufferUsage.VERTEX, - }); - - const uniformBuffer = device.createBuffer({ - viewOrSize: uniformBufferSize, // mat4 - usage: BufferUsage.UNIFORM | BufferUsage.COPY_DST, - hint: BufferFrequencyHint.DYNAMIC, - }); - - const bindingLayouts = [{ numSamplers: 0, numUniformBuffers: 1 }]; - - const inputLayout = device.createInputLayout({ - vertexBufferDescriptors: [ - { - byteStride: cubeVertexSize, - stepMode: VertexStepMode.VERTEX, - }, - ], - vertexAttributeDescriptors: [ - { - location: 0, - bufferIndex: 0, - bufferByteOffset: 0, - format: Format.F32_RGB, - }, - ], - indexBufferFormat: null, - program, - }); - - const pipeline = device.createRenderPipeline({ - bindingLayouts, - inputLayout, - program, - colorAttachmentFormats: [Format.U8_RGBA_RT], - depthStencilAttachmentFormat: Format.D24_S8, - megaStateDescriptor: { - attachmentsState: [ - { - channelWriteMask: ChannelWriteMask.ALL, - rgbBlendState: { - blendMode: BlendMode.ADD, - blendSrcFactor: BlendFactor.SRC_ALPHA, - blendDstFactor: BlendFactor.ONE_MINUS_SRC_ALPHA, - }, - alphaBlendState: { - blendMode: BlendMode.ADD, - blendSrcFactor: BlendFactor.ONE, - blendDstFactor: BlendFactor.ONE_MINUS_SRC_ALPHA, - }, - }, - ], - blendConstant: TransparentBlack, - depthWrite: true, - depthCompare: CompareMode.LESS, - cullMode: CullMode.BACK, - stencilWrite: false, - }, - }); - - const bindings = device.createBindings({ - pipeline, - bindingLayout: bindingLayouts[0], - uniformBufferBindings: [ - { - buffer: uniformBuffer, - wordCount: matrixFloatCount * numInstances, - }, - ], - samplerBindings: [], - }); - - const mainColorRT = device.createRenderTargetFromTexture( - device.createTexture({ - pixelFormat: Format.U8_RGBA_RT, - width: $canvas.width, - height: $canvas.height, - usage: TextureUsage.RENDER_TARGET, - }), - ); - const mainDepthRT = device.createRenderTargetFromTexture( - device.createTexture({ - pixelFormat: Format.D24_S8, - width: $canvas.width, - height: $canvas.height, - usage: TextureUsage.RENDER_TARGET, - }), - ); - - const aspect = $canvas.width / $canvas.height; - const projectionMatrix = mat4.perspective( - mat4.create(), - (2 * Math.PI) / 5, - aspect, - 1, - 100, - ); - const modelMatrices = new Array(numInstances); - const mvpMatricesData = new Float32Array(matrixFloatCount * numInstances); - - const step = 4.0; - - // Initialize the matrix data for every instance. - let m = 0; - for (let x = 0; x < xCount; x++) { - for (let y = 0; y < yCount; y++) { - modelMatrices[m] = mat4.fromTranslation( - mat4.create(), - vec3.fromValues( - step * (x - xCount / 2 + 0.5), - step * (y - yCount / 2 + 0.5), - 0, - ), - ); - m++; - } - } - - const viewMatrix = mat4.fromTranslation( - mat4.create(), - vec3.fromValues(0, 0, -12), - ); - const tmpMat4 = mat4.create(); - - let id; - const frame = () => { - const now = Date.now() / 1000; - - let m = 0, - i = 0; - for (let x = 0; x < xCount; x++) { - for (let y = 0; y < yCount; y++) { - mat4.rotate( - tmpMat4, - modelMatrices[i], - 1, - vec3.fromValues( - Math.sin((x + 0.5) * now), - Math.cos((y + 0.5) * now), - 0, - ), - ); - - mat4.multiply(tmpMat4, viewMatrix, tmpMat4); - mat4.multiply(tmpMat4, projectionMatrix, tmpMat4); - - mvpMatricesData.set(tmpMat4, m); - - i++; - m += matrixFloatCount; - } - } - - uniformBuffer.setSubData(0, new Uint8Array(mvpMatricesData.buffer)); - - /** - * An application should call getCurrentTexture() in the same task that renders to the canvas texture. - * Otherwise, the texture could get destroyed by these steps before the application is finished rendering to it. - */ - const onscreenTexture = swapChain.getOnscreenTexture(); - - const renderPass = device.createRenderPass({ - colorAttachment: [mainColorRT], - colorResolveTo: [onscreenTexture], - colorClearColor: [TransparentWhite], - depthStencilAttachment: mainDepthRT, - depthClearValue: 1, - }); - - renderPass.setPipeline(pipeline); - renderPass.setVertexInput( - inputLayout, - [ - { - buffer: vertexBuffer, - }, - ], - null, - ); - renderPass.setViewport(0, 0, $canvas.width, $canvas.height); - renderPass.setBindings(0, bindings, [0]); - renderPass.draw(cubeVertexCount, numInstances); - - device.submitPass(renderPass); - id = requestAnimationFrame(frame); - }; - - frame(); - - return () => { - if (id) { - cancelAnimationFrame(id); - } - program.destroy(); - vertexBuffer.destroy(); - uniformBuffer.destroy(); - inputLayout.destroy(); - bindings.destroy(); - pipeline.destroy(); - mainColorRT.destroy(); - mainDepthRT.destroy(); - device.destroy(); - - // For debug. - device.checkForLeaks(); - }; -} - -(async () => { - let disposeCallback = await render(deviceContributionWebGL2); - - // GUI - const gui = new lil.GUI({ autoPlace: false }); - $container.appendChild(gui.domElement); - const rendererFolder = gui.addFolder('renderer'); - const rendererConfig = { - renderer: 'webgl2', - }; - rendererFolder - .add(rendererConfig, 'renderer', ['webgl2', 'webgpu']) - .onChange(async (renderer) => { - if (disposeCallback) { - disposeCallback(); - // @ts-ignore - disposeCallback = undefined; - } - - if (renderer === 'webgl2') { - disposeCallback = await render(deviceContributionWebGL2); - } else if (renderer === 'webgpu') { - disposeCallback = await render(deviceContributionWebGPU); - } - }); - rendererFolder.open(); -})(); diff --git a/site/examples/3d/device/demo/meta.json b/site/examples/3d/device/demo/meta.json deleted file mode 100644 index dcbb55376..000000000 --- a/site/examples/3d/device/demo/meta.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "title": { - "zh": "Device API", - "en": "Device API" - }, - "demos": [ - { - "filename": "primitive-topology-points.ts", - "title": { - "zh": "绘制点 - GL.POINTS", - "en": "GL.POINTS" - }, - "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*WJU8SpnjjkUAAAAAAAAAAAAADmJ7AQ/original" - }, - { - "filename": "primitive-topology-triangles.ts", - "title": { - "zh": "绘制三角形 - GL.TRIANGLES", - "en": "GL.TRIANGLES" - }, - "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*JetpQZ--TzQAAAAAAAAAAAAADmJ7AQ/original" - }, - { - "filename": "rotating-cube.ts", - "title": { - "zh": "旋转的立方体", - "en": "Rotating cube" - }, - "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*ygJNSJCkAWgAAAAAAAAAAAAADmJ7AQ/original" - }, - { - "filename": "textured-cube.ts", - "title": { - "zh": "贴图的立方体", - "en": "Textured cube" - }, - "screenshot": "https://mdn.alipayobjects.com/mdn/huamei_qa8qxu/afts/img/A*xZcvSrlYoE8AAAAAAAAAAAAADmJ7AQ" - }, - { - "filename": "instanced-cubes.ts", - "title": { - "zh": "批量绘制立方体", - "en": "Instanced cubes" - }, - "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*OO5nSL6fcB0AAAAAAAAAAAAADmJ7AQ/original" - }, - { - "filename": "msaa.ts", - "title": { - "zh": "MSAA", - "en": "MSAA" - }, - "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*JetpQZ--TzQAAAAAAAAAAAAADmJ7AQ/original" - }, - { - "filename": "resize-canvas.ts", - "title": { - "zh": "改变 Canvas 尺寸", - "en": "Resize canvas" - }, - "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*JetpQZ--TzQAAAAAAAAAAAAADmJ7AQ/original" - }, - { - "filename": "sampler.ts", - "title": { - "zh": "Sampler", - "en": "Sampler" - }, - "screenshot": "" - }, - { - "filename": "cubemap.ts", - "title": { - "zh": "Cubemap", - "en": "Cubemap" - }, - "screenshot": "" - }, - { - "filename": "compute-boids.ts", - "title": { - "zh": "使用 Compute Shader 仿真", - "en": "Use Compute Shader" - }, - "screenshot": "" - }, - { - "filename": "wgsl.ts", - "title": { - "zh": "直接在 WebGPU 中使用 WGSL 语法", - "en": "Use WGSL" - }, - "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*JetpQZ--TzQAAAAAAAAAAAAADmJ7AQ/original" - } - ] -} diff --git a/site/examples/3d/device/demo/msaa.ts b/site/examples/3d/device/demo/msaa.ts deleted file mode 100644 index def76de53..000000000 --- a/site/examples/3d/device/demo/msaa.ts +++ /dev/null @@ -1,194 +0,0 @@ -import { WebGLDeviceContribution } from '@antv/g-plugin-webgl-device'; -import { WebGPUDeviceContribution } from '@antv/g-plugin-webgpu-device'; -import { - VertexStepMode, - Format, - TransparentWhite, - BufferUsage, - BufferFrequencyHint, -} from '@antv/g-plugin-device-renderer'; -import * as lil from 'lil-gui'; - -/** - * Use multisampled antialiasing (MSAA). - * @see https://github.com/shrekshao/MoveWebGL1EngineToWebGL2/blob/master/Move-a-WebGL-1-Engine-To-WebGL-2-Blog-2.md#multisampled-renderbuffers - * @see https://webgpu.github.io/webgpu-samples/samples/helloTriangleMSAA#main.ts - */ - -const deviceContributionWebGL2 = new WebGLDeviceContribution({ - targets: ['webgl2', 'webgl1'], - onContextCreationError: () => {}, - onContextLost: () => {}, - onContextRestored(e) {}, -}); -const deviceContributionWebGPU = new WebGPUDeviceContribution( - { - shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', - }, - // @ts-ignore - { - globalThis: window, - }, -); - -const $container = document.getElementById('container')!; -const $canvasContainer = document.createElement('div'); -$canvasContainer.id = 'canvas'; -$container.appendChild($canvasContainer); - -async function render( - deviceContribution: WebGLDeviceContribution | WebGPUDeviceContribution, -) { - $canvasContainer.innerHTML = ''; - const $canvas = document.createElement('canvas'); - $canvas.width = 1000; - $canvas.height = 1000; - $canvas.style.width = '500px'; - $canvas.style.height = '500px'; - $canvasContainer.appendChild($canvas); - - // create swap chain and get device - const swapChain = await deviceContribution.createSwapChain($canvas); - - // TODO: resize - swapChain.configureSwapChain($canvas.width, $canvas.height); - const device = swapChain.getDevice(); - - const program = device.createProgram({ - vertex: { - glsl: ` -layout(location = 0) in vec2 a_Position; - -void main() { - gl_Position = vec4(a_Position, 0.0, 1.0); -} -`, - }, - fragment: { - glsl: ` -out vec4 outputColor; - -void main() { - outputColor = vec4(1.0, 0.0, 0.0, 1.0); -} -`, - }, - }); - - const vertexBuffer = device.createBuffer({ - viewOrSize: new Float32Array([0, 0.5, -0.5, -0.5, 0.5, -0.5]), - usage: BufferUsage.VERTEX, - hint: BufferFrequencyHint.DYNAMIC, - }); - device.setResourceName(vertexBuffer, 'a_Position'); - - const inputLayout = device.createInputLayout({ - vertexBufferDescriptors: [ - { - byteStride: 4 * 2, - stepMode: VertexStepMode.VERTEX, - }, - ], - vertexAttributeDescriptors: [ - { - location: 0, - bufferIndex: 0, - bufferByteOffset: 0, - format: Format.F32_RG, - }, - ], - indexBufferFormat: null, - program, - }); - - const pipeline = device.createRenderPipeline({ - inputLayout, - program, - colorAttachmentFormats: [Format.U8_RGBA_RT], - sampleCount: 4, - }); - - const renderTarget = device.createRenderTarget({ - pixelFormat: Format.U8_RGBA_RT, - width: $canvas.width, - height: $canvas.height, - sampleCount: 4, - }); - device.setResourceName(renderTarget, 'Main Render Target'); - - let id; - const frame = () => { - /** - * An application should call getCurrentTexture() in the same task that renders to the canvas texture. - * Otherwise, the texture could get destroyed by these steps before the application is finished rendering to it. - */ - const onscreenTexture = swapChain.getOnscreenTexture(); - - const renderPass = device.createRenderPass({ - colorAttachment: [renderTarget], - colorResolveTo: [onscreenTexture], - colorClearColor: [TransparentWhite], - }); - - renderPass.setPipeline(pipeline); - renderPass.setVertexInput( - inputLayout, - [ - { - buffer: vertexBuffer, - }, - ], - null, - ); - renderPass.setViewport(0, 0, $canvas.width, $canvas.height); - renderPass.draw(3); - - device.submitPass(renderPass); - id = requestAnimationFrame(frame); - }; - - frame(); - - return () => { - if (id) { - cancelAnimationFrame(id); - } - program.destroy(); - vertexBuffer.destroy(); - inputLayout.destroy(); - pipeline.destroy(); - renderTarget.destroy(); - device.destroy(); - - // For debug. - device.checkForLeaks(); - }; -} - -(async () => { - let disposeCallback = await render(deviceContributionWebGL2); - - // GUI - const gui = new lil.GUI({ autoPlace: false }); - $container.appendChild(gui.domElement); - const rendererFolder = gui.addFolder('renderer'); - const rendererConfig = { - renderer: 'webgl2', - }; - rendererFolder - .add(rendererConfig, 'renderer', ['webgl2', 'webgpu']) - .onChange(async (renderer) => { - if (disposeCallback) { - disposeCallback(); - // @ts-ignore - disposeCallback = undefined; - } - - if (renderer === 'webgl2') { - disposeCallback = await render(deviceContributionWebGL2); - } else if (renderer === 'webgpu') { - disposeCallback = await render(deviceContributionWebGPU); - } - }); - rendererFolder.open(); -})(); diff --git a/site/examples/3d/device/demo/primitive-topology-points.ts b/site/examples/3d/device/demo/primitive-topology-points.ts deleted file mode 100644 index c0fda99e1..000000000 --- a/site/examples/3d/device/demo/primitive-topology-points.ts +++ /dev/null @@ -1,184 +0,0 @@ -import { WebGLDeviceContribution } from '@antv/g-plugin-webgl-device'; -import { WebGPUDeviceContribution } from '@antv/g-plugin-webgpu-device'; -import { - VertexStepMode, - Format, - TransparentWhite, - PrimitiveTopology, - BufferUsage, - BufferFrequencyHint, - TextureUsage, -} from '@antv/g-plugin-device-renderer'; -import * as lil from 'lil-gui'; - -/** - * WebGPU doesn't support gl_PointSize - * @see https://github.com/gpuweb/gpuweb/issues/1190 - */ - -const deviceContributionWebGL1 = new WebGLDeviceContribution({ - targets: ['webgl1'], - onContextCreationError: () => {}, - onContextLost: () => {}, - onContextRestored(e) {}, -}); -const deviceContributionWebGL2 = new WebGLDeviceContribution({ - targets: ['webgl2', 'webgl1'], - onContextCreationError: () => {}, - onContextLost: () => {}, - onContextRestored(e) {}, -}); - -const $container = document.getElementById('container')!; -const $canvasContainer = document.createElement('div'); -$canvasContainer.id = 'canvas'; -$container.appendChild($canvasContainer); - -async function render( - deviceContribution: WebGLDeviceContribution | WebGPUDeviceContribution, -) { - $canvasContainer.innerHTML = ''; - const $canvas = document.createElement('canvas'); - $canvas.width = 1000; - $canvas.height = 1000; - $canvas.style.width = '500px'; - $canvas.style.height = '500px'; - $canvasContainer.appendChild($canvas); - - // create swap chain and get device - const swapChain = await deviceContribution.createSwapChain($canvas); - // TODO: resize - swapChain.configureSwapChain($canvas.width, $canvas.height); - const device = swapChain.getDevice(); - - const onscreenTexture = swapChain.getOnscreenTexture(); - - const program = device.createProgram({ - vertex: { - glsl: ` -layout(location = 0) in vec2 a_Position; - -void main() { - gl_Position = vec4(a_Position, 0.0, 1.0); - gl_PointSize = 100.0; -} -`, - }, - fragment: { - glsl: ` -out vec4 outputColor; - -void main() { - outputColor = vec4(1.0, 0.0, 0.0, 1.0); -} -`, - }, - }); - - const vertexBuffer = device.createBuffer({ - viewOrSize: new Float32Array([0, 0.5, -0.5, -0.5, 0.5, -0.5]), - usage: BufferUsage.VERTEX, - hint: BufferFrequencyHint.DYNAMIC, - }); - - const inputLayout = device.createInputLayout({ - vertexBufferDescriptors: [ - { - byteStride: 4 * 2, - stepMode: VertexStepMode.VERTEX, - }, - ], - vertexAttributeDescriptors: [ - { - location: 0, - bufferIndex: 0, - bufferByteOffset: 0, - format: Format.F32_RG, - }, - ], - indexBufferFormat: null, - program, - }); - - const pipeline = device.createRenderPipeline({ - inputLayout, - program, - topology: PrimitiveTopology.POINTS, - colorAttachmentFormats: [Format.U8_RGBA_RT], - }); - - const renderTarget = device.createRenderTargetFromTexture( - device.createTexture({ - pixelFormat: Format.U8_RGBA_RT, - width: $canvas.width, - height: $canvas.height, - usage: TextureUsage.RENDER_TARGET, - }), - ); - - const frame = () => { - const renderPass = device.createRenderPass({ - colorAttachment: [renderTarget], - colorResolveTo: [onscreenTexture], - colorClearColor: [TransparentWhite], - }); - - renderPass.setPipeline(pipeline); - renderPass.setVertexInput( - inputLayout, - [ - { - buffer: vertexBuffer, - }, - ], - null, - ); - renderPass.setViewport(0, 0, $canvas.width, $canvas.height); - renderPass.draw(3); - - device.submitPass(renderPass); - requestAnimationFrame(frame); - }; - - frame(); - - return () => { - program.destroy(); - vertexBuffer.destroy(); - inputLayout.destroy(); - pipeline.destroy(); - renderTarget.destroy(); - device.destroy(); - - // For debug. - device.checkForLeaks(); - }; -} - -(async () => { - let disposeCallback = await render(deviceContributionWebGL2); - - // GUI - const gui = new lil.GUI({ autoPlace: false }); - $container.appendChild(gui.domElement); - const rendererFolder = gui.addFolder('renderer'); - const rendererConfig = { - renderer: 'webgl2', - }; - rendererFolder - .add(rendererConfig, 'renderer', ['webgl1', 'webgl2']) - .onChange(async (renderer) => { - if (disposeCallback) { - disposeCallback(); - // @ts-ignore - disposeCallback = undefined; - } - - if (renderer === 'webgl1') { - disposeCallback = await render(deviceContributionWebGL1); - } else if (renderer === 'webgl2') { - disposeCallback = await render(deviceContributionWebGL2); - } - }); - rendererFolder.open(); -})(); diff --git a/site/examples/3d/device/demo/primitive-topology-triangles.ts b/site/examples/3d/device/demo/primitive-topology-triangles.ts deleted file mode 100644 index 075fcf651..000000000 --- a/site/examples/3d/device/demo/primitive-topology-triangles.ts +++ /dev/null @@ -1,198 +0,0 @@ -import { WebGLDeviceContribution } from '@antv/g-plugin-webgl-device'; -import { WebGPUDeviceContribution } from '@antv/g-plugin-webgpu-device'; -import { - VertexStepMode, - Format, - TransparentWhite, - BufferUsage, - BufferFrequencyHint, - TextureUsage, -} from '@antv/g-plugin-device-renderer'; -import * as lil from 'lil-gui'; - -const deviceContributionWebGL1 = new WebGLDeviceContribution({ - targets: ['webgl1'], - onContextCreationError: () => {}, - onContextLost: () => {}, - onContextRestored(e) {}, -}); -const deviceContributionWebGL2 = new WebGLDeviceContribution({ - targets: ['webgl2', 'webgl1'], - onContextCreationError: () => {}, - onContextLost: () => {}, - onContextRestored(e) {}, -}); -const deviceContributionWebGPU = new WebGPUDeviceContribution( - { - shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', - }, - // @ts-ignore - { - globalThis: window, - }, -); - -const $container = document.getElementById('container')!; -const $canvasContainer = document.createElement('div'); -$canvasContainer.id = 'canvas'; -$container.appendChild($canvasContainer); - -async function render( - deviceContribution: WebGLDeviceContribution | WebGPUDeviceContribution, -) { - $canvasContainer.innerHTML = ''; - const $canvas = document.createElement('canvas'); - $canvas.width = 1000; - $canvas.height = 1000; - $canvas.style.width = '500px'; - $canvas.style.height = '500px'; - $canvasContainer.appendChild($canvas); - - // create swap chain and get device - const swapChain = await deviceContribution.createSwapChain($canvas); - - // TODO: resize - swapChain.configureSwapChain($canvas.width, $canvas.height); - const device = swapChain.getDevice(); - - const program = device.createProgram({ - vertex: { - glsl: ` -layout(location = 0) in vec2 a_Position; - -void main() { - gl_Position = vec4(a_Position, 0.0, 1.0); -} -`, - }, - fragment: { - glsl: ` -out vec4 outputColor; - -void main() { - outputColor = vec4(1.0, 0.0, 0.0, 1.0); -} -`, - }, - }); - - const vertexBuffer = device.createBuffer({ - viewOrSize: new Float32Array([0, 0.5, -0.5, -0.5, 0.5, -0.5]), - usage: BufferUsage.VERTEX, - hint: BufferFrequencyHint.DYNAMIC, - }); - device.setResourceName(vertexBuffer, 'a_Position'); - - const inputLayout = device.createInputLayout({ - vertexBufferDescriptors: [ - { - byteStride: 4 * 2, - stepMode: VertexStepMode.VERTEX, - }, - ], - vertexAttributeDescriptors: [ - { - location: 0, - bufferIndex: 0, - bufferByteOffset: 0, - format: Format.F32_RG, - }, - ], - indexBufferFormat: null, - program, - }); - - const pipeline = device.createRenderPipeline({ - inputLayout, - program, - colorAttachmentFormats: [Format.U8_RGBA_RT], - }); - - const renderTarget = device.createRenderTargetFromTexture( - device.createTexture({ - pixelFormat: Format.U8_RGBA_RT, - width: $canvas.width, - height: $canvas.height, - usage: TextureUsage.RENDER_TARGET, - }), - ); - device.setResourceName(renderTarget, 'Main Render Target'); - - let id; - const frame = () => { - /** - * An application should call getCurrentTexture() in the same task that renders to the canvas texture. - * Otherwise, the texture could get destroyed by these steps before the application is finished rendering to it. - */ - const onscreenTexture = swapChain.getOnscreenTexture(); - - const renderPass = device.createRenderPass({ - colorAttachment: [renderTarget], - colorResolveTo: [onscreenTexture], - colorClearColor: [TransparentWhite], - }); - - renderPass.setPipeline(pipeline); - renderPass.setVertexInput( - inputLayout, - [ - { - buffer: vertexBuffer, - }, - ], - null, - ); - renderPass.setViewport(0, 0, $canvas.width, $canvas.height); - renderPass.draw(3); - - device.submitPass(renderPass); - id = requestAnimationFrame(frame); - }; - - frame(); - - return () => { - if (id) { - cancelAnimationFrame(id); - } - program.destroy(); - vertexBuffer.destroy(); - inputLayout.destroy(); - pipeline.destroy(); - renderTarget.destroy(); - device.destroy(); - - // For debug. - device.checkForLeaks(); - }; -} - -(async () => { - let disposeCallback = await render(deviceContributionWebGL2); - - // GUI - const gui = new lil.GUI({ autoPlace: false }); - $container.appendChild(gui.domElement); - const rendererFolder = gui.addFolder('renderer'); - const rendererConfig = { - renderer: 'webgl2', - }; - rendererFolder - .add(rendererConfig, 'renderer', ['webgl1', 'webgl2', 'webgpu']) - .onChange(async (renderer) => { - if (disposeCallback) { - disposeCallback(); - // @ts-ignore - disposeCallback = undefined; - } - - if (renderer === 'webgl1') { - disposeCallback = await render(deviceContributionWebGL1); - } else if (renderer === 'webgl2') { - disposeCallback = await render(deviceContributionWebGL2); - } else if (renderer === 'webgpu') { - disposeCallback = await render(deviceContributionWebGPU); - } - }); - rendererFolder.open(); -})(); diff --git a/site/examples/3d/device/demo/resize-canvas.ts b/site/examples/3d/device/demo/resize-canvas.ts deleted file mode 100644 index 9ac18e4cf..000000000 --- a/site/examples/3d/device/demo/resize-canvas.ts +++ /dev/null @@ -1,208 +0,0 @@ -import { WebGLDeviceContribution } from '@antv/g-plugin-webgl-device'; -import { WebGPUDeviceContribution } from '@antv/g-plugin-webgpu-device'; -import { - VertexStepMode, - Format, - TransparentWhite, - BufferUsage, - BufferFrequencyHint, -} from '@antv/g-plugin-device-renderer'; -import * as lil from 'lil-gui'; - -/** - * @see https://webgpu.github.io/webgpu-samples/samples/resizeCanvas#main.ts - */ - -const deviceContributionWebGL2 = new WebGLDeviceContribution({ - targets: ['webgl2', 'webgl1'], - onContextCreationError: () => {}, - onContextLost: () => {}, - onContextRestored(e) {}, -}); -const deviceContributionWebGPU = new WebGPUDeviceContribution( - { - shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', - }, - // @ts-ignore - { - globalThis: window, - }, -); - -const $container = document.getElementById('container')!; -const $canvasContainer = document.createElement('div'); -$canvasContainer.id = 'canvas'; -$container.appendChild($canvasContainer); - -async function render( - deviceContribution: WebGLDeviceContribution | WebGPUDeviceContribution, -) { - $canvasContainer.innerHTML = ''; - const $canvas = document.createElement('canvas'); - $canvas.classList.add('animatedCanvasSize'); - $canvas.width = 1000; - $canvas.height = 1000; - $canvas.style.width = '500px'; - $canvas.style.height = '500px'; - $canvasContainer.appendChild($canvas); - - // create swap chain and get device - const swapChain = await deviceContribution.createSwapChain($canvas); - swapChain.configureSwapChain($canvas.width, $canvas.height); - const device = swapChain.getDevice(); - - const program = device.createProgram({ - vertex: { - glsl: ` -layout(location = 0) in vec2 a_Position; - -void main() { - gl_Position = vec4(a_Position, 0.0, 1.0); -} -`, - }, - fragment: { - glsl: ` -out vec4 outputColor; - -void main() { - outputColor = vec4(1.0, 0.0, 0.0, 1.0); -} -`, - }, - }); - - const vertexBuffer = device.createBuffer({ - viewOrSize: new Float32Array([0, 0.5, -0.5, -0.5, 0.5, -0.5]), - usage: BufferUsage.VERTEX, - hint: BufferFrequencyHint.DYNAMIC, - }); - device.setResourceName(vertexBuffer, 'a_Position'); - - const inputLayout = device.createInputLayout({ - vertexBufferDescriptors: [ - { - byteStride: 4 * 2, - stepMode: VertexStepMode.VERTEX, - }, - ], - vertexAttributeDescriptors: [ - { - location: 0, - bufferIndex: 0, - bufferByteOffset: 0, - format: Format.F32_RG, - }, - ], - indexBufferFormat: null, - program, - }); - - const pipeline = device.createRenderPipeline({ - inputLayout, - program, - colorAttachmentFormats: [Format.U8_RGBA_RT], - sampleCount: 4, - }); - - let renderTarget = device.createRenderTarget({ - pixelFormat: Format.U8_RGBA_RT, - width: $canvas.width, - height: $canvas.height, - sampleCount: 4, - }); - - let id; - const frame = () => { - const currentWidth = $canvas.clientWidth * devicePixelRatio; - const currentHeight = $canvas.clientHeight * devicePixelRatio; - - $canvas.width = currentWidth; - $canvas.height = currentHeight; - - swapChain.configureSwapChain($canvas.width, $canvas.height); - - if (renderTarget) { - renderTarget.destroy(); - renderTarget = device.createRenderTarget({ - pixelFormat: Format.U8_RGBA_RT, - width: $canvas.width, - height: $canvas.height, - sampleCount: 4, - }); - } - - /** - * An application should call getCurrentTexture() in the same task that renders to the canvas texture. - * Otherwise, the texture could get destroyed by these steps before the application is finished rendering to it. - */ - const onscreenTexture = swapChain.getOnscreenTexture(); - - const renderPass = device.createRenderPass({ - colorAttachment: [renderTarget], - colorResolveTo: [onscreenTexture], - colorClearColor: [TransparentWhite], - }); - - renderPass.setPipeline(pipeline); - renderPass.setVertexInput( - inputLayout, - [ - { - buffer: vertexBuffer, - }, - ], - null, - ); - renderPass.setViewport(0, 0, $canvas.width, $canvas.height); - renderPass.draw(3); - - device.submitPass(renderPass); - id = requestAnimationFrame(frame); - }; - - frame(); - - return () => { - if (id) { - cancelAnimationFrame(id); - } - program.destroy(); - vertexBuffer.destroy(); - inputLayout.destroy(); - pipeline.destroy(); - renderTarget.destroy(); - device.destroy(); - - // For debug. - device.checkForLeaks(); - }; -} - -(async () => { - let disposeCallback = await render(deviceContributionWebGL2); - - // GUI - const gui = new lil.GUI({ autoPlace: false }); - $container.appendChild(gui.domElement); - const rendererFolder = gui.addFolder('renderer'); - const rendererConfig = { - renderer: 'webgl2', - }; - rendererFolder - .add(rendererConfig, 'renderer', ['webgl2', 'webgpu']) - .onChange(async (renderer) => { - if (disposeCallback) { - disposeCallback(); - // @ts-ignore - disposeCallback = undefined; - } - - if (renderer === 'webgl2') { - disposeCallback = await render(deviceContributionWebGL2); - } else if (renderer === 'webgpu') { - disposeCallback = await render(deviceContributionWebGPU); - } - }); - rendererFolder.open(); -})(); diff --git a/site/examples/3d/device/demo/rotating-cube.ts b/site/examples/3d/device/demo/rotating-cube.ts deleted file mode 100644 index 376b9c65d..000000000 --- a/site/examples/3d/device/demo/rotating-cube.ts +++ /dev/null @@ -1,334 +0,0 @@ -import { WebGLDeviceContribution } from '@antv/g-plugin-webgl-device'; -import { WebGPUDeviceContribution } from '@antv/g-plugin-webgpu-device'; -import { - VertexStepMode, - Format, - TransparentWhite, - BufferUsage, - BufferFrequencyHint, - BlendMode, - BlendFactor, - TextureUsage, - CullMode, - ChannelWriteMask, - TransparentBlack, - CompareMode, -} from '@antv/g-plugin-device-renderer'; -import * as lil from 'lil-gui'; -import { mat4, vec3 } from 'gl-matrix'; - -/** - * @see https://webgpu.github.io/webgpu-samples/samples/rotatingCube - */ - -const deviceContributionWebGL1 = new WebGLDeviceContribution({ - targets: ['webgl1'], - onContextCreationError: () => {}, - onContextLost: () => {}, - onContextRestored(e) {}, -}); -const deviceContributionWebGL2 = new WebGLDeviceContribution({ - targets: ['webgl2', 'webgl1'], - onContextCreationError: () => {}, - onContextLost: () => {}, - onContextRestored(e) {}, -}); -const deviceContributionWebGPU = new WebGPUDeviceContribution( - { - shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', - }, - // @ts-ignore - { - globalThis: window, - }, -); - -const $container = document.getElementById('container')!; -const $canvasContainer = document.createElement('div'); -$canvasContainer.id = 'canvas'; -$container.appendChild($canvasContainer); - -async function render( - deviceContribution: WebGLDeviceContribution | WebGPUDeviceContribution, -) { - $canvasContainer.innerHTML = ''; - const $canvas = document.createElement('canvas'); - $canvas.width = 1000; - $canvas.height = 1000; - $canvas.style.width = '500px'; - $canvas.style.height = '500px'; - $canvasContainer.appendChild($canvas); - - // create swap chain and get device - const swapChain = await deviceContribution.createSwapChain($canvas); - - // TODO: resize - swapChain.configureSwapChain($canvas.width, $canvas.height); - const device = swapChain.getDevice(); - - const program = device.createProgram({ - vertex: { - glsl: ` -layout(std140) uniform Uniforms { - mat4 u_ModelViewProjectionMatrix; -}; - -layout(location = 0) in vec3 a_Position; - -out vec4 v_Position; - -void main() { - v_Position = vec4(a_Position, 1.0); - gl_Position = u_ModelViewProjectionMatrix * vec4(a_Position, 1.0); -} -`, - }, - fragment: { - glsl: ` -in vec4 v_Position; -out vec4 outputColor; - -void main() { - outputColor = v_Position; -} -`, - }, - }); - - const cubeVertexSize = 4 * 10; // Byte size of one cube vertex. - const cubePositionOffset = 0; - const cubeColorOffset = 4 * 4; // Byte offset of cube vertex color attribute. - const cubeUVOffset = 4 * 8; - const cubeVertexCount = 36; - - const cubeVertexArray = new Float32Array([ - // float4 position, float4 color, float2 uv, - 1, -1, 1, 1, 1, 0, 1, 1, 0, 1, -1, -1, 1, 1, 0, 0, 1, 1, 1, 1, -1, -1, -1, - 1, 0, 0, 0, 1, 1, 0, 1, -1, -1, 1, 1, 0, 0, 1, 0, 0, 1, -1, 1, 1, 1, 0, 1, - 1, 0, 1, -1, -1, -1, 1, 0, 0, 0, 1, 1, 0, - - 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, -1, -1, 1, - 1, 0, 0, 1, 1, 0, 1, 1, -1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, -1, -1, 1, 1, 0, 0, 1, 1, 0, - - -1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, - 1, 0, 1, 1, 0, -1, 1, -1, 1, 0, 1, 0, 1, 0, 0, -1, 1, 1, 1, 0, 1, 1, 1, 0, - 1, 1, 1, -1, 1, 1, 1, 0, 1, 1, 0, - - -1, -1, 1, 1, 0, 0, 1, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, -1, 1, -1, 1, - 0, 1, 0, 1, 1, 0, -1, -1, -1, 1, 0, 0, 0, 1, 0, 0, -1, -1, 1, 1, 0, 0, 1, 1, - 0, 1, -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, - - 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, -1, -1, 1, 1, - 0, 0, 1, 1, 1, 0, -1, -1, 1, 1, 0, 0, 1, 1, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, - 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, - - 1, -1, -1, 1, 1, 0, 0, 1, 0, 1, -1, -1, -1, 1, 0, 0, 0, 1, 1, 1, -1, 1, -1, - 1, 0, 1, 0, 1, 1, 0, 1, 1, -1, 1, 1, 1, 0, 1, 0, 0, 1, -1, -1, 1, 1, 0, 0, - 1, 0, 1, -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, - ]); - - const vertexBuffer = device.createBuffer({ - viewOrSize: cubeVertexArray, - usage: BufferUsage.VERTEX, - // hint: BufferFrequencyHint.DYNAMIC, - }); - - const uniformBuffer = device.createBuffer({ - viewOrSize: 16 * 4, // mat4 - usage: BufferUsage.UNIFORM | BufferUsage.COPY_DST, - hint: BufferFrequencyHint.DYNAMIC, - }); - - const bindingLayouts = [{ numSamplers: 0, numUniformBuffers: 1 }]; - - const inputLayout = device.createInputLayout({ - vertexBufferDescriptors: [ - { - byteStride: cubeVertexSize, - stepMode: VertexStepMode.VERTEX, - }, - ], - vertexAttributeDescriptors: [ - { - location: 0, - bufferIndex: 0, - bufferByteOffset: 0, - format: Format.F32_RGB, - }, - ], - indexBufferFormat: null, - program, - }); - - const pipeline = device.createRenderPipeline({ - bindingLayouts, - inputLayout, - program, - colorAttachmentFormats: [Format.U8_RGBA_RT], - depthStencilAttachmentFormat: Format.D24_S8, - megaStateDescriptor: { - attachmentsState: [ - { - channelWriteMask: ChannelWriteMask.ALL, - rgbBlendState: { - blendMode: BlendMode.ADD, - blendSrcFactor: BlendFactor.SRC_ALPHA, - blendDstFactor: BlendFactor.ONE_MINUS_SRC_ALPHA, - }, - alphaBlendState: { - blendMode: BlendMode.ADD, - blendSrcFactor: BlendFactor.ONE, - blendDstFactor: BlendFactor.ONE_MINUS_SRC_ALPHA, - }, - }, - ], - blendConstant: TransparentBlack, - depthWrite: true, - depthCompare: CompareMode.LESS, - cullMode: CullMode.BACK, - stencilWrite: false, - }, - }); - - const bindings = device.createBindings({ - pipeline, - bindingLayout: bindingLayouts[0], - uniformBufferBindings: [ - { - buffer: uniformBuffer, - wordCount: 16, - }, - ], - samplerBindings: [], - }); - - const mainColorRT = device.createRenderTargetFromTexture( - device.createTexture({ - pixelFormat: Format.U8_RGBA_RT, - width: $canvas.width, - height: $canvas.height, - usage: TextureUsage.RENDER_TARGET, - }), - ); - const mainDepthRT = device.createRenderTargetFromTexture( - device.createTexture({ - pixelFormat: Format.D24_S8, - width: $canvas.width, - height: $canvas.height, - usage: TextureUsage.RENDER_TARGET, - }), - ); - - let id; - const frame = () => { - const aspect = $canvas.width / $canvas.height; - const projectionMatrix = mat4.perspective( - mat4.create(), - (2 * Math.PI) / 5, - aspect, - 0.1, - 1000, - ); - const viewMatrix = mat4.identity(mat4.create()); - const modelViewProjectionMatrix = mat4.create(); - mat4.translate(viewMatrix, viewMatrix, vec3.fromValues(0, 0, -4)); - const now = Date.now() / 1000; - mat4.rotate( - viewMatrix, - viewMatrix, - 1, - vec3.fromValues(Math.sin(now), Math.cos(now), 0), - ); - mat4.multiply(modelViewProjectionMatrix, projectionMatrix, viewMatrix); - uniformBuffer.setSubData( - 0, - new Uint8Array((modelViewProjectionMatrix as Float32Array).buffer), - ); - // WebGL1 need this - program.setUniformsLegacy({ - u_ModelViewProjectionMatrix: modelViewProjectionMatrix, - }); - - /** - * An application should call getCurrentTexture() in the same task that renders to the canvas texture. - * Otherwise, the texture could get destroyed by these steps before the application is finished rendering to it. - */ - const onscreenTexture = swapChain.getOnscreenTexture(); - - const renderPass = device.createRenderPass({ - colorAttachment: [mainColorRT], - colorResolveTo: [onscreenTexture], - colorClearColor: [TransparentWhite], - depthStencilAttachment: mainDepthRT, - depthClearValue: 1, - }); - - renderPass.setPipeline(pipeline); - renderPass.setVertexInput( - inputLayout, - [ - { - buffer: vertexBuffer, - }, - ], - null, - ); - renderPass.setViewport(0, 0, $canvas.width, $canvas.height); - renderPass.setBindings(0, bindings, [0]); - renderPass.draw(cubeVertexCount); - - device.submitPass(renderPass); - id = requestAnimationFrame(frame); - }; - - frame(); - - return () => { - if (id) { - cancelAnimationFrame(id); - } - program.destroy(); - vertexBuffer.destroy(); - uniformBuffer.destroy(); - inputLayout.destroy(); - bindings.destroy(); - pipeline.destroy(); - mainColorRT.destroy(); - mainDepthRT.destroy(); - device.destroy(); - - // For debug. - device.checkForLeaks(); - }; -} - -(async () => { - let disposeCallback = await render(deviceContributionWebGL2); - - // GUI - const gui = new lil.GUI({ autoPlace: false }); - $container.appendChild(gui.domElement); - const rendererFolder = gui.addFolder('renderer'); - const rendererConfig = { - renderer: 'webgl2', - }; - rendererFolder - .add(rendererConfig, 'renderer', ['webgl1', 'webgl2', 'webgpu']) - .onChange(async (renderer) => { - if (disposeCallback) { - disposeCallback(); - // @ts-ignore - disposeCallback = undefined; - } - - if (renderer === 'webgl1') { - disposeCallback = await render(deviceContributionWebGL1); - } else if (renderer === 'webgl2') { - disposeCallback = await render(deviceContributionWebGL2); - } else if (renderer === 'webgpu') { - disposeCallback = await render(deviceContributionWebGPU); - } - }); - rendererFolder.open(); -})(); diff --git a/site/examples/3d/device/demo/sampler.ts b/site/examples/3d/device/demo/sampler.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/site/examples/3d/device/demo/textured-cube.ts b/site/examples/3d/device/demo/textured-cube.ts deleted file mode 100644 index f071d732c..000000000 --- a/site/examples/3d/device/demo/textured-cube.ts +++ /dev/null @@ -1,389 +0,0 @@ -import { WebGLDeviceContribution } from '@antv/g-plugin-webgl-device'; -import { WebGPUDeviceContribution } from '@antv/g-plugin-webgpu-device'; -import { - VertexStepMode, - Format, - TransparentWhite, - BufferUsage, - BufferFrequencyHint, - BlendMode, - BlendFactor, - TextureUsage, - CullMode, - ChannelWriteMask, - TransparentBlack, - CompareMode, - WrapMode, - TexFilterMode, - MipFilterMode, -} from '@antv/g-plugin-device-renderer'; -import * as lil from 'lil-gui'; -import { mat4, vec3 } from 'gl-matrix'; - -/** - * @see https://webgpu.github.io/webgpu-samples/samples/texturedCube - */ - -const deviceContributionWebGL1 = new WebGLDeviceContribution({ - targets: ['webgl1'], - onContextCreationError: () => {}, - onContextLost: () => {}, - onContextRestored(e) {}, -}); -const deviceContributionWebGL2 = new WebGLDeviceContribution({ - targets: ['webgl2', 'webgl1'], - onContextCreationError: () => {}, - onContextLost: () => {}, - onContextRestored(e) {}, -}); -const deviceContributionWebGPU = new WebGPUDeviceContribution( - { - shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', - }, - // @ts-ignore - { - globalThis: window, - }, -); - -const $container = document.getElementById('container')!; -const $canvasContainer = document.createElement('div'); -$canvasContainer.id = 'canvas'; -$container.appendChild($canvasContainer); - -async function loadImage(url: string) { - if (!!window.createImageBitmap) { - const response = await fetch(url); - const imageBitmap = await createImageBitmap(await response.blob()); - return imageBitmap; - } else { - const image = new window.Image(); - return new Promise((res) => { - image.onload = () => res(image); - image.src = url; - image.crossOrigin = 'Anonymous'; - }); - } -} - -async function render( - deviceContribution: WebGLDeviceContribution | WebGPUDeviceContribution, -) { - $canvasContainer.innerHTML = ''; - const $canvas = document.createElement('canvas'); - $canvas.width = 1000; - $canvas.height = 1000; - $canvas.style.width = '500px'; - $canvas.style.height = '500px'; - $canvasContainer.appendChild($canvas); - - // create swap chain and get device - const swapChain = await deviceContribution.createSwapChain($canvas); - - // TODO: resize - swapChain.configureSwapChain($canvas.width, $canvas.height); - const device = swapChain.getDevice(); - - const program = device.createProgram({ - vertex: { - glsl: ` -layout(std140) uniform Uniforms { - mat4 u_ModelViewProjectionMatrix; -}; - -layout(location = 0) in vec4 a_Position; -layout(location = 1) in vec2 a_Uv; - -out vec2 v_Uv; - -void main() { - v_Uv = a_Uv; - gl_Position = u_ModelViewProjectionMatrix * a_Position; -} -`, - }, - fragment: { - glsl: ` -uniform sampler2D u_Texture; -in vec2 v_Uv; -out vec4 outputColor; - -void main() { - outputColor = texture(SAMPLER_2D(u_Texture), v_Uv); -} -`, - }, - }); - - const cubeVertexSize = 4 * 10; // Byte size of one cube vertex. - const cubePositionOffset = 0; - const cubeColorOffset = 4 * 4; // Byte offset of cube vertex color attribute. - const cubeUVOffset = 4 * 8; - const cubeVertexCount = 36; - - const cubeVertexArray = new Float32Array([ - // float4 position, float4 color, float2 uv, - 1, -1, 1, 1, 1, 0, 1, 1, 0, 1, -1, -1, 1, 1, 0, 0, 1, 1, 1, 1, -1, -1, -1, - 1, 0, 0, 0, 1, 1, 0, 1, -1, -1, 1, 1, 0, 0, 1, 0, 0, 1, -1, 1, 1, 1, 0, 1, - 1, 0, 1, -1, -1, -1, 1, 0, 0, 0, 1, 1, 0, - - 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, -1, -1, 1, - 1, 0, 0, 1, 1, 0, 1, 1, -1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, -1, -1, 1, 1, 0, 0, 1, 1, 0, - - -1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, - 1, 0, 1, 1, 0, -1, 1, -1, 1, 0, 1, 0, 1, 0, 0, -1, 1, 1, 1, 0, 1, 1, 1, 0, - 1, 1, 1, -1, 1, 1, 1, 0, 1, 1, 0, - - -1, -1, 1, 1, 0, 0, 1, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, -1, 1, -1, 1, - 0, 1, 0, 1, 1, 0, -1, -1, -1, 1, 0, 0, 0, 1, 0, 0, -1, -1, 1, 1, 0, 0, 1, 1, - 0, 1, -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, - - 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, -1, -1, 1, 1, - 0, 0, 1, 1, 1, 0, -1, -1, 1, 1, 0, 0, 1, 1, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, - 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, - - 1, -1, -1, 1, 1, 0, 0, 1, 0, 1, -1, -1, -1, 1, 0, 0, 0, 1, 1, 1, -1, 1, -1, - 1, 0, 1, 0, 1, 1, 0, 1, 1, -1, 1, 1, 1, 0, 1, 0, 0, 1, -1, -1, 1, 1, 0, 0, - 1, 0, 1, -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, - ]); - - const vertexBuffer = device.createBuffer({ - viewOrSize: cubeVertexArray, - usage: BufferUsage.VERTEX, - }); - - const uniformBuffer = device.createBuffer({ - viewOrSize: 16 * 4, // mat4 - usage: BufferUsage.UNIFORM | BufferUsage.COPY_DST, - hint: BufferFrequencyHint.DYNAMIC, - }); - - const imageBitmap = await loadImage( - 'https://gw.alipayobjects.com/mdn/rms_6ae20b/afts/img/A*_aqoS73Se3sAAAAAAAAAAAAAARQnAQ', - ); - const texture = device.createTexture({ - pixelFormat: Format.U8_RGBA_NORM, - width: imageBitmap.width, - height: imageBitmap.height, - usage: TextureUsage.SAMPLED, - immutable: false, - }); - texture.setImageData([imageBitmap]); - - const sampler = device.createSampler({ - wrapS: WrapMode.CLAMP, - wrapT: WrapMode.CLAMP, - minFilter: TexFilterMode.POINT, - magFilter: TexFilterMode.BILINEAR, - mipFilter: MipFilterMode.LINEAR, - minLOD: 0, - maxLOD: 0, - }); - - const bindingLayouts = [{ numSamplers: 1, numUniformBuffers: 1 }]; - - const inputLayout = device.createInputLayout({ - vertexBufferDescriptors: [ - { - byteStride: cubeVertexSize, - stepMode: VertexStepMode.VERTEX, - }, - ], - vertexAttributeDescriptors: [ - { - location: 0, - bufferIndex: 0, - bufferByteOffset: cubePositionOffset, - format: Format.F32_RGBA, - }, - { - location: 1, - bufferIndex: 0, - bufferByteOffset: cubeUVOffset, - format: Format.F32_RG, - }, - ], - indexBufferFormat: null, - program, - }); - - const pipeline = device.createRenderPipeline({ - bindingLayouts, - inputLayout, - program, - colorAttachmentFormats: [Format.U8_RGBA_RT], - depthStencilAttachmentFormat: Format.D24_S8, - megaStateDescriptor: { - attachmentsState: [ - { - channelWriteMask: ChannelWriteMask.ALL, - rgbBlendState: { - blendMode: BlendMode.ADD, - blendSrcFactor: BlendFactor.SRC_ALPHA, - blendDstFactor: BlendFactor.ONE_MINUS_SRC_ALPHA, - }, - alphaBlendState: { - blendMode: BlendMode.ADD, - blendSrcFactor: BlendFactor.ONE, - blendDstFactor: BlendFactor.ONE_MINUS_SRC_ALPHA, - }, - }, - ], - blendConstant: TransparentBlack, - depthWrite: true, - depthCompare: CompareMode.LESS, - cullMode: CullMode.BACK, - stencilWrite: false, - }, - }); - - const bindings = device.createBindings({ - pipeline, - bindingLayout: bindingLayouts[0], - uniformBufferBindings: [ - { - buffer: uniformBuffer, - wordCount: 16, - }, - ], - samplerBindings: [ - { - texture, - sampler, - }, - ], - }); - - const mainColorRT = device.createRenderTargetFromTexture( - device.createTexture({ - pixelFormat: Format.U8_RGBA_RT, - width: $canvas.width, - height: $canvas.height, - usage: TextureUsage.RENDER_TARGET, - }), - ); - const mainDepthRT = device.createRenderTargetFromTexture( - device.createTexture({ - pixelFormat: Format.D24_S8, - width: $canvas.width, - height: $canvas.height, - usage: TextureUsage.RENDER_TARGET, - }), - ); - - let id; - const frame = () => { - const aspect = $canvas.width / $canvas.height; - const projectionMatrix = mat4.perspective( - mat4.create(), - (2 * Math.PI) / 5, - aspect, - 0.1, - 1000, - ); - const viewMatrix = mat4.identity(mat4.create()); - const modelViewProjectionMatrix = mat4.create(); - mat4.translate(viewMatrix, viewMatrix, vec3.fromValues(0, 0, -4)); - const now = Date.now() / 1000; - mat4.rotate( - viewMatrix, - viewMatrix, - 1, - vec3.fromValues(Math.sin(now), Math.cos(now), 0), - ); - mat4.multiply(modelViewProjectionMatrix, projectionMatrix, viewMatrix); - uniformBuffer.setSubData( - 0, - new Uint8Array((modelViewProjectionMatrix as Float32Array).buffer), - ); - // WebGL1 need this - program.setUniformsLegacy({ - u_ModelViewProjectionMatrix: modelViewProjectionMatrix, - u_Texture: texture, - }); - - /** - * An application should call getCurrentTexture() in the same task that renders to the canvas texture. - * Otherwise, the texture could get destroyed by these steps before the application is finished rendering to it. - */ - const onscreenTexture = swapChain.getOnscreenTexture(); - - const renderPass = device.createRenderPass({ - colorAttachment: [mainColorRT], - colorResolveTo: [onscreenTexture], - colorClearColor: [TransparentWhite], - depthStencilAttachment: mainDepthRT, - depthClearValue: 1, - }); - - renderPass.setPipeline(pipeline); - renderPass.setVertexInput( - inputLayout, - [ - { - buffer: vertexBuffer, - }, - ], - null, - ); - renderPass.setViewport(0, 0, $canvas.width, $canvas.height); - renderPass.setBindings(0, bindings, [0]); - renderPass.draw(cubeVertexCount); - - device.submitPass(renderPass); - id = requestAnimationFrame(frame); - }; - - frame(); - - return () => { - if (id) { - cancelAnimationFrame(id); - } - program.destroy(); - vertexBuffer.destroy(); - uniformBuffer.destroy(); - inputLayout.destroy(); - bindings.destroy(); - pipeline.destroy(); - mainColorRT.destroy(); - mainDepthRT.destroy(); - texture.destroy(); - sampler.destroy(); - device.destroy(); - - // For debug. - device.checkForLeaks(); - }; -} - -(async () => { - let disposeCallback = await render(deviceContributionWebGPU); - - // GUI - const gui = new lil.GUI({ autoPlace: false }); - $container.appendChild(gui.domElement); - const rendererFolder = gui.addFolder('renderer'); - const rendererConfig = { - renderer: 'webgl2', - }; - rendererFolder - .add(rendererConfig, 'renderer', ['webgl1', 'webgl2', 'webgpu']) - .onChange(async (renderer) => { - if (disposeCallback) { - disposeCallback(); - // @ts-ignore - disposeCallback = undefined; - } - - if (renderer === 'webgl1') { - disposeCallback = await render(deviceContributionWebGL1); - } else if (renderer === 'webgl2') { - disposeCallback = await render(deviceContributionWebGL2); - } else if (renderer === 'webgpu') { - disposeCallback = await render(deviceContributionWebGPU); - } - }); - rendererFolder.open(); -})(); diff --git a/site/examples/3d/device/demo/wgsl.ts b/site/examples/3d/device/demo/wgsl.ts deleted file mode 100644 index 7e471642a..000000000 --- a/site/examples/3d/device/demo/wgsl.ts +++ /dev/null @@ -1,163 +0,0 @@ -import { WebGPUDeviceContribution } from '@antv/g-plugin-webgpu-device'; -import { - VertexStepMode, - Format, - TransparentWhite, - BufferUsage, - BufferFrequencyHint, -} from '@antv/g-plugin-device-renderer'; - -/** - * Draw a triangle - * @see https://webgpu.github.io/webgpu-samples/samples/helloTriangle - */ - -const deviceContributionWebGPU = new WebGPUDeviceContribution( - { - shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', - }, - // @ts-ignore - { - globalThis: window, - }, -); - -const $container = document.getElementById('container')!; -const $canvasContainer = document.createElement('div'); -$canvasContainer.id = 'canvas'; -$container.appendChild($canvasContainer); - -async function render(deviceContribution: WebGPUDeviceContribution) { - $canvasContainer.innerHTML = ''; - const $canvas = document.createElement('canvas'); - $canvas.width = 1000; - $canvas.height = 1000; - $canvas.style.width = '500px'; - $canvas.style.height = '500px'; - $canvasContainer.appendChild($canvas); - - // create swap chain and get device - const swapChain = await deviceContribution.createSwapChain($canvas); - - // TODO: resize - swapChain.configureSwapChain($canvas.width, $canvas.height); - const device = swapChain.getDevice(); - - const program = device.createProgram({ - vertex: { - wgsl: ` -@vertex -fn main( - @builtin(vertex_index) VertexIndex : u32 -) -> @builtin(position) vec4 { - var pos = array, 3>( - vec2(0.0, 0.5), - vec2(-0.5, -0.5), - vec2(0.5, -0.5) - ); - - return vec4(pos[VertexIndex], 0.0, 1.0); -} -`, - }, - fragment: { - wgsl: ` -@fragment -fn main() -> @location(0) vec4 { - return vec4(1.0, 0.0, 0.0, 1.0); -} -`, - }, - }); - - const vertexBuffer = device.createBuffer({ - viewOrSize: new Float32Array([0, 0.5, -0.5, -0.5, 0.5, -0.5]), - usage: BufferUsage.VERTEX, - hint: BufferFrequencyHint.DYNAMIC, - }); - device.setResourceName(vertexBuffer, 'a_Position'); - - const inputLayout = device.createInputLayout({ - vertexBufferDescriptors: [ - { - byteStride: 4 * 2, - stepMode: VertexStepMode.VERTEX, - }, - ], - vertexAttributeDescriptors: [ - { - location: 0, - bufferIndex: 0, - bufferByteOffset: 0, - format: Format.F32_RG, - }, - ], - indexBufferFormat: null, - program, - }); - - const pipeline = device.createRenderPipeline({ - inputLayout, - program, - colorAttachmentFormats: [Format.U8_RGBA_RT], - }); - - const renderTarget = device.createRenderTarget({ - pixelFormat: Format.U8_RGBA_RT, - width: $canvas.width, - height: $canvas.height, - }); - device.setResourceName(renderTarget, 'Main Render Target'); - - let id; - const frame = () => { - /** - * An application should call getCurrentTexture() in the same task that renders to the canvas texture. - * Otherwise, the texture could get destroyed by these steps before the application is finished rendering to it. - */ - const onscreenTexture = swapChain.getOnscreenTexture(); - - const renderPass = device.createRenderPass({ - colorAttachment: [renderTarget], - colorResolveTo: [onscreenTexture], - colorClearColor: [TransparentWhite], - }); - - renderPass.setPipeline(pipeline); - renderPass.setVertexInput( - inputLayout, - [ - { - buffer: vertexBuffer, - }, - ], - null, - ); - renderPass.setViewport(0, 0, $canvas.width, $canvas.height); - renderPass.draw(3); - - device.submitPass(renderPass); - id = requestAnimationFrame(frame); - }; - - frame(); - - return () => { - if (id) { - cancelAnimationFrame(id); - } - program.destroy(); - vertexBuffer.destroy(); - inputLayout.destroy(); - pipeline.destroy(); - renderTarget.destroy(); - device.destroy(); - - // For debug. - device.checkForLeaks(); - }; -} - -(async () => { - await render(deviceContributionWebGPU); -})(); diff --git a/site/examples/3d/device/index.en.md b/site/examples/3d/device/index.en.md deleted file mode 100644 index 1e94b7683..000000000 --- a/site/examples/3d/device/index.en.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Device API -order: 10 ---- diff --git a/site/examples/3d/device/index.zh.md b/site/examples/3d/device/index.zh.md deleted file mode 100644 index 1e94b7683..000000000 --- a/site/examples/3d/device/index.zh.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Device API -order: 10 ---- diff --git a/site/examples/gpgpu/basic-algorithm/demo/add-2-vectors.js b/site/examples/gpgpu/basic-algorithm/demo/add-2-vectors.js index cc0f44f53..23fe688dd 100644 --- a/site/examples/gpgpu/basic-algorithm/demo/add-2-vectors.js +++ b/site/examples/gpgpu/basic-algorithm/demo/add-2-vectors.js @@ -1,40 +1,30 @@ -import { Canvas, CanvasEvent } from '@antv/g'; -import { Kernel, Plugin } from '@antv/g-plugin-gpgpu'; -import { DeviceRenderer, Renderer } from '@antv/g-webgpu'; +import { WebGPUDeviceContribution, BufferUsage } from '@antv/g-device-api'; -const { BufferUsage } = DeviceRenderer; - -const CANVAS_SIZE = 1; const $canvas = document.createElement('canvas'); -// use WebGPU -const renderer = new Renderer(); -renderer.registerPlugin(new Plugin()); - -// create a canvas -const canvas = new Canvas({ - canvas: $canvas, - width: CANVAS_SIZE, - height: CANVAS_SIZE, - renderer, -}); - -canvas.addEventListener(CanvasEvent.READY, () => { - const plugin = renderer.getPlugin('device-renderer'); - const device = plugin.getDevice(); - - const kernel = new Kernel(device, { - computeShader: ` -@binding(0) @group(0) var input : array; -@binding(1) @group(0) var output : array; - -@compute @workgroup_size(8, 8) -fn main( - @builtin(global_invocation_id) global_id : vec3 -) { - var index = global_id.x; - output[index] = input[index] + output[index]; -}`, +(async () => { + const deviceContributionWebGPU = new WebGPUDeviceContribution({ + shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', + }); + + const swapChain = await deviceContributionWebGPU.createSwapChain($canvas); + const device = swapChain.getDevice(); + + const program = device.createProgram({ + compute: { + wgsl: ` + @binding(0) @group(0) var input : array; + @binding(1) @group(0) var output : array; + + @compute @workgroup_size(8, 8) + fn main( + @builtin(global_invocation_id) global_id : vec3 + ) { + var index = global_id.x; + output[index] = input[index] + output[index]; + } + `, + }, }); const inputBuffer = device.createBuffer({ @@ -45,16 +35,32 @@ fn main( usage: BufferUsage.STORAGE | BufferUsage.COPY_SRC, viewOrSize: new Int32Array([1, 2, 3, 4]), }); - const readback = device.createReadback(); - kernel.setBinding(0, inputBuffer); - kernel.setBinding(1, outputBuffer); - - kernel.dispatch(1, 1); + const pipeline = device.createComputePipeline({ + inputLayout: null, + program, + }); + const bindings = device.createBindings({ + pipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: inputBuffer, + }, + { + binding: 1, + buffer: outputBuffer, + }, + ], + }); - (async () => { - const output = await readback.readBuffer(outputBuffer); + const computePass = device.createComputePass(); + computePass.setPipeline(pipeline); + computePass.setBindings(bindings); + computePass.dispatchWorkgroups(1); + device.submitPass(computePass); - console.log(output); - })(); -}); + const readback = device.createReadback(); + const output = await readback.readBuffer(outputBuffer); + console.log(output); +})(); diff --git a/site/examples/gpgpu/basic-algorithm/demo/compute-shader-test.js b/site/examples/gpgpu/basic-algorithm/demo/compute-shader-test.js index c79beb122..8f7834988 100644 --- a/site/examples/gpgpu/basic-algorithm/demo/compute-shader-test.js +++ b/site/examples/gpgpu/basic-algorithm/demo/compute-shader-test.js @@ -1,35 +1,24 @@ -import { Canvas, CanvasEvent } from '@antv/g'; -import { Kernel, Plugin } from '@antv/g-plugin-gpgpu'; -import { DeviceRenderer, Renderer } from '@antv/g-webgpu'; - -const { BufferUsage } = DeviceRenderer; +import { WebGPUDeviceContribution, BufferUsage } from '@antv/g-device-api'; /** * ported from Tint * @see https://dawn.googlesource.com/tint/+/f9d19719fd500668e1f74d98e881073baeaf03ff/test/intrinsics/gen/atomicSub/051100.wgsl */ -const CANVAS_SIZE = 1; const $canvas = document.createElement('canvas'); -// use WebGPU -const renderer = new Renderer(); -renderer.registerPlugin(new Plugin()); - -// create a canvas -const canvas = new Canvas({ - canvas: $canvas, - width: CANVAS_SIZE, - height: CANVAS_SIZE, - renderer, -}); +(async () => { + const deviceContributionWebGPU = new WebGPUDeviceContribution({ + shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', + }); -canvas.addEventListener(CanvasEvent.READY, () => { - const plugin = renderer.getPlugin('device-renderer'); - const device = plugin.getDevice(); + const swapChain = await deviceContributionWebGPU.createSwapChain($canvas); + const device = swapChain.getDevice(); - const kernel = new Kernel(device, { - computeShader: ` + const program = device.createProgram({ + compute: { + wgsl: ` + struct Buffer { data: array, }; @@ -57,7 +46,9 @@ fn main( input.data[index] = input.data[index] + params.k; atomicSub(&output.data[index], 1); -}`, +} + `, + }, }); const inputBuffer = device.createBuffer({ @@ -72,24 +63,54 @@ fn main( usage: BufferUsage.UNIFORM | BufferUsage.COPY_DST, viewOrSize: new Int32Array([1, 0, 0, 0]), }); - const readback = device.createReadback(); - kernel.setBinding(0, inputBuffer); - kernel.setBinding(1, outputBuffer); - kernel.setBinding(2, uniformBuffer); + const pipeline = device.createComputePipeline({ + inputLayout: null, + program, + }); + const bindings = device.createBindings({ + pipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: inputBuffer, + }, + { + binding: 1, + buffer: outputBuffer, + }, + ], + uniformBufferBindings: [ + { + binding: 2, + buffer: uniformBuffer, + size: 4 * 4, + }, + ], + }); - for (let i = 0; i < 100; i++) { - uniformBuffer.setSubData(0, new Int32Array([2, 0, 0, 0])); - kernel.dispatch(1, 1); + const computePass = device.createComputePass(); + computePass.setPipeline(pipeline); + computePass.setBindings(bindings); - uniformBuffer.setSubData(0, new Int32Array([-2, 0, 0, 0])); - kernel.dispatch(1, 1); + for (let i = 0; i < 100; i++) { + uniformBuffer.setSubData( + 0, + new Uint8Array(new Int32Array([2, 0, 0, 0]).buffer), + ); + computePass.dispatchWorkgroups(1); + + uniformBuffer.setSubData( + 0, + new Uint8Array(new Int32Array([-2, 0, 0, 0]).buffer), + ); + computePass.dispatchWorkgroups(1); } - (async () => { - const input = await readback.readBuffer(inputBuffer); - const output = await readback.readBuffer(outputBuffer); + device.submitPass(computePass); - console.log(input, output); - })(); -}); + const readback = device.createReadback(); + const input = await readback.readBuffer(inputBuffer); + const output = await readback.readBuffer(outputBuffer); + console.log(input, output); +})(); diff --git a/site/examples/gpgpu/basic-algorithm/demo/matrix-multiplication.js b/site/examples/gpgpu/basic-algorithm/demo/matrix-multiplication.js index 453926d29..5a086e72d 100644 --- a/site/examples/gpgpu/basic-algorithm/demo/matrix-multiplication.js +++ b/site/examples/gpgpu/basic-algorithm/demo/matrix-multiplication.js @@ -1,10 +1,6 @@ -import { Canvas, CanvasEvent } from '@antv/g'; -import { Kernel, Plugin } from '@antv/g-plugin-gpgpu'; -import { DeviceRenderer, Renderer } from '@antv/g-webgpu'; +import { WebGPUDeviceContribution, BufferUsage } from '@antv/g-device-api'; import * as lil from 'lil-gui'; -const { BufferUsage } = DeviceRenderer; - /** * ported from https://web.dev/gpu-compute/ * @@ -13,26 +9,19 @@ const { BufferUsage } = DeviceRenderer; const WORKGROUP_SIZE_X = 8; const WORKGROUP_SIZE_Y = 8; +const $canvas = document.createElement('canvas'); + +(async () => { + const deviceContributionWebGPU = new WebGPUDeviceContribution({ + shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', + }); -// use WebGPU -const renderer = new Renderer(); -renderer.registerPlugin(new Plugin()); - -// create a canvas -const $wrapper = document.getElementById('container'); -const canvas = new Canvas({ - container: $wrapper, - width: 1, - height: 1, - renderer, -}); - -canvas.addEventListener(CanvasEvent.READY, () => { - const plugin = renderer.getPlugin('device-renderer'); - const device = plugin.getDevice(); - - const kernel = new Kernel(device, { - computeShader: ` + const swapChain = await deviceContributionWebGPU.createSwapChain($canvas); + const device = swapChain.getDevice(); + + const program = device.createProgram({ + compute: { + wgsl: ` struct Matrix { size : vec2, numbers: array, @@ -63,18 +52,19 @@ canvas.addEventListener(CanvasEvent.READY, () => { let index = resultCell.y + resultCell.x * u32(secondMatrix.size.y); resultMatrix.numbers[index] = result; - }`, + } + `, + }, }); - calc( - kernel, - device, - new Float32Array([2 /* rows */, 4 /* columns */, 1, 2, 3, 4, 5, 6, 7, 8]), - new Float32Array([4 /* rows */, 2 /* columns */, 1, 2, 3, 4, 5, 6, 7, 8]), - ); + const pipeline = device.createComputePipeline({ + inputLayout: null, + program, + }); // GUI const gui = new lil.GUI({ autoPlace: false }); + const $wrapper = document.getElementById('container'); $wrapper.appendChild(gui.domElement); const folder = gui.addFolder('matrix size'); const config = { @@ -87,116 +77,136 @@ canvas.addEventListener(CanvasEvent.READY, () => { const second = new Float32Array( [size, size].concat(new Array(size * size).fill(Math.random())), ); - calc(kernel, device, first, second); + calc(first, second); }); folder.open(); -}); -const cpuMultiplication = (firstMatrix, secondMatrix, $div) => { - const startTime = window.performance.now(); + const cpuMultiplication = (firstMatrix, secondMatrix, $div) => { + const startTime = window.performance.now(); - const x = firstMatrix[0]; - const z = firstMatrix[1]; - const y = secondMatrix[1]; + const x = firstMatrix[0]; + const z = firstMatrix[1]; + const y = secondMatrix[1]; - const resultMatrix = new Float32Array(firstMatrix[0] * secondMatrix[1]); + const resultMatrix = new Float32Array(firstMatrix[0] * secondMatrix[1]); - let productRow = Array.apply(null, new Array(y)).map( - Number.prototype.valueOf, - 0, - ); - let product = new Array(x); - for (let p = 0; p < x; p++) { - product[p] = productRow.slice(); - } - for (let i = 0; i < x; i++) { - for (let j = 0; j < y; j++) { - for (let k = 0; k < z; k++) { - product[i][j] += firstMatrix[i * x + k] * secondMatrix[k * y + j]; + let productRow = Array.apply(null, new Array(y)).map( + Number.prototype.valueOf, + 0, + ); + let product = new Array(x); + for (let p = 0; p < x; p++) { + product[p] = productRow.slice(); + } + for (let i = 0; i < x; i++) { + for (let j = 0; j < y; j++) { + for (let k = 0; k < z; k++) { + product[i][j] += firstMatrix[i * x + k] * secondMatrix[k * y + j]; + } } } - } - const elapsed = window.performance.now() - startTime; - setCPUTimeElapsed(elapsed, $div); - - return elapsed; -}; - -const gpuMultiplication = async ( - kernel, - device, - firstMatrix, - secondMatrix, - $div, -) => { - let startTime = window.performance.now(); - const x = Math.ceil(firstMatrix[0] / WORKGROUP_SIZE_X); // X dimension of the grid of workgroups to dispatch. - const y = Math.ceil(secondMatrix[1] / WORKGROUP_SIZE_Y); // Y dimension of the grid of workgroups to dispatch. - const resultMatrixBufferSize = 2 + firstMatrix[0] * secondMatrix[1]; - const resultMatrix = new Float32Array(resultMatrixBufferSize); - - const firstMatrixBuffer = device.createBuffer({ - usage: BufferUsage.STORAGE, - viewOrSize: firstMatrix, - }); - const secondMatrixBuffer = device.createBuffer({ - usage: BufferUsage.STORAGE, - viewOrSize: secondMatrix, - }); - const resultBuffer = device.createBuffer({ - usage: BufferUsage.STORAGE | BufferUsage.COPY_SRC, - viewOrSize: resultMatrix, - }); - const readback = device.createReadback(); - - kernel.setBinding(0, firstMatrixBuffer); - kernel.setBinding(1, secondMatrixBuffer); - kernel.setBinding(2, resultBuffer); - kernel.dispatch(x, y); - - await readback.readBuffer(resultBuffer); - const elapsed = window.performance.now() - startTime; - - setGPUTimeElapsed(elapsed, $div); - - // output - console.log(resultMatrix); - return elapsed; -}; - -const calc = async (kernel, device, firstMatrix, secondMatrix) => { - const $div = document.createElement('div'); - $div.textContent = `Matrix size: ${firstMatrix[0]} * ${firstMatrix[1]}`; - $wrapper.appendChild($div); - - const cpuTimeElapsed = cpuMultiplication(firstMatrix, secondMatrix, $div); - const gpuTimeElapsed = await gpuMultiplication( - kernel, - device, - firstMatrix, - secondMatrix, - $div, + const elapsed = window.performance.now() - startTime; + setCPUTimeElapsed(elapsed, $div); + + return elapsed; + }; + + const gpuMultiplication = async (firstMatrix, secondMatrix, $div) => { + let startTime = window.performance.now(); + const x = Math.ceil(firstMatrix[0] / WORKGROUP_SIZE_X); // X dimension of the grid of workgroups to dispatch. + const y = Math.ceil(secondMatrix[1] / WORKGROUP_SIZE_Y); // Y dimension of the grid of workgroups to dispatch. + const resultMatrixBufferSize = 2 + firstMatrix[0] * secondMatrix[1]; + const resultMatrix = new Float32Array(resultMatrixBufferSize); + + const firstMatrixBuffer = device.createBuffer({ + usage: BufferUsage.STORAGE, + viewOrSize: firstMatrix, + }); + const secondMatrixBuffer = device.createBuffer({ + usage: BufferUsage.STORAGE, + viewOrSize: secondMatrix, + }); + const resultBuffer = device.createBuffer({ + usage: BufferUsage.STORAGE | BufferUsage.COPY_SRC, + viewOrSize: resultMatrix, + }); + const readback = device.createReadback(); + + console.log(secondMatrix); + + const bindings = device.createBindings({ + pipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: firstMatrixBuffer, + }, + { + binding: 1, + buffer: secondMatrixBuffer, + }, + { + binding: 2, + buffer: resultBuffer, + }, + ], + }); + + const computePass = device.createComputePass(); + computePass.setPipeline(pipeline); + computePass.setBindings(bindings); + computePass.dispatchWorkgroups(x, y); + device.submitPass(computePass); + + await readback.readBuffer(resultBuffer); + const elapsed = window.performance.now() - startTime; + + setGPUTimeElapsed(elapsed, $div); + + // output + console.log(resultMatrix); + return elapsed; + }; + + const calc = async (firstMatrix, secondMatrix) => { + const $div = document.createElement('div'); + $div.textContent = `Matrix size: ${firstMatrix[0]} * ${firstMatrix[1]}`; + $wrapper.appendChild($div); + + const cpuTimeElapsed = cpuMultiplication(firstMatrix, secondMatrix, $div); + const gpuTimeElapsed = await gpuMultiplication( + firstMatrix, + secondMatrix, + $div, + ); + const speedUp = Number.parseFloat(cpuTimeElapsed / gpuTimeElapsed).toFixed( + 1, + ); + + const $speedUp = document.createElement('div'); + $speedUp.textContent = `SpeedUp: ${speedUp}x`; + $speedUp.style = 'font-weight: bold; margin-bottom: 16px;'; + $wrapper.appendChild($speedUp); + }; + + const setCPUTimeElapsed = (time, $div) => { + const $cpu = document.createElement('div'); + $cpu.textContent = `CPU Time Elapsed: ${Number.parseFloat(time).toFixed( + 2, + )}ms`; + $div.appendChild($cpu); + }; + const setGPUTimeElapsed = (time, $div) => { + const $gpu = document.createElement('div'); + $gpu.textContent = `GPU Time Elapsed: ${Number.parseFloat(time).toFixed( + 2, + )}ms`; + $div.appendChild($gpu); + }; + + calc( + new Float32Array([2 /* rows */, 4 /* columns */, 1, 2, 3, 4, 5, 6, 7, 8]), + new Float32Array([4 /* rows */, 2 /* columns */, 1, 2, 3, 4, 5, 6, 7, 8]), ); - const speedUp = Number.parseFloat(cpuTimeElapsed / gpuTimeElapsed).toFixed(1); - - const $speedUp = document.createElement('div'); - $speedUp.textContent = `SpeedUp: ${speedUp}x`; - $speedUp.style = 'font-weight: bold; margin-bottom: 16px;'; - $wrapper.appendChild($speedUp); -}; - -const setCPUTimeElapsed = (time, $div) => { - const $cpu = document.createElement('div'); - $cpu.textContent = `CPU Time Elapsed: ${Number.parseFloat(time).toFixed( - 2, - )}ms`; - $div.appendChild($cpu); -}; -const setGPUTimeElapsed = (time, $div) => { - const $gpu = document.createElement('div'); - $gpu.textContent = `GPU Time Elapsed: ${Number.parseFloat(time).toFixed( - 2, - )}ms`; - $div.appendChild($gpu); -}; +})(); diff --git a/site/examples/gpgpu/basic-algorithm/demo/reduce.js b/site/examples/gpgpu/basic-algorithm/demo/reduce.js index a406fc042..2bea5b8db 100644 --- a/site/examples/gpgpu/basic-algorithm/demo/reduce.js +++ b/site/examples/gpgpu/basic-algorithm/demo/reduce.js @@ -1,100 +1,97 @@ -import { Canvas, CanvasEvent } from '@antv/g'; -import { Kernel, Plugin } from '@antv/g-plugin-gpgpu'; -import { DeviceRenderer, Renderer } from '@antv/g-webgpu'; import * as lil from 'lil-gui'; - -const { BufferUsage } = DeviceRenderer; +import { WebGPUDeviceContribution, BufferUsage } from '@antv/g-device-api'; /** * ported from https://github.com/9ballsyndrome/WebGL_Compute_shader/blob/master/webgl-compute-bitonicSort/js/script.js */ -const CANVAS_SIZE = 1; - -// use WebGPU -const renderer = new Renderer(); -renderer.registerPlugin(new Plugin()); - -// create a canvas -const $wrapper = document.getElementById('container'); -const canvas = new Canvas({ - container: $wrapper, - width: CANVAS_SIZE, - height: CANVAS_SIZE, - renderer, -}); - -const workgroupSize = 128; - -canvas.addEventListener(CanvasEvent.READY, () => { - const plugin = renderer.getPlugin('device-renderer'); - const device = plugin.getDevice(); - const kernel = new Kernel(device, { - computeShader: ` -struct Array { - size: u32, - data: array, -}; - -@group(0) @binding(0) var input : Array; - -var sharedData : array; - -@compute @workgroup_size(${workgroupSize}, 1) -fn main( - @builtin(global_invocation_id) global_id : vec3, - @builtin(local_invocation_id) local_id : vec3, - @builtin(workgroup_id) workgroup_id : vec3, -) { - var tid = local_id.x; - // var i = global_id.x; - - // version 4 - var i = workgroup_id.x * ${workgroupSize}u * 2u + local_id.x; - sharedData[tid] = input.data[i] + input.data[i + ${workgroupSize}u]; - // sharedData[tid] = input.data[i]; - workgroupBarrier(); - - // version 5 - // for (var s = ${workgroupSize}u / 2u; s > 32u; s = s >> 1u) { - // version 3 - for (var s = ${workgroupSize}u / 2u; s > 0u; s = s >> 1u) { - if (tid < s) { - sharedData[tid] = sharedData[tid] + sharedData[tid + s]; - } +const $canvas = document.createElement('canvas'); - // for (var s = 1u; s < ${workgroupSize}u; s = s * 2u) { - // version 1 - // if (tid % (s * 2u) == 0u) { - // sharedData[tid] = sharedData[tid] + sharedData[tid + s]; - // } +(async () => { + const deviceContributionWebGPU = new WebGPUDeviceContribution({ + shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', + }); - // version 2 - // var index = 2u * s * tid; - // if (index < ${workgroupSize}u) { - // sharedData[index] = sharedData[index] + sharedData[index + s]; - // } - - workgroupBarrier(); - } + const swapChain = await deviceContributionWebGPU.createSwapChain($canvas); + const device = swapChain.getDevice(); - // if (tid < 32u) { - // sharedData[tid] = - // sharedData[tid + 32u] - // + sharedData[tid + 16u] - // + sharedData[tid + 8u] - // + sharedData[tid + 4u] - // + sharedData[tid + 2u] - // + sharedData[tid + 1u]; - // } - - if (tid == 0u) { - input.data[workgroup_id.x] = sharedData[0u]; + // create a canvas + const $wrapper = document.getElementById('container'); + + const workgroupSize = 128; + + const program = device.createProgram({ + compute: { + wgsl: ` + struct Array { + size: u32, + data: array, + }; + + @group(0) @binding(0) var input : Array; + + var sharedData : array; + + @compute @workgroup_size(${workgroupSize}, 1) + fn main( + @builtin(global_invocation_id) global_id : vec3, + @builtin(local_invocation_id) local_id : vec3, + @builtin(workgroup_id) workgroup_id : vec3, + ) { + var tid = local_id.x; + // var i = global_id.x; + + // version 4 + var i = workgroup_id.x * ${workgroupSize}u * 2u + local_id.x; + sharedData[tid] = input.data[i] + input.data[i + ${workgroupSize}u]; + // sharedData[tid] = input.data[i]; + workgroupBarrier(); + + // version 5 + // for (var s = ${workgroupSize}u / 2u; s > 32u; s = s >> 1u) { + // version 3 + for (var s = ${workgroupSize}u / 2u; s > 0u; s = s >> 1u) { + if (tid < s) { + sharedData[tid] = sharedData[tid] + sharedData[tid + s]; + } + + // for (var s = 1u; s < ${workgroupSize}u; s = s * 2u) { + // version 1 + // if (tid % (s * 2u) == 0u) { + // sharedData[tid] = sharedData[tid] + sharedData[tid + s]; + // } + + // version 2 + // var index = 2u * s * tid; + // if (index < ${workgroupSize}u) { + // sharedData[index] = sharedData[index] + sharedData[index + s]; + // } + + workgroupBarrier(); + } + + // if (tid < 32u) { + // sharedData[tid] = + // sharedData[tid + 32u] + // + sharedData[tid + 16u] + // + sharedData[tid + 8u] + // + sharedData[tid + 4u] + // + sharedData[tid + 2u] + // + sharedData[tid + 1u]; + // } + + if (tid == 0u) { + input.data[workgroup_id.x] = sharedData[0u]; + } } -}`, +`, + }, }); - calc(kernel, device, new Array(200).fill(1)); + const pipeline = device.createComputePipeline({ + inputLayout: null, + program, + }); // GUI const gui = new lil.GUI({ autoPlace: false }); @@ -106,58 +103,69 @@ fn main( folder .add(config, 'size', [32, 1000, 10000, 100000, 1000000]) .onChange((size) => { - calc( - kernel, - device, - new Array(Number(size)).fill(undefined).map(() => Math.random()), - ); + calc(new Array(Number(size)).fill(undefined).map(() => Math.random())); }); folder.open(); -}); -const cpuReduceSum = (array) => { - const startTime = window.performance.now(); - console.log(array.reduce((prev, cur) => prev + cur, 0)); - console.log(`CPU Time Elapsed: ${window.performance.now() - startTime}ms`); -}; + const cpuReduceSum = (array) => { + const startTime = window.performance.now(); + console.log(array.reduce((prev, cur) => prev + cur, 0)); + console.log(`CPU Time Elapsed: ${window.performance.now() - startTime}ms`); + }; -const gpuReduceSum = async (kernel, device, array) => { - const padding = array.concat( - new Array(workgroupSize - (array.length % workgroupSize)).fill(0), - ); + const gpuReduceSum = async (array) => { + const padding = array.concat( + new Array(workgroupSize - (array.length % workgroupSize)).fill(0), + ); - const input = new Float32Array( - [padding.length] // size - .concat(padding), // origin data - ); + const input = new Float32Array( + [padding.length] // size + .concat(padding), // origin data + ); - let startTime = window.performance.now(); + let startTime = window.performance.now(); - const result = device.createBuffer({ - usage: BufferUsage.STORAGE | BufferUsage.COPY_SRC, - viewOrSize: input, - }); - const readback = device.createReadback(); - kernel.setBinding(0, result); - kernel.dispatch(Math.ceil(array.length / workgroupSize), 1); - - // result - await readback.readBuffer(result); - - console.log( - input - .slice(1, padding.length / workgroupSize + 1) - .reduce((prev, cur) => prev + cur, 0), - ); - console.log(`GPU Time Elapsed: ${window.performance.now() - startTime}ms`); -}; - -const calc = async (kernel, device, array) => { - cpuReduceSum(array); - gpuReduceSum(kernel, device, array); -}; - -const $text = document.createElement('div'); -$text.textContent = - 'Please open the devtools, the CPU & CPU time will be printed in console.'; -$wrapper.appendChild($text); + const result = device.createBuffer({ + usage: BufferUsage.STORAGE | BufferUsage.COPY_SRC, + viewOrSize: input, + }); + const readback = device.createReadback(); + const bindings = device.createBindings({ + pipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: result, + }, + ], + }); + + const computePass = device.createComputePass(); + computePass.setPipeline(pipeline); + computePass.setBindings(bindings); + computePass.dispatchWorkgroups(Math.ceil(array.length / workgroupSize), 1); + device.submitPass(computePass); + + // result + await readback.readBuffer(result); + + console.log( + input + .slice(1, padding.length / workgroupSize + 1) + .reduce((prev, cur) => prev + cur, 0), + ); + console.log(`GPU Time Elapsed: ${window.performance.now() - startTime}ms`); + }; + + const calc = async (array) => { + cpuReduceSum(array); + gpuReduceSum(array); + }; + + const $text = document.createElement('div'); + $text.textContent = + 'Please open the devtools, the CPU & CPU time will be printed in console.'; + $wrapper.appendChild($text); + + calc(new Array(200).fill(1)); +})(); diff --git a/site/examples/gpgpu/graph-analysis-algorithm/demo/bellman-ford-big-dataset.js b/site/examples/gpgpu/graph-analysis-algorithm/demo/bellman-ford-big-dataset.js index f761fc2ee..02e2cbfb5 100644 --- a/site/examples/gpgpu/graph-analysis-algorithm/demo/bellman-ford-big-dataset.js +++ b/site/examples/gpgpu/graph-analysis-algorithm/demo/bellman-ford-big-dataset.js @@ -1,10 +1,6 @@ -import { Canvas } from '@antv/g'; -import { Kernel, Plugin } from '@antv/g-plugin-gpgpu'; -import { DeviceRenderer, Renderer } from '@antv/g-webgpu'; +import { WebGPUDeviceContribution, BufferUsage } from '@antv/g-device-api'; import { Algorithm } from '@antv/g6'; -const { BufferUsage } = DeviceRenderer; - /** * SSSP(Bellman-Ford) ported from CUDA, * find all shortest paths started from Node 0 @@ -18,6 +14,7 @@ const { BufferUsage } = DeviceRenderer; * @see https://github.com/sengorajkumar/gpu_graph_algorithms/tree/master/input */ +const $canvas = document.createElement('canvas'); const $wrapper = document.getElementById('container'); (async () => { // load & parse CSV datasets, which use Compressed Sparse Row (CSR) for adjacency list @@ -91,25 +88,16 @@ const calculateInGPU = async (V, E, I, W) => { const CANVAS_SIZE = 1; const MAX_DISTANCE = 1000000; - // use WebGPU - const renderer = new Renderer(); - renderer.registerPlugin(new Plugin()); - - // create a canvas - const canvas = new Canvas({ - container: $wrapper, - width: CANVAS_SIZE, - height: CANVAS_SIZE, - renderer, + const deviceContributionWebGPU = new WebGPUDeviceContribution({ + shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', }); - // wait for canvas' services ready - await canvas.ready; - const plugin = renderer.getPlugin('device-renderer'); - const device = plugin.getDevice(); + const swapChain = await deviceContributionWebGPU.createSwapChain($canvas); + const device = swapChain.getDevice(); - const relaxKernel = new Kernel(device, { - computeShader: ` + const relaxProgram = device.createProgram({ + compute: { + wgsl: ` struct Buffer { data: array, }; @@ -144,10 +132,16 @@ fn main( } } }`, + }, + }); + const relaxPipeline = device.createComputePipeline({ + inputLayout: null, + program: relaxProgram, }); - const updateDistanceKernel = new Kernel(device, { - computeShader: ` + const updateDistanceProgram = device.createProgram({ + compute: { + wgsl: ` struct Buffer { data: array, }; @@ -168,10 +162,16 @@ fn main( } } `, + }, + }); + const updateDistancePipeline = device.createComputePipeline({ + inputLayout: null, + program: updateDistanceProgram, }); - const updatePredKernel = new Kernel(device, { - computeShader: ` + const updatePredProgram = device.createProgram({ + compute: { + wgsl: ` struct Buffer { data: array, }; @@ -205,6 +205,11 @@ fn main( } } `, + }, + }); + const updatePredPipeline = device.createComputePipeline({ + inputLayout: null, + program: updatePredProgram, }); const VBuffer = device.createBuffer({ @@ -225,7 +230,6 @@ fn main( }); const DOutBuffer = device.createBuffer({ usage: BufferUsage.STORAGE | BufferUsage.COPY_SRC, - // since we want to find all paths for Node 0, set the first element to 0 viewOrSize: new Int32Array([ 0, ...new Array(V.length - 1).fill(MAX_DISTANCE), @@ -238,8 +242,6 @@ fn main( ...new Array(V.length - 1).fill(MAX_DISTANCE), ]), }); - - // store predecessors const POutBuffer = device.createBuffer({ usage: BufferUsage.STORAGE | BufferUsage.COPY_SRC, viewOrSize: new Int32Array([ @@ -247,31 +249,96 @@ fn main( ...new Array(V.length - 1).fill(MAX_DISTANCE), ]), }); - const readback = device.createReadback(); - - relaxKernel.setBinding(0, EBuffer); - relaxKernel.setBinding(1, IBuffer); - relaxKernel.setBinding(2, WBuffer); - relaxKernel.setBinding(3, DOutBuffer); - relaxKernel.setBinding(4, DiOutBuffer); - - updateDistanceKernel.setBinding(0, DOutBuffer); - updateDistanceKernel.setBinding(1, DiOutBuffer); + const relaxBindings = device.createBindings({ + pipeline: relaxPipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: EBuffer, + }, + { + binding: 1, + buffer: IBuffer, + }, + { + binding: 2, + buffer: WBuffer, + }, + { + binding: 3, + buffer: DOutBuffer, + }, + { + binding: 4, + buffer: DiOutBuffer, + }, + ], + }); + const updateDistanceBindings = device.createBindings({ + pipeline: updateDistancePipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: DOutBuffer, + }, + { + binding: 1, + buffer: DiOutBuffer, + }, + ], + }); + const updatePredBindings = device.createBindings({ + pipeline: updatePredPipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: VBuffer, + }, + { + binding: 1, + buffer: EBuffer, + }, + { + binding: 2, + buffer: IBuffer, + }, + { + binding: 3, + buffer: WBuffer, + }, + { + binding: 4, + buffer: DOutBuffer, + }, + { + binding: 5, + buffer: POutBuffer, + }, + ], + }); - updatePredKernel.setBinding(0, VBuffer); - updatePredKernel.setBinding(1, EBuffer); - updatePredKernel.setBinding(2, IBuffer); - updatePredKernel.setBinding(3, WBuffer); - updatePredKernel.setBinding(4, DOutBuffer); - updatePredKernel.setBinding(5, POutBuffer); + const readback = device.createReadback(); - const grids = Math.ceil(V.length / (BLOCKS * BLOCK_SIZE)); for (let i = 1; i < V.length; i++) { - relaxKernel.dispatch(grids, 1); - updateDistanceKernel.dispatch(grids, 1); + const relaxComputePass = device.createComputePass(); + relaxComputePass.setPipeline(relaxPipeline); + relaxComputePass.setBindings(relaxBindings); + relaxComputePass.dispatchWorkgroups(1, 1); + device.submitPass(relaxComputePass); + + const updateDistancePass = device.createComputePass(); + updateDistancePass.setPipeline(updateDistancePipeline); + updateDistancePass.setBindings(updateDistanceBindings); + updateDistancePass.dispatchWorkgroups(1, 1); + device.submitPass(updateDistancePass); } - updatePredKernel.dispatch(grids, 1); + const updatePredPass = device.createComputePass(); + updatePredPass.setPipeline(updatePredPipeline); + updatePredPass.setBindings(updatePredBindings); + updatePredPass.dispatchWorkgroups(1, 1); + device.submitPass(updatePredPass); + // result const out = await readback.readBuffer(DiOutBuffer); const predecessor = await readback.readBuffer(POutBuffer); diff --git a/site/examples/gpgpu/graph-analysis-algorithm/demo/bellman-ford.js b/site/examples/gpgpu/graph-analysis-algorithm/demo/bellman-ford.js index a5868dd77..d5a5ada7c 100644 --- a/site/examples/gpgpu/graph-analysis-algorithm/demo/bellman-ford.js +++ b/site/examples/gpgpu/graph-analysis-algorithm/demo/bellman-ford.js @@ -1,10 +1,6 @@ -import { Canvas, CanvasEvent } from '@antv/g'; -import { Kernel, Plugin } from '@antv/g-plugin-gpgpu'; -import { DeviceRenderer, Renderer } from '@antv/g-webgpu'; +import { WebGPUDeviceContribution, BufferUsage } from '@antv/g-device-api'; import { Algorithm } from '@antv/g6'; -const { BufferUsage } = DeviceRenderer; - /** * SSSP(Bellman-Ford) ported from CUDA * @see https://www.lewuathe.com/illustration-of-distributed-bellman-ford-algorithm.html @@ -25,7 +21,6 @@ const W = [9, 4, 10, 2, 3, 2, 11, 2, 2]; const BLOCK_SIZE = 1; const BLOCKS = 5; -const CANVAS_SIZE = 1; const MAX_DISTANCE = 10000; const $wrapper = document.getElementById('container'); @@ -34,23 +29,19 @@ $text.textContent = 'Please open the devtools, the shortest paths will be printed in console.'; $wrapper.appendChild($text); -// use WebGPU -const renderer = new Renderer(); -renderer.registerPlugin(new Plugin()); +const $canvas = document.createElement('canvas'); + +(async () => { + const deviceContributionWebGPU = new WebGPUDeviceContribution({ + shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', + }); -// create a canvas -const canvas = new Canvas({ - container: $wrapper, - width: CANVAS_SIZE, - height: CANVAS_SIZE, - renderer, -}); + const swapChain = await deviceContributionWebGPU.createSwapChain($canvas); + const device = swapChain.getDevice(); -canvas.addEventListener(CanvasEvent.READY, () => { - const plugin = renderer.getPlugin('device-renderer'); - const device = plugin.getDevice(); - const kernel = new Kernel(device, { - computeShader: ` + const relaxProgram = device.createProgram({ + compute: { + wgsl: ` struct Buffer { data: array, }; @@ -85,10 +76,16 @@ fn main( } } }`, + }, + }); + const relaxPipeline = device.createComputePipeline({ + inputLayout: null, + program: relaxProgram, }); - const updateDistanceKernel = new Kernel(device, { - computeShader: ` + const updateDistanceProgram = device.createProgram({ + compute: { + wgsl: ` struct Buffer { data: array, }; @@ -109,10 +106,16 @@ fn main( } } `, + }, + }); + const updateDistancePipeline = device.createComputePipeline({ + inputLayout: null, + program: updateDistanceProgram, }); - const updatePredKernel = new Kernel(device, { - computeShader: ` + const updatePredProgram = device.createProgram({ + compute: { + wgsl: ` struct Buffer { data: array, }; @@ -146,17 +149,13 @@ fn main( } } `, + }, + }); + const updatePredPipeline = device.createComputePipeline({ + inputLayout: null, + program: updatePredProgram, }); - calcShortestPath(device, kernel, updateDistanceKernel, updatePredKernel); -}); - -const calcShortestPath = async ( - device, - relaxKernel, - updateDistanceKernel, - updatePredKernel, -) => { const VBuffer = device.createBuffer({ usage: BufferUsage.STORAGE, viewOrSize: new Int32Array(V), @@ -194,47 +193,115 @@ const calcShortestPath = async ( ...new Array(V.length - 1).fill(MAX_DISTANCE), ]), }); - const readback = device.createReadback(); + const relaxBindings = device.createBindings({ + pipeline: relaxPipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: EBuffer, + }, + { + binding: 1, + buffer: IBuffer, + }, + { + binding: 2, + buffer: WBuffer, + }, + { + binding: 3, + buffer: DOutBuffer, + }, + { + binding: 4, + buffer: DiOutBuffer, + }, + ], + }); + const updateDistanceBindings = device.createBindings({ + pipeline: updateDistancePipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: DOutBuffer, + }, + { + binding: 1, + buffer: DiOutBuffer, + }, + ], + }); + const updatePredBindings = device.createBindings({ + pipeline: updatePredPipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: VBuffer, + }, + { + binding: 1, + buffer: EBuffer, + }, + { + binding: 2, + buffer: IBuffer, + }, + { + binding: 3, + buffer: WBuffer, + }, + { + binding: 4, + buffer: DOutBuffer, + }, + { + binding: 5, + buffer: POutBuffer, + }, + ], + }); - relaxKernel.setBinding(0, EBuffer); - relaxKernel.setBinding(1, IBuffer); - relaxKernel.setBinding(2, WBuffer); - relaxKernel.setBinding(3, DOutBuffer); - relaxKernel.setBinding(4, DiOutBuffer); + const calcShortestPath = async () => { + const readback = device.createReadback(); + const startTime = window.performance.now(); - updateDistanceKernel.setBinding(0, DOutBuffer); - updateDistanceKernel.setBinding(1, DiOutBuffer); + for (let i = 1; i < V.length; i++) { + const relaxComputePass = device.createComputePass(); + relaxComputePass.setPipeline(relaxPipeline); + relaxComputePass.setBindings(relaxBindings); + relaxComputePass.dispatchWorkgroups(1, 1); + device.submitPass(relaxComputePass); - updatePredKernel.setBinding(0, VBuffer); - updatePredKernel.setBinding(1, EBuffer); - updatePredKernel.setBinding(2, IBuffer); - updatePredKernel.setBinding(3, WBuffer); - updatePredKernel.setBinding(4, DOutBuffer); - updatePredKernel.setBinding(5, POutBuffer); + const updateDistancePass = device.createComputePass(); + updateDistancePass.setPipeline(updateDistancePipeline); + updateDistancePass.setBindings(updateDistanceBindings); + updateDistancePass.dispatchWorkgroups(1, 1); + device.submitPass(updateDistancePass); + } + const updatePredPass = device.createComputePass(); + updatePredPass.setPipeline(updatePredPipeline); + updatePredPass.setBindings(updatePredBindings); + updatePredPass.dispatchWorkgroups(1, 1); + device.submitPass(updatePredPass); - const startTime = window.performance.now(); + // result + const out = await readback.readBuffer(DiOutBuffer); + const predecessor = await readback.readBuffer(POutBuffer); - for (let i = 1; i < V.length; i++) { - relaxKernel.dispatch(1, 1); - updateDistanceKernel.dispatch(1, 1); - } - updatePredKernel.dispatch(1, 1); - - // result - const out = await readback.readBuffer(DiOutBuffer); - const predecessor = await readback.readBuffer(POutBuffer); + const labels = ['A', 'B', 'C', 'D', 'E']; + for (let i = 0; i < V.length; i++) { + console.log( + `from ${labels[0]} to ${labels[i]} = ${out[i]}, predecessor = ${ + labels[predecessor[i]] + }`, + ); + } - const labels = ['A', 'B', 'C', 'D', 'E']; - for (let i = 0; i < V.length; i++) { - console.log( - `from ${labels[0]} to ${labels[i]} = ${out[i]}, predecessor = ${ - labels[predecessor[i]] - }`, - ); - } + console.log(`GPU Time Elapsed: ${window.performance.now() - startTime}ms`); + }; - console.log(`GPU Time Elapsed: ${window.performance.now() - startTime}ms`); -}; + calcShortestPath(); +})(); const { findShortestPath } = Algorithm; const data = { diff --git a/site/examples/gpgpu/graph-analysis-algorithm/demo/bfs.js b/site/examples/gpgpu/graph-analysis-algorithm/demo/bfs.js index 8f8f8fd39..afdc596fc 100644 --- a/site/examples/gpgpu/graph-analysis-algorithm/demo/bfs.js +++ b/site/examples/gpgpu/graph-analysis-algorithm/demo/bfs.js @@ -1,10 +1,5 @@ -// import { Canvas, CanvasEvent } from '@antv/g'; -// import { Kernel, Plugin } from '@antv/g-plugin-gpgpu'; -// import { DeviceRenderer, Renderer } from '@antv/g-webgpu'; import { Algorithm } from '@antv/g6'; -// const { BufferUsage } = DeviceRenderer; - /** * Implementing Breadth First Search in CUDA * @see https://siddharths2710.wordpress.com/2017/05/16/implementing-breadth-first-search-in-cuda/ diff --git a/site/examples/gpgpu/graph-analysis-algorithm/demo/fruchterman.js b/site/examples/gpgpu/graph-analysis-algorithm/demo/fruchterman.js index 08f8e0dff..1845ebbd2 100644 --- a/site/examples/gpgpu/graph-analysis-algorithm/demo/fruchterman.js +++ b/site/examples/gpgpu/graph-analysis-algorithm/demo/fruchterman.js @@ -1,9 +1,6 @@ import { Canvas, CanvasEvent, Circle, Line } from '@antv/g'; -import { Kernel, Plugin } from '@antv/g-plugin-gpgpu'; import { Renderer as WebGLRenderer } from '@antv/g-webgl'; -import { DeviceRenderer, Renderer as WebGPURenderer } from '@antv/g-webgpu'; - -const { BufferUsage } = DeviceRenderer; +import { WebGPUDeviceContribution, BufferUsage } from '@antv/g-device-api'; /** * ported from https://nblintao.github.io/ParaGraphL/ @@ -16,26 +13,21 @@ const { BufferUsage } = DeviceRenderer; const MAX_ITERATION = 1000; const CANVAS_SIZE = 600; -// use WebGPU -const renderer = new WebGPURenderer(); -renderer.registerPlugin(new Plugin()); - // create a canvas const $wrapper = document.getElementById('container'); const $text = document.createElement('div'); $text.textContent = 'Please open the devtools, the shortest paths will be printed in console.'; $wrapper.appendChild($text); - -const canvas = new Canvas({ - container: $wrapper, - width: 1, - height: 1, - renderer, -}); +const $canvas = document.createElement('canvas'); (async () => { - await canvas.ready; + const deviceContributionWebGPU = new WebGPUDeviceContribution({ + shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', + }); + + const swapChain = await deviceContributionWebGPU.createSwapChain($canvas); + const device = swapChain.getDevice(); // @see https://g6.antv.vision/en/examples/net/forceDirected/#basicForceDirected const data = await ( @@ -61,10 +53,9 @@ const canvas = new Canvas({ const k2 = area / (nodes.length + 1); const k = Math.sqrt(k2); - const plugin = renderer.getPlugin('device-renderer'); - const device = plugin.getDevice(); - const kernel = new Kernel(device, { - computeShader: ` + const program = device.createProgram({ + compute: { + wgsl: ` struct Buffer { data: array, }; @@ -177,6 +168,7 @@ fn main( } } }`, + }, }); const readback = device.createReadback(); @@ -206,19 +198,53 @@ fn main( ]), }); - kernel.setBinding(0, edgesBuffer); - kernel.setBinding(1, indicesBuffer); - kernel.setBinding(2, positionsBuffer); - kernel.setBinding(3, paramBuffer); + const pipeline = device.createComputePipeline({ + inputLayout: null, + program, + }); + + const bindings = device.createBindings({ + pipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: edgesBuffer, + }, + { + binding: 1, + buffer: indicesBuffer, + }, + { + binding: 2, + buffer: positionsBuffer, + }, + ], + uniformBufferBindings: [ + { + binding: 3, + buffer: paramBuffer, + size: 8 * 4, + }, + ], + }); + + const computePass = device.createComputePass(); + computePass.setPipeline(pipeline); + computePass.setBindings(bindings); for (let i = 0; i < MAX_ITERATION; i++) { - kernel.dispatch(nodeNum, 1); + computePass.dispatchWorkgroups(nodeNum, 1); // update uniform - maxDisplace *= 0.99; - paramBuffer.setSubData(5 * 4, new Float32Array([maxDisplace])); + maxDisplace *= 0.99999; + paramBuffer.setSubData( + 5 * 4, + new Uint8Array(new Float32Array([maxDisplace]).buffer), + ); } + device.submitPass(computePass); + const result = await readback.readBuffer(positionsBuffer); console.log( diff --git a/site/examples/gpgpu/graph-analysis-algorithm/demo/louvain.js b/site/examples/gpgpu/graph-analysis-algorithm/demo/louvain.js index e3349def0..01b991306 100644 --- a/site/examples/gpgpu/graph-analysis-algorithm/demo/louvain.js +++ b/site/examples/gpgpu/graph-analysis-algorithm/demo/louvain.js @@ -1,10 +1,5 @@ -// import { Canvas, CanvasEvent } from '@antv/g'; -// import { Kernel, Plugin } from '@antv/g-plugin-gpgpu'; -// import { DeviceRenderer, Renderer } from '@antv/g-webgpu'; import { Algorithm } from '@antv/g6'; -// const { BufferUsage } = DeviceRenderer; - /** * Implementing Louvain Clustering Algorithms in CUDA * @see https://github.com/rapidsai/cugraph/tree/branch-22.08/cpp/src/community diff --git a/site/examples/gpgpu/graph-analysis-algorithm/demo/pagerank-big-dataset.js b/site/examples/gpgpu/graph-analysis-algorithm/demo/pagerank-big-dataset.js index ec8d8b876..7f0480eba 100644 --- a/site/examples/gpgpu/graph-analysis-algorithm/demo/pagerank-big-dataset.js +++ b/site/examples/gpgpu/graph-analysis-algorithm/demo/pagerank-big-dataset.js @@ -1,9 +1,7 @@ -import { Canvas } from '@antv/g'; -import { Kernel, Plugin } from '@antv/g-plugin-gpgpu'; -import { DeviceRenderer, Renderer } from '@antv/g-webgpu'; +import { WebGPUDeviceContribution, BufferUsage } from '@antv/g-device-api'; import { Algorithm } from '@antv/g6'; -const { BufferUsage } = DeviceRenderer; +const $canvas = document.createElement('canvas'); /** * Pagerank with power method, ported from CUDA @@ -78,23 +76,12 @@ const calculateInGPU = async (V, From, To) => { const eps = 0.000001; let maxIteration = 1000; - // use WebGPU - const renderer = new Renderer(); - renderer.registerPlugin(new Plugin()); - - // create a canvas - const canvas = new Canvas({ - container: $wrapper, - width: CANVAS_SIZE, - height: CANVAS_SIZE, - renderer, + const deviceContributionWebGPU = new WebGPUDeviceContribution({ + shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', }); - // wait for canvas' services ready - await canvas.ready; - - const plugin = renderer.getPlugin('device-renderer'); - const device = plugin.getDevice(); + const swapChain = await deviceContributionWebGPU.createSwapChain($canvas); + const device = swapChain.getDevice(); const n = V.length; const graph = new Float32Array(new Array(n * n).fill((1 - d) / n)); const r = new Float32Array(new Array(n).fill(1 / n)); @@ -119,8 +106,9 @@ const calculateInGPU = async (V, From, To) => { } } - const storeKernel = new Kernel(device, { - computeShader: ` + const storeProgram = device.createProgram({ + compute: { + wgsl: ` struct Buffer { data: array, }; @@ -137,10 +125,16 @@ fn main( r_last.data[index] = r.data[index]; } }`, + }, + }); + const storePipeline = device.createComputePipeline({ + inputLayout: null, + program: storeProgram, }); - const matmulKernel = new Kernel(device, { - computeShader: ` + const matmulProgram = device.createProgram({ + compute: { + wgsl: ` struct Buffer { data: array, }; @@ -163,10 +157,16 @@ fn main( } } `, + }, + }); + const matmulPipeline = device.createComputePipeline({ + inputLayout: null, + program: matmulProgram, }); - const rankDiffKernel = new Kernel(device, { - computeShader: ` + const rankDiffProgram = device.createProgram({ + compute: { + wgsl: ` struct Buffer { data: array, }; @@ -184,6 +184,11 @@ fn main( } } `, + }, + }); + const rankDiffPipeline = device.createComputePipeline({ + inputLayout: null, + program: rankDiffProgram, }); const rBuffer = device.createBuffer({ @@ -199,24 +204,72 @@ fn main( viewOrSize: new Float32Array(graph), }); - const readback = device.createReadback(); - - storeKernel.setBinding(0, rBuffer); - storeKernel.setBinding(1, rLastBuffer); - - matmulKernel.setBinding(0, graphBuffer); - matmulKernel.setBinding(1, rBuffer); - matmulKernel.setBinding(2, rLastBuffer); + const storeBindings = device.createBindings({ + pipeline: storePipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: rBuffer, + }, + { + binding: 1, + buffer: rLastBuffer, + }, + ], + }); + const matmulBindings = device.createBindings({ + pipeline: matmulPipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: graphBuffer, + }, + { + binding: 1, + buffer: rBuffer, + }, + { + binding: 2, + buffer: rLastBuffer, + }, + ], + }); + const rankDiffBindings = device.createBindings({ + pipeline: rankDiffPipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: rBuffer, + }, + { + binding: 1, + buffer: rLastBuffer, + }, + ], + }); - rankDiffKernel.setBinding(0, rBuffer); - rankDiffKernel.setBinding(1, rLastBuffer); + const readback = device.createReadback(); const grids = Math.ceil(V.length / (BLOCKS * BLOCK_SIZE)); while (maxIteration--) { - storeKernel.dispatch(grids, 1); - matmulKernel.dispatch(grids, 1); - rankDiffKernel.dispatch(grids, 1); + const storeComputePass = device.createComputePass(); + storeComputePass.setPipeline(storePipeline); + storeComputePass.setBindings(storeBindings); + storeComputePass.dispatchWorkgroups(1, 1); + device.submitPass(storeComputePass); + + const matmulComputePass = device.createComputePass(); + matmulComputePass.setPipeline(matmulPipeline); + matmulComputePass.setBindings(matmulBindings); + matmulComputePass.dispatchWorkgroups(1, 1); + device.submitPass(matmulComputePass); + + const rankDiffComputePass = device.createComputePass(); + rankDiffComputePass.setPipeline(rankDiffPipeline); + rankDiffComputePass.setBindings(rankDiffBindings); + rankDiffComputePass.dispatchWorkgroups(1, 1); + device.submitPass(rankDiffComputePass); const last = await readback.readBuffer(rLastBuffer); const result = last.reduce((prev, cur) => prev + cur, 0); diff --git a/site/examples/gpgpu/graph-analysis-algorithm/demo/pagerank.js b/site/examples/gpgpu/graph-analysis-algorithm/demo/pagerank.js index c47d7960b..2d2fa972f 100644 --- a/site/examples/gpgpu/graph-analysis-algorithm/demo/pagerank.js +++ b/site/examples/gpgpu/graph-analysis-algorithm/demo/pagerank.js @@ -1,9 +1,7 @@ -import { Canvas, CanvasEvent } from '@antv/g'; -import { Kernel, Plugin } from '@antv/g-plugin-gpgpu'; -import { DeviceRenderer, Renderer } from '@antv/g-webgpu'; +import { WebGPUDeviceContribution, BufferUsage } from '@antv/g-device-api'; import { Algorithm } from '@antv/g6'; -const { BufferUsage } = DeviceRenderer; +const $canvas = document.createElement('canvas'); /** * Pagerank with power method, ported from CUDA @@ -26,31 +24,23 @@ const To = [1, 2, 2, 3, 4, 3, 4, 1, 3]; const BLOCK_SIZE = 1; const BLOCKS = 5; -const CANVAS_SIZE = 1; - const $wrapper = document.getElementById('container'); const $text = document.createElement('div'); $text.textContent = 'Please open the devtools, the top nodes will be printed in console.'; $wrapper.appendChild($text); -// use WebGPU -const renderer = new Renderer(); -renderer.registerPlugin(new Plugin()); +(async () => { + const deviceContributionWebGPU = new WebGPUDeviceContribution({ + shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', + }); -// create a canvas -const canvas = new Canvas({ - container: $wrapper, - width: CANVAS_SIZE, - height: CANVAS_SIZE, - renderer, -}); + const swapChain = await deviceContributionWebGPU.createSwapChain($canvas); + const device = swapChain.getDevice(); -canvas.addEventListener(CanvasEvent.READY, () => { - const plugin = renderer.getPlugin('device-renderer'); - const device = plugin.getDevice(); - const storeKernel = new Kernel(device, { - computeShader: ` + const storeProgram = device.createProgram({ + compute: { + wgsl: ` struct Buffer { data: array, }; @@ -67,10 +57,16 @@ fn main( r_last.data[index] = r.data[index]; } }`, + }, + }); + const storePipeline = device.createComputePipeline({ + inputLayout: null, + program: storeProgram, }); - const matmulKernel = new Kernel(device, { - computeShader: ` + const matmulProgram = device.createProgram({ + compute: { + wgsl: ` struct Buffer { data: array, }; @@ -93,10 +89,16 @@ fn main( } } `, + }, + }); + const matmulPipeline = device.createComputePipeline({ + inputLayout: null, + program: matmulProgram, }); - const rankDiffKernel = new Kernel(device, { - computeShader: ` + const rankDiffProgram = device.createProgram({ + compute: { + wgsl: ` struct Buffer { data: array, }; @@ -114,88 +116,134 @@ fn main( } } `, + }, + }); + const rankDiffPipeline = device.createComputePipeline({ + inputLayout: null, + program: rankDiffProgram, }); - pageRankGPU(device, storeKernel, matmulKernel, rankDiffKernel); -}); + const pageRankGPU = async () => { + const d = 0.85; + const eps = 0.000001; + let maxIteration = 1000; + const n = V.length; + const graph = new Float32Array(new Array(n * n).fill((1 - d) / n)); + const r = new Float32Array(new Array(n).fill(1 / n)); -const pageRankGPU = async ( - device, - storeKernel, - matmulKernel, - rankDiffKernel, -) => { - const d = 0.85; - const eps = 0.000001; - let maxIteration = 1000; - const n = V.length; - const graph = new Float32Array(new Array(n * n).fill((1 - d) / n)); - const r = new Float32Array(new Array(n).fill(1 / n)); + From.forEach((from, i) => { + graph[To[i] * n + from] += d * 1.0; + }); - From.forEach((from, i) => { - graph[To[i] * n + from] += d * 1.0; - }); + for (let j = 0; j < n; j++) { + let sum = 0.0; - for (let j = 0; j < n; j++) { - let sum = 0.0; + for (let i = 0; i < n; ++i) { + sum += graph[i * n + j]; + } - for (let i = 0; i < n; ++i) { - sum += graph[i * n + j]; + for (let i = 0; i < n; ++i) { + if (sum != 0.0) { + graph[i * n + j] /= sum; + } else { + graph[i * n + j] = 1 / n; + } + } } - for (let i = 0; i < n; ++i) { - if (sum != 0.0) { - graph[i * n + j] /= sum; - } else { - graph[i * n + j] = 1 / n; + const rBuffer = device.createBuffer({ + usage: BufferUsage.STORAGE | BufferUsage.COPY_SRC, + viewOrSize: new Float32Array(r), + }); + const rLastBuffer = device.createBuffer({ + usage: BufferUsage.STORAGE | BufferUsage.COPY_SRC, + viewOrSize: new Float32Array(n), + }); + const graphBuffer = device.createBuffer({ + usage: BufferUsage.STORAGE, + viewOrSize: new Float32Array(graph), + }); + + const storeBindings = device.createBindings({ + pipeline: storePipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: rBuffer, + }, + { + binding: 1, + buffer: rLastBuffer, + }, + ], + }); + const matmulBindings = device.createBindings({ + pipeline: matmulPipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: graphBuffer, + }, + { + binding: 1, + buffer: rBuffer, + }, + { + binding: 2, + buffer: rLastBuffer, + }, + ], + }); + const rankDiffBindings = device.createBindings({ + pipeline: rankDiffPipeline, + storageBufferBindings: [ + { + binding: 0, + buffer: rBuffer, + }, + { + binding: 1, + buffer: rLastBuffer, + }, + ], + }); + + const readback = device.createReadback(); + + const startTime = window.performance.now(); + while (maxIteration--) { + const storeComputePass = device.createComputePass(); + storeComputePass.setPipeline(storePipeline); + storeComputePass.setBindings(storeBindings); + storeComputePass.dispatchWorkgroups(1, 1); + device.submitPass(storeComputePass); + + const matmulComputePass = device.createComputePass(); + matmulComputePass.setPipeline(matmulPipeline); + matmulComputePass.setBindings(matmulBindings); + matmulComputePass.dispatchWorkgroups(1, 1); + device.submitPass(matmulComputePass); + + const rankDiffComputePass = device.createComputePass(); + rankDiffComputePass.setPipeline(rankDiffPipeline); + rankDiffComputePass.setBindings(rankDiffBindings); + rankDiffComputePass.dispatchWorkgroups(1, 1); + device.submitPass(rankDiffComputePass); + + const last = await readback.readBuffer(rLastBuffer); + const result = last.reduce((prev, cur) => prev + cur, 0); + if (result < eps) { + const out = await readback.readBuffer(rBuffer); + console.log(out); + break; } } - } - - const rBuffer = device.createBuffer({ - usage: BufferUsage.STORAGE | BufferUsage.COPY_SRC, - viewOrSize: new Float32Array(r), - }); - const rLastBuffer = device.createBuffer({ - usage: BufferUsage.STORAGE | BufferUsage.COPY_SRC, - viewOrSize: new Float32Array(n), - }); - const graphBuffer = device.createBuffer({ - usage: BufferUsage.STORAGE, - viewOrSize: new Float32Array(graph), - }); - - const readback = device.createReadback(); - - storeKernel.setBinding(0, rBuffer); - storeKernel.setBinding(1, rLastBuffer); - - matmulKernel.setBinding(0, graphBuffer); - matmulKernel.setBinding(1, rBuffer); - matmulKernel.setBinding(2, rLastBuffer); - - rankDiffKernel.setBinding(0, rBuffer); - rankDiffKernel.setBinding(1, rLastBuffer); - const startTime = window.performance.now(); - while (maxIteration--) { - storeKernel.dispatch(1, 1); + console.log(`GPU Time Elapsed: ${window.performance.now() - startTime}ms`); + }; - matmulKernel.dispatch(1, 1); - - rankDiffKernel.dispatch(1, 1); - - const last = await readback.readBuffer(rLastBuffer); - const result = last.reduce((prev, cur) => prev + cur, 0); - if (result < eps) { - const out = await readback.readBuffer(rBuffer); - console.log(out); - break; - } - } - - console.log(`GPU Time Elapsed: ${window.performance.now() - startTime}ms`); -}; + pageRankGPU(); +})(); const { pageRank } = Algorithm; const data = { diff --git a/site/package.json b/site/package.json index 10e573534..8dc546c5a 100644 --- a/site/package.json +++ b/site/package.json @@ -25,6 +25,7 @@ }, "dependencies": { "@antv/g-components": "^1.9.1", + "@antv/g-device-api": "^1.2.2", "@antv/g-lite": "^1.2.12", "@antv/g-mobile-webgl": "^0.9.1", "@antv/g-plugin-a11y": "^0.6.7",