Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

Windows: DX12's shader compiler ships with raea (#215)

shinyobjectz39369393f75c
diff --git a/NOTICE b/NOTICE
index 88577a3a..38e1bdc9 100644
--- a/NOTICE
+++ b/NOTICE
@@ -27,7 +27,9 @@ paths for Windows in runtime/bundle). Its bin\ also carries, each with its licen
and libvpx 1.17.0's decoders (BSD-3-Clause with the WebM project's patent grant: libvpx-LICENSE.txt,
libvpx-PATENTS.txt) by tools/release/ffmpeg-win.sh, its H.264 encoder Windows' own (Media Foundation), its source
published as the release tools-ffmpeg-9.0.2-lgpl;
- uv (uv.exe; Astral, MIT OR Apache-2.0).
+ uv (uv.exe; Astral, MIT OR Apache-2.0);
+ Microsoft's DirectX Shader Compiler v1.8.2502 (dxcompiler.dll, dxil.dll), DX12's shader compiler, redistributed under
+ its licence terms (dxc-LICENSE-MS.txt; its LLVM parts under dxc-LICENSE-LLVM.txt and dxc-LICENSE-MIT.txt).
The Windows app adds Git for Windows with Git LFS (dugite-native; GPLv2 and its parts' licences, in git\), which raea
runs as a separate program; its complete corresponding source is published as the release tools-git-<tag>-sources.
raea.exe, on a PC with no Git, fetches the same build once into its tools cache (io/assets git()).
diff --git a/tools/release-check.sh b/tools/release-check.sh
index 307aa5d2..60e5707c 100644
--- a/tools/release-check.sh
+++ b/tools/release-check.sh
@@ -151,7 +151,7 @@ api=$(cat "$check"/raea/bin/* | grep -aoE '(api|sign)\.raea\.io|RAEA_(SIGN|GEN)_
keys=$(grep -rlE 'sk-or-v1-[0-9a-f]{20}|sk-ant-[A-Za-z0-9_-]{20}|(^|[^A-Za-z0-9+/])AKIA[0-9A-Z]{16}([^A-Za-z0-9+/=]|$)|BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY' "$check/raea" 2>/dev/null | head -5 || true)
[ -z "$keys" ] || fail "key-shaped text in: $keys"
# Windows: our binaries, and Microsoft's only where raea ships them on purpose, with their licences: ONNX Runtime's
-# onnxruntime.dll (MIT, #110) and the VC++ runtime's four DLLs (tools/release/win-bundle.sh). Any other DLL, or a file
+# onnxruntime.dll (MIT, #110), the VC++ runtime's four DLLs and DXC's two (#215; tools/release/win-bundle.sh). Any other DLL, or a file
# named like the CRT, the SDK or DirectX's redistributables, isn't ours to ship.
bundle=$(tr -d '\r' < "$(dirname "$0")/release/win-bundle.files")
allowed=$(printf './bin/%s\n' raea_bundle.dll onnxruntime.dll $bundle)
diff --git a/tools/release.sh b/tools/release.sh
index 83bb11a8..efe1ece9 100755
--- a/tools/release.sh
+++ b/tools/release.sh
@@ -138,14 +138,14 @@ loader (Debian and Ubuntu: apt install libxkbcommon-x11-0 libxcursor1 libxi6 lib
cp "$bin/$f" "$stage/bin/"
done
# and what a PC with nothing installed and no downloads needs (tools/release/win-bundle.sh): the VC++ runtime
- # raea.exe and onnxruntime.dll import, FFmpeg (raea's LGPL build) and uv, each with its licence; the list read without
+ # raea.exe and onnxruntime.dll import, FFmpeg (raea's LGPL build), uv and DXC (DX12's shader compiler, #215), each with its licence; the list read without
# its \r, as GitHub's Windows runner checks it out with CRLF (0.1.8-rc9 looked for "vcruntime140.dll\r")
for f in $(tr -d '\r' < "$root/tools/release/win-bundle.files"); do
[ -f "$bin/$f" ] || { echo "release.sh: $bin has no $f (tools/release/win-bundle.sh $bin)" >&2; exit 1; }
cp "$bin/$f" "$stage/bin/"
done
printf '%s\r\n' "raea $version for Windows x86_64 (Windows 10 or 11, a DirectX 12 or Vulkan GPU driver; with no GPU, Mesa's lavapipe and WGPU_BACKEND=vulkan)." \
- "bin\\ carries what raea needs from outside it: Microsoft's Visual C++ runtime and ONNX Runtime, FFmpeg (LGPL) and uv," \
+ "bin\\ carries what raea needs from outside it: Microsoft's Visual C++ runtime, ONNX Runtime and DXC, FFmpeg (LGPL) and uv," \
"each with its licence beside it (ffmpeg-README.txt says where FFmpeg's source is)." > "$stage/README.txt" ;;
*) cp "$bin/raea" "$bin/libraea_bundle.dylib" "$bin/raea-perceive" "$bin/raea-rune-host" "$bin/raea-page-host" "$stage/bin/"
# stripped as they linked (tools/link-jit.sh, #88); a binary that still holds its debug map is a build from before
diff --git a/tools/release/win-bundle.files b/tools/release/win-bundle.files
index 58dc3df5..057c404f 100644
--- a/tools/release/win-bundle.files
+++ b/tools/release/win-bundle.files
@@ -12,3 +12,8 @@ libvpx-PATENTS.txt
uv.exe
uv-LICENSE-MIT.txt
uv-LICENSE-APACHE.txt
+dxcompiler.dll
+dxil.dll
+dxc-LICENSE-MS.txt
+dxc-LICENSE-LLVM.txt
+dxc-LICENSE-MIT.txt
diff --git a/tools/release/win-bundle.sh b/tools/release/win-bundle.sh
index 57baf19e..fcb7a40d 100755
--- a/tools/release/win-bundle.sh
+++ b/tools/release/win-bundle.sh
@@ -9,6 +9,10 @@
# - FFmpeg (ffmpeg.exe, ffprobe.exe): raea's own LGPL build (tools/release/ffmpeg-win.sh), the one setup.rs fetches
# where it isn't, with its licence and where its source is
# - uv (uv.exe), the release every local model's setup was measured with (MIT or Apache 2.0), with both licences
+# - DXC (dxcompiler.dll, dxil.dll), Microsoft's shader compiler, from its release v1.8.2502 (wgpu's minimum), with its
+# three licences: wgpu compiles DX12's shaders with it when it sits beside raea.exe, else with the old FXC, which cost
+# 6 to 13 s of hitches at start and as new 3D appeared on every PC DX12 is chosen for: Intel, AMD and Arc (#215; the
+# chat page 17.7 s with FXC, 12.0 s with DXC on the test PC)
# The pins are setup.rs's, so what ships and what's fetched are the same build.
# tools/release/win-bundle.sh DEST (on the Windows runner, in Git's bash)
set -euo pipefail
@@ -59,4 +63,10 @@ unzip -q -o "$tmp/uv.zip" uv.exe -d "$dest"
fetch "https://raw.githubusercontent.com/astral-sh/uv/$uv/LICENSE-MIT" "$dest/uv-LICENSE-MIT.txt" 860e3d7a86b84e6a7012c7a635fc64df475cebc6cce34dfeb73a5982ec58176c
fetch "https://raw.githubusercontent.com/astral-sh/uv/$uv/LICENSE-APACHE" "$dest/uv-LICENSE-APACHE.txt" c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4
-echo "win-bundle: in $dest: the VC++ runtime $ver, FFmpeg ($top), uv $uv, with their licences"
+# DXC: Microsoft's distributable dxcompiler.dll and dxil.dll (LICENSE-MS.txt), the x64 ones, and the release's licences
+dxc=v1.8.2502
+fetch "https://github.com/microsoft/DirectXShaderCompiler/releases/download/$dxc/dxc_2025_02_20.zip" "$tmp/dxc.zip" 70b1913a1bfce4a3e1a5311d16246f4ecdf3a3e613abec8aa529e57668426f85
+unzip -q -o -j "$tmp/dxc.zip" bin/x64/dxcompiler.dll bin/x64/dxil.dll -d "$dest"
+for l in MS LLVM MIT; do unzip -p "$tmp/dxc.zip" "LICENSE-$l.txt" > "$dest/dxc-LICENSE-$l.txt"; done
+
+echo "win-bundle: in $dest: the VC++ runtime $ver, FFmpeg ($top), uv $uv, DXC $dxc, with their licences"