Confused on Steam Play and Proton? Be sure to check out our guide.
We do often include affiliate links to earn us some pennies. See more here.

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.

Article taken from GamingOnLinux.com.
18 Likes
About the author -
author picture
I am the owner of GamingOnLinux. After discovering Linux back in the days of Mandrake in 2003, I constantly checked on the progress of Linux until Ubuntu appeared on the scene and it helped me to really love it. You can reach me easily by emailing GamingOnLinux directly. You can also follow my personal adventures on Bluesky.
See more from me
The comments on this article are closed.
All posts need to follow our rules. For users logged in: please hit the Report Flag icon on any post that breaks the rules or contains illegal / harmful content. Guest readers can email us for any issues.
16 comments

Alm888 Mar 24, 2020
Well, it might technically be beneficial for Microsoft®, considering Windows' current sore state of built-in OpenGL implementation (I think it is something like "OpenGL 1.1") and could make some vendor-locked-in devices (like "Microsoft Surface") to be somewhat useful. Or to help AMDGPU-powered devices to s**k a little less in OpenGL applications (it would be nice to have a comparison to official AMD OpenGL stack)…

But, honestly, using "DirectX 12" is like betting on a dead horse. I mean, who needs DX12 when we have Vulkan? On the other hand, DX12 is all Microsoft® has, so they are out of options… :S:
Shmerl Mar 24, 2020
Nice and all, but MS are just trying to hide the elephant in the room. They should be supporting Vulkan to begin with, instead of DX12. There is no valid reason for them not to.

So I don't buy all this "we are good now" act, until we'll see Vulkan support on Xbox and any other devices that MS tightly control.


Last edited by Shmerl on 24 March 2020 at 5:24 pm UTC
Schattenspiegel Mar 24, 2020
I may be completely wrong here, but would this part:
This means that a GPU vendor only has to implement a D3D12 driver for their hardware in order to support all three APIs.
not be a really bad thing?
Liam Dawe Mar 24, 2020
I may be completely wrong here, but would this part:
This means that a GPU vendor only has to implement a D3D12 driver for their hardware in order to support all three APIs.
not be a really bad thing?
Nope, it helps prevent the Apple situation with OpenGL seeing total crap support for a very long time and eventually they will remove it as it's deprecated in favour of Metal which screwed over a lot of developers.
Leopard Mar 24, 2020
I may be completely wrong here, but would this part:
This means that a GPU vendor only has to implement a D3D12 driver for their hardware in order to support all three APIs.
not be a really bad thing?
Nope, it helps prevent the Apple situation with OpenGL seeing total crap support for a very long time and eventually they will remove it as it's deprecated in favour of Metal which screwed over a lot of developers.

No , MS won't break compatibility ever which is why they lead consumer market. Even there are some odd examples ; your 10 year old games will still work on newest Windows.

But i doubt implementing OGL over D3D is a good thing at all. Because what MS tries to achieve with it is forcing hw vendors to put all weight on D3D12 drivers but nothing else. So in the end ; OGL apps that relies on it can work but in a very poor state. So that might be another " See , other api's suck. While DX12 Ultimate shines all above them." because they're used to do such marketing.

They did on Vista days anyway which kinda sped up death of OGL usage on modern apps.
Liam Dawe Mar 24, 2020
But i doubt implementing OGL over D3D is a good thing at all. Because what MS tries to achieve with it is forcing hw vendors to put all weight on D3D12 drivers but nothing else. So in the end ; OGL apps that relies on it can work but in a very poor state. So that might be another " See , other api's suck. While DX12 Ultimate shines all above them." because they're used to do such marketing.

They did on Vista days anyway which kinda sped up death of OGL usage on modern apps.
I get what you're saying, however, with it relying on Mesa unless Microsoft go entirely out of their way to break it by drastically changing DX12 (which they can't, as it would break anything shipping DX12) - it will keep on working. That's the point of this. It uses open source, which can continue to improve and Windows gets decent OpenGL support which does help cross-compatibility.
Leopard Mar 24, 2020
No , actually Windows at this point has nothing to do with OGL situation on Windows.

Reason why OGL is still a relevant api these days ( for professional use cases like CAD apps etc ) is Nvidia and Nvidia's OGL driver is pretty solid on both platforms.

OGL on D3D won't be featureful like NV driver or even AMD's very slow OGL driver,which i don't even take account of many many OGL driver app profiles goes for somewhat broken but important apps. So i think that is not so beneficial as it might seem. There are vendors who can deliver solid OGL implementations already. If they somehow join into this trend and starts to abandon OGL driver of theirs , this might give D3D12 a critical edge over Vulkan , which fears me most.

https://twitter.com/_Humus_/status/1018846492273119233?s=19

Funny story about how AMD screwed with their OGL driver btw.
BrazilianGamer Mar 25, 2020
Kudos to Colabora, only
TheRiddick Mar 25, 2020
AMD's OGL driver under Linux is pretty decent (not quite as good as NVIDIA's but close), but their OGL driver under Windows is still using old trash code. IF AMD ever decides to open-source their windows driver, they can port over the Linux OGL code and get a immediate benefit.

