Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider always saving the rendering API name #37645

Open
aaronfranke opened this issue Apr 6, 2020 · 9 comments
Open

Consider always saving the rendering API name #37645

aaronfranke opened this issue Apr 6, 2020 · 9 comments

Comments

@aaronfranke
Copy link
Member

aaronfranke commented Apr 6, 2020

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 uh, non-Vulkan version of Godot).

@clayjohn
Copy link
Member

clayjohn commented Apr 7, 2020

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

@aaronfranke
Copy link
Member Author

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.

@clayjohn
Copy link
Member

clayjohn commented Apr 7, 2020

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.

@aaronfranke
Copy link
Member Author

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

@clayjohn
Copy link
Member

clayjohn commented Apr 7, 2020

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?

@aaronfranke
Copy link
Member Author

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.

@akien-mga
Copy link
Member

akien-mga commented Apr 7, 2020

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.

@aaronfranke
Copy link
Member Author

aaronfranke commented Apr 7, 2020

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(). EDIT: Never mind.

@clayjohn
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants