Concepts
These ideas cover every vgpu program. Read them in order — each page builds on the previous one.
Contextinit() creates the Gpu context; every surface, target, effect, and frame is created from it.Drawsdraw(gpu, opts) renders geometry with custom vertex buffers — you write the vertex stage, geometry(gpu, ...) supplies the buffers.CompilationPipelines compile lazily on first use; pre-warm them during load so the first frame doesn't hitch.EffectsAn effect is a full-screen fragment shader; chain effects by binding a target as another effect's input.PassesA pass composites any number of draws into one target; a single shader can draw directly.Framesframe(gpu, cb) encodes your passes and submits once; frameLoop(gpu, cb) drives animation.Render bundlesbundle(gpu, opts, record) records draws once; replaying them each frame skips re-encoding.