Contributing to wgpu
December 7, 2025 · View on GitHub
Thank you for your interest in contributing to wgpu!
Getting Started
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/wgpu - Create a branch:
git checkout -b feat/your-feature - Make your changes
- Run tests:
go test ./... - Commit:
git commit -m "feat: add your feature" - Push:
git push origin feat/your-feature - Open a Pull Request
Development Setup
# Clone the repository
git clone https://github.com/gogpu/wgpu
cd wgpu
# Install dependencies
go mod download
# Run tests
go test ./...
# Run linter
golangci-lint run
Code Style
- Follow standard Go conventions
- Use
gofmtfor formatting - Use
golangci-lintfor linting - Write tests for new functionality
- Document public APIs
Project Structure
wgpu/
├── types/ # WebGPU type definitions
├── core/ # Core validation and state tracking
├── hal/ # Hardware abstraction layer
│ ├── vulkan/ # Vulkan backend
│ ├── metal/ # Metal backend
│ ├── dx12/ # DirectX 12 backend
│ └── gl/ # OpenGL backend
├── internal/ # Internal utilities
└── cmd/ # CLI tools (if any)
Commit Messages
We use Conventional Commits:
feat(component): add new feature
fix(component): fix bug
docs: update documentation
test: add tests
refactor: code refactoring
chore: maintenance tasks
Components: types, core, hal, vulkan, metal, dx12, gl, docs, ci
Pull Request Guidelines
- Keep PRs focused on a single change
- Update documentation if needed
- Add tests for new features
- Ensure all tests pass
- Reference related issues
Testing
Unit Tests
go test ./...
With Coverage
go test -cover ./...
With Race Detector
go test -race ./...
Reporting Issues
- Use GitHub Issues
- Include Go version and OS
- Provide minimal reproduction
- Include error messages
Questions?
Open a GitHub Discussion or reach out to maintainers.
Thank you for contributing!