mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-03-11 17:44:23 +00:00
27 lines
562 B
C#
27 lines
562 B
C#
![]() |
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();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|