top | item 13467866

New DirectX Shader Compiler Based on Clang/LLVM Open-Sourced

125 points| xamlhacker | 9 years ago |blogs.msdn.microsoft.com | reply

87 comments

order
[+] DannyBee|9 years ago|reply
While it's really nice they built this on open source compiler infrastructure, it's also too bad they took all the LLVM code and changed the license headers on it (additionally pretending to relicense it and changing the copyright string) when that's 100% not okay:

https://github.com/Microsoft/DirectXShaderCompiler/blob/mast...

I'm sure it was a script, but this needs to be fixed, stat.

Sadly, not even the first time: https://github.com/Microsoft/WinObjC/issues/35

https://news.ycombinator.com/item?id=10024377

https://news.ycombinator.com/item?id=10018208 (which devolved into a licensing discussion)

It'd be nice if folks paid a little more attention, because for releases from large companies, stuff spreads quickly, which means a year from now, there are still likely to be "mit licensed" copies of this that are still wrong :(

[+] shmerl|9 years ago|reply
Hopefully it will be of some help for this effort: https://github.com/KhronosGroup/glslang/issues/362

I'm kind of surprised that this happened, though I've heard it could happen from glslang developers. It helps reducing DX/HLSL lock-in, and it's as if usual MS management responsible for such lock-in fell asleep, and developers managed to release something good for the world for once.

[+] dtech|9 years ago|reply
Microsoft has been going away from that path for quite a while now, ever since Balmer left. For example the .NET runtime now runs on BSD/Unix/Mac OS X and sql server was released for Linux.

Ultimately it is still in the interest of Microsoft if their toolchain is interesting because it is compatible among all target devices (PC, Xbox, PS, Mobile) so I'm unsurprised they are moving in that direction.

[+] pitaj|9 years ago|reply
I gotta say, this "new, open Microsoft" is really surprising me. I think what this signals is the end of selling software. Microsoft has seen the writing on the wall and realize that the money is in subscriptions and services.

Due to piracy, a company can no longer just release an incremental update of their software package every couple years. They have to have rolling updates and constant improvements to keep the money stream rolling in from their customers.

This is why MS is focusing on Azure, Office 360, Windows 10, etc.

[+] wolfgke|9 years ago|reply
> Due to piracy, a company can no longer just release an incremental update of their software package every couple years.

In earlier days (before Microsoft introduced much stronger copy protection schemes, such as the necessity to activate the products or WGA) a lot more installed copies of Microsoft products were illegal copies (in particular on computers owned by private users). And Microsoft survived quite well. So if you really believe in the "piracy explanation", you are deeply brainwashed by rightholder's propaganda.

The IMHO most plausible reason why the model worked in former days, but worse today (though "worse" is probably a really bad word: revenue today is surely still much larger than in the former days), is that as long as Moore's law correlated to increased speed for existing applications (without need for new programming tricks such as having to use multithreading, new SIMD instructions etc. in the programs to make use of the additional power of new processors), there was a good reason to buy a new PC every few years. With each new PC there came a new OEM version of Windows and sometimes some Microsoft Office applications. So the formerly existing correlation between Moore's law and speed for existing applications drove Microsoft's sales.

[+] faragon|9 years ago|reply
So now all the "NDA" excuses for not releasing graphic drivers source code are gone?
[+] robbies|9 years ago|reply
Releasing source for graphics drivers has zero to do with this DirectX Shader Compiler going open source. This compiler just compiles from HLSL to DXIL. During run-time, the application submits DXIL to the IHV driver for compilation into machine bytecode. And that compiler is still closed-source, at least for most GPU use cases.

I don't understand what you thought you'd accomplish with your comment. It's almost a willful attempt at not understanding what the project/event is about.

[+] leonatan|9 years ago|reply
One really has nothing to do with the other in this case.
[+] valarauca1|9 years ago|reply
1. It never did exist

2. AMD has

3. Nvidia won't because their GPU does a lot of magic to fix DX9/DX10/DX11 screw ups some people shops who've partnered with Nvidia leave in their code.

