Last updated: December 29, 2025
Join the Discussion: Help shape the future of Go graphics! Share your ideas, report issues, and discuss features at our GitHub Discussions.
Update (December 29, 2025): All backends complete! naga v0.8.0 — HLSL backend added, all 4 shader targets stable (SPIR-V, MSL, GLSL, HLSL). wgpu v0.8.1 — DX12 backend complete. 249K lines of Pure Go — production-ready for Windows, Linux, macOS.
Finally, a graphics framework that feels like Go.
TL;DR
- Problem: Go lacks a professional graphics library
- Solution: GoGPU — Pure Go, Zero-CGO, WebGPU-based
- Result: 249K lines of Pure Go code, no Rust, no C
- NEW: DX12 backend complete, HLSL shader output, all 4 GPU backends!
- Repo: github.com/gogpu/gogpu
- Discussion: Join the conversation
The Ecosystem (December 2025)
What started as a simple triangle demo has grown into a complete graphics stack:
| Project | Description | Version | LOC |
|---|---|---|---|
| gogpu/gg | 2D graphics library | v0.15.3 | ~104K |
| gogpu/wgpu | Pure Go WebGPU | v0.8.2 | ~87K |
| gogpu/naga | Shader compiler (WGSL → SPIR-V/MSL/GLSL/HLSL) | v0.8.0 | ~32K |
| gogpu/gogpu | Graphics framework | v0.8.3 | ~26K |
| gogpu/ui | GUI widget toolkit | Planning | — |
Total: ~249K lines of Pure Go — no CGO, no Rust, no C.
What's New (December 2025)
All Shader Backends Complete (naga v0.8.0)
naga now compiles WGSL to all four major GPU targets:
| Target | Platforms | Status |
|---|---|---|
| SPIR-V | Vulkan (all platforms) | Stable |
| MSL | Metal (macOS/iOS) | Stable |
| GLSL | OpenGL 3.3+, ES 3.0+ | Stable |
| HLSL | DirectX 11/12 | Stable |
// Compile WGSL to any target
spirvBytes, _ := naga.GenerateSPIRV(module, spirv.Options{})
mslCode, _, _ := msl.Compile(module, msl.DefaultOptions())
glslCode, _, _ := glsl.Compile(module, glsl.DefaultOptions())
hlslCode, _, _ := hlsl.Compile(module, hlsl.DefaultOptions())
DirectX 12 Backend (wgpu v0.8.1)
Pure Go DX12 backend — no CGO, just syscall + COM:
- Complete D3D12 and DXGI bindings (~6K LOC)
- Descriptor heap management
- Flip model swapchain with tearing support
- Intel GPU support (COM calling convention fix)
GPU Compute Shaders (gg v0.15.0)
The 2D graphics library now includes vello-style GPU compute pipeline:
- Sparse Strips — Efficient GPU path rasterization
- Flatten/Coarse/Fine — Multi-stage compute pipeline
- 29 blend modes on GPU — Porter-Duff + Advanced + HSL
// GPU-accelerated 2D rendering
dc := gg.NewContext(1920, 1080)
dc.DrawCircle(960, 540, 400)
dc.Fill() // GPU compute shaders!
Platform Support
| Platform | Windowing | GPU Backend | Status |
|---|---|---|---|
| Windows | Win32 | Vulkan, GLES | Production |
| Linux X11 | X11 | Vulkan, GLES | Production |
| Linux Wayland | Wayland | Vulkan, GLES | Production |
| macOS | Cocoa | Metal | Production (v0.8.0) |
All major desktop platforms fully supported!
Pure Go WebGPU Backends
| Backend | Status | LOC | Use Case |
|---|---|---|---|
| Vulkan | Done | ~27K | Cross-platform (Windows/Linux/macOS) |
| DX12 | Done | ~12K | Windows native |
| Metal | Done | ~3K | macOS/iOS |
| OpenGL ES | Done | ~7.5K | Windows + Linux |
| Software | Done | ~10K | Headless, CI/CD |
All 5 GPU backends complete!
The Problem: Go and Graphics Don't Mix (Until Now)
If you've ever tried graphics programming in Go, you know the pain:
- CGO hell — Most libraries require a C compiler
- Abandoned projects — Promising repos with no updates since 2019+
- "Just use Rust/C++" — The default answer in every forum
I saw this frustration firsthand in a Reddit thread: "Go deserves more support in GUI development".
So I built it.
Show Me the Code
High-Level: 2D Graphics (gogpu/gg)
package main
import (
"github.com/gogpu/gg"
"github.com/gogpu/gg/text"
)
func main() {
ctx := gg.NewContext(512, 512)
ctx.ClearWithColor(gg.White)
// Draw shapes
ctx.SetColor(gg.Hex("#3498db"))
ctx.DrawCircle(256, 256, 100)
ctx.Fill()
// Load font and draw text
source, _ := text.NewFontSourceFromFile("arial.ttf")
defer source.Close()
ctx.SetFont(source.Face(32))
ctx.SetColor(gg.Black)
ctx.DrawString("Hello, GoGPU!", 180, 260)
ctx.SavePNG("output.png")
}
Low-Level: Triangle (gogpu/gogpu)
package main
import (
"log"
"github.com/gogpu/gogpu"
"github.com/gogpu/gogpu/gmath"
)
func main() {
app := gogpu.NewApp(gogpu.DefaultConfig().
WithTitle("GoGPU Triangle").
WithSize(800, 600))
app.OnDraw(func(ctx *gogpu.Context) {
ctx.DrawTriangleColor(gmath.DarkGray)
})
if err := app.Run(); err != nil {
log.Fatal(err)
}
}
15 lines vs 400-500 lines of raw WebGPU boilerplate.
Architecture
┌─────────────────────────────────────────┐
│ Your Application │
├─────────────────────────────────────────┤
│ gogpu/ui (GUI Toolkit) │
│ Widgets, Layouts │ ← In Planning
├─────────────────────────────────────────┤
│ gogpu/gg (2D Graphics API) │
│ Scene Graph, Blend Modes, Layers │
├─────────────────────────────────────────┤
│ gogpu/gogpu (Framework) │
│ Windowing, Input, Lifecycle │
│ Win32 │ X11 │ Wayland │ Cocoa │
├─────────────────────────────────────────┤
│ gogpu/wgpu (Pure Go WebGPU) │
│ Vulkan │ DX12 │ Metal │ GLES │ Software│
├─────────────────────────────────────────┤
│ gogpu/naga (Shader Compiler) │
│ WGSL → SPIR-V │ MSL │ GLSL │ HLSL │
└─────────────────────────────────────────┘
Key innovation: Everything is Pure Go. No CGO, no wgpu-native dependency.
GUI Toolkit: gogpu/ui (In Planning)
We're designing an enterprise-grade GUI toolkit for Go:
- Signals-based reactivity (like Angular/SolidJS)
- Tailwind-style API for styling
- Enterprise features: docking, virtualization, accessibility
- Cross-platform: Same code for Desktop, Web (WASM), Mobile
Want to help shape the API? Join the discussion:
Series
This is part of a series documenting the GoGPU journey:
- GoGPU: A Pure Go Graphics Library for GPU Programming ← You are here
- GoGPU: From Idea to 100K Lines in Two Weeks
- Building a Shader Compiler in Pure Go: naga Reaches v0.4.0
- Pure Go 2D Graphics Library with GPU Acceleration: Introducing gogpu/gg
- naga v0.8.0: Pure Go Shader Compiler Reaches Stability Milestone ← NEW
Current Status
Ecosystem: 249K lines of Pure Go
Platforms: Windows │ Linux (X11 + Wayland) │ macOS
Backends: Vulkan │ DX12 │ Metal │ OpenGL ES │ Software
Shaders: WGSL → SPIR-V │ MSL │ GLSL │ HLSL
UI: Architecture validated, awaiting community feedback
Phase: RAPID DEVELOPMENT — API not frozen, contributions welcome!
What works:
- Complete 2D graphics API (gogpu/gg v0.15.3)
- GPU compute shaders via Sparse Strips
- Pure Go WebGPU with 5 backends
- Shader compilation to all 4 targets
- Windows Win32 windowing
- Linux X11 windowing (Pure Go!)
- Linux Wayland windowing (Pure Go!)
- macOS Cocoa windowing (Pure Go!)
- All GPU backends complete! (Vulkan, DX12, Metal, GLES, Software)
- Scene graph with retained mode rendering
- 29 blend modes (Porter-Duff + Advanced + HSL)
- Layers with per-layer opacity
- GPU text rendering with MSDF atlas
What's Next?
- v1.0.0: Production release with stable API
- GUI toolkit: gogpu/ui — signals, widgets, themes
- Optimization passes: Dead code elimination, constant folding for naga
- Compute shaders: Full compute pipeline in all backends
- Performance: SIMD optimization for 2D rendering
Join Us Now — While You Can Shape the Future
This is the perfect time to get involved.
We're in a rapid development phase where the API is still evolving. This means:
- Your ideas matter — Share in Discussions
- Your feedback shapes the API — Before v1.0.0 freezes the interface
- Cross-platform testers needed — Help us validate on real hardware
- Your name in history — Be part of building Go's GPU ecosystem
Once we hit v1.0.0, the API freezes. Now is your window.
How You Can Help
Test on Your Platform
# Clone and build
git clone https://github.com/gogpu/gogpu
cd gogpu
go build -tags purego ./examples/triangle/
./triangle
Report issues at github.com/gogpu/gogpu/issues
Discuss Features
Join the conversation about UI toolkit design:
Star the Repos
- gogpu/gogpu — Framework
- gogpu/gg — 2D Graphics
- gogpu/wgpu — Pure Go WebGPU
- gogpu/naga — Shader Compiler
- gogpu/ui — GUI Toolkit
Contribute Code
PRs welcome! Especially needed:
- Cross-platform testing (Windows, Linux X11/Wayland, macOS)
- UI toolkit development (signals, widgets, layouts)
- Compute shader examples
- Documentation
- Real-world usage examples
Links
- Organization: github.com/gogpu
- Discussion: Join the conversation
- gogpu v0.8.3: Graphics framework
- gg v0.15.3: 2D graphics library
- wgpu v0.8.2: Pure Go WebGPU
- naga v0.8.0: Shader compiler
Go deserves a great graphics library. We're building it.
Questions? Drop them in the comments or join the discussion.
Top comments (4)
As soon as Text Rendering is available, I will be using this as the rendering engine for Bellina (a GUI library in Go).
Thanks for your comment. Try github.com/gogpu/gg and the text rendering should work. There might be some bugs, but I've only tested it so far.
I'm also been working on a experimental GUI library, currently using raylib because I don't know GPU programming, how hard would it be to use gogpu compared to raylib? Raylib is great but it redraws everything and my library is meant to be a retained mode gui, I want to redraw only the updated regions to keep GPU usage low. reddit.com/r/raylib/comments/1puyi...
Hi ANDRES36! Great to hear about your GUI library project!
Your approach with raylib is interesting. Here's a quick comparison:
What gogpu/gg offers for GUI building (v0.14.0):
gogpu/ui (in planning):
We're designing a signals-based GUI toolkit on top of gogpu/gg. Think Angular/SolidJS reactivity but for native desktop apps. Enterprise features like docking, virtualization, accessibility are planned.
Your HTML/CSS reverse-engineering approach is clever! If you're interested in comparing notes or potentially collaborating on retained-mode patterns, join our discussion:
👉 github.com/orgs/gogpu/discussions/18
The Pure Go ecosystem means easy cross-compilation:
GOOS=linux go build— no C toolchain needed.