We do often include affiliate links to earn us some pennies. See more here.

Microsoft announces new DirectX Shader Compiler that's open source

By - | Views: 16,965
It must be a bit chilly in hell today, as Microsoft have announced a new DirectX Shader Compiler and it's open source.

While this isn't exactly gaming news, we do cover other interesting stuff like this from time.

I'm not entirely sure if it will be at all useful for Wine or any Linux-related projects, but it's still good to see another open source effort from Microsoft. Hopefully with more of DirectX being in the open, in future it may be even easier for ports to happen from DirectX to OpenGL/Vulkan.

The most likely reason for them doing this, is to make DirectX development more attractive against how open OpenGL/Vulkan are. I have doubts that this will actually help us at all, as that remains to be seen.

You can find it on github, under the MIT license.

Thanks for pointing it out on Twitter Padre! Article taken from GamingOnLinux.com.
Tags: Open Source
5 Likes
About the author -
author picture
I am the owner of GamingOnLinux. After discovering Linux back in the days of Mandrake in 2003, I constantly came back to check on the progress of Linux until Ubuntu appeared on the scene and it helped me to really love it. You can reach me easily by emailing GamingOnLinux directly. Find me on Mastodon.
See more from me
The comments on this article are closed.
22 comments
Page: 1/3»
  Go to:

silmeth Jan 24, 2017
QuoteI'm not entirely sure if it will be at all useful for Wine or any Linux-related projects, but it's still good to see another open source effort from Microsoft. Hopefully with more of DirectX being in the open, in future it may be even easier for ports to happen from DirectX to OpenGL/Vulkan.

I am pretty sure it will make glslang guys life much easier with their attempt at compiling HLSL, and that certainly will benefit Linux gaming – as game programmers will need to write shaders in only one language for both Vulkan and D3D.

Wine also does (for now) translation of HLSL → GLSL, and it probably will stay that way for some time, but anyway code of the compiler will probably make it easier to enhance that translation. And, perhaps, later Wine will replace it with glslang’s HLSL compilation or other way of translation directly to SPIR-V (at least for Vulkan-capable hardware). Will see.


Last edited by silmeth on 24 January 2017 at 10:37 am UTC
Teal Jan 24, 2017
Damn, that's some good news.

I bet it's mostly to make HLSL compete with SPIR-V a bit better, but if competition leads to open sourcing things, that's to great benefit of everyone!


Last edited by Teal on 24 January 2017 at 10:56 am UTC
Teal Jan 24, 2017
NVidia go and do open source your GPU drivers NOW


Last edited by Teal on 24 January 2017 at 10:57 am UTC
STiAT Jan 24, 2017
That one was unexpected. And is very welcome indeed. Thinking about it - it's fascinating what possibilities this opens to several projects (and porting engines) if we can get a native HLSL compiler in Linux.
Nanobang Jan 24, 2017
View PC info
  • Supporter
Microsoft has never done anything nice or good for anybody but Microsoft, and whatever feeds the Lords of Redmond will be cut from the flesh of the rest of us.

So while I don't understand what this means to GLSL, HLSL, SPIR-V (because I don't know what GLSL, HLSL, SPIR-V even are, lol) I do know Microsoft is scheming to feed again, and that this latest money-grubbing skulduggery is aimed at open source software and that concerns me.


Last edited by Nanobang on 24 January 2017 at 1:23 pm UTC
amonobeax Jan 24, 2017
Hi brothers,

like many here I don't grasp what this really means, so if anybody has more content explaining the repercussions of this MS move, plz share with us.
kirgahn Jan 24, 2017
Quoting: amonobeaxHi brothers,

like many here I don't grasp what this really means, so if anybody has more content explaining the repercussions of this MS move, plz share with us.

Disclaimer: I'm neither a shaders nor game developer.

Using shaders is the "modern" way of working with graphics hardware in order to create special FX (and so much more). Think of that game you played that has that awesome lighting or that peculiar sepia filter. That's done through shading.

Shaders are software. They are written in a specific language (GLSL for OpenGL and Vulkan, HLSL for DirectX). Which means that they get compiled (to an intermediate language). Which means that you need a compiler. This open source compiler from Microsoft compiles HLSL into DXIL, which is Microsoft new intermediate representation.

The useful part here is that those involved with shader compiling can actually understand exactly how to parse and compile HLSL, and possibly make it compile directly into, say, SPIR-V, which is Vulkan's intermediate representation.

They only negative effect this could potentially have is that delevopers could stop writing shaders in GLSL because HLSL can be compiled for every possible IR. I don't see that happening tough.

TL;DR
could be potentially easier to develop other compilers that compile shaders directly from DirectX language to OpenGL/Vulkan supported intermediate representation.
eridanired123 Jan 24, 2017
Openness is a good thing. Whatever reasons Microsoft has for opening their stuff, is good it is open now. But I would advice everyone to be cautious with Microsoft, not because "MS is evil", but because MS is a business.

Accept and welcome any new open project regardless of its precedence, but don't be naive believing BS of the sort "Microsoft <3 Linux".
Sgt.Romeo9 Jan 24, 2017
Quoting: TealDamn, that's some good news.

I bet it's mostly to make HLSL compete with SPIR-V a bit better, but if competition leads to open sourcing things, that's to great benefit of everyone!

Yeah agreed, I think you've hit the nail on the head there. It basically comes down to Microsoft open sourcing a DirectX shader compiler and not even the entire compiler as a whole but rather a utility for converting HLSL into DXIL, if I read the description correctly.
Keeping this code closed source would do them more harm than good I personally think, mainly because of how SPIR-V works over HLSL and GLSL previously. SPIR-V can make use of both GLSL and HLSL, it simply converts them to SPIR-V once at build time not everytime at runtime, which is how it's done currently and is quite complex due to there being multiple rendering backends and not to mention bytecode at runtime. There are libraries and translation layers that assist in reducing the complexity of this process, but having this process completely removed is going to be a big step in the right direction. Don't get me wrong it still needs to do the compiling and caching though, but the responsibility of that is now moved to the game engine and not the GPU driver.

The point is, having SPIR-V be able to work with GLSL and HLSL on equal ground is probably what drove Microsoft to open-source this DirectX shader compiler. Just my opinion.
Shmerl Jan 24, 2017
Quoting: TealDamn, that's some good news.

I bet it's mostly to make HLSL compete with SPIR-V a bit better, but if competition leads to open sourcing things, that's to great benefit of everyone!

I think it actually helps Vulkan and SPIR-V. See https://github.com/KhronosGroup/glslang/issues/362
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
The comments on this article are closed.