Skip to content
@gogpu

GoGPU

Pure Go GPU Computing Ecosystem — GUI, Graphics, Windowing, Shaders, ML. Zero CGO.

GoGPU Logo

GoGPU

Pure Go GPU Computing Ecosystem
1.1M+ lines of code. GPU power, Go simplicity. Zero CGO.

Go Version License Pure Go Discussions Open Collective


Why GoGPU?

GoGPU is to Go what Flutter is to Dart, Qt is to C++, and JavaFX is to Java — a professional, complete GPU computing ecosystem, not just a single library. From shader compilation and GPU abstraction to 2D/3D rendering, GUI toolkit with themed widgets, and platform integration — all in Pure Go with zero CGO.

Inspired by this discussion on r/golang. Go waited 17 years for a professional graphics ecosystem. We're building it — together with you.


Ecosystem

Library Purpose Version Stars Issues PRs
gg 2D graphics, 5-engine smart rasterizer, GPU acceleration (~215K LOC)
wgpu Unified Go WebGPU — Pure Go + Rust FFI + Browser (Vulkan/Metal/DX12/GLES/Software, ~130K LOC)
naga WGSL → SPIR-V/MSL/GLSL/HLSL/DXIL shader compiler (~189K LOC)
gogpu Graphics framework, windowing (~53K LOC)
gpucontext Shared interfaces (DeviceProvider, EventSource)
gputypes WebGPU types (webgpu.h spec compliant)
gg-pdf PDF export backend for gg recording
gg-svg SVG export backend for gg recording
ui Enterprise GUI toolkit (22 widgets, M3/Fluent/Cupertino, ~167K LOC)
g3d Pure Go 3D rendering (scene graph, PBR materials, forward renderer, ~12K LOC)
systray Pure Go system tray (Win32/macOS/Linux, zero CGO, ~6.2K LOC)
audio Pure Go audio engine (WASAPI/CoreAudio/PulseAudio, zero CGO)
editor Text/Code editor widget — GPU-accelerated, embeddable (like Monaco)
compose Multi-process composition (Unix socket IPC, LZ4, ~9K LOC)

Pure Go | Zero CGO | Cross-platform


Architecture

┌─────────────────────────────────────────────────────────────┐
│              Your Application                               │
├─────────────────────────────────────────────────────────────┤
│   gogpu/ui (GUI)   │   born-ml/born   │   Your Framework    │
├─────────────────────────────────────────────────────────────┤
│  gogpu/gg (2D Graphics)  │  gogpu/g3d (3D Rendering)        │
│   Smart Rasterizer: Scanline│4×4 Tiles│16×16│SDF│Compute    │
│                 ↓ export to ↓                               │
│           gg-pdf (PDF)    gg-svg (SVG)                      │
├─────────────────────────────────────────────────────────────┤
│              gogpu/gogpu (Graphics Framework)               │
│         GPU abstraction, windowing, input, math             │
│     gogpu/systray (System Tray)   gogpu/audio (Audio)       │
├─────────────────────────────────────────────────────────────┤
│    gogpu/gpucontext (Shared Interfaces)                     │
│       DeviceProvider, EventSource, Registry                 │
├─────────────────────────────────────────────────────────────┤
│    gogpu/gputypes (WebGPU Types, webgpu.h compliant)        │
│       TextureFormat, BufferUsage, PresentMode, etc.         │
├─────────────────────────────────────────────────────────────┤
│       gogpu/wgpu (Unified WebGPU: Pure Go │ Rust FFI │ WASM)│
├─────────────────────────────────────────────────────────────┤
│                   gogpu/naga (Shader Compiler)              │
│       (WGSL → SPIR-V/MSL/GLSL/HLSL/DXIL)                    │
├─────────────────────────────────────────────────────────────┤
│        Vulkan │ Metal │ DX12 │ OpenGL │ Software            │
└─────────────────────────────────────────────────────────────┘

Key Features

Feature Description
Zero CGO No C compiler required, simple go build
WebGPU API Modern, portable GPU abstraction
Smart Rasterizer 5 algorithms with per-path auto-selection (scanline, 4×4 tiles, 16×16 tiles, SDF, compute)
Triple Backend Pure Go (default), Rust FFI (-tags rust), Browser WASM — same API, build tag selects
Layered Design Use only what you need
webgpu.h Compliant Binary-compatible with wgpu-native

