Today the Direct3D and HLSL teams are excited to share some insight into the next big step for GPU programmability. Once Shader Model 7 is released, DirectX 12 will accept shaders compiled to SPIR-V™. The HLSL team is committed to open development processes and collaborating with The Khronos®...
devblogs.microsoft.com
This is mostly a good thing, but the benefits to non-windows platforms will take a while to show up, I imagine, as it's early days yet.
Shaders are programs that run on a GPU. GPUs have their own instruction set that isn't standardized. So when a driver encounters a shader in source code form, it needs to run an internal compiler to get it down to the instructions the GPU will understand.
It turns out that it's really smart to have a sort of in-between step. Instead of going straight from the high level shader programming language to the low level GPU microarchitecture, you take a pit stop at an Intermediate Representation, a halfway point between the two.
There are a lot of advantages to having this intermediate representation, but one of them is that it's smaller and simpler and faster to compile. That means instead of shipping around the whole source code for your shader, which might take a while to compile, you ship this tiny intermediate representation that compiles very fast. Smaller file sizes, faster performance for users.
Another advantage is that
occasionally a developer might be able to make smart optimizations that the compiler couldn't figure out on it's own, because the developer knows things about the code that the compiler doesn't. It may be occasionally useful to bypass the high level code that shaders are written in, and get down into something lower level. The intermediate representation works on all different kinds of graphics cards, but is lower level than standard shader language, and offers this ability.
Microsoft has developed a high level shader language, called HLSL, and most vendors (Google, Apple, Vulkan, Nintendo) have all moved over to it. But Microsoft also has their own intermediate representation, DXIL, and the industry has
not moved to it. So if you ship a game with both an Mac and a PC version - or a PC and a Nintendo version - you can't ship the same, small intermediate versions of your shaders. Either you ship the full big source code, with no optimizations, or you write your small optimized versions twice.
This will begin to resolve that issue in the industry. It will make PC ports of console games easier, and easier for console games to use optimizations from PC ports.