From 4a1c7de57c53af429a3523bdcbef65c8c791f09f Mon Sep 17 00:00:00 2001 From: clayjohn Date: Wed, 7 Sep 2022 17:44:36 -0700 Subject: Split rendering driver project setting into renderer_name and rendering_driver. To differentiate between a driver (e.g. Vulkan or D3D12) and a renderer (e.g. clustered or mobile renderer). --- core/config/project_settings.cpp | 15 ++++++++++----- core/os/os.h | 5 +++++ 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'core') diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 6275502378..da3a85cd3b 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -101,10 +101,15 @@ const PackedStringArray ProjectSettings::_get_supported_features() { features.append(VERSION_BRANCH "." _MKSTR(VERSION_PATCH)); features.append(VERSION_FULL_CONFIG); features.append(VERSION_FULL_BUILD); - // For now, assume Vulkan is always supported. - // This should be removed if it's possible to build the editor without Vulkan. - features.append("Vulkan Clustered"); - features.append("Vulkan Mobile"); + +#ifdef VULKAN_ENABLED + features.append("Forward Plus"); + features.append("Mobile"); +#endif + +#ifdef GLES3_ENABLED + features.append("GL Compatibility"); +#endif return features; } @@ -909,7 +914,7 @@ Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_cust project_features = ProjectSettings::get_required_features(); } // Check the rendering API. - const String rendering_api = has_setting("rendering/quality/driver/driver_name") ? (String)get_setting("rendering/quality/driver/driver_name") : String(); + const String rendering_api = has_setting("rendering/renderer/rendering_method") ? (String)get_setting("rendering/renderer/rendering_method") : String(); if (!rendering_api.is_empty()) { // Add the rendering API as a project feature if it doesn't already exist. if (!project_features.has(rendering_api)) { diff --git a/core/os/os.h b/core/os/os.h index 363697ea30..c17e855e86 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -69,6 +69,7 @@ class OS { // so we can retrieve the rendering drivers available int _display_driver_id = -1; String _current_rendering_driver_name; + String _current_rendering_method; protected: void _set_logger(CompositeLogger *p_logger); @@ -98,6 +99,8 @@ protected: virtual void initialize_joypads() = 0; void set_current_rendering_driver_name(String p_driver_name) { _current_rendering_driver_name = p_driver_name; } + void set_current_rendering_method(String p_name) { _current_rendering_method = p_name; } + void set_display_driver_id(int p_display_driver_id) { _display_driver_id = p_display_driver_id; } virtual void set_main_loop(MainLoop *p_main_loop) = 0; @@ -116,6 +119,8 @@ public: static OS *get_singleton(); String get_current_rendering_driver_name() const { return _current_rendering_driver_name; } + String get_current_rendering_method() const { return _current_rendering_method; } + int get_display_driver_id() const { return _display_driver_id; } void print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, bool p_editor_notify = false, Logger::ErrorType p_type = Logger::ERR_ERROR); -- cgit v1.2.3