@vgpu/adapter-mock
v0.3.1
Published
Mock GPU adapter for testing vgpu code without real WebGPU hardware.
Downloads
30,645
Maintainers
Readme
@vgpu/adapter-mock
Deterministic adapter for vgpu/mock.
@vgpu/adapter-mock backs the vgpu/mock entrypoint for tests that need the public Gpu API without real GPU hardware.
Install
pnpm add -D @vgpu/adapter-mockUsage
import { init, storage } from "vgpu/mock";
const gpu = await init();
const buffer = storage(gpu, 16);
buffer.write(new Float32Array([1, 2, 3, 4]));
await buffer.read();
gpu.dispose();Use vgpu/mock for command/resource tests and vgpu/node for real rendering/readback snapshots.
License
MIT.
