Revert "Revert the Metal Experiment (#701)"

This reverts commit fe1617ffea.
This commit is contained in:
Evan Husted
2025-02-22 21:33:38 -06:00
parent fe1617ffea
commit 80d619f010
135 changed files with 15077 additions and 302 deletions

View File

@@ -0,0 +1,26 @@
using SharpMetal.Metal;
using System;
using System.Runtime.Versioning;
namespace Ryujinx.Graphics.Metal
{
[SupportedOSPlatform("macos")]
readonly struct DisposableBuffer : IDisposable
{
public MTLBuffer Value { get; }
public DisposableBuffer(MTLBuffer buffer)
{
Value = buffer;
}
public void Dispose()
{
if (Value != IntPtr.Zero)
{
Value.SetPurgeableState(MTLPurgeableState.Empty);
Value.Dispose();
}
}
}
}