ground up re-implementation of dxc with minimal dependency graph targeting dxil and spirv, will eventually directly output msl as well
Go to file
peterino2 4666275a0b DXIL: fold promoted values, pass constant buffer structs in place
GlimmerProbeTrace (Glide) still came out at 374 KB of DXIL against
dxc's 155 KB, with 130 allocas against 40. Most of the remainder:
by-value struct parameters copied out of the constant buffer at every
call (GlimmerGroundParams and GlimmerSpanParams, 32 i32s each), then
indexed dynamically, which pinned each copy in memory.

- Arguments loaded from a constant buffer are passed as the constant
  buffer place itself, structs as well as arrays (not with matrices,
  whose constant buffer access is narrower than a local's). Locals still
  alias only within a block with no write since. The alias now comes
  first in local_var lowering, so the skipped parameter store always
  matches.
- Peepholes on promoted values: bitcast round trips (int/float mixing
  locals store i32s), constant integer arithmetic and comparisons,
  identities, selects on a constant. A constant out-of-bounds array
  index this exposes (on a path that cannot run) becomes 0, since the
  validator rejects it.
- Inlined callees' array locals return to a per-type pool on return,
  for later callees to reuse.
- -Od and -zdxc-no-opt skip promotion, aliasing and reuse, as they skip
  the SPIR-V IR passes.

GlimmerProbeTrace: 374 KB to 191 KB, 21 allocas, 282 bitcasts (from
7198). Its pipeline builds in 3.6 s on an RX 9070 XT (was 5.1 s). All
of Glide's 400 DXIL compiles: 5.91 MB (dxc: 6.11 MB), 7.1x faster than
dxc. All pass dxc 1.8.2505's validator, and Glide renders.
2026-11-02 01:13:16 -08:00
docs Add a DXC drop-in: dxc and a dxcompiler library with DXC's COM API 2026-11-01 17:59:17 -08:00
include zdxc: C API and static libzdxc 2026-11-01 17:15:16 -08:00
src DXIL: fold promoted values, pass constant buffer structs in place 2026-11-02 01:13:16 -08:00
tools Add semantic analysis (Sema) with dxc-derived oracles 2026-10-31 03:17:40 -07:00
vendor Add semantic analysis (Sema) with dxc-derived oracles 2026-10-31 03:17:40 -07:00
.gitignore removing the zdxc binary 2026-11-01 15:26:33 -08:00
build.zig Add a DXC drop-in: dxc and a dxcompiler library with DXC's COM API 2026-11-01 17:59:17 -08:00
build.zig.zon zdxc: C API and static libzdxc 2026-11-01 17:15:16 -08:00