@vgpu/core
v0.6.0
Published
Core WebGPU runtime primitives (device, buffer, texture, shader, queue) for vgpu.
Maintainers
Readme
@vgpu/core
Core layer (vgpu/core) runtime primitives.
@vgpu/core contains the low-level WebGPU wrappers used by vgpu/core: Device, Buffer, Texture, Queue, shader modules, bind-group helpers, resource identities, and validation errors. Most applications should start from init() in vgpu, vgpu/node, or vgpu/mock and drop to these primitives only for explicit native control.
Install
pnpm add vgpuUse from the main API (vgpu)
import { init, draw } from "vgpu/mock";
import { UniformPool } from "vgpu/core";
import objShader from "./obj.wgsl";
const gpu = await init();
const drawable = draw(gpu, { shader: objShader });
const pool = new UniformPool(gpu.device, { capacityBytes: 1 << 20 });
const slot = pool.alloc({ size: 64, bindGroupLayout: drawable.layout(1, { dynamicOffsets: true }) });
drawable.group(1, slot.bindGroup);Use raw .gpu handles deliberately. Wrapper lifecycle methods (buffer.destroy(), texture.destroy(), device.destroy()) remain preferred for resources created through vgpu.
License
MIT.
