Polish rendering driver refactor further (take 2)

This commit is contained in:
Pedro J. Estébanez 2022-10-11 10:32:13 +02:00
parent e413d1c9c3
commit f82deaa5b3
8 changed files with 16 additions and 16 deletions

View file

@ -599,8 +599,8 @@ void OS::_bind_methods() {
ADD_PROPERTY_DEFAULT("low_processor_usage_mode", false); ADD_PROPERTY_DEFAULT("low_processor_usage_mode", false);
ADD_PROPERTY_DEFAULT("low_processor_usage_mode_sleep_usec", 6900); ADD_PROPERTY_DEFAULT("low_processor_usage_mode_sleep_usec", 6900);
BIND_ENUM_CONSTANT(VIDEO_DRIVER_VULKAN); BIND_ENUM_CONSTANT(RENDERING_DRIVER_VULKAN);
BIND_ENUM_CONSTANT(VIDEO_DRIVER_OPENGL_3); BIND_ENUM_CONSTANT(RENDERING_DRIVER_OPENGL3);
BIND_ENUM_CONSTANT(DAY_SUNDAY); BIND_ENUM_CONSTANT(DAY_SUNDAY);
BIND_ENUM_CONSTANT(DAY_MONDAY); BIND_ENUM_CONSTANT(DAY_MONDAY);

View file

@ -124,9 +124,9 @@ protected:
static OS *singleton; static OS *singleton;
public: public:
enum VideoDriver { enum RenderingDriver {
VIDEO_DRIVER_VULKAN, RENDERING_DRIVER_VULKAN,
VIDEO_DRIVER_OPENGL_3, RENDERING_DRIVER_OPENGL3,
}; };
enum Weekday { enum Weekday {
@ -576,7 +576,7 @@ VARIANT_ENUM_CAST(core_bind::ResourceLoader::CacheMode);
VARIANT_BITFIELD_CAST(core_bind::ResourceSaver::SaverFlags); VARIANT_BITFIELD_CAST(core_bind::ResourceSaver::SaverFlags);
VARIANT_ENUM_CAST(core_bind::OS::VideoDriver); VARIANT_ENUM_CAST(core_bind::OS::RenderingDriver);
VARIANT_ENUM_CAST(core_bind::OS::Weekday); VARIANT_ENUM_CAST(core_bind::OS::Weekday);
VARIANT_ENUM_CAST(core_bind::OS::Month); VARIANT_ENUM_CAST(core_bind::OS::Month);
VARIANT_ENUM_CAST(core_bind::OS::SystemDir); VARIANT_ENUM_CAST(core_bind::OS::SystemDir);

View file

@ -616,11 +616,11 @@
</member> </member>
</members> </members>
<constants> <constants>
<constant name="VIDEO_DRIVER_VULKAN" value="0" enum="VideoDriver"> <constant name="RENDERING_DRIVER_VULKAN" value="0" enum="RenderingDriver">
The Vulkan rendering backend. It requires Vulkan 1.0 support and automatically uses features from Vulkan 1.1 and 1.2 if available. The Vulkan rendering driver. It requires Vulkan 1.0 support and automatically uses features from Vulkan 1.1 and 1.2 if available.
</constant> </constant>
<constant name="VIDEO_DRIVER_OPENGL_3" value="1" enum="VideoDriver"> <constant name="RENDERING_DRIVER_OPENGL3" value="1" enum="RenderingDriver">
The OpenGL 3 rendering backend. It uses OpenGL 3.3 Core Profile on desktop platforms, OpenGL ES 3.0 on mobile devices, and WebGL 2.0 on Web. The OpenGL 3 rendering driver. It uses OpenGL 3.3 Core Profile on desktop platforms, OpenGL ES 3.0 on mobile devices, and WebGL 2.0 on Web.
</constant> </constant>
<constant name="DAY_SUNDAY" value="0" enum="Weekday"> <constant name="DAY_SUNDAY" value="0" enum="Weekday">
Sunday. Sunday.

View file

@ -5909,7 +5909,7 @@ void EditorNode::_update_renderer_color() {
if (renderer->get_text() == "gl_compatibility") { if (renderer->get_text() == "gl_compatibility") {
renderer->add_theme_color_override("font_color", Color::hex(0x5586a4ff)); renderer->add_theme_color_override("font_color", Color::hex(0x5586a4ff));
} else if (renderer->get_text() == "forward_plus" || renderer->get_text() == "mobile") { } else if (renderer->get_text() == "forward_plus" || renderer->get_text() == "mobile") {
renderer->add_theme_color_override("font_color", theme_base->get_theme_color(SNAME("vulkan_color"), SNAME("Editor"))); renderer->add_theme_color_override("font_color", theme_base->get_theme_color(SNAME("highend_color"), SNAME("Editor")));
} }
} }

View file

@ -564,9 +564,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("readonly_color", "Editor", readonly_color); theme->set_color("readonly_color", "Editor", readonly_color);
if (!dark_theme) { if (!dark_theme) {
theme->set_color("vulkan_color", "Editor", Color::hex(0xad1128ff)); theme->set_color("highend_color", "Editor", Color::hex(0xad1128ff));
} else { } else {
theme->set_color("vulkan_color", "Editor", Color(1.0, 0.0, 0.0)); theme->set_color("highend_color", "Editor", Color(1.0, 0.0, 0.0));
} }
const int thumb_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size"); const int thumb_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size");
theme->set_constant("scale", "Editor", EDSCALE); theme->set_constant("scale", "Editor", EDSCALE);

View file

@ -4778,7 +4778,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p
view_menu->set_disable_shortcuts(true); view_menu->set_disable_shortcuts(true);
// TODO: Re-evaluate with new OpenGL3 renderer, and implement. // TODO: Re-evaluate with new OpenGL3 renderer, and implement.
//if (OS::get_singleton()->get_current_video_driver() == OS::VIDEO_DRIVER_GLES2) { //if (OS::get_singleton()->get_current_video_driver() == OS::RENDERING_DRIVER_OPENGL3) {
if (false) { if (false) {
// Alternate display modes only work when using the Vulkan renderer; make this explicit. // Alternate display modes only work when using the Vulkan renderer; make this explicit.
const int normal_idx = view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL); const int normal_idx = view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL);

View file

@ -3707,7 +3707,7 @@ void VisualShaderEditor::_notification(int p_what) {
[[fallthrough]]; [[fallthrough]];
} }
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
highend_label->set_modulate(get_theme_color(SNAME("vulkan_color"), SNAME("Editor"))); highend_label->set_modulate(get_theme_color(SNAME("highend_color"), SNAME("Editor")));
node_filter->set_right_icon(Control::get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); node_filter->set_right_icon(Control::get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));

View file

@ -159,7 +159,7 @@ Error OS_UWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
outside = true; outside = true;
// FIXME: Hardcoded for now, add Vulkan support. // FIXME: Hardcoded for now, add Vulkan support.
p_video_driver = VIDEO_DRIVER_OPENGL; p_video_driver = RENDERING_DRIVER_OPENGL3;
ContextEGL_UWP::Driver opengl_api_type = ContextEGL_UWP::GLES_2_0; ContextEGL_UWP::Driver opengl_api_type = ContextEGL_UWP::GLES_2_0;
bool gl_initialization_error = false; bool gl_initialization_error = false;