Friday, September 20th 2024
Microsoft DirectX 12 Shifts to SPIR-V as Default Interchange Format
Microsoft's Direct3D and HLSL teams have unveiled plans to integrate SPIR-V support into DirectX 12 with the upcoming release of Shader Model 7. This significant transition marks a new era in GPU programmability, as it aims to unify the intermediate representation for graphical-shader stages and compute kernels. SPIR-V, an open standard intermediate representation for graphics and compute shaders, will replace the proprietary DirectX Intermediate Language (DXIL) as the shader interchange format for DirectX 12. The adoption of SPIR-V is expected to ease development processes across multiple GPU runtime environments. By embracing this open standard, Microsoft aims to enhance HLSL's position as the premier language for compiling graphics and compute shaders across various devices and APIs. This transition is part of a multi-year development process, during which Microsoft will work closely with The Khronos Group and the LLVM Project. The company has joined Khronos' SPIR and Vulkan working groups to ensure smooth collaboration and rapid feature adoption.
While the transition will take several years, Microsoft is providing early notice to allow developers and partners to plan accordingly. The company will offer translation tools between SPIR-V and DXIL to facilitate a gradual transition for both application and driver developers. For those not familiar with graphics development, graphics APIs ship with virtual instruction set architectures (ISA) that abstracts standard hardware features at a higher level. As GPUs don't follow the same ISA as CPUs (x86, Arm, RISC-V), this virtual ISA is needed to define some generics in the GPU architecture and allow various APIs like DirectX and Vulkan to run. Instead of focusing support on several formats like DXIL, Microsoft is embracing the open SPIR-V standard, which will become de facto for API developers in the future, allowing focus on more features instead of constantly replicating each other's functions. While DXIL is used mainly for gaming environments, SPIR-V has adoption in high-performance computing as well, with OpenCL and SYCL. Gaming presence is also there with Vulkan API, and we expect to see SPIR-V join DirectX 12 games.
Source:
Microsoft
While the transition will take several years, Microsoft is providing early notice to allow developers and partners to plan accordingly. The company will offer translation tools between SPIR-V and DXIL to facilitate a gradual transition for both application and driver developers. For those not familiar with graphics development, graphics APIs ship with virtual instruction set architectures (ISA) that abstracts standard hardware features at a higher level. As GPUs don't follow the same ISA as CPUs (x86, Arm, RISC-V), this virtual ISA is needed to define some generics in the GPU architecture and allow various APIs like DirectX and Vulkan to run. Instead of focusing support on several formats like DXIL, Microsoft is embracing the open SPIR-V standard, which will become de facto for API developers in the future, allowing focus on more features instead of constantly replicating each other's functions. While DXIL is used mainly for gaming environments, SPIR-V has adoption in high-performance computing as well, with OpenCL and SYCL. Gaming presence is also there with Vulkan API, and we expect to see SPIR-V join DirectX 12 games.
35 Comments on Microsoft DirectX 12 Shifts to SPIR-V as Default Interchange Format
I just wonder when we will see this in games, and how well Blackwell and RDNA 4 will support this.
Xbox hardware is what's been declining.
Game Pass is what's keeping Xbox alive.
When a game developer builds graphical effects they use a language like HLSL (D3D), GLSL (OpenGL) or PSSL (PlayStation) to write shaders in. Those programs then get compiled to an intermediate representation (IL). This IL is then used by the GPU driver to generate low level code that will run on the target GPU architecture. As AleksandarK noted it's done in order to ease development for all parties since GPU internal architectures can vary wildly.
DirectX has been using an internal to them IL called DXIL, I'll steal a diagram from their documentation:
SPIR-V has been in use in part of the Linux graphical subsystem called Mesa that implements graphical APIs like OpenGL, Vulkan and even Direct3D. Just like other ILs it can be used for graphical shaders and compute kernels.
On Windows all 3 major vendors already support SPIR-V since it's a part of the Vulkan API. Other Vulkan-capable drivers most likely do as well, but I have no experience with e.g. Qualcomm's.
What this change from Microsoft means is eased compatibility between DirectX and Vulkan since Direct3D shaders will be able to be compiled to a form that Vulkan can ingest natively. In the long run also simplifies driver development since vendors won't have to split their support to DXIL and SPIR-V.
CUDA has been CUDA for years or decades now, nothing new there and no changes expected.
From what AMD said, I'd not expect unified architecture before RDNA6/UDNA6 but that's just my guess. Though, AMD did have an unified architecture a while back with Graphics Core Next (Radeon HD 7000 - Vega)
Again, all that is unrelated to SPIR-V
And its revenue was up, but its subscriber count has been stagnant. Gives games away for cheap isnt a sustainable business model, and MS knows it. It shouldnt. Like everything else in the space, by the time this arch change makes a noticeable effect, the games that need it will be too demanding for the hardware anyway.
I just verified and in case of Qualcomm I see that SPIR-V could be supported since 2018.
Actually, it depends on a support of OpenCL features, also called as extensions, implemented in versions 2 and 3 of OpenCL. Since I have a significant experience with porting OpenCL functionality from Linux / Windows OSs to Android OS I could say that cl_khr_spir extension needs to be implemented. This is a piece of codes from cl_ext.h header file of Adreno OpenCL SDK version 1.2.1 ( 2018 year! ) for Mobile Devices with Android OS:
...
/*
* Extension: cl_khr_spir
*
* This extension adds support to create an OpenCL program object from a
* Standard Portable Intermediate Representation (SPIR) instance
*/
#define CL_DEVICE_SPIR_VERSIONS 0x40E0
#define CL_PROGRAM_BINARY_TYPE_INTERMEDIATE 0x40E1
...
It's unable to handle graphical primitives, a deficiency that SPIR-V rectifies while retaining the compute lineage of SPIR.
In fact support for SPIR-V is mandatory in OpenCL 2.1, but... due to certain vendor's reluctance to implement full 2.x capabilities the new OpenCL 3.0 version drops that requirement (among with many other features of 2.x).
Was funny when everyone discovered the quick way to kill 90% of stutters in FF7 remake was to disable DX12. I think gamepass has potential, but the reason I didnt renew was the games rotate, I think everything added either needs an assured 3 years minimum, or should be perpetual. It is also a bit flaky playing content offline.
Dont get me wrong, i am the staunchest supporter of pro consumer practices, so simply curious. Sadly, we no longer “own” games, we have licenses to use/play those games.
One thing that might happen e.g. is someone plays a game on game pass, decides they like it or might be mid way through playing it, it then rotates out, then publisher gets a sale. That wouldnt happen if everything was perpetual.
So yeah my comment is a touch of selfishness, but its what I would want to sign back up to game pass.
What they could is let you pick favourite genres, so if e.g. pick platformers, retro and jrpgs, then you get those perpetual, but you also wouldnt get shooters, sports, driving as an example, so it avoids them having to supply a ever growing library to everyone. For some reason dev's keep choosing DX12 over Vulkan. Although I dont think I am a fan of a close to metal API, as it means if the dev does a bad job its hard to fix with mod's custom drivers etc.
Then moved to Steam and bought them right away because I ended liking them that much.
In my particular case, i dont game that much, so gamepass didnt work for me, but it might work for others.
About games being there perpetually, that would be nice if you game a lot and replay games a lot, i think.