Use OpenGL 3.3 core profile instead of compatibility profile

- Rename OpenGL to GLES3 in the source code per community feedback.
  - The renderer is still exposed as "OpenGL 3" to the user.
- Hide renderer selection dropdown until OpenGL support is more mature.
  - The renderer can still be changed in the Project Settings or using
    the `--rendering-driver opengl` command line argument.
- Remove commented out exporter code.
- Remove some OpenGL/DisplayServer-related debugging prints.
This commit is contained in:
Clay John
2021-10-26 08:18:39 -07:00
committed by Hugo Locurcio
parent ce97ddbcb1
commit 8a10bb7d0d
83 changed files with 2155 additions and 8187 deletions

View File

@@ -344,8 +344,8 @@ void DisplayServerAndroid::process_events() {
Vector<String> DisplayServerAndroid::get_rendering_drivers_func() {
Vector<String> drivers;
#ifdef OPENGL_ENABLED
drivers.push_back("opengl");
#ifdef GLES3_ENABLED
drivers.push_back("opengl3");
#endif
#ifdef VULKAN_ENABLED
drivers.push_back("vulkan");
@@ -407,13 +407,13 @@ DisplayServerAndroid::DisplayServerAndroid(const String &p_rendering_driver, Dis
keep_screen_on = GLOBAL_GET("display/window/energy_saving/keep_screen_on");
#if defined(OPENGL_ENABLED)
if (rendering_driver == "opengl") {
#if defined(GLES3_ENABLED)
if (rendering_driver == "opengl3") {
bool gl_initialization_error = false;
if (RasterizerOpenGLis_viable() == OK) {
RasterizerOpenGLregister_config();
RasterizerOpenGLmake_current();
if (RasterizerGLES3::is_viable() == OK) {
RasterizerGLES3::register_config();
RasterizerGLES3::make_current();
} else {
gl_initialization_error = true;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1612,7 +1612,7 @@ Vector<String> EditorExportPlatformAndroid::get_enabled_abis(const Ref<EditorExp
void EditorExportPlatformAndroid::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) {
String driver = ProjectSettings::get_singleton()->get("rendering/driver/driver_name");
if (driver == "OpenGL") {
if (driver == "OpenGL3") {
r_features->push_back("etc");
}
// FIXME: Review what texture formats are used for Vulkan.

View File

@@ -74,51 +74,6 @@ Error rename_and_store_file_in_gradle_project(void *p_userdata, const String &p_
// Creates strings.xml files inside the gradle project for different locales.
Error _create_project_name_strings_files(const Ref<EditorExportPreset> &p_preset, const String &project_name);
//Error _create_project_name_strings_files(const Ref<EditorExportPreset> &p_preset, const String &project_name) {
// // Stores the string into the default values directory.
// String processed_default_xml_string = vformat(godot_project_name_xml_string, project_name.xml_escape(true));
// store_string_at_path("res://android/build/res/values/godot_project_name_string.xml", processed_default_xml_string);
// // Searches the Gradle project res/ directory to find all supported locales
// DirAccessRef da = DirAccess::open("res://android/build/res");
// if (!da) {
// return ERR_CANT_OPEN;
// }
// da->list_dir_begin();
// while (true) {
// String file = da->get_next();
// if (file == "") {
// break;
// }
// if (!file.begins_with("values-")) {
// // NOTE: This assumes all directories that start with "values-" are for localization.
// continue;
// }
// String locale = file.replace("values-", "").replace("-r", "_");
// String property_name = "application/config/name_" + locale;
// String locale_directory = "res://android/build/res/" + file + "/godot_project_name_string.xml";
// if (ProjectSettings::get_singleton()->has_setting(property_name)) {
// String locale_project_name = ProjectSettings::get_singleton()->get(property_name);
// String processed_xml_string = vformat(godot_project_name_xml_string, locale_project_name.xml_escape(true));
// store_string_at_path(locale_directory, processed_xml_string);
// } else {
// // TODO: Once the legacy build system is deprecated we don't need to have xml files for this else branch
// store_string_at_path(locale_directory, processed_default_xml_string);
// }
// }
// da->list_dir_end();
// return OK;
//}
//String bool_to_string(bool v) {
// return v ? "true" : "false";
//}
//String _get_gles_tag() {
// bool min_gles3 = ProjectSettings::get_singleton()->get("rendering/driver/driver_name") == "GLES3" &&
// !ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2");
// return min_gles3 ? " <uses-feature android:glEsVersion=\"0x00030000\" android:required=\"true\" />\n" : "";
//}
String bool_to_string(bool v);

View File

@@ -262,14 +262,14 @@ Size2i OS_Android::get_display_size() const {
}
void OS_Android::set_context_is_16_bits(bool p_is_16) {
#if defined(OPENGL_ENABLED)
#if defined(GLES3_ENABLED)
//if (rasterizer)
// rasterizer->set_force_16_bits_fbo(p_is_16);
#endif
}
void OS_Android::set_opengl_extensions(const char *p_gl_extensions) {
#if defined(OPENGL_ENABLED)
#if defined(GLES3_ENABLED)
ERR_FAIL_COND(!p_gl_extensions);
gl_extensions = p_gl_extensions;
#endif
@@ -321,7 +321,7 @@ OS_Android::OS_Android(GodotJavaWrapper *p_godot_java, GodotIOJavaWrapper *p_god
main_loop = nullptr;
#if defined(OPENGL_ENABLED)
#if defined(GLES3_ENABLED)
gl_extensions = nullptr;
use_gl2 = false;
#endif

View File

@@ -47,7 +47,7 @@ private:
bool use_apk_expansion;
#if defined(OPENGL_ENABLED)
#if defined(GLES3_ENABLED)
const char *gl_extensions;
#endif