Collabora Launches OpenCL And OpenGL On DirectX

Recently, Collabora announced its partnership with Microsoft DirectX engineers in order to build OpenCL and OpenGL mapping layers to bring OpenCL 1.2 and OpenGL 3.3 support to all Windows and DirectX 12 enabled devices.
 
To build this Collabora is making use of Mesa 3D, with the Gallium interface as the base for the OpenGL layer, and NIR as the base for the OpenCL compiler. Collabora is also using LLVM and the SPIRV-LLVM-Translator from Khronos as the compiler front-end.
 
Collabora said it is taking advantage of Microsoft's experience in creating the D3D12 Translation Layer.
 
 
Source: collabora 
 
According to Collabora, in the implementation aspect, the OpenCL compiler uses LLVM and the SPIRV-LLVM-Translator to generate SPIR-V representations of OpenCL kernels. These, in turn, are passed to Mesa’s SPIR-V to NIR translator, where some optimizations and semantical translations are done.
 
And finally, NIR representation is passed to NIR-to-DXIL. This outputs a DXIL compute shader and the needed metadata so NIR representation can be executed on the GPU by the runtime using D3D12.