mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-08-06 09:22:33 -07:00
* Basic BufferManager * Start Scoped Command Buffers * Fences stuff * Remember to cleanup sync manager * Auto, Command Buffer Dependants * Cleanup * Cleanup + Fix Texture->Buffer Copies * Slow buffer upload * Cleanup + Rework TextureBuffer * Don’t get unsafe * Cleanup * Goddamn it * Staging Buffer + Interrupt Action + Flush
27 lines
569 B
C#
27 lines
569 B
C#
using SharpMetal.Metal;
|
|
using System;
|
|
using System.Runtime.Versioning;
|
|
|
|
namespace Ryujinx.Graphics.Metal
|
|
{
|
|
[SupportedOSPlatform("macos")]
|
|
public 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();
|
|
}
|
|
}
|
|
}
|
|
}
|