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.
| Repository | Description | Status |
|---|---|---|
| gogpu | Graphics framework — GPU abstraction, windowing, input | v0.7.0 |
| wgpu | Pure Go WebGPU implementation (types, core, HAL) | v0.6.0 |
| naga | Pure Go shader compiler — WGSL → SPIR-V/MSL | v0.5.0 |
| gg | 2D graphics with GPU backend, scene graph, text | v0.13.0 |
| ui | GUI widget toolkit | Planned |
┌─────────────────────────────────────────────────────────────┐
│ 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 | Description |
|---|---|---|
| webgpu | go-webgpu | Zero-CGO WebGPU bindings |
| goffi | go-webgpu | Pure Go FFI library |
| born | born-ml | Pure Go ML framework |
- 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.13.0 with GPU text rendering!
- 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.13.0) — MSDF atlas, emoji, subpixel positioning!
- 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.6.0) — Pure Go via goffi, ~2.5K LOC!
- MSL shader output (naga v0.5.0) — WGSL → Metal Shading Language!
- 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