←back to thread

88 points bwidlar | 2 comments | | HN request time: 0s | source
Show context
c1b ◴[] No.42160022[source]
does this also already exist on llvm toolchain?
replies(2): >>42160075 #>>42161939 #
Conscat ◴[] No.42160075[source]
Not really. LLVM does support compute mode SPIR-V, and _very_ recently graphics-mode SPIR-V which is being dogfooded by the highly WIP HLSL front-end in Clang (I couldn't get a trivial fragment shader to build with it a few weeks ago). Clang does not support compiling graphics-mode SPIR-V from C or C++.

This seems similar to the Vulkan Clang Compiler (which is not in-tree of LLVM), although it has some interesting differences such as implementing shader functions with new specifiers like `__hcc_vertex` rather than repurposing attributes for it like `[[clang::annotate("shady::entry_point::vertex")]]`.

replies(1): >>42161602 #
1. kimixa ◴[] No.42161602[source]
The Microsoft HLSL compiler for dx12+ is based on LLVM and supports spir-v output https://github.com/microsoft/DirectXShaderCompiler

Though my understanding is that it's a complete hackjob stuck on an old version of LLVM, and not in a remotely upstream-able state and breaks other parts of the LLVM toolchain completely. I think there was talk about trying to clean that up at the same time as bringing the baseline version forward, but I have no idea about it's progress.

replies(1): >>42162525 #
2. pjmlp ◴[] No.42162525[source]
The progress is that DirectX will also support SPIR-V, going forward.

https://devblogs.microsoft.com/directx/directx-adopting-spir...