-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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 a script to install Direct3D 12 SDK components #86123
Conversation
- Define a default path that uses the locations from the script. This makes it much faster to get started with Direct3D 12 builds, as you only need to run `misc/scripts/install_d3d12_sdk_windows.ps1` then run `scons d3d12=yes`. This installs DirectX Shader Compiler, Mesa NIR, WinPixEventRuntime and DirectX 12 Agility SDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems useful 👍
I'm a bit concerned about the impact of the Agility and PIX SDKs which are optional dependencies, but now would likely be installed by most users if we document this as the easiest way to set things up.
What's the impact from those optional deps on production builds?
Another concern is that we're installing silently to %LOCALAPPDATA%
, so it might not be easy for users to clean up old dependencies in their user folder. At least printing the path at install would help, but maybe it should even be printed when building? Or there could be an uninstall script.
("mesa_libs", "Path to the MESA/NIR static libraries (required for D3D12)", f"{os.getenv("LOCALAPPDATA")}/mesa"), | ||
("dxc_path", "Path to the DirectX Shader Compiler distribution (required for D3D12)", f"{os.getenv("LOCALAPPDATA")}/dxc"), | ||
("agility_sdk_path", "Path to the Agility SDK distribution (optional for D3D12)", f"{os.getenv("LOCALAPPDATA")}/agility_sdk"), | ||
("agility_sdk_multiarch", "Whether the Agility SDK DLLs will be stored in arch-specific subdirectories", False), | ||
("pix_path", "Path to the PIX runtime distribution (optional for D3D12)", ""), | ||
("pix_path", "Path to the PIX runtime distribution (optional for D3D12)", f"{os.getenv("LOCALAPPDATA")}/pix"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would install those in something like %LOCALAPPDATA%\Godot\build_deps\
. Which can can be factored out as a variable so you only need to getenv
once.
|
||
Write-Output "DirectX 12 Agility SDK $agility_sdk_version installed successfully.`n" | ||
|
||
Write-Output "All Direct3D 12 SDK components were installed successfully!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would output where the dependencies have been installed.
|
||
$dxc_filename="dxc_2023_08_14.zip" | ||
Write-Output "Downloading DirectX Shader Compiler $dxc_filename ..." | ||
Invoke-WebRequest -Uri https://github.com/microsoft/DirectXShaderCompiler/releases/download/v1.7.2308/$dxc_filename -OutFile "$env:TEMP\$dxc_filename" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we extract all version strings as variables at the top of the script, so it's easy to update?
# Downloaded by `misc/scripts/install_dxcompiler_windows.ps1` | ||
platform/windows/dxc/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be from an earlier attempt.
Is downloading these SDKs to %localappdata% a must? |
It could be done, but my rationale for downloading them to
|
Oh that's what I missed. I agree that we can store these in %LOCALAPPDATA%, but should give a clear reminder (or providing an uninstall script). |
A similar Python script could still be useful for cross-compiling Godot with Direct3D on Linux using Wine/MSVC I think. |
MinGW support will be added, either via #86150 or #83452 (Mesa static libs repo is already updated). So adding support for the Wine/MSVC is excessive (is it possible with the current MSVC? Even if it is, it's probably complicated and unstable). |
There is also a downside to using PS1 scripts. If they are not signed, you cannot run them without lowering security levels locally. Doing so is a huge PITA, so unless you have an environment ready for this, it will be very challenging to runs a PS1 script. So moving to Python is probably worthwhile even now. |
This makes it much faster to get started with Direct3D 12 builds, as you only need to run
misc/scripts/install_d3d12_sdk_windows.ps1
then runscons d3d12=yes
.This installs DirectX Shader Compiler, Mesa NIR, WinPixEventRuntime and DirectX 12 Agility SDK.
See also godotengine/godot-docs#8610.
Preview