Documentation
¶
Overview ¶
Example: gogpu/ui — GPUView Demo
Demonstrates the GPUView widget which provides a GPU-rendered view for external content: 3D scenes, video, compute visualization, or custom shader output. The widget follows the Flutter Texture pattern: it owns an offscreen GPU texture that an external renderer draws into, and the Layer Tree compositor blits it to the surface.
This example shows GPUView integration into a standard widget layout. The OnRender callback receives a gpucontext.TextureView for GPU rendering. In production, a 3D engine (e.g., gogpu/g3d) would render into this texture.
Architecture:
GPUView widget → offscreen GPU texture → Layer Tree → surface blit
Rendering: event-driven (default since gogpu v0.43.0). 0% CPU when idle. The view re-renders only when explicitly invalidated or when Continuous(true) is set for real-time content.