Join us on our own very special Reddit: /r/Linuxers

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.
20 Likes, Who?
We do often include affiliate links to earn us some pennies. We are currently affiliated with GOG, Humble Store and Paradox Interactive. See more here.
About the author -
author picture
I am the owner of GamingOnLinux. After discovering Linux back in the days of Mandrake in 2003, I constantly came back to check 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.
See more from me
19 comments
Page: «2/2
  Go to:

mirv 25 Mar
View PC info
  • Supporter Plus
Random late night thought: if this is a success, and considering we've all seen how well DXVK has worked, I wonder if Microsoft might be aiming long term to only need drivers for DX12, and then provide shim layers to implement DX9, 10, 11, on top of that. It would certainly be nice for the hardware vendors, and would let Microsoft more tightly control legacy API support.
TheRiddick 25 Mar
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 25 Mar
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 25 Mar
Quoting: ThetargosNow 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 25 Mar
"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 25 Mar
Quoting: GuestSo 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 25 Mar
Quoting: Alm888Well, 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 25 Mar
Quoting: mirv
Quoting: LeopardNo , 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 25 Mar
Quoting: TheRiddickAMD'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:

Patreon, Liberapay or PayPal Donation.

We have no adverts, no paywalls, no timed exclusive articles. Just 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!
Login / Register

Or login with...
Sign in with Steam Sign in with Twitter Sign in with Google
Social logins require cookies to stay logged in.

Livestreams & Videos
Community Livestreams
Latest Forum Posts