How webgpu/webgpu-samples works
WebGPU Samples is a browser-based catalog and runner for demonstrations of the WebGPU API. A visitor browses or filters categorized samples, selects one, and the site displays it in an iframe alongside source tabs; local demos exercise WebGPU and web-platform integrations. The repository also contains reusable mesh construction and model data. The README documents the sample collection and its purpose; the graph uses the sampled site code for catalog, UI, and iframe relationships, and treats unsampled demo internals as subsystem-level components.
Main entry points: main.ts Site Interface · mesh.ts Mesh Runtime · sample Basic Graphics · primitives.ts Mesh Generators
Components 17
Sample Website
- Site Interface
src/main.ts - Sample Registry
src/samples.ts - DOM Builder
src/utils/elem.ts - Source Viewer
src/main.ts - Demo Frame
src/main.ts - Frame Resizer
public/js/iframe-helper.js
Demo Catalog
- Basic Graphics
sample - WebGPU Features
sample - GPGPU Demos
sample - Graphics Techniques
sample - Platform Integration
sample - Benchmarks
sample
Mesh Support
- Mesh Runtime
meshes/mesh.ts - Mesh Generators
meshes/primitives.ts - Dragon Mesh Data
meshes/stanfordDragonData.ts
Other components
- Visitor
- WebGPU API
Connections 14
- Visitor → Site Interface: browses
README.md - Site Interface → Sample Registry: loads catalog
src/main.ts - Site Interface → DOM Builder: builds UI
src/main.ts - Site Interface → Source Viewer: shows source
src/main.ts - Site Interface → Demo Frame: runs sample
src/main.ts - Demo Frame → Frame Resizer: reports size
- Basic Graphics → WebGPU API: demonstrates
README.md - WebGPU Features → WebGPU API: demonstrates
README.md - GPGPU Demos → WebGPU API: demonstrates
README.md - Graphics Techniques → WebGPU API: demonstrates
README.md - Platform Integration → WebGPU API: integrates
README.md - Benchmarks → WebGPU API: benchmarks
README.md - Mesh Generators → Mesh Runtime: creates mesh data
- Dragon Mesh Data → Mesh Runtime: supplies geometry