Thank you for your interest in contributing to GoGPU!
- Go 1.25+ (required for iterators, generics, and modern features)
- golangci-lint for code quality checks
- wgpu-native (optional, for Rust backend testing)
# Clone the repository
git clone https://github.com/gogpu/gogpu
cd gogpu
# Build
go build ./...
# Run tests
go test ./...
# Run linter
golangci-lint run --timeout=5mgit clone https://github.com/YOUR_USERNAME/gogpu
cd gogpu
git remote add upstream https://github.com/gogpu/gogpugit checkout -b feat/your-feature
# or
git checkout -b fix/issue-number-description- Follow code style guidelines below
- Add tests for new functionality
- Update documentation if needed
# Format code
go fmt ./...
# Run pre-release checks
bash scripts/pre-release-check.shAll contributions must go through Pull Requests:
git add .
git commit -m "feat(component): description"
git push origin feat/your-featureThen open a PR on GitHub: https://github.com/gogpu/gogpu/compare
- All tests pass (
go test ./...) - Linter passes (
golangci-lint run) - Code is formatted (
go fmt ./...) - Documentation updated (if applicable)
- CHANGELOG.md updated (for features/fixes)
feat(gpu): add Metal backend support
fix(platform): resolve macOS window sizing issue
docs: update ROADMAP for v0.7.0
test(backend): add smoke tests for native backend
## Summary
Brief description of changes.
## Changes
- Change 1
- Change 2
## Testing
How was this tested?
## Related Issues
Closes #123- Use
gofmtfor formatting (tabs, not spaces) - Follow Effective Go
- Use pointer receivers for structs with mutexes
| Type | Convention | Example |
|---|---|---|
| Exported | PascalCase | CreateSurface |
| Unexported | camelCase | handleEvent |
| Acronyms | Uppercase | GetHTTPURL, DeviceID |
| Constants | PascalCase | MaxTextureSize |
// Always check errors
if err != nil {
return fmt.Errorf("operation failed: %w", err)
}
// Or explicitly ignore
_ = file.Close()We use Conventional Commits:
type(scope): description
[optional body]
[optional footer]
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation |
test |
Tests |
refactor |
Code refactoring |
perf |
Performance |
ci |
CI/CD changes |
chore |
Maintenance |
| Scope | Description |
|---|---|
gpu |
GPU backend |
platform |
Platform code (Win32, Cocoa, X11, Wayland) |
backend |
Native/Rust backend |
gmath |
Math library |
window |
Window management |
input |
Input handling |
examples |
Example code |
deps |
Dependencies |
gogpu/
├── gpu/ # GPU abstraction layer
│ ├── types/ # BackendType, GraphicsAPI enums
│ └── backend/
│ └── native/ # HAL backend creation (Vulkan/Metal/DX12/GLES/Software)
├── internal/platform/ # Platform-specific windowing
│ ├── platform_windows.go # Win32
│ ├── platform_darwin.go # macOS Cocoa
│ ├── platform_linux.go # X11 + Wayland
│ ├── platform_browser.go # Browser/WASM
│ ├── darwin/ # Objective-C runtime via goffi
│ ├── wayland/ # libwayland-client FFI, CSD, xdg-shell, input
│ └── x11/ # Pure Go X11 wire protocol
├── gmath/ # Vec2, Vec3, Vec4, Mat4, Color
├── window/ # Window configuration
├── input/ # Keyboard and mouse input
├── sound/ # Platform system sounds
├── examples/ # Example applications
└── scripts/ # Build/release scripts
| Platform | Windowing | GPU Backends | Status |
|---|---|---|---|
| Windows | Win32 | Vulkan, DX12, GLES, Software | Production |
| Linux X11 | X11 (Pure Go wire protocol) | Vulkan, GLES, Software | Production |
| Linux Wayland | Wayland (libwayland FFI) | Vulkan, GLES, Software | Production |
| macOS | Cocoa (goffi ObjC runtime) | Metal, Software | Production |
| Browser | WASM (syscall/js) | WebGPU | Production |
go test ./...go test -v ./internal/platform/...go test -race ./...bash scripts/pre-release-check.sh- Platform Testing — Test on Linux Wayland (GNOME, KDE, sway), macOS, Windows DX12/GLES
- GLES Testing — Different GPU vendors (AMD, NVIDIA, Intel) and driver versions
- Documentation — Examples, tutorials, API docs
- Cursor Fallback —
wl_pointer.set_cursorwith libwayland-cursor for compositors withoutwp_cursor_shape_v1(ADR-043) - CSD Geometry — Maximize/fullscreen decoration handling (#300)
- Performance — Profiling, benchmarks, optimization
- Open a GitHub Issue
- Check existing Discussions
Thank you for contributing to GoGPU!