[+] frik|9 years ago|reply
Oh they are still working on DirectX 12.

Microsoft has the tendency to downside and almost stop development after reaching near monopoly of a niche. Everyone remembers the Internet Explorer 6 years, it took years and Firefox reaching 25% market share to continue development of IE7. The same with DirectX: DirectX 9 was too successful, and OpenGL supported was limited to OpenGL 1 in WinXP and onwards (only tricks like bootstrapping allows OpenGL2+ on Win). DirectX 9 was around for many years. When OpenGL 3 and 4 came around, Microsoft restarted development of DirectX 10. DirectX 11 was merely a maintenance release. When the new AMD API (now Vulcan) came along, Microsoft restarted development with DirectX 12. Nowadays 99.9% of all new games are DirectX10/11 or Vulcan and support Win7+ and are usually available over Steam and/or GoG. And PlayStation 4 is very successful worldwide. XBoxOne is mainly successful in US and has little presents worldwide, Microsoft even stopped announcing sales two years ago - it's that bad. Nor are there any new exclusive games to speak of, PS4 has dozends of exclusive games, Win7+ has millions of exclusive games. Win10 Store is a complete desaster, worst software ever and hardly anyone would use it to buy games, if there are far better alternatives like Steam and GoG. Is DirectX 12 still a thing?

[+] pjmlp|9 years ago|reply
Regardless of urban legends, game consoles have their own graphic APIs.

PlayStation 4 doesn't use OpenGL either, rather LibCGM.

From all other PlayStations, including the portable ones, only the PlayStation 3 did support a mixture of OpenGL 1.0 + NVidia's Cg for shaders in addition to their actual graphics API. Almost no one ever bother with it, other than creating game prototypes.

Nintendo Switch has adopted Vulkan, but it remains to be seen if it will be any more successful on the market than Wii U was. None of the other Nintendo consoles do support OpenGL, rather they have an OpenGL-like API, GX and GX2.

Actually if it wasn't for Apple's adoption of OpenGL ES 1.0 for the iPhone, the first hardware support after Nokia's N95, it wouldn't probably ever taken off on the mobile devices.

[+] dogma1138|9 years ago|reply
Because DX12 gives you support for 2 out of the 3 major AAA platforms. Sony seems to have no inclination of supporting Vulcan as a native API for the PS4/PS4pro.

Vulkan is also not Mantle, it's similar to the original Spec which was written by Johan Andersson from DICE. AMD did give Khronos the spec but there isn't some shared code implementation for Vulkan that is based on Mantle, there isn't a common shared library in general as the implementation for each IHV/System is proprietary.

Vulkan is still a camel, not as much as OpenGL but a camel nonetheless, it's currently quite behind DX as far as featureset goes and Vulkan Next which would add needed features such as mGPU support seems lag into late 2017.

Vulkan is a good alternative but it already shows some signs of getting it self into the same position that OpenGL found it self.

It's also worth noting that DX12 development has nothing to do with Mantle, it's a continuation of the Xbox 360 API and effectively the mature version of the API developed for the Xbox One.

[+] pandaman|9 years ago|reply
DX12 is the base for XBox One API so it's going to be a thing, I suppose, until MS pulls out of console business (but I don't see why they would, the original XBox was a bigger disaster yet they stayed). After all, both Sony and Nintendo use their proprietary APIs too.

The reason you need a proprietary API on a console is that you cannot make a game running on a $200-300 piece of consumer electronics compete with a game running on a $1000+ PC if they both use the same API. There is a lot of work a DX/OpenGL driver does behind the scenes to make the same code run on GPUs of different architectures while sharing the same device with other processes. When you target only one GPU in exclusive mode you can do the same things so much faster.

[+] robbies|9 years ago|reply
Beware all who are reading below this comment: it's aggressively misinformed. It starts with this comment, which is almost completely inaccurate. And then it continues from there. Wth HN...
[+] shmerl|9 years ago|reply
> Is DirectX 12 still a thing?

Unfortunately, while MS will require DX for Xbox, it will remain a thing. It's not needed otherwise.