patchsets: Handle non-Metal debugging

This commit is contained in:
Mykola Grymalyuk
2024-09-02 19:48:16 -06:00
parent fcf24cef88
commit 4b7c399ce6
7 changed files with 15 additions and 7 deletions

View File

@@ -2,7 +2,8 @@
base.py: Base class for hardware patch set detection
"""
from enum import StrEnum
from enum import StrEnum
from pathlib import Path
from ..base import BasePatchset
@@ -166,3 +167,10 @@ class BaseHardware(BasePatchset):
if self._xnu_float < self.macOS_14_4:
return "12.5-23"
return "12.5-23.4"
def _dortania_internal_check(self) -> None:
"""
Determine whether to unlock Dortania Developer mode
"""
return Path("~/.dortania_developer").expanduser().exists()

View File

@@ -98,7 +98,7 @@ class AMDTeraScale1(BaseHardware):
if self.native_os() is True:
return {}
if self._xnu_major not in self._constants.legacy_accel_support:
if self._xnu_major not in self._constants.legacy_accel_support and self._dortania_internal_check() is False:
return {
**AMDTeraScale(self._xnu_major, self._xnu_minor, self._os_build).patches(),
**self._model_specific_patches()

View File

@@ -102,7 +102,7 @@ class AMDTeraScale2(BaseHardware):
if self.native_os() is True:
return {}
if self._xnu_major not in self._constants.legacy_accel_support:
if self._xnu_major not in self._constants.legacy_accel_support and self._dortania_internal_check() is False:
return {
**AMDTeraScale(self._xnu_major, self._xnu_minor, self._os_build).patches(),
**self._model_specific_patches()

View File

@@ -93,7 +93,7 @@ class IntelIronLake(BaseHardware):
if self.native_os() is True:
return {}
if self._xnu_major not in self._constants.legacy_accel_support:
if self._xnu_major not in self._constants.legacy_accel_support and self._dortania_internal_check() is False:
return {**self._model_specific_patches()}
return {

View File

@@ -97,7 +97,7 @@ class IntelSandyBridge(BaseHardware):
if self.native_os() is True:
return {}
if self._xnu_major not in self._constants.legacy_accel_support:
if self._xnu_major not in self._constants.legacy_accel_support and self._dortania_internal_check() is False:
return {**self._model_specific_patches()}
return {

View File

@@ -96,7 +96,7 @@ class NvidiaTesla(BaseHardware):
if self.native_os() is True:
return {}
if self._xnu_major not in self._constants.legacy_accel_support:
if self._xnu_major not in self._constants.legacy_accel_support and self._dortania_internal_check() is False:
return {**self._model_specific_patches()}
return {

View File

@@ -149,7 +149,7 @@ class NvidiaWebDriver(BaseHardware):
if self.native_os() is True:
return {}
if self._xnu_major not in self._constants.legacy_accel_support:
if self._xnu_major not in self._constants.legacy_accel_support and self._dortania_internal_check() is False:
return {**self._model_specific_patches()}
return {