443 -libarmeillure-macos (#142)

Fixes [#443](https://github.com/Ryubing/Issues/issues/433)

Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/142
This commit is contained in:
Max
2026-06-15 23:20:44 +00:00
committed by sh0inx
parent e777e3f93b
commit 6d67a86efd
4 changed files with 21 additions and 20 deletions

View File

@@ -47,12 +47,14 @@ def get_new_name(
input_component = str(input_dylib_path).replace(str(input_directory), "")[1:] input_component = str(input_dylib_path).replace(str(input_directory), "")[1:]
return Path(os.path.join(output_directory, input_component)) return Path(os.path.join(output_directory, input_component))
def get_archs(dylib_path: Path) -> list[str]:
res = subprocess.check_output([LIPO, "-info", str(dylib_path)]).decode("utf-8") def is_fat_file(dylib_path: Path) -> str:
if res.startswith("Non-fat file"): res = subprocess.check_output([LIPO, "-info", str(dylib_path.absolute())]).decode(
return [res.split(":")[-1].strip()] "utf-8"
else: )
return res.split("are:")[-1].strip().split()
return not res.split("\n")[0].startswith("Non-fat file")
def construct_universal_dylib( def construct_universal_dylib(
arm64_input_dylib_path: Path, x86_64_input_dylib_path: Path, output_dylib_path: Path arm64_input_dylib_path: Path, x86_64_input_dylib_path: Path, output_dylib_path: Path
@@ -67,12 +69,11 @@ def construct_universal_dylib(
os.path.basename(arm64_input_dylib_path.resolve()), output_dylib_path os.path.basename(arm64_input_dylib_path.resolve()), output_dylib_path
) )
else: else:
arm64_archs = get_archs(arm64_input_dylib_path) if is_fat_file(arm64_input_dylib_path) or not x86_64_input_dylib_path.exists():
x86_64_archs = get_archs(x86_64_input_dylib_path) if x86_64_input_dylib_path.exists() else [] with open(output_dylib_path, "wb") as dst:
with open(arm64_input_dylib_path, "rb") as src:
if "arm64" in arm64_archs and "x86_64" in arm64_archs: dst.write(src.read())
shutil.copy2(arm64_input_dylib_path, output_dylib_path) else:
elif x86_64_archs:
subprocess.check_call( subprocess.check_call(
[ [
LIPO, LIPO,

View File

@@ -16,15 +16,15 @@ namespace Ryujinx.Graphics.Vulkan
{ {
DescriptorSetLayout[] layouts = new DescriptorSetLayout[setDescriptors.Count]; DescriptorSetLayout[] layouts = new DescriptorSetLayout[setDescriptors.Count];
bool[] updateAfterBindFlags = new bool[setDescriptors.Count]; bool[] updateAfterBindFlags = new bool[setDescriptors.Count];
bool isMoltenVk = gd.IsMoltenVk; bool isMoltenVk = gd.IsMoltenVk;
for (int setIndex = 0; setIndex < setDescriptors.Count; setIndex++) for (int setIndex = 0; setIndex < setDescriptors.Count; setIndex++)
{ {
ResourceDescriptorCollection rdc = setDescriptors[setIndex]; ResourceDescriptorCollection rdc = setDescriptors[setIndex];
ResourceStages activeStages = ResourceStages.None; ResourceStages activeStages = ResourceStages.None;
if (isMoltenVk) if (isMoltenVk)
{ {
for (int descIndex = 0; descIndex < rdc.Descriptors.Count; descIndex++) for (int descIndex = 0; descIndex < rdc.Descriptors.Count; descIndex++)
@@ -48,7 +48,7 @@ namespace Ryujinx.Graphics.Vulkan
// causes invalid resource errors, allow the binding on all active stages as workaround. // causes invalid resource errors, allow the binding on all active stages as workaround.
// https://github.com/KhronosGroup/MoltenVK/issues/1870 // https://github.com/KhronosGroup/MoltenVK/issues/1870
stages = activeStages; stages = activeStages;
} }
layoutBindings[descIndex] = new DescriptorSetLayoutBinding layoutBindings[descIndex] = new DescriptorSetLayoutBinding
{ {

View File

@@ -439,7 +439,7 @@ namespace Ryujinx.Graphics.Vulkan
features2.Features.MultiViewport && !(IsMoltenVk && Vendor == Vendor.Amd), // Workaround for AMD on MoltenVK issue features2.Features.MultiViewport && !(IsMoltenVk && Vendor == Vendor.Amd), // Workaround for AMD on MoltenVK issue
featuresRobustness2.NullDescriptor || IsMoltenVk, featuresRobustness2.NullDescriptor || IsMoltenVk,
supportsPushDescriptors, supportsPushDescriptors,
IsMoltenVk ? 16 : propertiesPushDescriptor.MaxPushDescriptors, // In case an old version of MoltenVK is used, apply a limit to prevent vertex explosions. IsMoltenVk ? 16 : propertiesPushDescriptor.MaxPushDescriptors, // Prevents vertex explosions on MoltenVK.
featuresPrimitiveTopologyListRestart.PrimitiveTopologyListRestart, featuresPrimitiveTopologyListRestart.PrimitiveTopologyListRestart,
featuresPrimitiveTopologyListRestart.PrimitiveTopologyPatchListRestart, featuresPrimitiveTopologyListRestart.PrimitiveTopologyPatchListRestart,
supportsTransformFeedback, supportsTransformFeedback,

View File

@@ -28,14 +28,14 @@
<PublishTrimmed>true</PublishTrimmed> <PublishTrimmed>true</PublishTrimmed>
<TrimMode>partial</TrimMode> <TrimMode>partial</TrimMode>
</PropertyGroup> </PropertyGroup>
<!-- <!--
FluentAvalonia, used in the Avalonia UI, requires a workaround for the json serializer used internally when using .NET 8+ System.Text.Json. FluentAvalonia, used in the Avalonia UI, requires a workaround for the json serializer used internally when using .NET 8+ System.Text.Json.
See: See:
https://github.com/amwx/FluentAvalonia/issues/481 https://github.com/amwx/FluentAvalonia/issues/481
https://devblogs.microsoft.com/dotnet/system-text-json-in-dotnet-8/ https://devblogs.microsoft.com/dotnet/system-text-json-in-dotnet-8/
--> -->
<PropertyGroup> <PropertyGroup>
<JsonSerializerIsReflectionEnabledByDefault>true</JsonSerializerIsReflectionEnabledByDefault> <JsonSerializerIsReflectionEnabledByDefault>true</JsonSerializerIsReflectionEnabledByDefault>
</PropertyGroup> </PropertyGroup>
@@ -73,7 +73,7 @@
<PackageReference Include="Silk.NET.Vulkan.Extensions.KHR" /> <PackageReference Include="Silk.NET.Vulkan.Extensions.KHR" />
<PackageReference Include="SPB" /> <PackageReference Include="SPB" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Ryujinx.Graphics.RenderDocApi\Ryujinx.Graphics.RenderDocApi.csproj" /> <ProjectReference Include="..\Ryujinx.Graphics.RenderDocApi\Ryujinx.Graphics.RenderDocApi.csproj" />
<ProjectReference Include="..\Ryujinx.Graphics.Vulkan/Ryujinx.Graphics.Vulkan.csproj" /> <ProjectReference Include="..\Ryujinx.Graphics.Vulkan/Ryujinx.Graphics.Vulkan.csproj" />