Skip to content

Commit

Permalink
Remove DXIL installation which is no longer needed
Browse files Browse the repository at this point in the history
The script now only sets up Agility SDK, which mostly benefits users
on Windows 10.
  • Loading branch information
Calinou committed Jul 13, 2024
1 parent 75e31bc commit 1a6f19c
Showing 1 changed file with 17 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -1,73 +1,34 @@
@echo off

set godot_version=4.3.dev
set dxc_version=v1.8.2403.2
set dxc_filename=dxc_2024_03_29.zip
set agility_sdk_version=1.610.4
set godot_version=4.3
set agility_sdk_version=1.614.0

echo.
echo --------------------------------------------------------------------------------
echo This script sets up Direct3D 12 support for Godot %godot_version%.
echo.
echo As Direct3D 12 support requires a proprietary library, it is not enabled by default.
echo Note that you don't need Direct3D 12 to use Godot, as Godot already comes with
echo Vulkan and OpenGL support out of the box.
echo.
echo This script will download and install the required libraries for Direct3D 12 support.
echo The libraries will also be installed in the export templates folder, so they can be
echo This script sets up optimized Direct3D 12 support on Windows 10 for Godot %godot_version%.

echo This script will download and install an optional library for enhanced Direct3D 12 support.
echo The library will also be installed in the export templates folder, so they can be
echo copied on export when a project is configured to use Direct3D 12.
echo The total download size is about 65 MB.
echo.
echo By installing DirectX Shader Compiler, you accept the terms of the Microsoft EULA:
echo.
echo TODO
echo.
echo Tip: Use the -y or /y command line argument to automatically accept the EULA.
echo This library is not as useful on Windows 11, but installing it will still benefit
echo players on Windows 10 for projects you export from this PC.
echo --------------------------------------------------------------------------------
echo.

echo Do you accept the Microsoft EULA linked above? (y/n)
if "%1" == "-y" set eula_accepted_cli=1
if "%1" == "/y" set eula_accepted_cli=1
if "%eula_accepted_cli%" == "1" (
echo EULA accepted via command line argument.
goto yes
)
set /p eula_accepted="> " %=%
if /i "%eula_accepted%" == "y" goto yes
if /i "%eula_accepted%" == "yes" goto yes
goto no

:yes
echo.
echo [1m[1/2] Downloading DirectX Shader Compiler release %dxc_version%...[0m
curl.exe -L https://github.com/microsoft/DirectXShaderCompiler/releases/download/%dxc_version%/%dxc_filename% -o "%TEMP%\dxc.zip"
echo [1mDownloading DirectX 12 Agility SDK release %agility_sdk_version%...[0m
curl.exe -L https://www.nuget.org/api/v2/package/Microsoft.Direct3D.D3D12/%agility_sdk_version% -o "%TEMP%\agility_sdk.zip"
echo Download completed.
echo Extracting DirectX Shader Compiler...
call :unzipfile "%TEMP%\dxc" "%TEMP%\dxc.zip"
del "%TEMP%\dxc.zip"
echo Extracting DirectX 12 Agility SDK...
call :unzipfile "%TEMP%\agility_sdk" "%TEMP%\agility_sdk.zip"
del "%TEMP%\agility_sdk.zip"
mkdir "%APPDATA%\Godot" 2>nul
mkdir "%APPDATA%\Godot\export_templates" 2>nul
mkdir "%APPDATA%\Godot\export_templates\%godot_version%" 2>nul
mkdir x64 2>nul
mkdir arm64 2>nul
mkdir x86 2>nul
copy "%TEMP%\dxc\bin\x64\dxil.dll" %APPDATA%\Godot\export_templates\%godot_version%\dxil.x64.dll >nul
move "%TEMP%\dxc\bin\x64\dxil.dll" x64\dxil.dll >nul
copy "%TEMP%\dxc\bin\arm64\dxil.dll" %APPDATA%\Godot\export_templates\%godot_version%\dxil.arm64.dll >nul
move "%TEMP%\dxc\bin\arm64\dxil.dll" arm64\dxil.dll >nul
copy "%TEMP%\dxc\bin\x86\dxil.dll" %APPDATA%\Godot\export_templates\%godot_version%\dxil.x86.dll >nul
move "%TEMP%\dxc\bin\x86\dxil.dll" x86\dxil.dll >nul
del /s /q "%TEMP%\dxc" >nul 2>&1
echo Done installing `dxil.dll` from DirectX Shader Compiler.

echo.
echo [2/2] Downloading DirectX 12 Agility SDK release %agility_sdk_version%...
curl.exe -L https://www.nuget.org/api/v2/package/Microsoft.Direct3D.D3D12/%agility_sdk_version% -o "%TEMP%\agility_sdk.zip"
echo Download completed.
echo Extracting DirectX 12 Agility SDK...
call :unzipfile "%TEMP%\agility_sdk" "%TEMP%\agility_sdk.zip"
del "%TEMP%\agility_sdk.zip"
copy "%TEMP%\agility_sdk\build\native\bin\x64\D3D12Core.dll" %APPDATA%\Godot\export_templates\%godot_version%\D3D12Core.x64.dll >nul
move "%TEMP%\agility_sdk\build\native\bin\x64\D3D12Core.dll" x64\D3D12Core.dll >nul
copy "%TEMP%\agility_sdk\build\native\bin\arm64\D3D12Core.dll" %APPDATA%\Godot\export_templates\%godot_version%\D3D12Core.arm64.dll >nul
Expand All @@ -85,18 +46,15 @@ echo Done installing Agility SDK libraries.

echo.
echo --------------------------------------------------------------------------------
echo Success! Direct3D 12 support is now enabled for this Godot installation (%godot_version%).
echo You can now choose the `d3d12` rendering driver project setting in any project,
echo or run a project with the `--rendering-driver d3d12` command line argument
echo to override the rendering driver for a single session.
echo Success! Optimized Direct3D 12 support is now enabled for this Godot installation (%godot_version%).
echo.
echo Direct3D 12 libraries will automatically be copied along with a project exported
echo for Windows if the project is configured to use Direct3D 12, or if the
echo The Direct3D 12 Agility SDK will automatically be copied along with a project
echo exported for Windows if the project is configured to use Direct3D 12, or if the
echo `application/export_d3d12` option is enabled in the Windows export preset
echo in a given project.
echo.
echo After updating Godot to a newer version, remember to run the Direct3D 12
echo [1msetup script that comes with it to install the Direct3D 12 libraries[0m
echo [1msetup script that comes with it to install the Agility SDK[0m
echo corresponding to the new Godot version. Each Godot version stores
echo Direct3D 12 libraries in a version-specific folder to be copied when exporting.
echo --------------------------------------------------------------------------------
Expand All @@ -118,9 +76,3 @@ if exist %vbs% del /f /q %vbs%
cscript //nologo %vbs%
if exist %vbs% del /f /q %vbs%
goto :eof

:no
echo.
echo You must accept the Microsoft EULA to set up Direct3D 12 support. Aborting.
pause
exit /b 1

0 comments on commit 1a6f19c

Please sign in to comment.