Open-Source Wikis

/

Godot

/

Drivers

godotengine/godot

Drivers

drivers/ holds the concrete I/O backends — graphics APIs, audio APIs, input/MIDI APIs, and OS-specific helpers — that engine subsystems plug into. Drivers are decoupled from platforms in the sense that the same driver (e.g., Vulkan, GLES3) can run on multiple platforms, even though some drivers are platform-locked (Direct3D 12 → Windows, Metal → Apple, WASAPI → Windows).

What lives here

drivers/
├── vulkan/                         RenderingDeviceDriverVulkan
├── d3d12/                          RenderingDeviceDriverD3D12
├── metal/                          RenderingDeviceDriverMetal (shared by macOS/iOS/visionOS)
├── gles3/                          OpenGL ES 3 backend ("Compatibility" renderer)
├── gl_context/                     OS-agnostic GL context interfaces
├── egl/                            EGL helper (Linux/Android GL context creation)
├── alsa/, pulseaudio/              Linux audio
├── alsamidi/                       Linux MIDI input
├── coreaudio/, coremidi/           Apple audio + MIDI
├── wasapi/, xaudio2/, winmidi/     Windows audio + MIDI
├── apple/, apple_embedded/         Shared Apple driver code (Metal, CoreAudio)
├── png/                            libpng wrapper for PNG image loading
├── unix/, windows/                 Cross-platform Unix / Windows POSIX-flavoured helpers (file_access_unix, dir_access_unix, …)
├── sdl/                            SDL3-based joypad driver (Linux/BSD)
├── backtrace/                      Stack-trace bridges
└── accesskit/                      Accessibility integration

A separate page covers each major group:

How a driver plugs in

The two main contracts:

  • Graphics: implement RenderingDeviceDriver (servers/rendering/rendering_device_driver.h). The driver owns vendor-specific objects (Vulkan instances, D3D12 devices, Metal devices) and exposes them through Godot's vendor-neutral handles.
  • Audio: implement AudioDriver (core/os/audio_driver.h). The driver runs its own callback thread, requests mixed buffers from AudioServer::_driver_process, and pushes them to the OS audio stack.

Driver registration happens in register_driver_types.cpp per platform — for example, drivers/register_driver_types.cpp is platform-conditional, calling AudioDriverManager::add_driver(memnew(AudioDriverPulseAudio)); etc.

Cross-platform helpers

Drivers also include platform-portable helpers used by core/:

  • drivers/unix/file_access_unix.cpp, dir_access_unix.cpp — POSIX file and directory access, used by Linux/BSD/macOS/iOS/visionOS/Android.
  • drivers/windows/file_access_windows.cpp, dir_access_windows.cpp — Win32 equivalents.
  • drivers/png/image_loader_png.cpp — PNG image loading via libpng (vendored under thirdparty/libpng).
  • drivers/backtrace/ — backtrace bridges using libbacktrace where available.

These don't have a "driver"-like contract; they're shared platform abstractions parked in drivers/ because they are tightly coupled to the platform's I/O layer.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Drivers – Godot wiki | Factory