Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ The version number for this package has increased due to a version update of a r
- Fixed light layers not correctly disabled when the lightlayers is set to Nothing and Lightlayers isn't enabled in HDRP Asset
- Fixed a wrong condition in CameraSwitcher, potentially causing out of bound exceptions.
- Fixed an issue where editing the Look Dev default profile would not reflect directly in the Look Dev window.
- Fix supported Mac platform detection to handle new major version (11.0) properly

### Changed
- Hide unused LOD settings in Quality Settings legacy window.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,31 +657,37 @@ internal static OperatingSystemFamily BuildTargetToOperatingSystemFamily(UnityEd

#endif

internal static bool IsMacOSVersionAtLeast(string os, int majorVersion, int minorVersion, int patchVersion)
{
int startIndex = os.LastIndexOf(" ");
var parts = os.Substring(startIndex + 1).Split('.');
int currentMajorVersion = Convert.ToInt32(parts[0]);
int currentMinorVersion = Convert.ToInt32(parts[1]);
int currentPatchVersion = Convert.ToInt32(parts[2]);

if (currentMajorVersion < majorVersion) return false;
if (currentMajorVersion > majorVersion) return true;
if (currentMinorVersion < minorVersion) return false;
if (currentMinorVersion > minorVersion) return true;
if (currentPatchVersion < patchVersion) return false;
if (currentPatchVersion > patchVersion) return true;
return true;
}

internal static bool IsOperatingSystemSupported(string os)
{
// Metal support depends on OS version:
// macOS 10.11.x doesn't have tessellation / earlydepthstencil support, early driver versions were buggy in general
// macOS 10.12.x should usually work with AMD, but issues with Intel/Nvidia GPUs. Regardless of the GPU, there are issues with MTLCompilerService crashing with some shaders
// macOS 10.13.x is expected to work, and if it's a driver/shader compiler issue, there's still hope on getting it fixed to next shipping OS patch release
// macOS 10.13.x should work, but active development tests against current OS
//
// Has worked experimentally with iOS in the past, but it's not currently supported
//

if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal)
{
if (os.StartsWith("Mac"))
{
// TODO: Expose in C# version number, for now assume "Mac OS X 10.10.4" format with version 10 at least
int startIndex = os.LastIndexOf(" ");
var parts = os.Substring(startIndex + 1).Split('.');
int a = Convert.ToInt32(parts[0]);
int b = Convert.ToInt32(parts[1]);
// In case in the future there's a need to disable specific patch releases
// int c = Convert.ToInt32(parts[2]);

if (a < 10 || b < 13)
return false;
}
if (os.StartsWith("Mac") && !IsMacOSVersionAtLeast(os, 10, 13, 0))
return false;
}

return true;
Expand Down