summaryrefslogtreecommitdiffstats
path: root/misc/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'misc/scripts')
-rwxr-xr-xmisc/scripts/black_format.sh2
-rwxr-xr-xmisc/scripts/clang_format.sh2
-rwxr-xr-xmisc/scripts/clang_tidy.sh2
-rwxr-xr-xmisc/scripts/dotnet_format.sh2
-rwxr-xr-xmisc/scripts/file_format.sh2
-rwxr-xr-xmisc/scripts/header_guards.sh2
-rw-r--r--misc/scripts/install_d3d12_sdk_windows.py104
7 files changed, 110 insertions, 6 deletions
diff --git a/misc/scripts/black_format.sh b/misc/scripts/black_format.sh
index 3a64284eb6..48dc14c734 100755
--- a/misc/scripts/black_format.sh
+++ b/misc/scripts/black_format.sh
@@ -20,7 +20,7 @@ fi
# A diff has been created, notify the user, clean up, and exit.
printf "\n\e[1;33m*** The following changes must be made to comply with the formatting rules:\e[0m\n\n"
# Perl commands replace trailing spaces with `·` and tabs with `<TAB>`.
-printf "$diff\n" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge'
+printf "%s\n" "$diff" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge'
printf "\n\e[1;91m*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\e[0m\n"
exit 1
diff --git a/misc/scripts/clang_format.sh b/misc/scripts/clang_format.sh
index 40d94d4276..8b59519606 100755
--- a/misc/scripts/clang_format.sh
+++ b/misc/scripts/clang_format.sh
@@ -47,7 +47,7 @@ fi
# A diff has been created, notify the user, clean up, and exit.
printf "\n\e[1;33m*** The following changes must be made to comply with the formatting rules:\e[0m\n\n"
# Perl commands replace trailing spaces with `·` and tabs with `<TAB>`.
-printf "$diff\n" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge'
+printf "%s\n" "$diff" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge'
printf "\n\e[1;91m*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\e[0m\n"
exit 1
diff --git a/misc/scripts/clang_tidy.sh b/misc/scripts/clang_tidy.sh
index c4811b903c..0c6998b491 100755
--- a/misc/scripts/clang_tidy.sh
+++ b/misc/scripts/clang_tidy.sh
@@ -27,7 +27,7 @@ fi
# A diff has been created, notify the user, clean up, and exit.
printf "\n\e[1;33m*** The following changes must be made to comply with the formatting rules:\e[0m\n\n"
# Perl commands replace trailing spaces with `·` and tabs with `<TAB>`.
-printf "$diff\n" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge'
+printf "%s\n" "$diff" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge'
printf "\n\e[1;91m*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\e[0m\n"
exit 1
diff --git a/misc/scripts/dotnet_format.sh b/misc/scripts/dotnet_format.sh
index cac00f5cb1..e2b4ba5e43 100755
--- a/misc/scripts/dotnet_format.sh
+++ b/misc/scripts/dotnet_format.sh
@@ -31,7 +31,7 @@ fi
# A diff has been created, notify the user, clean up, and exit.
printf "\n\e[1;33m*** The following changes must be made to comply with the formatting rules:\e[0m\n\n"
# Perl commands replace trailing spaces with `·` and tabs with `<TAB>`.
-printf "$diff\n" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge'
+printf "%s\n" "$diff" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge'
printf "\n\e[1;91m*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\e[0m\n"
exit 1
diff --git a/misc/scripts/file_format.sh b/misc/scripts/file_format.sh
index 94a3affbd7..ad58657883 100755
--- a/misc/scripts/file_format.sh
+++ b/misc/scripts/file_format.sh
@@ -82,7 +82,7 @@ then
# A diff has been created, notify the user, clean up, and exit.
printf "\n\e[1;33m*** The following changes must be made to comply with the formatting rules:\e[0m\n\n"
# Perl commands replace trailing spaces with `·` and tabs with `<TAB>`.
- printf "$diff\n" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge'
+ printf "%s\n" "$diff" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge'
fi
printf "\n\e[1;91m*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\e[0m\n"
diff --git a/misc/scripts/header_guards.sh b/misc/scripts/header_guards.sh
index ce0b3f334d..a79ccd4bee 100755
--- a/misc/scripts/header_guards.sh
+++ b/misc/scripts/header_guards.sh
@@ -81,7 +81,7 @@ fi
# A diff has been created, notify the user, clean up, and exit.
printf "\n\e[1;33m*** The following changes must be made to comply with the formatting rules:\e[0m\n\n"
# Perl commands replace trailing spaces with `·` and tabs with `<TAB>`.
-printf "$diff\n" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge'
+printf "%s\n" "$diff" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge'
printf "\n\e[1;91m*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\e[0m\n"
exit 1
diff --git a/misc/scripts/install_d3d12_sdk_windows.py b/misc/scripts/install_d3d12_sdk_windows.py
new file mode 100644
index 0000000000..8cfa1d399b
--- /dev/null
+++ b/misc/scripts/install_d3d12_sdk_windows.py
@@ -0,0 +1,104 @@
+#!/usr/bin/env python
+
+import os
+import urllib.request
+import shutil
+
+# Base Godot dependencies path
+# If cross-compiling (no LOCALAPPDATA), we install in `bin`
+deps_folder = os.getenv("LOCALAPPDATA")
+if deps_folder:
+ deps_folder = os.path.join(deps_folder, "Godot", "build_deps")
+else:
+ deps_folder = os.path.join("bin", "build_deps")
+
+# DirectX Shader Compiler
+dxc_version = "v1.7.2308"
+dxc_filename = "dxc_2023_08_14.zip"
+dxc_archive = os.path.join(deps_folder, dxc_filename)
+dxc_folder = os.path.join(deps_folder, "dxc")
+# Mesa NIR
+mesa_version = "23.1.0-devel"
+mesa_filename = "godot-nir-23.1.0-1-devel.zip"
+mesa_archive = os.path.join(deps_folder, mesa_filename)
+mesa_folder = os.path.join(deps_folder, "mesa")
+# WinPixEventRuntime
+pix_version = "1.0.231030001"
+pix_archive = os.path.join(deps_folder, f"WinPixEventRuntime_{pix_version}.nupkg")
+pix_folder = os.path.join(deps_folder, "pix")
+# DirectX 12 Agility SDK
+agility_sdk_version = "1.610.4"
+agility_sdk_archive = os.path.join(deps_folder, f"Agility_SDK_{agility_sdk_version}.nupkg")
+agility_sdk_folder = os.path.join(deps_folder, "agility_sdk")
+
+# Create dependencies folder
+if not os.path.exists(deps_folder):
+ os.makedirs(deps_folder)
+
+# DirectX Shader Compiler
+print("[1/4] DirectX Shader Compiler")
+if os.path.isfile(dxc_archive):
+ os.remove(dxc_archive)
+print(f"Downloading DirectX Shader Compiler {dxc_filename} ...")
+urllib.request.urlretrieve(
+ f"https://github.com/microsoft/DirectXShaderCompiler/releases/download/{dxc_version}/{dxc_filename}",
+ dxc_archive,
+)
+if os.path.exists(dxc_folder):
+ print(f"Removing existing local DirectX Shader Compiler installation in {dxc_folder} ...")
+ shutil.rmtree(dxc_folder)
+print(f"Extracting DirectX Shader Compiler {dxc_filename} to {dxc_folder} ...")
+shutil.unpack_archive(dxc_archive, dxc_folder)
+os.remove(dxc_archive)
+print(f"DirectX Shader Compiler {dxc_filename} installed successfully.\n")
+
+# Mesa NIR
+print("[2/4] Mesa NIR")
+if os.path.isfile(mesa_archive):
+ os.remove(mesa_archive)
+print(f"Downloading Mesa NIR {mesa_filename} ...")
+urllib.request.urlretrieve(
+ f"https://github.com/godotengine/godot-nir-static/releases/download/{mesa_version}/{mesa_filename}",
+ mesa_archive,
+)
+if os.path.exists(mesa_folder):
+ print(f"Removing existing local Mesa NIR installation in {mesa_folder} ...")
+ shutil.rmtree(mesa_folder)
+print(f"Extracting Mesa NIR {mesa_filename} to {mesa_folder} ...")
+shutil.unpack_archive(mesa_archive, mesa_folder)
+os.remove(mesa_archive)
+print(f"Mesa NIR {mesa_filename} installed successfully.\n")
+
+# WinPixEventRuntime
+print("[3/4] WinPixEventRuntime")
+if os.path.isfile(pix_archive):
+ os.remove(pix_archive)
+print(f"Downloading WinPixEventRuntime {pix_version} ...")
+urllib.request.urlretrieve(f"https://www.nuget.org/api/v2/package/WinPixEventRuntime/{pix_version}", pix_archive)
+if os.path.exists(pix_folder):
+ print(f"Removing existing local WinPixEventRuntime installation in {pix_folder} ...")
+ shutil.rmtree(pix_folder)
+print(f"Extracting WinPixEventRuntime {pix_version} to {pix_folder} ...")
+shutil.unpack_archive(pix_archive, pix_folder, "zip")
+os.remove(pix_archive)
+print(f"WinPixEventRuntime {pix_version} installed successfully.\n")
+
+# DirectX 12 Agility SDK
+print("[4/4] DirectX 12 Agility SDK")
+if os.path.isfile(agility_sdk_archive):
+ os.remove(agility_sdk_archive)
+print(f"Downloading DirectX 12 Agility SDK {agility_sdk_version} ...")
+urllib.request.urlretrieve(
+ f"https://www.nuget.org/api/v2/package/Microsoft.Direct3D.D3D12/{agility_sdk_version}", agility_sdk_archive
+)
+if os.path.exists(agility_sdk_folder):
+ print(f"Removing existing local DirectX 12 Agility SDK installation in {agility_sdk_folder} ...")
+ shutil.rmtree(agility_sdk_folder)
+print(f"Extracting DirectX 12 Agility SDK {agility_sdk_version} to {agility_sdk_folder} ...")
+shutil.unpack_archive(agility_sdk_archive, agility_sdk_folder, "zip")
+os.remove(agility_sdk_archive)
+print(f"DirectX 12 Agility SDK {agility_sdk_version} installed successfully.\n")
+
+# Complete message
+print(f"All Direct3D 12 SDK components were installed to {deps_folder} successfully!")
+print('You can now build Godot with Direct3D 12 support enabled by running "scons d3d12=yes".')