Godot: Consider always saving the rendering API name

Created on 7 Apr 2020  路  9Comments  路  Source: godotengine/godot

If you set a project to use GLES 2, this is saved in the project.godot file:

[rendering]

quality/driver/driver_name="GLES2"

However, this string is not saved with a GLES 3 project in Godot 3.2, or in a Vulkan project in the current master. I think it would make sense for this string to always be saved.

This would help with #31171, since we could use this information to show warnings in the project manager if the project is using an unsupported API, such as if the list of rendering APIs in Godot changes in the future (ex: Opening a 3.2 GLES 3 project in Godot 4.0), or if compiling for a platform without specific APIs (ex: We'd want to show warnings for Vulkan projects if you tried to open them on a possible future Raspberry Pi version of Godot).

discussion enhancement editor

Most helpful comment

I agree that some settings which have a big impact on the project should always be serialized, even when using a default value, so that we can also change default values in the future without breaking projects.

For example:

  • Rendering driver
  • Physics backend (current 3D "DEFAULT" is Bullet, but Juan wants to fix GodotPhysics and maybe make it default again - but Bullet-using projects should not be impacted)
  • VRAM compression formats (goes with rendering driver)
  • Window width/height and maybe some of the flags (resizable, borderless, fullscreen, etc.)

Reviewing the list, I can't think of others that would benefit from this.

All 9 comments

Wouldn't you be able to just infer the rendering API? For example:

var api_name = get_api_name()

if api_name == String():
    api_name = "Vulkan"

//This section wouldnt even have to change
if api_name == "Vulkan":
    //Do something
else if api_name == "GLES3":
    //Can extend to any hypothetical renderer
else if api_name == "GLES2":
    //Do stuff

No, because this code:

var api_name = get_api_name()

if api_name == String():
    api_name = "Vulkan"

will return "Vulkan" for projects using GLES 3, since api_name == String() is true for GLES 3 projects.

No version of the engine currently allows for both Vulkan and GLES3. If we hypothetically re-added GLES3 in the future it would be saved as it isn't the default rendering API.

The issue is with newer versions of the engine reading projects from different engine versions.

So the problem would arise if we decided to ship a version of Godot that supported Vulkan, GLES2 and GLES3 and users wanted to upgrade a project from 3.2, but were on a device that supports GLES3 but not Vulkan?

It's useful any time the default API changes (which has so far happened for both Godot 3.0 and 4.0). There is currently no way to definitively determine the rendering API used in a project unless you also know what version of Godot was used to make the project.

I agree that some settings which have a big impact on the project should always be serialized, even when using a default value, so that we can also change default values in the future without breaking projects.

For example:

  • Rendering driver
  • Physics backend (current 3D "DEFAULT" is Bullet, but Juan wants to fix GodotPhysics and maybe make it default again - but Bullet-using projects should not be impacted)
  • VRAM compression formats (goes with rendering driver)
  • Window width/height and maybe some of the flags (resizable, borderless, fullscreen, etc.)

Reviewing the list, I can't think of others that would benefit from this.

For a solution to this, I have this commit, but if #32144 is merged then we can store a PackedStringArray of exceptions and check against that via .has().

Just wanted to point out that my comments haven't aged well now that we are considering have GLES2, GLES3, and Vulkan backends. :P

Was this page helpful?
0 / 5 - 0 ratings