build: Add flags to toggle specific renderer backends. (#7375)

This commit is contained in:
Steveice10 2024-01-21 23:29:46 -08:00 committed by GitHub
parent 77fce3cf82
commit 82294425e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 443 additions and 211 deletions

View file

@ -449,13 +449,19 @@ struct Values {
Setting<bool> allow_plugin_loader{true, "allow_plugin_loader"};
// Renderer
SwitchableSetting<GraphicsAPI, true> graphics_api{
#ifdef HAS_OPENGL
SwitchableSetting<GraphicsAPI, true> graphics_api {
#if defined(ENABLE_OPENGL)
GraphicsAPI::OpenGL,
#else
#elif defined(ENABLE_VULKAN)
GraphicsAPI::Vulkan,
#elif defined(ENABLE_SOFTWARE_RENDERER)
GraphicsAPI::Software,
#else
// TODO: Add a null renderer backend for this, perhaps.
#error "At least one renderer must be enabled."
#endif
GraphicsAPI::Software, GraphicsAPI::Vulkan, "graphics_api"};
GraphicsAPI::Software, GraphicsAPI::Vulkan, "graphics_api"
};
SwitchableSetting<u32> physical_device{0, "physical_device"};
Setting<bool> use_gles{false, "use_gles"};
Setting<bool> renderer_debug{false, "renderer_debug"};