Package Exports
- @antv/g-webgpu
- @antv/g-webgpu/dist/index.esm.js
- @antv/g-webgpu/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@antv/g-webgpu) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@antv/g-webgpu
This is an experimental renderer implemented with WebGPU.
import { Canvas, CanvasEvent, Circle } from '@antv/g';
import { Renderer as WebGPURenderer } from '@antv/g-webgpu';
const webgpuRenderer = new WebGPURenderer({
shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm',
onContextLost: () => {},
});
// create a canvas
const canvas = new Canvas({
container: 'container',
width: 600,
height: 500,
renderer: webgpuRenderer,
});Options
shaderCompilerPath
We translate GLSL to WGSL with naga bundled into WASM which need to be loaded at runtime.