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

[ANGLE] Add fallback control options and defaults. #82364

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Sep 26, 2023

  • [macOS] Use ANGLE by default if engine is built with statically linked ANGLE.
    • macOS OpenGL is deprecated and buggy, using ANGLE should be more compatible.
  • [Windows] Add option enable/disable fallback to ANGLE and option force specific GPU to always use ANGLE.
    • Automatic fallback to ANGLE might be undesirec in some cases (e.g., in case of OpenXR which doesn't support it).
    • Some older Intel integrated devices have extreamly bad OpenGL support, but still have OpenGL 3.3 listead as supported so automatic fallback won't work in this case, and it might be necessery to workaround it.

int gl_version = detect_wgl_version();
if (gl_version < 30003) {
bool fallback = GLOBAL_GET("rendering/gl_compatibility/fallback_to_angle");
if (fallback && (rendering_driver == "opengl3")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we still need a path to check for gl_version support when not using the fallback? This seems like it will fail for devices that don't have the fallback enabled and don't support the required version

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it will fail for devices that don't have the fallback enabled and don't support the required version

Isn't it what is supposed to do in such case?

@dsnopek
Copy link
Contributor

dsnopek commented Sep 26, 2023

[macOS] Use ANGLE by default if engine is built with statically linked ANGLE.

  • macOS OpenGL is deprecated and buggy, using ANGLE should be more compatible.

Hm. We recently added support for OpenXR on MacOS (see #79614), and while I'm still not totally sure how ANGLE will interact OpenXR, I'm assuming it won't work (either a crash or an error).

Is there an option to disable falling back to ANGLE on MacOS too? Or, is that just for Windows?

/cc @BastiaanOlij

@bruvzg
Copy link
Member Author

bruvzg commented Sep 26, 2023

Is there an option to disable falling back to ANGLE on MacOS too?

There's no fallback, macOS always pretend to have support for 3.2.

@bruvzg
Copy link
Member Author

bruvzg commented Sep 26, 2023

We recently added support for OpenXR on MacOS (see #79614)

It seems like it's not enabled for OpenGL, only for Vulkan.

@dsnopek
Copy link
Contributor

dsnopek commented Sep 26, 2023

It seems like it's not enabled for OpenGL, only for Vulkan.

Ah, I think you're right, based on the SCsub change on that PR. I actually thought it was the other way around since Vulkan isn't natively supported on MacOS :-)

@bruvzg bruvzg marked this pull request as ready for review September 30, 2023 21:09
@bruvzg bruvzg requested review from a team as code owners September 30, 2023 21:09
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@akien-mga akien-mga modified the milestones: 4.x, 4.2 Oct 3, 2023
[macOS] Use ANGLE by default if engine is built with statically linked ANGLE.
[Windows] Add option enable/disable fallback to ANGLE and option force specific GPU to always use ANGLE.
@akien-mga akien-mga merged commit 30bc077 into godotengine:master Oct 3, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@BastiaanOlij
Copy link
Contributor

@bruvzg congrats on the merge. Re OpenXR, we should have a chat, if Angle supports the multiview support, it should be easy to add OpenXR support for DirectX over Angle. Doing so would also be a good prelude to having this work once the DirectX native drivers become available.

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

Successfully merging this pull request may close these issues.

5 participants