Skip to content

Commit c39dbfc

Browse files
[renderbox] Rename metal_31001 to renderbox.py, finish removing from GCN
1 parent 36ff4a8 commit c39dbfc

File tree

8 files changed

+49
-87
lines changed

8 files changed

+49
-87
lines changed

opencore_legacy_patcher/sys_patch/patchsets/hardware/graphics/amd_legacy_gcn.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from ...base import PatchType
88

9-
from ...shared_patches.metal_31001 import LegacyMetal31001
109
from ...shared_patches.monterey_gva import MontereyGVA
1110
from ...shared_patches.monterey_opencl import MontereyOpenCL
1211
from ...shared_patches.amd_opencl import AMDOpenCL
@@ -119,9 +118,8 @@ def patches(self) -> dict:
119118
if self.native_os() is True:
120119
return {}
121120

122-
_base = {
123-
**LegacyMetal31001(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
124-
}
121+
# Placeholder, don't remove
122+
_base = {}
125123

126124
# AMD GCN and newer GPUs can still use the native GVA stack
127125
_base.update({
@@ -134,4 +132,4 @@ def patches(self) -> dict:
134132
**self._model_specific_patches(),
135133
})
136134

137-
return _base
135+
return _base

opencore_legacy_patcher/sys_patch/patchsets/hardware/graphics/amd_navi.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from ...base import PatchType
88

9-
from ...shared_patches.metal_31001 import LegacyMetal31001
109
from ...shared_patches.monterey_gva import MontereyGVA
1110
from ...shared_patches.monterey_opencl import MontereyOpenCL
1211
from ...shared_patches.amd_opencl import AMDOpenCL
@@ -124,7 +123,6 @@ def patches(self) -> dict:
124123
return {}
125124

126125
return {
127-
**LegacyMetal31001(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
128126
**MontereyGVA(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).revert_patches(),
129127
**MontereyOpenCL(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
130128
**AMDOpenCL(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),

opencore_legacy_patcher/sys_patch/patchsets/hardware/graphics/amd_polaris.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from ...base import PatchType
1010

11-
from ...shared_patches.metal_31001 import LegacyMetal31001
1211
from ...shared_patches.monterey_gva import MontereyGVA
1312
from ...shared_patches.monterey_opencl import MontereyOpenCL
1413
from ...shared_patches.amd_opencl import AMDOpenCL
@@ -132,7 +131,6 @@ def patches(self) -> dict:
132131
return self._model_specific_patches()
133132

134133
_base = {
135-
**LegacyMetal31001(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
136134
**MontereyOpenCL(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
137135
**self._model_specific_patches(),
138136
}

opencore_legacy_patcher/sys_patch/patchsets/hardware/graphics/amd_vega.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from ...base import PatchType
88

9-
from ...shared_patches.metal_31001 import LegacyMetal31001
109
from ...shared_patches.monterey_gva import MontereyGVA
1110
from ...shared_patches.monterey_opencl import MontereyOpenCL
1211
from ...shared_patches.amd_opencl import AMDOpenCL
@@ -123,8 +122,6 @@ def patches(self) -> dict:
123122
return {}
124123

125124
return {
126-
**LegacyMetal31001(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
127-
128125
# AMD GCN and newer GPUs can still use the native GVA stack
129126
**MontereyGVA(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).revert_patches(),
130127

opencore_legacy_patcher/sys_patch/patchsets/hardware/graphics/intel_broadwell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from ...base import PatchType
88

9-
from ...shared_patches.metal_31001 import LegacyMetal31001
9+
from ...shared_patches.renderbox import RenderBox
1010
from ...shared_patches.monterey_gva import MontereyGVA
1111
from ...shared_patches.monterey_opencl import MontereyOpenCL
1212

@@ -89,7 +89,7 @@ def patches(self) -> dict:
8989
return {}
9090

9191
return {
92-
**LegacyMetal31001(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
92+
**RenderBox(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
9393
**MontereyGVA(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
9494
**MontereyOpenCL(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
9595
**self._model_specific_patches(),

opencore_legacy_patcher/sys_patch/patchsets/hardware/graphics/intel_skylake.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from ...base import PatchType
88

9-
from ...shared_patches.metal_31001 import LegacyMetal31001
9+
from ...shared_patches.renderbox import RenderBox
1010
from ...shared_patches.monterey_opencl import MontereyOpenCL
1111

1212
from .....constants import Constants
@@ -89,7 +89,7 @@ def patches(self) -> dict:
8989
return {}
9090

9191
return {
92-
**LegacyMetal31001(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
92+
**RenderBox(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
9393
**MontereyOpenCL(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
9494
**self._model_specific_patches(),
9595
}

opencore_legacy_patcher/sys_patch/patchsets/shared_patches/metal_31001.py

Lines changed: 0 additions & 71 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
"""
2+
renderbox.py: RenderBox metallib patch set
3+
"""
4+
5+
import packaging.version
6+
7+
from .base import BaseSharedPatchSet
8+
9+
from ..base import PatchType, DynamicPatchset
10+
11+
from ....datasets.os_data import os_data
12+
13+
14+
class RenderBox(BaseSharedPatchSet):
15+
16+
def __init__(self, xnu_major: int, xnu_minor: int, marketing_version: str) -> None:
17+
super().__init__(xnu_major, xnu_minor, marketing_version)
18+
19+
20+
def _os_requires_patches(self) -> bool:
21+
"""
22+
Check if the current OS requires
23+
"""
24+
return self._xnu_major >= os_data.ventura.value
25+
26+
27+
def patches(self) -> dict:
28+
"""
29+
Dictionary of patches
30+
"""
31+
if self._os_requires_patches() is False:
32+
return {}
33+
34+
return {
35+
"RenderBox Common": {
36+
PatchType.OVERWRITE_SYSTEM_VOLUME: {
37+
"/System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/Resources": {
38+
**({ "default.metallib": f"RenderBox-{self._xnu_major}" }),
39+
},
40+
},
41+
}
42+
}

0 commit comments

Comments
 (0)