Search Unity

  1. We would like to hear your feedback about Unity and our products. Click here for more information.
    Dismiss Notice

Is better compute shader support coming soon for Mac?

Discussion in 'OSX' started by gecko, Mar 30, 2019.

  1. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    1,980
    Compute shader support on Mac OSX seems to lag behind Windows. I know almost nothing about shaders, so this will be quite vague, in hopes that more knowledgable people will chime in. All I know is that some tools like Advanced Terrain Grass and Vegetation Studio Pro have options like Instanced Indirect and Compute to render lots and lots of grass more rapidly, and these work great on Windows, but are actually worse on Mac than the standard methods provided by those tools. (Maybe @larsbertram1 and @LennartJohansen can explain this better about their shaders...)

    Anyways, I'm wondering if this is due to limitations inherent in OSX (and thus Apple's fault), or if it's something that Unity can improve, and if so, does anyone know whether that's likely to happen soon.

    thanks
    Dave
     
    catfink likes this.
  2. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    124
    I am also interested in the answer to this - many of us make cross platform products. Having to do significantly different things for different platforms in order to get performance is a workload I could do with, lets say "less of", as I doubt I'll ever get to do without it at all.
     
  3. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,174
    Unity compute shader support for macs using Metal is actually pretty good. For example I run a 3D fluid sim that makes very heavy use of compute shaders and the same Unity compute shader HLSL code has worked for a number of years on Windows and MacOS without me having to do anything. Performance is harder to compare as I have different graphics cards in my systems. But I had have the same card on both operating systems in the past and there was a difference but it wasnt an insanely bad difference, just the typical differences that have always meant macOS graphics performance overall wasnt up to the levels achieved by all the years of Windows DirectX & driver optimisations.

    Also a lot of macs dont have very good gpus to begin with. I get round this using an external gpu enclosure & thunderbolt 3, but there is some performance overhead for that too.

    Sorry to say your question is probably much too vague and non-technical, including a lack of info about what hardware you are using. For example Instanced Indirect is different to the compute shader stuff I just spoke of, perhaps there is a bottleneck there, or somewhere else, but there isnt with compute shaders in general so there will be no magic fix from Unity on the compute shader front. Or the performance issue is somewhere else in those assets you mention. I dont really know what to tell you, except for my own experience and other stuff like the fact it is perfectly possible to get good results using Unitys HDRP on the mac, and that makes extensive use of compute shaders.
     
  4. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    1,980
    Well, yeah, it's vague because I don't understand this stuff. But using Vegetation Studio Pro as an example: It offers Instanced Indirect method, which I believe uses compute shaders. On Windows, I get a significant speed increase when I switch to this method. On Mac, I get an enormous slowdown. Using 2018.3.9:

    * WIndows 10 with GTX 1060: Grass rendering takes 2-4ms with indirect.
    * Mac OS 10.13 with Radeon 580 eGPU: Well, since GPU profiling doesn't work on Macs, I have no detailed breakdown, but when I enable Indirect, FPS drops from 30+ to 2, and the Rendering thread (shown in the Stats panel) rises to at least 100ms, often 300 or more.

    This is a known issue (at least by Lennart and LarsBertram and VSP-Mac users), not just something on my end.

    Is this due to OSX drivers? Metal implementation (by Apple or Unity)? Something else? That's what I am hoping someone knows....and whether it's possible/likely to improve in the near future.
     
  5. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    244
    Yup, Mac is pain in the ... GPU ... this is so frustrating; I doubt Apple will anytime soon support 'gamers'; sad.
     
  6. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    84
    This sounds like a possible bug. Mind reporting it?
    https://unity3d.com/unity/qa/bug-reporting
     
    gecko likes this.
  7. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    1,980
    @PixelJ I've submitted a repro project, Case 1153743
     
    PixelJ likes this.