From 72411b9786c2e1975f104385bf8fb4e7ed9055c0 Mon Sep 17 00:00:00 2001 From: Krishna Ayyalasomayajula Date: Sat, 30 May 2026 20:59:06 -0500 Subject: [PATCH] docs: add ASCII diagram of GPU init chain to S3 --- docs/01-rainbow-triangle.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/01-rainbow-triangle.md b/docs/01-rainbow-triangle.md index c74cdfe..04d4af0 100644 --- a/docs/01-rainbow-triangle.md +++ b/docs/01-rainbow-triangle.md @@ -192,6 +192,18 @@ exits. New concept: **5-layer GPU connection.** Each layer adds a capability: +```text +Instance + │ + ├──> Surface (winit window → GPU surface) + │ + ├──> Adapter (select GPU: integrated vs discrete) + │ + ├──> Device + Queue (GPU connection + command submission) + │ + └──> SurfaceConfiguration (swapchain: format, size, present mode) +``` + 1. **[Instance](concepts/GLOSSARY.md#instance)** — opens a connection to the graphics driver. On Vulkan this loads the Vulkan loader and registers instance-level extensions. On WebGL this picks the browser GPU context. @@ -935,6 +947,19 @@ continues the next frame while the GPU works in the background. > `encoder.finish()` seals the script. `queue.submit()` dispatches it. The GPU > executes it later, in parallel. There is no `.await` on a draw call. +### Render Loop Cycle + +``` +[RedrawRequested event] + │ + ▼ +get_current_texture() → [Success?] → Yes → record commands + │ │ + └── No (Timeout/Occluded) → skip frame │ + ▼ +device.poll() → encoder.begin_render_pass() → draw() → submit() → present() +``` + ### The `render(&mut self)` Method Signature ```rust