Pure Go GPU Computing Ecosystem
GPU power, Go simplicity. Zero CGO.
Inspired by this discussion on r/golang, we're building the GPU computing ecosystem that Go deserves — from low-level graphics to high-level GUI, all with zero CGO.
| Library | Purpose | LOC | Stars | Issues |
|---|---|---|---|---|
| gg | 2D graphics, Canvas API, GPU compute | ~104K | ||
| wgpu | Pure Go WebGPU (Vulkan/Metal/GLES) | ~71K | ||
| gogpu | Graphics framework, windowing | ~26K | ||
| naga | WGSL → SPIR-V/MSL/GLSL compiler | ~23K | ||
| ui | GUI toolkit (planned) | — |
Total: ~224K LOC Pure Go | Zero CGO | Cross-platform
┌─────────────────────────────────────────────────────────────┐
│ Your Application │
├─────────────────────────────────────────────────────────────┤
│ gogpu/ui (GUI) │ born-ml/born │ Your Framework │
├─────────────────────────────────────────────────────────────┤
│ gogpu/gg (2D Graphics) │
├─────────────────────────────────────────────────────────────┤
│ gogpu/gogpu (Graphics Framework) │
│ GPU abstraction, windowing, input, math │
├─────────────────────────────────────────────────────────────┤
│ go-webgpu/webgpu (FFI) → gogpu/wgpu (Pure Go) │
├─────────────────────────────────────────────────────────────┤
│ Vulkan │ Metal │ DX12 │ OpenGL │
└─────────────────────────────────────────────────────────────┘
| Feature | Description |
|---|---|
| Zero CGO | No C compiler required, simple go build |
| WebGPU API | Modern, portable GPU abstraction |
| Layered Design | Use only what you need |
| Pure Go Goal | Gradually replacing FFI with native Go |
package main
import "github.com/gogpu/gogpu"
func main() {
app := gogpu.NewApp(gogpu.Config{
Title: "Hello GoGPU",
Width: 800,
Height: 600,
})
app.OnDraw(func(ctx *gogpu.Context) {
ctx.Clear(gogpu.Black)
ctx.DrawTriangle(/* ... */)
})
app.Run()
}Note: API is in active development and will change.
| Project | Organization | Purpose | Stars | Issues |
|---|---|---|---|---|
| webgpu | go-webgpu | Zero-CGO WebGPU bindings (wgpu-native FFI) | ||
| goffi | go-webgpu | Pure Go FFI library (88-114ns overhead) | ||
| born | born-ml | Pure Go ML framework (97%+ MNIST) |
- Zero-CGO WebGPU bindings (go-webgpu/webgpu)
- Pure Go FFI (go-webgpu/goffi)
- Graphics framework (gogpu/gogpu) — Triangle, Textures, Dual Backend
- Shader compiler (gogpu/naga) — WGSL → SPIR-V/MSL + compute shaders (~21K LOC)
- WebGPU types package (gogpu/wgpu/types)
- Core validation & state (gogpu/wgpu/core)
- HAL abstraction layer (gogpu/wgpu/hal)
- OpenGL ES backend (gogpu/wgpu/hal/gles) — ~7.5K LOC, Windows + Linux
- Vulkan backend (gogpu/wgpu/hal/vulkan) — ~27K LOC, cross-platform!
- Software backend (gogpu/wgpu/hal/software) — ~10K LOC, full rasterizer!
- Metal backend (gogpu/wgpu/hal/metal) — ~2.5K LOC, macOS/iOS!
- 2D graphics library (gogpu/gg) — v0.15.0 with GPU compute shaders!
- Text rendering (v0.2.0) — FontSource/Face, MultiFace fallback
- Images, Clipping, Compositing (v0.3.0) — DrawImage, Clip API, Porter-Duff
- Layer API, Color Pipeline (v0.4.0) — PushLayer/PopLayer, HSL blend modes
- SIMD Optimization (v0.5.0) — Fast div255, sRGB LUTs, batch blending (260x faster)
- Parallel Rendering (v0.6.0) — TileGrid, WorkerPool, lock-free DirtyRegion!
- Scene Graph (v0.7.0) — Retained mode, 13 shapes, filters, layer cache!
- Backend Abstraction (v0.8.0) — RenderBackend interface, registry!
- GPU Backend (v0.9.0) — Sparse Strips, WGSL shaders, 29 blend modes on GPU!
- GPU Text Pipeline (v0.10.0) — Shaper, Layout, Bidi, 25+ scripts!
- GPU Text Rendering (v0.11.0) — MSDF atlas, emoji, subpixel positioning!
- Rust-First API (v0.12.0) — Brush, Gradients, Stroke, Dash!
- Go 1.25+ (v0.13.0) — Iterators, Generic Cache, Context!
- Advanced Features (v0.14.0) — Alpha Masks, PathBuilder, io.Closer!
- GPU Compute Shaders (v0.15.0) — vello-style flatten/coarse/fine pipeline!
- Linux Wayland (v0.4.0) — Pure Go implementation, 5,700 LOC!
- Linux X11 (v0.6.0) — Pure Go wire protocol, ~5K LOC!
- macOS Cocoa (v0.5.0) — Pure Go via goffi, ~950 LOC!
- Metal backend (wgpu v0.7.0) — WGSL→MSL compilation, render pipeline!
- GLSL shader output (naga v0.6.0) — WGSL → OpenGL 3.3+/ES 3.0+!
- Widget toolkit (gogpu/ui)
- Layouts, styling, themes
We welcome contributions! See individual repository CONTRIBUTING.md files.
Areas where we need help:
- Pure Go GPU backends (DX12)
- WebGPU examples and tutorials
- Documentation
- GUI widget toolkit (gogpu/ui)
All projects are licensed under the MIT License.
Building the GPU computing ecosystem Go deserves
github.com/gogpu