Documentation
¶
Overview ¶
Package native provides HAL backend registration for the pure Go (gogpu/wgpu) path. This is the default backend, always available without external dependencies.
Supports: Windows (Vulkan, DX12), Linux (Vulkan), macOS (Metal)
Importing this package triggers HAL backend registration via init() side effects. The renderer calls BackendInfo(api) to get the display name and variant mask, then uses wgpu.CreateInstance() which discovers the registered backends.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackendInfo ¶
func BackendInfo(api GraphicsAPI) (name string, mask gputypes.Backends)
BackendInfo returns the backend display name and mask for the given graphics API.
Types ¶
type BackendType ¶
type BackendType uint8
const ( // BackendAuto automatically selects the best available backend. // Pure Go is default, Rust is opt-in with -tags rust. BackendAuto BackendType = iota // BackendNative uses pure Go WebGPU implementation (gogpu/wgpu). // Zero dependencies, just `go build`. Default backend. BackendNative // BackendRust uses wgpu-gpu (Rust) via go-webgpu/webgpu. // Maximum performance, requires wgpu-native shared library. BackendRust // BackendGo is an alias for BackendNative. // Provided for user convenience ("I want the Go backend"). BackendGo = BackendNative )
type GraphicsAPI ¶
type GraphicsAPI uint8
GraphicsAPI specifies which graphics API to use for rendering. This is orthogonal to BackendType (Rust/Native implementation choice).
const ( // GraphicsAPIAuto automatically selects the best graphics API for the platform. // Windows: Vulkan (default), macOS: Metal, Linux: Vulkan. GraphicsAPIAuto GraphicsAPI = iota // GraphicsAPIVulkan forces Vulkan. Available on Windows and Linux. GraphicsAPIVulkan // GraphicsAPIDX12 forces DirectX 12. Available on Windows only. GraphicsAPIDX12 // GraphicsAPIMetal forces Metal. Available on macOS only. GraphicsAPIMetal // GraphicsAPIGLES forces OpenGL ES. Available on Windows and Linux. GraphicsAPIGLES // GraphicsAPISoftware forces the CPU-based software rasterizer. // Always available — no build tags or GPU hardware required. // Useful for headless rendering, CI/CD, and systems without GPU. GraphicsAPISoftware )
func (GraphicsAPI) String ¶
func (g GraphicsAPI) String() string
String returns the graphics API name.