A very interesting use of open source in action here from the incredibly smart team over at Collabora who teamed up with Microsoft engineers to get OpenGL and OpenCL via DirectX.
Why is this interesting? Well, they're doing it by using the open source Mesa drivers. It's pretty darn clever, and shows just how far translation layers are being used industry-wide. Once this is all implemented, it means that any device that supports DirectX 12 would also work with (and actually be compliant) with OpenGL 3.3 and OpenCL 1.2.
Not all Windows-powered devices have consistent support for hardware-accelerated OpenCL and OpenGL. So in order to improve application compatibility, we are building a generic solution to the problem. This means that a GPU vendor only has to implement a D3D12 driver for their hardware in order to support all three APIs.
This mapping layer is also expected to serve as a starting point in porting older OpenCL and OpenGL applications over to D3D12.
In addition, we believe this is good for the wider open source community. A lot of the problems we are solving here are shared with other drivers and translation layers, and we hope that the code will be useful beyond the use cases listed above.Collabora
It's not finished yet, plenty of work is still to be done but you can find the source code online now and they are planning to upstream the work to the main Mesa project.
Speaking to Collabora today over email to get something cleared up, I asked them if this actually meant that if a developer made an OpenGL game, that on Windows they could keep it as OpenGL but it would run through DirectX 12 in the driver without the developer needing to do anything. Daniel Stone, Graphics Lead at Collabora, replied to say "Provided the application uses a supported version of the OpenGL API, it will be able to run unmodified using the OS's DirectX 12 driver. This applies to any application, not just games! :)".
What's interesting here then, is not how this directly benefits Linux/Linux Gaming but cross-platform compatibility as a whole which is great. Especially good when it's using open source already, so improvements can go back into upstream Mesa, therefore making Linux drivers even better in future.
I'm keen for anything open source like this that can help developers, good stuff.
See the full blog post on the Collabora website.