Rether / docs
engine/apis/Graphics APIs
hubThe same GPU, described three ways

Graphics APIs

updated 2026.08.14created 2026.08.14~3 min

Vulkan, Metal and DirectX 12 drive the same hardware and were designed in the same five years, from the same frustration with the drivers that came before. They agree about far more than their spellings suggest. These notes learn the agreement first, then the three dialects.

How this folder is split

Three pillars for what every API has, one folder per API for what only it has.

  • resources — what the GPU reads from: buffers, textures, the memory under them, and how a shader is told where to find them.
  • pipeline — how vertices become pixels: the shader stages, the fixed-function state wrapped around them, and the render targets they write to.
  • commands — how work is handed over: recording, queues, synchronisation, and getting a finished image onto a screen.

The pillars carry the concept, defined once and named in the neutral term. The API folders carry the spelling, the object model, and the places where that API genuinely differs rather than merely renames.

graph TD
    HUB["Graphics APIs<br/><i>hub</i>"]

    subgraph concepts["The concepts · one note each"]
        RES["resources"]
        PIPE["pipeline"]
        CMD["commands"]
    end

    subgraph dialects["The dialects"]
        VK["Vulkan"]
        MTL["Metal"]
        DX["DirectX 12"]
    end

    HUB --> concepts
    HUB --> dialects

    VK -.->|"names, does not redefine"| concepts
    MTL -.->|"names, does not redefine"| concepts
    DX -.->|"names, does not redefine"| concepts
Concepts are written once; each API folder maps its own vocabulary onto them.

An API note never redefines what a vertex buffer is. It says what this API calls one, what it makes you do that the others do not, and links back.

The correspondence

The table I actually reopen. Everything below is the same idea under three names; where a cell is missing, the API folded that responsibility into something else, and that absence is usually the interesting part.

ConceptVulkanMetalDirectX 12
DeviceVkDeviceMTLDeviceID3D12Device
QueueVkQueueMTLCommandQueueID3D12CommandQueue
Command recordingVkCommandBufferMTLCommandBuffer + encodersID3D12GraphicsCommandList
Command backing memoryVkCommandPool(the queue owns it)ID3D12CommandAllocator
BufferVkBufferMTLBufferID3D12Resource
TextureVkImage + VkImageViewMTLTextureID3D12Resource + a view
MemoryVkDeviceMemoryMTLHeap (or implicit)ID3D12Heap
SamplerVkSamplerMTLSamplerStatea sampler descriptor
Shader unitVkShaderModuleMTLFunction in a MTLLibrarya DXIL blob
Graphics pipelineVkPipelineMTLRenderPipelineStateID3D12PipelineState
Binding layoutVkPipelineLayoutargument buffer layoutID3D12RootSignature
Binding groupVkDescriptorSetargument bufferdescriptor table
Descriptor storageVkDescriptorPool(a plain buffer)ID3D12DescriptorHeap
Render targetsVkRenderPass / dynamic renderingMTLRenderPassDescriptorOMSetRenderTargets
PresentationVkSwapchainKHRCAMetalLayer / CAMetalDrawableIDXGISwapChain
GPU → CPU signalVkFencecompletion handlerID3D12Fence
GPU → GPU signalVkSemaphoreMTLEventID3D12Fence
Shading languageGLSL / HLSL → SPIR-VMSL → AIRHLSL → DXIL

Two rows are worth staring at. Command backing memory: Metal has no allocator because its driver owns the lifetime, which is one less thing to get wrong and one less thing to tune. GPU → CPU / GPU → GPU: D3D12 uses one object for both, Vulkan splits them in two, Metal gives you a callback for one and an event for the other — the same problem, solved at three levels of explicitness.

Not written yet

The concepts each pillar owes. Each is a note that will live in the pillar folder, not here.

  • resourcesbuffer, vertex-buffer, index-buffer, uniform-buffer, texture-resource, device-memory, resource-binding
  • pipelinevertex-shader, fragment-shader, vertex-input, pipeline-state, render-target
  • commandscommand-buffer, queue, gpu-synchronisation, swapchain

The dialects

  • Vulkan — the explicit one, and the one gamegine is built on.
  • Metal — Apple only, and the one that hides the most without lying about it.
  • DirectX 12 — Windows and Xbox, descriptor heaps and root signatures.

Keyboard

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