JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5059
  • Score
    100M100P100Q126162F
  • License MIT

Core WebGPU runtime primitives (device, buffer, texture, shader, queue) for vgpu.

Package Exports

  • @vgpu/core

Readme

@vgpu/core

0.0.1 — early preview

@vgpu/core is the runtime foundation for vgpu. It gives you a small wrapper layer around WebGPU devices, queues, buffers, textures, and shader modules, plus an App.create() entry point that asks an adapter for a device and returns a compact app instance. In 0.0.1 the goal is portability and a minimal public surface, not a fully opinionated engine.

Install

pnpm add @vgpu/core

Exports

Classes

  • App
  • Buffer
  • Device
  • Queue
  • Shader
  • Texture
  • VGPUError
  • ValidationError

Functions

  • createMockGPUDevice

Types

  • AppCreateOptions
  • AppInstance
  • VGPUAdapter
  • BufferOptions
  • BufferUsageName
  • BufferWriteData
  • TextureOptions
  • TextureUsageName
  • CreateDeviceOptions
  • ShaderInput

Usage

import { App } from "@vgpu/core";
import { createMockAdapter } from "@vgpu/adapter-mock";

const { device } = await App.create({ adapter: createMockAdapter() });
const data = new Float32Array([1, 2, 3, 4]);
const buffer = device.createBuffer({
  size: data.byteLength,
  usage: ["copy_dst", "copy_src", "storage"],
});

buffer.write(data);
const copy = new Float32Array(await buffer.read(data.byteLength));
device.destroy();

License

MIT.