Confused on Steam Play and Proton? Be sure to check out our guide.
We do often include affiliate links to earn us some pennies. See more here.
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 checked 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. You can also follow my personal adventures on Bluesky.
See more from me
The comments on this article are closed.
All posts need to follow our rules. For users logged in: please hit the Report Flag icon on any post that breaks the rules or contains illegal / harmful content. Guest readers can email us for any issues.
22 comments
Page: 1/2»
  Go to:

silmeth Jan 24, 2017
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.

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
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.

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
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!

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
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!

I think it actually helps Vulkan and SPIR-V. See https://github.com/KhronosGroup/glslang/issues/362
Shmerl Jan 24, 2017
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.

I can understand Vulkan developers being interested in it. But why MS if they staunchly refused to participate in the Vulkan working group? Or they now are changing their mind?
minj Jan 24, 2017
Now, how about a FOSS de-/cross-compiler plz?

No?

Thought so.
elmapul Jan 24, 2017
or maybe wine implementation of this is already better so they decided to open what we already have
Mountain Man Jan 24, 2017
So, I'm, like:

Open source is good! Yah! :D
But Microsoft is bad! Boo! :S:

I really have no idea what to think of this.
PsynoKhi0 Jan 24, 2017
So, I'm, like:

Open source is good! Yah! :D
But Microsoft is bad! Boo! :S:

I really have no idea what to think of this.

This is licensed under MIT, just like all (AFAIK) their OSS effort. Makes sense for them since the license permits code inclusion into proprietary software, however there is no implicit nor explicit obligation to contribute changes back. The OSS code base could be left to rot further down the line, once the bait has caught the attention of enough devs - when only targetting the proprietary version becomes the path of least resistance.

If FOSS started as "people scratching their own itch", I see microsoft's effort as them "scratching their own itch, but slowly giving everybody else herpes".

I mean... They've joined the Linux Foundation, primarily to make sure Linux works fine on azure - which is the only instance where they "love" Linux, it's less controversial than patent strong arming after all. Can anyone point me towards indication that they also helped KVM and Xen run windows OSes better?

Microsoft FOSS is a one-way street.
niarbeht Jan 24, 2017
NVidia go and do open source your GPU drivers NOW
Yeah right, you have more chance of Microsoft upgrading Windows to a Linux kernel. :P

On a side note though, it's about time Microsoft open sourced their DX9 since it won't be used for much longer. Or why can't they just port the damn thing to Linux, it's not like the penguin is going to make a big dent in their market share any time soon.
I would welcome their WinRT to Linux, for gaming only of course!

Honestly, if Microsoft published their own runtime for Linux, giving effectively Wine-style functionality but more... work-y, I'd probably pay $30 or $40 for that.
etonbears Jan 24, 2017
So, I'm, like:

Open source is good! Yah! :D
But Microsoft is bad! Boo! :S:

I really have no idea what to think of this.

I'm not sure it means anything much. It is a front-end compiler that translates from a Microsoft-defined programming language to a Microsoft-defined Virtual Machine instruction format.

It may be useful to someone wanting to define a programming language that compiles to the same Virtual Machine, or someone wanting to compile HLSL to a different Virtual Machine.

I don't think it either helps or harms them really, but there seems to be more interest in Vulkan/SPIR-V.
Mountain Man Jan 25, 2017
Honestly, if Microsoft published their own runtime for Linux, giving effectively Wine-style functionality but more... work-y, I'd probably pay $30 or $40 for that.
No way. That could so easily end badly for Linux.


Last edited by Mountain Man on 25 January 2017 at 12:36 am UTC
GoLBuzzkill Jan 25, 2017
Its a Trap!

Open source is not same as libre/free software; M$ still has control.

Shader compiler is useless for us, everything that M$ had open sourced is useless form Linux user perspective, dont fall for it, dont be a traitor!

They are open sourcing benign part of software just to say they are OPEN.
tuubi Jan 25, 2017
View PC info
  • Supporter Plus
Shader compiler is useless for us, everything that M$ had open sourced is useless form Linux user perspective, dont fall for it, dont be a traitor!
You lost me at traitor. :)
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.