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.
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.
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.
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.
@PixelJ Any news about that repro (Case 1153743)? I got an email back saying it was confirmed, and would be passed along to the development team, but nothing since thenā¦
Well, that bug has been around for years, so Iām personally not holding my breath.
Thereās also the similar issue of the use of tesselation being incompatible with terrain instancing.
The Metal world is unfortunately still full of weird deviations from what one usually expects. Collectively, these things impel people to consider other platforms or to avoid the Mac entirely. Part of it has to do with Appleās choices, other with Unityās inaction ā or shall we say, Unityās priorities.
Also, these things are not always clear even to developers of high-end graphics products. I remember debating the indirect instance issue with the author of Vegetation Studio Pro, who wasnāt aware of this particular consideration. I also reported that my instanced terrains simply vanished to the author of MicroSplat, who also had no idea of what was going on, despite the fact the he develops on a Mac. So these things are sometimes a mystery even to the āhigh initiatesā. It would be good if Unity brought uniformity and clarity to these issues, for there has been confusion for years now and people have spent many hours trying to find workarounds which simply do not exist.
I should add that both authors now have disabled those features on the Mac platform. Too messy, too many problems, no documentation from Unity, no response when filing bug reports, I guess.