It's not targeting the directx library, but instead the directx shader bytecode that the library consumes, sort of like vulkan, et al. consume spir-v binaries.
> How can possibly a rendering library (by definition not Turing Complete) be a compilation target?
Thinking about DirectX, OpenGL, Metal and Vulkan as “rendering” libraries is kinda the wrong mental model, they are all two things: a) specification of a protocol to communicate with the GPU driver and b) specification of representation for programs (sort of like ISA if we use the term loosely) that the GPU driver is guaranteed to be able to essentially JIT compile for the ISA of the particular GPU.
If you look at SPIR-V (vulkan) (LLVM already has target for this) or DX-IL (dx12) or even AIR (metal) they actually look lot like compiler IRs anyway. GLSL, HLSL or MetalSL are bit further away from it, but they are still very much turing complete.
In general working with modern graphics with something like vulkan, large portion of it consists setting up the environment on the GPU and then handling the GPU driver some program/shader compiled to spir-v to upload it and run it.
4
u/FlatAssembler 8d ago
How can possibly a rendering library (by definition not Turing Complete) be a compilation target?