I'm not sure why its hard to open-source drivers under windows, maybe Microsoft says no?
Thetargos Mar 25, 2020
I thought part of this stems from Vendors such as AMD no longer providing OpenGL drivers for Windows. Alas I am uncertain as 1, I do not have Windows and 2, nor an AMD graphics card. But I did read somewhere AMD was stopping Open GL drivers on Windows (do not quote me on that, I'm sure I read about it, just do not remember where, so...)

Now why go the DX12 route rather than Vulkan route (which, I'd assume could provide higher version OpenGL compliance, since hw compliance for VK is roughly the same as for GL 4.5), I'd assume is because it would be expected better DX12 support rather than Vulkan support from IHVs, especially hardware found in Microsoft devices. So I guess this is twofold: For better support for Surface devices, as well as having a broader catalog of (older) games for the Xbox. Sure CAD applications and medical could also benefit.


Last edited by Thetargos on 25 March 2020 at 1:19 am UTC
Shmerl Mar 25, 2020
Now why go the DX12 route rather than Vulkan route (which, I'd assume could provide higher version OpenGL compliance, since hw compliance for VK is roughly the same as for GL 4.5), I'd assume is because it would be expected better DX12 support rather than Vulkan support from IHVs

Not really. It's for the sake of promoting MS technology, instead of collaborative one. Nothing stops MS from ditching DX12 and making sure Vulkan support is good on all of their devices, well except for them being MS.


Last edited by Shmerl on 25 March 2020 at 2:11 am UTC
elmapul Mar 25, 2020
"Not all Windows-powered devices have consistent support for hardware-accelerated OpenCL and OpenGL. "
that is actually a bad thing, now hardware vendors will not think twice before they dump openGL completely, and if they dont make an driver for windows, i dont see they doing one for linux either.
the ideal solution would be to translate it to vulkan
elmapul Mar 25, 2020
So it's either this support in order to have OpenGL and OpenCL on these machines, or nothing at all....
i think you didnt understood whats happening here.

if microsoft try to launch an hardware (eg: surface, xbox, etc) that dont have support for openGL, they will not be removing value from openGl, they will be removing value from their own product!

they cant afford to launch an device that didnt support aplications such as world of warcraft, they tried it in the past, and it was an disaster.

so, what they are doing?

creating an runtime that will run openGL applications on top of direct x 12, this will ensure that the performance of openGL applications is worse than DirectX 12 applications, wich will reduce the incentive do develop using openGL.
but since most aplications that use it are old, they should run fine (and fast) in those devices, fast enough to run an old game, but not fast enough to run an modern game developed in openGL (an game with tons of shaders, polygons, 3D models etc)
this will not affect indies, but triple A developers will not have an openGL backend.
(its not like they did anyway, but this type of things just ensure it)

the next step could be to do the samething with vulkan...

so, no, they arent adding value to openGL, big companies (like triple a game developers or game engine developers) wont use it anymore since vulkan and dx12 are better options, small companies usualy dont make their own engines, so this will not add value to openGL.
this may even create some frenkstein aplication hybrid from openGL and DirectX12...


Last edited by elmapul on 25 March 2020 at 9:11 am UTC
elmapul Mar 25, 2020
Well, it might technically be beneficial for Microsoft®, considering Windows' current sore state of built-in OpenGL implementation (I think it is something like "OpenGL 1.1") and could make some vendor-locked-in devices (like "Microsoft Surface") to be somewhat useful. Or to help AMDGPU-powered devices to s**k a little less in OpenGL applications (it would be nice to have a comparison to official AMD OpenGL stack)…

But, honestly, using "DirectX 12" is like betting on a dead horse. I mean, who needs DX12 when we have Vulkan? On the other hand, DX12 is all Microsoft® has, so they are out of options… :S:

anyone who develop for xbox needs DirectX12, and before some one says "ps4/switch runs vulkan" they really do? and its an first class citizen, or they threat it like microsoft threated openGL?
"yes, you can use it to port your multiplatform game to our system, but if you want use the full potential you should use our proprietary api"
elmapul Mar 25, 2020
No , actually Windows at this point has nothing to do with OGL situation on Windows.

Reason why OGL is still a relevant api these days ( for professional use cases like CAD apps etc ) is Nvidia and Nvidia's OGL driver is pretty solid on both platforms.

OGL on D3D won't be featureful like NV driver or even AMD's very slow OGL driver,which i don't even take account of many many OGL driver app profiles goes for somewhat broken but important apps. So i think that is not so beneficial as it might seem. There are vendors who can deliver solid OGL implementations already. If they somehow join into this trend and starts to abandon OGL driver of theirs , this might give D3D12 a critical edge over Vulkan , which fears me most.

https://twitter.com/_Humus_/status/1018846492273119233?s=19

Funny story about how AMD screwed with their OGL driver btw.

AMD poured a lot of effort into ATi's drivers actually, and were probably the minds behind trying to unify the Windows and Linux GL drivers. Those decisions are not taken lightly, or without understanding the risks.

And don't worry, Vulkan dominates (or is trending that way) in the mobile space. Microsoft can't touch that, and it's a big space. Then don't forget that perhaps some of this work might encourage OpenGL on Vulkan, simplifying the GNU/Linux driver space. If nothing else, it might get others thinking about it.

Not that I trust Microsoft with this one tiny bit however. They've done their best to deserve such ire.
the issue is, mobile games suck, so it dont matter to much...
and they still can enter this market with xcloud, or nvidia could enter with geforce now, wich seems like an great deal...
elmapul Mar 25, 2020
AMD's OGL driver under Linux is pretty decent (not quite as good as NVIDIA's but close), but their OGL driver under Windows is still using old trash code. IF AMD ever decides to open-source their windows driver, they can port over the Linux OGL code and get a immediate benefit.

I'm not sure why its hard to open-source drivers under windows, maybe Microsoft says no?

i dont know how to make an driver, but i think they should use some windows api that is deeply integrated with the kernel and other proprietary stuff, so exposing it may make it easier to reverse enginering windows and microsoft wont allow that.

even valve has an NDA for their apis, i'm not sure why.
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
The comments on this article are closed.