#spir-v #dxil

sys spirv-to-dxil-sys

Raw bindings to spirv-to-dxil

14 releases

0.4.7 Feb 20, 2024
0.4.5 Jan 16, 2024
0.4.4-beta Dec 10, 2023
0.4.3 Nov 29, 2023
0.3.0 Feb 7, 2023

#1254 in Graphics APIs

Download history 109/week @ 2025-09-23 331/week @ 2025-09-30 74/week @ 2025-10-07 183/week @ 2025-10-14 192/week @ 2025-10-21 346/week @ 2025-10-28 133/week @ 2025-11-04 195/week @ 2025-11-11 101/week @ 2025-11-18 91/week @ 2025-11-25 60/week @ 2025-12-02 56/week @ 2025-12-09 72/week @ 2025-12-16 57/week @ 2025-12-23 62/week @ 2025-12-30 127/week @ 2026-01-06

323 downloads per month
Used in 9 crates (via spirv-to-dxil)

MIT license

61MB
2.5M SLoC

C 2M SLoC // 0.1% comments C++ 80K SLoC // 0.2% comments Python 25K SLoC // 0.4% comments GNU Style Assembly 18K SLoC Rust 15K SLoC // 0.1% comments Happy 4.5K SLoC GLSL 3K SLoC // 0.2% comments LLVM 774 SLoC Lex 761 SLoC // 0.2% comments Forge Config 257 SLoC XSL 146 SLoC // 0.2% comments Shell 130 SLoC // 0.1% comments GraphQL 51 SLoC

spirv-to-dxil-rs

Safe Rust bindings to spirv-to-dxil.

Latest Version Docs License

Building

spirv-to-dxil-rs builds a copy of spirv-to-dxil statically from Mesa.

A script to clone a minimal subset of Mesa required to build spirv-to-dxil has been provided.

$ ./clone-mesa.sh
$ cargo build

Updating Mesa

Unless you are maintaining spirv-to-dxil-rs, you do not need to update Mesa frequently.

Updating Mesa requires Python 3.6 and mako to pre-generate templated files. CMake is also required to regenerate the Rust bindings from spirv-to-dxil.h, this is to ensure that bindings can be generated regardless of whether changes need to be made to the spirv-to-dxil-sys build script.

  1. Update the submodule to HEAD

    git submodule update --init --remote --depth 1 --single-branch --progress spirv-to-dxil-sys/native/mesa

  2. Re-apply sparse-checkout

    git submodule absorbgitdirs
    git -C spirv-to-dxil-sys/native/mesa config core.sparseCheckout true
    git -C spirv-to-dxil-sys/native/mesa config core.symlinks false
    cp spirv-to-dxil-sys/native/mesa-sparse-checkout .git/modules/spirv-to-dxil-sys/native/mesa/info/sparse-checkout
    git submodule foreach git sparse-checkout reapply
    
  3. Regenerate bindings

    cargo run --bin bindings_generator
    
  4. Regenerate mako-generated files for cc

    ./mesa_mako 
    

Dependencies