Available Backends
Location:Source/Core/VideoBackends/
Vulkan
Cross-platform, best performancePlatforms: Windows, Linux, Android
Direct3D 12
Modern Windows APIPlatforms: Windows 10+
Direct3D 11
Legacy Windows supportPlatforms: Windows 7+
OpenGL
Wide compatibilityPlatforms: Windows, Linux, macOS
Metal
Apple native APIPlatforms: macOS 11+, iOS
Software
CPU-based reference rendererPlatforms: All (debugging only)
Backend Selection
Choose backend in configuration:Graphics Pipeline
All backends implement the same pipeline:Command Processing
Read graphics FIFO from GPU memoryLocation:
VideoCommon/CommandProcessor.cpp- Process draw commands from CPU
- Parse vertex data and state changes
- Handle display lists
Geometry Processing
Transform and setup verticesLocation:
VideoCommon/VertexManagerBase.cpp- Run vertex shaders (XF emulation)
- Apply projection matrices
- Clip and cull primitives
Texture Decoding
Convert GC/Wii texture formatsLocation:
VideoCommon/TextureCacheBase.cpp- Decode native formats (RGBA8, RGB565, I4, IA8, etc.)
- Hash textures for cache lookup
- Apply arbitrary mipmaps
Shader Generation
Generate pixel shaders for TEVLocation:
VideoCommon/PixelShaderGen.cpp- Emulate Texture Environment (TEV) unit
- Combine up to 16 stages
- Output GLSL/HLSL/MSL shader code
Rasterization
Draw to render target
- Execute shaders via backend API
- Apply blending and Z-testing
- Output to EFB (Embedded FrameBuffer)
Vulkan Backend
Location:VideoBackends/Vulkan/
Recommended backend with best features:
Features
- Async shader compilation (minimal stutter)
- Pipeline caching (fast startup)
- Optimal descriptor management
- Efficient multithreading
- Exclusive fullscreen
Requirements
- Vulkan 1.1+ drivers
- VK_EXT_memory_budget for VRAM tracking
- VK_KHR_push_descriptor for performance
Pipeline State
Vulkan backend caches pipeline state objects:Direct3D 12 Backend
Location:VideoBackends/D3D12/
Modern Windows backend:
Features
- Explicit multithreading
- GPU timeline synchronization
- Descriptor heap management
- Root signature optimization
Requirements
- Windows 10 version 1903+
- D3D12 feature level 11_0+
- DirectX 12 capable GPU
Direct3D 11 Backend
Location:VideoBackends/D3D/
Legacy Windows support:
Features
- Broad hardware compatibility
- Mature and stable
- Good performance on older GPUs
Limitations
- Single-threaded API
- Potential shader stutter
- No async compilation
OpenGL Backend
Location:VideoBackends/OGL/
Cross-platform fallback:
Features
- Works on most systems
- Desktop OpenGL 3.3+ or OpenGL ES 3.0+
- DSA (Direct State Access) for efficiency
Limitations
- Driver quality varies widely
- Potential stutter on driver pipeline compilation
- Limited async compilation support
Metal Backend
Location:VideoBackends/Metal/
Apple platforms:
Features
- Native macOS/iOS performance
- Optimized for Apple Silicon
- MoltenVK-free implementation
Requirements
- macOS 11.0 (Big Sur) or later
- Metal 2.3+ support
Software Renderer
Location:VideoBackends/Software/
CPU-based reference implementation:
Use Cases
- Debugging graphics issues
- Verifying hardware backend correctness
- Pixel-perfect accuracy testing
Limitations
- Extremely slow (< 10 FPS typically)
- No enhancements
- Single-threaded
Shared Video Code
Location:Source/Core/VideoCommon/
Shared across all backends:
| Component | Purpose |
|---|---|
TextureCacheBase | Texture decoding and caching |
VertexManagerBase | Vertex buffer management |
PixelShaderGen | Pixel shader generation |
VertexShaderGen | Vertex shader generation |
ShaderCache | Compiled shader storage |
RenderBase | Abstract rendering interface |
FramebufferManager | EFB/XFB management |
Texture Cache
Central texture management:Cache Strategy
Cache Strategy
- Hash-based lookup by memory address + format
- LRU eviction when VRAM is full
- Lazy invalidation on RAM writes
- Supports arbitrary mipmaps
- Handles EFB copies (render-to-texture)
Texture Formats
Texture Formats
GameCube/Wii formats decoded to RGBA8:
- I4/I8: Intensity (grayscale)
- IA4/IA8: Intensity + Alpha
- RGB565/RGB5A3: Color formats
- RGBA8: Full color + alpha
- CMPR: DXT1-like compression
- C4/C8/C14X2: Palette-based (TLUT)
Shader Generation
Generate shaders for TEV (Texture Environment Unit):- Up to 16 TEV stages
- Each stage: 2 color inputs, 1 alpha input
- Operations: add, sub, multiply, blend, compare
- Konstant colors and rasterized colors
Graphics Enhancements
Backends support quality improvements:Internal Resolution
Render at higher resolution than native (640x528):- 1x (native), 2x, 3x, 4x, 5x, 6x, 7x, 8x
- Dramatically improves clarity
- GPU-intensive
Anti-Aliasing
- MSAA: 2x, 4x, 8x multisample
- SSAA: 4x supersampling (highest quality, slowest)
Anisotropic Filtering
- 1x (off), 2x, 4x, 8x, 16x
- Improves texture clarity at angles
Post-Processing
Shader-based effects:- Color correction
- Scanlines
- Edge smoothing (AA shaders)
- Custom shaders in
User/Shaders/
Performance Profiling
Built-in metrics:- Draw calls: Primitives submitted to GPU
- Shader compilations: New shaders generated
- Texture uploads: New textures sent to VRAM
- EFB peeks: CPU reads from framebuffer (slow)