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

Add Direct3D 12 setup script for distribution with binary releases #91475

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented May 2, 2024

This script is meant to be packaged with binary releases so that Direct3D 12 support can be set up in an automated manner. To use the script, double-click it and follow the instructions. The EULA can be accepted automatically using the -y or /y command line argument (e.g. for use on CI).

This installs dxil.dll and the Agility SDK, both of which are copied on export if a project uses Direct3D 12 or requests it with the application/export_d3d12 option in its Windows export preset.

PIX is not set up by this script, as it requires further conversion to work with MinGW (which official Godot binaries use). This tool is not available out of the box on Windows, so it'd need to also download a MinGW toolchain to run dlltool. Either way, PIX is only required for engine developers anyway, not regular users of an exported project.

There is a TODO left in the script as I can't find a permalink to the Microsoft EULA used for dxil.dll. This EULA is included as LICENSE-MS.txt in the DirectX Shader Compiler download, but since it's only part of the ZIP archive (and is not in the GitHub repository), there's no way we could display it to the user before they accept the EULA.

You can find the EULA I reuploaded from the latest release here: LICENSE-MS.txt

FAQ

In-editor integration versus command line tool

I chose to make this a command line tool, so you have a chance to run it before starting Godot. In platforms where OpenGL/Vulkan support are not available, this allows setting up Direct3D 12 before you start Godot. The project manager/editor could be configured to take advantage of this with an automatic fallback to Direct3D 12 (similar to godotengine/godot-proposals#8006).

In comparison, an editor or project manager tool wouldn't be able to run before initializing a window, and therefore a graphics context. (That is, unless Godot had a software rendering backend for 2D/GUI-only apps.)

Comparison with the existing install script

There's already a install_d3d12_sdk_windows.py script that installs Direct3D 12 SDK components. However, this one is meant to be used by engine developers to compile and run Direct3D 12-enabled builds. It also requires Python to be installed to be run.

In contrast, this PR adds a Batch script that has no dependencies. It's designed to be run by engine users who don't intend to compile the engine.

Preview

output

TODO

  • Check if the ANSI color codes work on recent Windows 10 versions with its traditional console.
    • Works on Windows 10 22H2 (conhost) and Windows 11 23H2 (Windows Terminal).

This script is meant to be packaged with binary releases so that
Direct3D 12 support can be set up in an automated manner.
To use the script, double-click it and follow the instructions.
The EULA can be accepted automatically using the `-y` or `/y`
command line argument (e.g. for use on CI).

This installs `dxil.dll` and the Agility SDK, both of which are
copied on export if a project uses Direct3D 12 or requests it
with the `application/export_d3d12` option in its Windows export preset.

PIX is not set up by this script, as it requires further conversion
to work with MinGW (which official Godot binaries use). It's also
only required for engine developers anyway, not regular users of an
exported project.
The script now only sets up Agility SDK, which mostly benefits users
on Windows 10.
@Calinou Calinou force-pushed the windows-add-d3d12-setup-script branch from e996809 to 1a6f19c Compare July 13, 2024 02:36
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.

1 participant