Merge pull request #65541 from clayjohn/renderer-setting
Split rendering driver project setting into renderer_name and rendering_driver
This commit is contained in:
commit
7da532275b
43 changed files with 411 additions and 245 deletions
|
|
@ -1669,14 +1669,7 @@ Vector<String> EditorExportPlatformAndroid::get_enabled_abis(const Ref<EditorExp
|
|||
}
|
||||
|
||||
void EditorExportPlatformAndroid::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) const {
|
||||
String driver = ProjectSettings::get_singleton()->get("rendering/driver/driver_name");
|
||||
if (driver == "opengl3") {
|
||||
r_features->push_back("etc");
|
||||
}
|
||||
// FIXME: Review what texture formats are used for Vulkan.
|
||||
if (driver == "vulkan") {
|
||||
r_features->push_back("etc2");
|
||||
}
|
||||
r_features->push_back("etc2");
|
||||
|
||||
Vector<String> abis = get_enabled_abis(p_preset);
|
||||
for (int i = 0; i < abis.size(); ++i) {
|
||||
|
|
|
|||
|
|
@ -189,9 +189,7 @@ String bool_to_string(bool v) {
|
|||
}
|
||||
|
||||
String _get_gles_tag() {
|
||||
bool min_gles3 = ProjectSettings::get_singleton()->get("rendering/driver/driver_name") == "GLES3" &&
|
||||
!ProjectSettings::get_singleton()->get("rendering/driver/fallback_to_gles2");
|
||||
return min_gles3 ? " <uses-feature android:glEsVersion=\"0x00030000\" android:required=\"true\" />\n" : "";
|
||||
return " <uses-feature android:glEsVersion=\"0x00030000\" android:required=\"true\" />\n";
|
||||
}
|
||||
|
||||
String _get_screen_sizes_tag(const Ref<EditorExportPreset> &p_preset) {
|
||||
|
|
|
|||
|
|
@ -274,11 +274,11 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
|
|||
return false;
|
||||
}
|
||||
|
||||
final String videoDriver = GodotLib.getGlobal("rendering/driver/driver_name");
|
||||
if (videoDriver.equals("vulkan")) {
|
||||
mRenderView = new GodotVulkanRenderView(activity, this);
|
||||
} else {
|
||||
final String renderer = GodotLib.getGlobal("rendering/renderer/rendering_method");
|
||||
if (renderer.equals("gl_compatibility")) {
|
||||
mRenderView = new GodotGLRenderView(activity, this, xrMode, use_debug_opengl);
|
||||
} else {
|
||||
mRenderView = new GodotVulkanRenderView(activity, this);
|
||||
}
|
||||
|
||||
View view = mRenderView.getView();
|
||||
|
|
|
|||
|
|
@ -89,12 +89,12 @@
|
|||
|
||||
// FIXME: Add Vulkan support via MoltenVK. Add fallback code back?
|
||||
|
||||
// Create GL ES 2 context
|
||||
if (GLOBAL_GET("rendering/driver/driver_name") == "opengl3") {
|
||||
context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
|
||||
NSLog(@"Setting up an OpenGL ES 2.0 context.");
|
||||
// Create GL ES 3 context
|
||||
if (GLOBAL_GET("rendering/renderer/rendering_method") == "gl_compatibility") {
|
||||
context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
|
||||
NSLog(@"Setting up an OpenGL ES 3.0 context.");
|
||||
if (!context) {
|
||||
NSLog(@"Failed to create OpenGL ES 2.0 context!");
|
||||
NSLog(@"Failed to create OpenGL ES 3.0 context!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ DisplayServerIOS::DisplayServerIOS(const String &p_rendering_driver, WindowMode
|
|||
// Note that we should be checking "opengl3" as the driver, might never enable this seeing OpenGL is deprecated on iOS
|
||||
// We are hardcoding the rendering_driver to "vulkan" down below
|
||||
|
||||
if (rendering_driver == "opengl_es") {
|
||||
if (rendering_driver == "opengl3") {
|
||||
bool gl_initialization_error = false;
|
||||
|
||||
// FIXME: Add Vulkan support via MoltenVK. Add fallback code back?
|
||||
|
|
@ -163,7 +163,7 @@ Vector<String> DisplayServerIOS::get_rendering_drivers_func() {
|
|||
drivers.push_back("vulkan");
|
||||
#endif
|
||||
#if defined(GLES3_ENABLED)
|
||||
drivers.push_back("opengl_es");
|
||||
drivers.push_back("opengl3");
|
||||
#endif
|
||||
|
||||
return drivers;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include "editor/editor_node.h"
|
||||
|
||||
void EditorExportPlatformIOS::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) const {
|
||||
String driver = ProjectSettings::get_singleton()->get("rendering/driver/driver_name");
|
||||
// Vulkan and OpenGL ES 3.0 both mandate ETC2 support.
|
||||
r_features->push_back("etc2");
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ static const float earth_gravity = 9.80665;
|
|||
|
||||
if ([driverName isEqualToString:@"vulkan"]) {
|
||||
layer = [GodotMetalLayer layer];
|
||||
} else if ([driverName isEqualToString:@"opengl_es"]) {
|
||||
} else if ([driverName isEqualToString:@"opengl3"]) {
|
||||
if (@available(iOS 13, *)) {
|
||||
NSLog(@"OpenGL ES is deprecated on iOS 13");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -307,13 +307,7 @@ void EditorExportPlatformWeb::get_preset_features(const Ref<EditorExportPreset>
|
|||
}
|
||||
|
||||
if (p_preset->get("vram_texture_compression/for_mobile")) {
|
||||
String driver = ProjectSettings::get_singleton()->get("rendering/driver/driver_name");
|
||||
if (driver == "opengl3") {
|
||||
r_features->push_back("etc");
|
||||
} else if (driver == "vulkan") {
|
||||
// FIXME: Review if this is correct.
|
||||
r_features->push_back("etc2");
|
||||
}
|
||||
r_features->push_back("etc2");
|
||||
}
|
||||
r_features->push_back("wasm32");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue