HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
microsoft
DirectXShaderCompiler
C++2017–2025
microsoft / DirectXShaderCompiler

DirectXShaderCompiler

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.

16Distinct people
17Mentions
0Explicit recommenders
3.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 12:45:45 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year17 dated mentions

Observed mentions: 2017-01-24 12:57:10 UTC to 2025-11-24 00:10:17 UTC.

024682017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 8 mentions; 0 submissions, 8 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC404
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC303
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC808
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101

What Hacker News says

17 sources
DirectX also suffers from it, to a lesser degree. There are important HLSL intrinsics that are vendor-dependent ( https://github.com/Microsoft/DirectXShaderCompiler/wiki/Wave... or https://github.com/NVIDIA/nvapi/blob/main/nvHLSLExtns.h ). Microsoft used to be more proactive. It pressured vendors to have rough feature parity with each other and then released the "harmonized" baseline as the next DirectX version. But as with many things, Microsoft dropped the ball there. The most recent DirectX revision is more than 4 years old, and it doesn't look like there's going to be a new one any time soon. The only truly unified API is Metal, for obvious reasons.
In Shaders: How to draw high fidelity graphics with just x and y coordinates
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.
In C Compiler to SPIR-V
> DXC’s fork of LLVM removed and/or damaged much of the code generation layer and infrastructure [of LLVM]. Given that, supporting DXBC generation in DXC would be a massive task to fix and restore broken LLVM functionality. Due to the large scale of this issue and resource constraints on our team we’re not going to address this issue in [the new] DXC [compiler] ever. > > We may support DXBC generation in Clang in the future (we mentioned that in the original proposal to LLVM). That work is unlikely to begin for a few years as our focus will be on supporting DXIL and SPIR-V generation first. I appreciate this quote[0] from the microsoft camp. Setting clear expectations that something will not be done is a nice bit of fresh air. [0] https://github.com/microsoft/DirectXShaderCompiler/issues/57...
In Building the DirectX shader compiler better than Microsoft?
Also Microsoft DirectX Shader Compiler[1] for HLSL. In fact, effort is ongoing to upstream HLSL support into Clang.[2][3][4] To answer your other question—why LLVM instead of GCC: - First-class support for non-Unix/Linux platforms. LLVM can be built on Windows and Visual Studio without ever needing a single GNU tool besides git[5]. Clang even has a MSVC-compatible interface that allows MSVC developers to switch to Clang without needing to change their command-line invocation[6]. - Written in C++ from the ground up, with a modular, first-class SSA IR-based interface. - Permissive Apache 2.0 licence. As much as this might exasperate the open-source community, it allows for significantly faster iteration; things tend to be upstreamed when private/corporate developers realise it is hard to maintain separate forks. All this allows LLVM to have
Read the rest
In Vcc – The Vulkan Clang Compiler
> Which is what I said, you can screenshot & compare. But it becomes a fuzzy compare due to acceptable precision differences You make it sound rigorous than it can be. A readback doesn't need to be a "screenshot" and doesn't need to be of a full scene. A frame buffer can be a 1x1 value. Regarding precision differences, it's not much different than testing floating point math anywhere else. Shaders allow fast-math style optimizations generally, but they can be disabled at least on some platforms[1][2], otherwise one can take care in floating point math, or provide tests just using integer math. > And it ends up being more of an integration test and not a unit test. Sure, if you just setup scenes, render, screenshot and do a fuzzy compare, that looks more like an integration test. And I agree it's more common to see integration tests for re
Read the rest
nderers. But really, it's a bit more involved in that you have to deal with uploads, command queues, readbacks, but you really can setup the infrastructure to do proper unit tests, and then you can decide how you want to handle unit testing of flexible precision code, either toggling precision in the compilers, or building your tests to properly bound your expected precision, or both. > GPU shaders are completely different. Numbers do not have consistent behavior across differing hardware & drivers. This is an outdated and simply not true view, every modern (PC-Spec?) GPU hardware has IEEE754 compliant floats. They have to, otherwise GPGPU wouldn't have taken off in scientific computing. compiler defaults may just not be right. [1] https://github.com/Microsoft/DirectXShaderCompiler/blob/mast... [2] See: #pragma optionNV(fastmath off)
In Ex Valve dev on CS:GO’s codebase
If games use it, Nvidia will support it properly. While Vulkan hasn't "won" in the game space (and might not ever), SPIR-V actually already has support from Microsoft. The HLSL DXC compiler can natively output SPIR-V: https://github.com/Microsoft/DirectXShaderCompiler/wiki/SPIR... So it's not implausible that there's a future world here where DX13 or DX14 use SPIR-V instead of DXIL. After all this makes AMD, Intel, and Nvidia's driver teams happier. Game devs also are happier as then they can ship a single precompiled shader on all platforms - PC & consoles. Microsoft's strong position with DirectX doesn't come from DXIL, but instead from making game developers happy, so SPIR-V's future could easily be very bright. And then if games are using SPIR-V for compute (and they already use GPU compute for various things), then Nvidia is absolute
Read the rest
ly going to optimize the ever leaving snot out of it. Likely even more than they do for CUDA, as gaming is by far Nvidia's largest source of revenue: https://s22.q4cdn.com/364334381/files/doc_financials/quarter...
In A Taste of GPU Compute [video]
> Not to mention that DirectX uses a totally different shader language than Vulkan, so you have to get in there and translate all that code over. Vulkan doesn't really have a shader language unless you want to write SPIR-V assembly. Thus you'd use either GLSL or HLSL. Microsoft's own DirectX HLSL compiler[0] supports SPIR-V as a target in addition to DXIL. [0]: https://github.com/microsoft/DirectXShaderCompiler
In Rocket League left behind on macOS and Linux due to DirectX 11 shift
Ah yes, you are right, WebGL shaders are translated first to GLSL or HLSL with a lib like ANGLE (https://github.com/google/angle). And that source is then send on to the drivers which compile it again to assembler for the graphic card. And there again are some differences between GLSL/HLSL it seems. If I remember right in GLSL the drivers do the work while in HLSL some DLL from MS produces another intermediate format (which I just found out seems to be even open source: https://github.com/Microsoft/DirectXShaderCompiler).
In The Book of Shaders
"For one, all shaders would need to be converted from HLSL to GLSL, which could become quite a big task depending on the amount of shaders, and testing of all changes." Ironically Microsoft have open-sourced a Clang-based HLSL compiler that could be used as a front-end for a Vulkan backend. https://github.com/Microsoft/DirectXShaderCompiler https://blogs.msdn.microsoft.com/directx/2017/01/23/new-dire...
In Star Citizen developers intend to drop DirectX support and only support Vulkan

Showing the 15 most recent of 17 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.