Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

DrawContext::run_gpu_pass end-to-end demo.

Shows the same pattern a user would reach for if they wanted to retain their own GPU buffers for instanced rendering of a large object scene: a CustomRenderPass implementation owns its wgpu::RenderPipeline, its base-quad wgpu::Buffer, and its per-instance wgpu::Buffer. All three are constructed once in initialize and reused on every frame. The pass is wrapped with blinc_gpu::GpuPass::new(...) so it can be passed through DrawContext::run_gpu_pass from inside a regular canvas() closure.

Tip: Some demos are best viewed in a full browser window. Click “Open in a new tab” below for the full experience.

Open in a new tab · View source on GitHub