Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

OpenGL 4.3 (or Apple Metal) GPU offload on Mac

Discussion in 'General Graphics' started by syscrusher, Apr 7, 2016.

  1. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I run Unity on a Macbook Pro Retina (2013 edition, NVIDIA GeForce 650M GPU). I'm using an asset whose upcoming major upgrade can run on just the CPU (and in fact multithreads there) but runs much better if it can offload computation to the GPU. The developer says this needs OpenGL 4.3. Apple, unfortunately, seems stubbornly stuck at OpenGL 4.1 with a slight (c. 15%) implementation of the 4.2 API extensions. Apparently Apple is going all-in for their own Metal, a competing proprietary offering that they think is the answer to DirectX.

    I installed an OpenGL diagnostic tool on my system yesterday and profiled and benchmarked the default El Capitan drivers. Then I installed the latest driver from NVIDIA, and repeated the tests. The bad news is that the new driver did not change the OpenGL support. I didn't really expect to, but I thought maybe some of the OpenGL was embedded into the GPU drivers on a Mac (I'm a programmer but not in the graphics pipeline, so forgive my ignorance of that part of things). The version is still basically 4.1, but with 15% implementation of the 4.2 API extensions.

    The good news, though, was the benchmarks. My frame rate on the OpenGL benchmarks went up by about 35% with the new driver. Tests with Unity, Substance Designer, Parallels Desktop, and Lightworks video editor found no problems with the driver.

    So, it looks as if I found a way to improve performance, but not to overcome the issue of an outdated OpenGL stack. I wanted to post here and see if anyone else in the Unity community has already solved this problem, and if so, how did you do it? I would even be willing to purchase a commercial driver if that would help, but I haven't seen anything offered. Is Unity planning to support Metal in version 5.4 or something soon after? Is there a way to grab an open source OpenGL stack and integrate it?

    Graphics pipeline is not my field of expertise, so I'm hoping someone with more knowledge in this area can suggest a solution other that "move to Windows". That's a non-starter for me because of various technical reasons not directly relevant to this thread.

    Thanks for any advice. I'm also interested in hearing from others interested in collaborating to solve this by testing any alternatives we can find.
     
  2. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    thanks in my case i have a 2014 MBP with an intel Iris 1536 chipset which i cant upgrade driver, except if apple provide an update themselves
     
  3. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Update: Unfortunately, I still have not found any solution to this, but I haven't given up yet.
     
  4. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Unity, it seems, has experimental support for Metal in the standalone runtime builds for Mac, but not yet in the editor. They say they're working on full integration.

    Interesting case history of one developer's experience porting Unity shaders to Metal.

    I still want Apple or some third party to provide OpenGL 4.3 on OSX.
     
  5. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I doubt you'll see third party support. Apples focus on Metal makes me less optimistic that they will focus on upgrading OpenGL, but I don't completely rule it (or Vulkan one day) out. All the same I expect we will get to Apple dev conference season and just hear more about Metal, but maybe I will be wrong.

    Unity's excellent efforts to seamlessly support compute shaders on graphics platforms other than DX11/12 have for a long time seemed like the most likely solution to me, but it takes time.
     
    syscrusher likes this.
  6. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I hear you, and I think you're right, but "hope springs eternal." It really bugs me when a company like Apple or Microsoft decides that their latest idea is the greatest thing since sliced bread, and they no longer need to support industry standards. Apple bills their systems as a fantastic multimedia platform, and if they intend that to be true, then they need to support all the appropriate industry standards and protocols. Microsoft has DirectX as their standard, but that hasn't prevented good OpenGL support in Windows. Linux supports OpenGL quite nicely, too. Apple can afford the resources to develop Metal and also support OpenGL.

    Understood. I don't blame Unity for this problem, as it's outside of their control, and I agree with you that UT is doing a pretty good job of compensating for the vagaries of hardware and operating systems.
     
  7. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    _Luthien_ likes this.