Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
[renderbox] Rename metal_31001 to renderbox.py, finish removing from GCN
  • Loading branch information
crystall1nedev committed Dec 28, 2025
commit c39dbfc189ee57b0e3e156eaa3176654a3c6f6f7
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from ...base import PatchType

from ...shared_patches.metal_31001 import LegacyMetal31001
from ...shared_patches.monterey_gva import MontereyGVA
from ...shared_patches.monterey_opencl import MontereyOpenCL
from ...shared_patches.amd_opencl import AMDOpenCL
Expand Down Expand Up @@ -119,9 +118,8 @@ def patches(self) -> dict:
if self.native_os() is True:
return {}

_base = {
**LegacyMetal31001(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
}
# Placeholder, don't remove
_base = {}

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

return _base
return _base
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from ...base import PatchType

from ...shared_patches.metal_31001 import LegacyMetal31001
from ...shared_patches.monterey_gva import MontereyGVA
from ...shared_patches.monterey_opencl import MontereyOpenCL
from ...shared_patches.amd_opencl import AMDOpenCL
Expand Down Expand Up @@ -124,7 +123,6 @@ def patches(self) -> dict:
return {}

return {
**LegacyMetal31001(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
**MontereyGVA(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).revert_patches(),
**MontereyOpenCL(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
**AMDOpenCL(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from ...base import PatchType

from ...shared_patches.metal_31001 import LegacyMetal31001
from ...shared_patches.monterey_gva import MontereyGVA
from ...shared_patches.monterey_opencl import MontereyOpenCL
from ...shared_patches.amd_opencl import AMDOpenCL
Expand Down Expand Up @@ -132,7 +131,6 @@ def patches(self) -> dict:
return self._model_specific_patches()

_base = {
**LegacyMetal31001(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
**MontereyOpenCL(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
**self._model_specific_patches(),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from ...base import PatchType

from ...shared_patches.metal_31001 import LegacyMetal31001
from ...shared_patches.monterey_gva import MontereyGVA
from ...shared_patches.monterey_opencl import MontereyOpenCL
from ...shared_patches.amd_opencl import AMDOpenCL
Expand Down Expand Up @@ -123,8 +122,6 @@ def patches(self) -> dict:
return {}

return {
**LegacyMetal31001(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),

# AMD GCN and newer GPUs can still use the native GVA stack
**MontereyGVA(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).revert_patches(),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from ...base import PatchType

from ...shared_patches.metal_31001 import LegacyMetal31001
from ...shared_patches.renderbox import RenderBox
from ...shared_patches.monterey_gva import MontereyGVA
from ...shared_patches.monterey_opencl import MontereyOpenCL

Expand Down Expand Up @@ -89,7 +89,7 @@ def patches(self) -> dict:
return {}

return {
**LegacyMetal31001(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
**RenderBox(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
**MontereyGVA(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
**MontereyOpenCL(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
**self._model_specific_patches(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from ...base import PatchType

from ...shared_patches.metal_31001 import LegacyMetal31001
from ...shared_patches.renderbox import RenderBox
from ...shared_patches.monterey_opencl import MontereyOpenCL

from .....constants import Constants
Expand Down Expand Up @@ -89,7 +89,7 @@ def patches(self) -> dict:
return {}

return {
**LegacyMetal31001(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
**RenderBox(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
**MontereyOpenCL(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
**self._model_specific_patches(),
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""
renderbox.py: RenderBox metallib patch set
"""

import packaging.version

from .base import BaseSharedPatchSet

from ..base import PatchType, DynamicPatchset

from ....datasets.os_data import os_data


class RenderBox(BaseSharedPatchSet):

def __init__(self, xnu_major: int, xnu_minor: int, marketing_version: str) -> None:
super().__init__(xnu_major, xnu_minor, marketing_version)


def _os_requires_patches(self) -> bool:
"""
Check if the current OS requires
"""
return self._xnu_major >= os_data.ventura.value


def patches(self) -> dict:
"""
Dictionary of patches
"""
if self._os_requires_patches() is False:
return {}

return {
"RenderBox Common": {
PatchType.OVERWRITE_SYSTEM_VOLUME: {
"/System/Library/PrivateFrameworks/RenderBox.framework/Versions/A/Resources": {
**({ "default.metallib": f"RenderBox-{self._xnu_major}" }),
},
},
}
}