Wraps d3dcompiler_47.dll with shims to run it as if it were a native Linux shared library. Primary use case for me is enabling cooking SM5/FXC shaders for Windows from Linux editor. Also includes Rust bindings and CLI for compiling to and inspecting DXBC shader blobs.
Requires d3dcompiler_47.dll be obtained and dropped in repo root.
d3dcrs compile shader.hlsl -e main -t ps_5_0 -o shader.dxbc
d3dcrs disasm shader.dxbc
d3dcrs reflect shader.dxbc
d3dcrs strip shader.dxbc -o stripped.dxbcunreal-4.27-cross-cook-content-windows-linux.patch
-
Build library
cargo build --release
-
Apply the engine patch
cd /path/to/UnrealEngine git apply /path/to/libd3dcompiler/assets/unreal-4.27-cross-cook-content-windows-linux.patch -
Install libd3dcompiler.so
mkdir -p Engine/Binaries/ThirdParty/D3DCompiler/Linux cp /path/to/libd3dcompiler/target/release/libd3dcompiler.so \ Engine/Binaries/ThirdParty/D3DCompiler/Linux/
-
Rebuild engine
./Setup.sh && ./GenerateProjectFiles.sh && make ShaderCompileWorker UnrealEditor
