Documentation
¶
Overview ¶
Package gpu registers the GPU accelerator and coverage filler for hardware-accelerated rendering.
Import this package to enable both GPU-based shape rendering (SDF for circles, rounded rectangles) and adaptive tile-based rasterization for complex paths. The GPU accelerator uses wgpu/hal compute shaders for parallel evaluation.
If GPU initialization fails (no Vulkan/Metal/DX12 available), the registration is silently skipped and rendering falls back to CPU.
For tile-based rasterization only (no GPU shapes), use:
import _ "github.com/gogpu/gg/raster"
Usage:
import _ "github.com/gogpu/gg/gpu" // enable GPU acceleration + tile rasterization
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDeviceProvider ¶
SetDeviceProvider configures the GPU accelerator to use a shared GPU device from an external provider (e.g., gogpu). This avoids creating a separate GPU instance and enables efficient device sharing.
The provider should be a gpucontext.DeviceProvider that also implements gpucontext.HalProvider for direct HAL access.
Call this before drawing operations, typically from ggcanvas.New() or manually after registering the accelerator.
Types ¶
This section is empty.