Research and benchmarksWorksSource available
Target: d3dasm

d3dasm Direct3D Shader Tooling

Platform
Cross-platform (Rust)
Outcome
Works

Evidence at a glance

Loading source evidence…

What was done

d3dasm provides a lossless, spec-accurate framework for parsing, modifying, and recompiling DXBC shader containers. It supports SM4/SM5 bytecode round-tripping and includes an HLSL decompiler built on cfglib.

d3dasm is a Rust-based suite for Direct3D shader bytecode manipulation. It parses DXBC containers and decodes SM4/SM5 bytecode into a typed intermediate representation, producing fxc.exe-compatible disassembly. The project features a lossless round-trip capability, verified against 1,152 real-world shader chunks with zero failures. While published structures like RDEF and signatures are fully parsed, unknown payloads and specific chunks like ILDB or LIBH are preserved opaquely to ensure forward compatibility. The suite includes a decompiler that lifts bytecode into an HLSL-dialect RTL using cfglib, recovering SSA variables and structured control flow. Development involved significant contributions from Claude Opus 4.8, which assisted in implementing byte-exact encoders for RDEF structures and signature blocks. The tool successfully achieves 100% byte-exact reconstruction for the corpus, allowing for shader inspection and modification. Some compiler metadata remains irreducible in HLSL, requiring inline annotations to maintain byte-identical reassembly.

Sources: Source 1, Source 2

Reproduce it

setup

cargo run -- <shader.bin>

Community

Ask a question, share what worked, or follow the next milestone.

Your library