LLVM Makes Its DirectX Backend an Official Target, With clang-dxc On by Default

LLVM has promoted its DirectX backend from experimental to an official target, so it builds by default and clang-dxc with HLSL support ships on in LLVM 24. Microsoft says graphics and ray-tracing shaders come next.
LLVM Makes Its DirectX Backend an Official Target, With clang-dxc On by Default
LLVM Makes Its DirectX Backend an Official Target, With clang-dxc On by Default

LLVM’s DirectX backend is no longer experimental. A patch from Microsoft HLSL compiler engineer Farzon Lotfi, merged on Aug. 31, promotes it to an official LLVM target and enables the clang-dxc frontend and HLSL support by default, Phoronix reported.

The backend lowers LLVM IR into DXIL, the DirectX Intermediate Language that Windows DirectX 12 graphics drivers consume. Microsoft has backed the work for about four years. Until now it sat in LLVM_ALL_EXPERIMENTAL_TARGETS and only got built if a developer added it by hand. Under the merged change, it moves into LLVM_ALL_TARGETS and is built by default, starting with the LLVM 24 release.

“This change moves the DirectX backend out of experimental and adds the clang-dxc frontend so the community has a path to trying out the new backend,” Lotfi wrote in the patch.

What the promotion required

The switch followed an RFC Lotfi posted on LLVM Discourse in early August. It argued the backend meets LLVM’s bar for official targets: active maintainers from Microsoft and the wider graphics community, in-tree documentation, development and stabilization in-tree since 2022, and test coverage that includes GitHub Actions checks on HLSL and DirectX pull requests plus the LLVM Offload Test Suite.

The RFC also laid out what comes next. “Looking ahead, our focus will shift towards supporting graphics and ray tracing shader, the newest Shader Models, and further tightening the integration between Clang’s HLSL frontend capabilities and the backend Codgen,” it said, adding that the team expects the default build to bring “a wider influx of user feedback.”

The LLVM documentation for the target says it is aimed at DirectX 12 for now, with DirectX 11 support planned later. The HLSL working group marked the change in its Sept. 3 meeting notes: “The DirectX backend is no longer experimental!”

Where it fits

Microsoft’s shipping shader compiler, DXC, is built on its own fork of an older LLVM, and DXIL itself is based on LLVM 3.7-era bitcode. An upstream backend gives Microsoft and other toolmakers a DXIL path in mainline LLVM and Clang instead. Microsoft has also said DirectX will adopt SPIR-V as its interchange format starting with Shader Model 7, so the DXIL backend covers the shader models in use today while that transition plays out.

Subscribe for Updates

DevNews Newsletter

The DevNews Email Newsletter is essential for software developers, web developers, programmers, and tech decision-makers. Perfect for professionals driving innovation and building the future of tech.

By signing up for our newsletter you agree to receive content related to ientry.com / webpronews.com and our affiliate partners. For additional information refer to our terms of service.

Notice an error?

Help us improve our content by reporting any issues you find.

Get the WebProNews newsletter delivered to your inbox

Get the free daily newsletter read by decision makers

Subscribe
Advertise with Us

Ready to get started?

Get our media kit

Advertise with Us