Rether / docs
engine/Graphics context
gardenWhat OpenGL forced on you, Vulkan makes you build yourself

Graphics context

updated 2026.08.29created 2026.08.28~1 min

The concept

The graphics context is created through a graphics API to interact with the driver, which makes the GPU render.

More precisely, a graphics context is the state object holding everything our program needs to talk to the GPU: which device we are talking to, the resources we allocated, and the current state configuration. An analogy: the API is a language (French), and the context is an active phone call held in that language.

What a Graphics Context holds

  • Handles & Connections: The logical link to the physical device.
  • Allocated Resources: Shaders, pipelines, vertex/index buffers, textures, descriptor sets, and command buffers in VRAM.
  • Execution Queues & State: The active state (bound pipelines, viewport configs, render targets) and command queues used to send work to the GPU.

The Rendering Chain

// text
Engine (our code)
  └─> Graphics API (the interface: Vulkan, DirectX, Metal)
       └─> Graphics Context (state, buffers, shaders, queues)
            └─> Driver (vendor's implementation)
                 └─> GPU (hardware)

A program can hold several contexts of the same API (one per GPU, or one per independent part of an app), but one is enough for most engines: in Vulkan, a single device context can drive many windows and record commands across multiple threads.

Keyboard

search this vault⌘K / /
step the sidebarjk
open selected↵
switch browse mode123
switch vaultgv
toggle themet
close / clearesc
this help?
esc to close