You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project
Godot runs into many driver bugs when using Vulkan on Windows. All GPU vendors are affected, but Intel generally has the Vulkan driver that runs into the most issues in Godot (such as godotengine/godot#86833).
On top of that, Vulkan allows applications to install layers which affect the rendering of any Vulkan application on the system. While this is an useful tool, applications often install broken layers or don't clean up layer files after uninstalling, which leads to various issues. In the worst case scenario, Godot is completely unable to start with Vulkan if a broken layer makes it crash on startup. In comparison, Direct3D 12 doesn't have a layer system, so it's impossible for this to happen.1
To summarize, the state of Vulkan drivers on Windows is less than ideal. It's overall better than OpenGL, but not quite at the level of Direct3D.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Special K injection works correctly when using D3D12, while it always crashes Godot on startup when using Vulkan (at least in my experience).
It's possible that this is a Godot bug, but I don't know what's causing this.
There are still a few roadblocks to using Direct3D 12 by default that we need to resolve first:
There is currently no shader pipeline caching. This impacts loading times and can result in increased shader compilation stutter.
This was resolved by Add shader baker to project exporter. godot#102552, but only if you export the project with the shader baker enabled. This must be done from a Windows device, which is an issue for those who don't have a Windows setup or are exporting from a Linux CI setup (as it's typically more convenient than using a dedicated Windows instance).
Visuals are expected to be 100% identical across rendering drivers (barring renderer or driver bugs). Therefore, this should not lead to visual changes in existing projects unless you run into a bug. Please report any such bugs when using Direct3D 12; make sure to include comparison screenshots between Direct3D 12 and Vulkan.
What about performance?
Unlike the Metal rendering driver that replaces MoltenVK by default on macOS, there isn't expected to be a significant performance difference between Vulkan and Direct3D 12 on most GPUs. This may differ on Intel GPUs which are known to have performance problems in Vulkan applications, so the D3D12 driver may perform better on those GPUs.
If you want to check this for yourself, try switching your project's rendering/rendering_device/driver.windows project setting to d3d12. If you run into large performance drops that don't occur in Vulkan, please open an issue with a minimal reproduction project attached.
What if my GPU doesn't support Direct3D 12?
Any GPU that supports Vulkan also supports Direct3D 12 on Windows. If this was not the case anyway (or if you use a binary compiled without Direct3D 12 support), Godot automatically falls back to Vulkan since 4.4. If Vulkan is not supported either, then Godot automatically falls back to OpenGL.
Note
Projects that use the Compatibility rendering method are not affected by this proposal. Compatibility uses OpenGL by default, with a fallback to ANGLE on specific graphics drivers (which translates OpenGL to Direct3D 11).
What about users compiling their own binaries?
You need to go through some extra steps to enable Direct3D 12 support in self-compiled binaries.
This proposal would also enable Direct3D 12 support by default in self-compiled binaries. Compilation will fail if the D3D12 dependencies aren't installed. Users can still pass d3d12=no if they wish to build Vulkan-only binaries without having to install Direct3D 12 dependencies.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Describe the project you are working on
The Godot editor 🙂
Describe the problem or limitation you are having in your project
Godot runs into many driver bugs when using Vulkan on Windows. All GPU vendors are affected, but Intel generally has the Vulkan driver that runs into the most issues in Godot (such as godotengine/godot#86833).
On top of that, Vulkan allows applications to install layers which affect the rendering of any Vulkan application on the system. While this is an useful tool, applications often install broken layers or don't clean up layer files after uninstalling, which leads to various issues. In the worst case scenario, Godot is completely unable to start with Vulkan if a broken layer makes it crash on startup. In comparison, Direct3D 12 doesn't have a layer system, so it's impossible for this to happen.1
To summarize, the state of Vulkan drivers on Windows is less than ideal. It's overall better than OpenGL, but not quite at the level of Direct3D.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Godot has a Direct3D 12 rendering driver since 4.0, but it's not used by default.
Using Direct3D 12 by default would sidestep the Vulkan driver bugs that Godot runs into. Additionally, we gain a few upsides for using Direct3D 12:
There are still a few roadblocks to using Direct3D 12 by default that we need to resolve first:
OpenXR lacks Direct3D 12 support with Godot.Does this affect visuals in existing projects?
Visuals are expected to be 100% identical across rendering drivers (barring renderer or driver bugs). Therefore, this should not lead to visual changes in existing projects unless you run into a bug. Please report any such bugs when using Direct3D 12; make sure to include comparison screenshots between Direct3D 12 and Vulkan.
What about performance?
Unlike the Metal rendering driver that replaces MoltenVK by default on macOS, there isn't expected to be a significant performance difference between Vulkan and Direct3D 12 on most GPUs. This may differ on Intel GPUs which are known to have performance problems in Vulkan applications, so the D3D12 driver may perform better on those GPUs.
If you want to check this for yourself, try switching your project's
rendering/rendering_device/driver.windowsproject setting tod3d12. If you run into large performance drops that don't occur in Vulkan, please open an issue with a minimal reproduction project attached.What if my GPU doesn't support Direct3D 12?
Any GPU that supports Vulkan also supports Direct3D 12 on Windows. If this was not the case anyway (or if you use a binary compiled without Direct3D 12 support), Godot automatically falls back to Vulkan since 4.4. If Vulkan is not supported either, then Godot automatically falls back to OpenGL.
Note
Projects that use the Compatibility rendering method are not affected by this proposal. Compatibility uses OpenGL by default, with a fallback to ANGLE on specific graphics drivers (which translates OpenGL to Direct3D 11).
What about users compiling their own binaries?
You need to go through some extra steps to enable Direct3D 12 support in self-compiled binaries.
This proposal would also enable Direct3D 12 support by default in self-compiled binaries. Compilation will fail if the D3D12 dependencies aren't installed. Users can still pass
d3d12=noif they wish to build Vulkan-only binaries without having to install Direct3D 12 dependencies.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Change this line in
main/main.cpp:Also change this line in
SConstruct:If this enhancement will not be used often, can it be worked around with a few lines of script?
No.
Is there a reason why this should be core and not an add-on in the asset library?
This is about changing a rendering default setting.
Footnotes
Vulkan layers are also supported on Linux, but are far less problematic overall due to apps being more behaved with layer usage there. ↩