gfx-rs / gfx

[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
http://gfx-rs.github.io/
Apache License 2.0
5.36k stars 547 forks source link

Pre-compile shaders at build time for DirectX #2313

Open fkaa opened 6 years ago

fkaa commented 6 years ago

Currently both DirectX 11 & 12 compile their internal shaders at runtime. Not only does it increase startup time, but also adds a runtime dependency on d3dcompiler_xx.dll, which I'm not entirely sure exists everywhere. The latter isn't too big of a deal since we already depend on it for compiling SPIRV-Cross output.

It would be ideal to move this step to build-time, using fxc or dxc in a build script. This would also mean that we need d3dcompiler for our CI, and I'm not sure about the situation there.

jrmuizel commented 6 years ago

d3dcompiler.dll is redistributable so it should be possible to just host it somewhere and download it during CI