Collabora & Microsoft to Bring OpenCL 1.2 and OpenGL 3.3 to DirectX 12 enabled Windows Devices

Collabora has been working on open-source graphics projects for a while, including Panfrost open-source drivers for Arm Midgard and Bitfrost GPUs which got experimental OpenGL ES 3.0 support earlier this year.

But the company has also been working with Microsoft in order to provide an OpenCL 1.2 & OpenGL 3.3 translation layer for Windows devices compatible with DirectX 12.

OpenCL DirectX Translation Layer
Diagram of the complete process for OpenCL translation – Click to Enlarge

Their solution relies on Mesa 3D OpenCL and OpenGL open-source implementation with three main components:

  • an OpenCL compiler using LLVM and the SPIRV-LLVM-Translator to generate SPIR-V representations of OpenCL kernels. The data goes through an SPIR-V to NIR translator (NIR is Mesa’s internal representation for GPU shaders), and finally to NIR-to-DXIL generating a DXIL compute shader and metadata understood by DirectX 12 (D3D12)
  • a custom OpenCL runtime to do a direct translation of DirectX 12 (Not based on Mesa Clover implementation)
  • a Gallium driver that builds and executes command-buffers on the GPU using the D3D12 API. It turns OpenGL commands into D3D12 command-buffers via the NIR to DXIL translator, which are executed on the GPU using the D3D12 driver.
wglgears
wglgears OpenGL demo program for Windows – Click to Enlarge

This will allow hardware platform without full support for OpenGL or OpenCL to run apps using those graphics standard, and make it easier for developers looking to move from older OpenCL and OpenGL API versions to Direct X12.

The project is open-source with the code hosted on Gitlab, and eventually Collabora and Microsoft plan to upstream the source code to Mesa 3D graphics library.

More details can be found in separate announced on Collabora and Microsoft developer blogs.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK Pi 4C Plus
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
1 Comment
oldest
newest
m][sko
4 years ago

They need this for Chromium/EDGE.
Chromium use SKIA and SKIA use only opengl/vulkan.
And also webgl is based on OpenGL so it is nice to have something that pass it trough DirectX drivers

Most GPU drivers on windows has really bad opengl drivers and Intel is one of them 🙂

Khadas VIM4 SBC