Quick Start

package main

import (
    "github.com/gogpu/gogpu"
    "github.com/gogpu/gogpu/gmath"
)

func main() {
    app := gogpu.NewApp(gogpu.DefaultConfig().
        WithTitle("Hello GoGPU").
        WithSize(800, 600))

    app.OnDraw(func(dc *gogpu.Context) {
        dc.DrawTriangleColor(gmath.DarkGray)
    })

    app.Run()
}

Result: A window with a rendered triangle in ~20 lines of code.


gg + gogpu Integration

Use 2D graphics from gg directly in gogpu windows — with smart rasterizer auto-selection and GPU-direct rendering (zero CPU readback):

import (
    "github.com/gogpu/gg"
    "github.com/gogpu/gg/integration/ggcanvas"
)

canvas, _ := ggcanvas.New(app.GPUContextProvider(), 800, 600)

app.OnDraw(func(dc *gogpu.Context) {
    sv := dc.SurfaceView()
    sw, sh := dc.SurfaceSize()
    gg.SetAcceleratorSurfaceTarget(sv, sw, sh)

    canvas.Draw(func(cc *gg.Context) {
        cc.SetRGB(1, 0, 0)
        cc.DrawCircle(400, 300, 100)
        cc.Fill()
    })

    canvas.RenderDirect(sv, sw, sh) // GPU-direct, zero-copy
})

Related Projects

Project Organization Purpose Version Stars Issues PRs
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)

Status

Component Status Description
gputypes ✅ Stable WebGPU types (webgpu.h spec compliant)
gpucontext ✅ Stable Shared interfaces (zero deps)
wgpu ✅ Stable Triple-backend: Pure Go (Vulkan/Metal/DX12/GLES/Software), Rust FFI, Browser WASM
naga ✅ Stable SPIR-V, MSL, GLSL, HLSL + DXIL (experimental) outputs
gg ✅ Stable 2D graphics, 5-engine rasterizer, recording, ggcanvas
gg-pdf ✅ Stable PDF export backend for gg
gg-svg ✅ Stable SVG export backend for gg
gogpu ✅ Stable Graphics framework, windowing
ui ✅ v0.1.1 Enterprise GUI toolkit — 22 widgets, Material 3 / Fluent / Cupertino themes, ~167K LOC
systray ✅ v0.1.0 System tray — Win32/macOS/Linux, dark mode, notifications, 72 tests
audio ✅ v0.1.0 Pure Go audio engine — WASAPI driver, WAV decoder, Mixer, 42 tests
g3d ✅ v0.1.0 Pure Go 3D rendering — scene graph, PBR materials, forward renderer, 5 backends, ~12K LOC
editor 🚧 Early dev Text/Code editor widget — GPU-accelerated, embeddable (like Monaco)
compose ✅ v0.1.0 Multi-process composition — Unix socket transport, LZ4, pull-based flow, ~9K LOC

Platforms

Platform Vulkan DX12 Metal GLES Software Rust FFI Browser
Windows
macOS ⚠️
Linux (X11)
Linux (Wayland)
Browser/WASM

See individual project ROADMAP.md files for detailed roadmaps.


Support

GoGPU is free and open source. If you find it useful, please consider supporting continued development:

🥇 First Sponsor: Inkflow (@omer316) — the person who asked "is there a way to support this project?" and then became the answer!

Backers

Sponsors


Contributing

We welcome contributions! See individual repository CONTRIBUTING.md files.

Areas where we need help:

  • GUI widgets and themes for gogpu/ui
  • Cross-platform testing (macOS, Linux)
  • WebGPU examples and tutorials
  • Documentation

License

All projects are licensed under the MIT License.


GO ❤ GPU

Building the GPU computing ecosystem Go deserves
github.com/gogpu

Pinned Loading

  1. gogpu gogpu Public

    Pure Go GPU Application Framework — windowing, input, lifecycle, platform abstraction. Part of the GoGPU ecosystem.

    Go 310 10

Repositories

Showing 10 of 15 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…