fix the failures that were failing quietly

This commit is contained in:
2026-09-21 06:22:44 +03:00
parent 371c910068
commit b33ce5bf77
8 changed files with 110 additions and 35 deletions
+7 -6
View File
@@ -8,9 +8,9 @@ fn main() {
/// Compile the HDR tonemap HLSL to bytecode at build time so we can embed it
/// via `include_bytes`! and avoid a runtime dependency on `d3dcompiler_47.dll`.
/// Looks for fxc.exe in the installed Windows SDK. If fxc is unavailable the
/// .cso files are emitted empty and capture.rs falls back to runtime
/// `D3DCompile` (so a clean checkout without the SDK still builds).
/// Looks for fxc.exe in the installed Windows SDK. Without the SDK the .cso
/// files are emitted empty so the build still succeeds, and there is no runtime
/// compile path: capture.rs refuses to start on empty bytecode and says why.
fn compile_shaders() {
// Cargo always sets OUT_DIR for a build script; if it is missing the build
// is broken in a way we cannot paper over, so say so plainly.
@@ -56,15 +56,16 @@ fn compile_shaders() {
}
}
None => {
// No SDK on the build machine - emit an empty .cso; capture.rs
// detects the zero size and compiles the HLSL at runtime.
// No SDK on the build machine - emit an empty .cso so the build
// still succeeds; capture.rs rejects it at startup and points at
// the SDK rather than failing opaquely on the first frame.
drop(std::fs::write(&dst, []));
}
}
}
if fxc.is_none() {
println!("cargo:warning=fxc.exe not found - shaders will be compiled at runtime");
println!("cargo:warning=fxc.exe not found - shaders cannot be compiled, capture will refuse to start");
}
println!("cargo:rerun-if-changed=shaders/tonemap.hlsl");
}