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

Implement Fallback to Vulkan for MoltenVK #102341

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
macOS: Implement fallback from Metal to Vulkan for x86_64
SheepYhangCN authored and akien-mga committed Feb 10, 2025
commit c0eec97e980305b61c0f3e15fa9fb4a152cf6933
4 changes: 2 additions & 2 deletions doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
@@ -2982,8 +2982,8 @@
[b]Note:[/b] This setting is implemented only on Windows, Android, macOS, iOS, and Linux/X11.
</member>
<member name="rendering/rendering_device/fallback_to_vulkan" type="bool" setter="" getter="" default="true">
If [code]true[/code], the forward renderer will fall back to Vulkan if Direct3D 12 is not supported.
[b]Note:[/b] This setting is implemented only on Windows.
If [code]true[/code], the forward renderer will fall back to Vulkan if Direct3D 12 (on Windows) or Metal (on macOS x86_64) are not supported.
[b]Note:[/b] This setting is implemented only on Windows and macOS.
</member>
<member name="rendering/rendering_device/pipeline_cache/enable" type="bool" setter="" getter="" default="true">
Enable the pipeline cache that is saved to disk if the graphics API supports it.
8 changes: 8 additions & 0 deletions platform/macos/display_server_macos.mm
Original file line number Diff line number Diff line change
@@ -3785,6 +3785,14 @@

#if defined(RD_ENABLED)
#if defined(VULKAN_ENABLED)
#if defined(__x86_64__)
bool fallback_to_vulkan = GLOBAL_GET("rendering/rendering_device/fallback_to_vulkan");
// Metal rendering driver not available on Intel.
if (fallback_to_vulkan && rendering_driver == "metal") {
rendering_driver = "vulkan";
OS::get_singleton()->set_current_rendering_driver_name(rendering_driver);
}
#endif
if (rendering_driver == "vulkan") {
rendering_context = memnew(RenderingContextDriverVulkanMacOS);
}