mirror of
https://github.com/GreemDev/Ryujinx
synced 2024-12-02 06:22:06 +01:00
Start Proper Dispose
This commit is contained in:
parent
4bbf7b67d4
commit
937d84018e
5 changed files with 17 additions and 11 deletions
|
@ -38,7 +38,7 @@
|
||||||
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
|
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
|
||||||
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
|
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
|
||||||
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
||||||
<PackageVersion Include="SharpMetal" Version="1.0.0-preview12" />
|
<PackageVersion Include="SharpMetal" Version="1.0.0-preview14" />
|
||||||
<PackageVersion Include="SharpZipLib" Version="1.4.2" />
|
<PackageVersion Include="SharpZipLib" Version="1.4.2" />
|
||||||
<PackageVersion Include="Silk.NET.Vulkan" Version="2.21.0" />
|
<PackageVersion Include="Silk.NET.Vulkan" Version="2.21.0" />
|
||||||
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.21.0" />
|
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.21.0" />
|
||||||
|
|
|
@ -215,7 +215,8 @@ namespace Ryujinx.Graphics.Metal
|
||||||
{
|
{
|
||||||
var blitEncoder = _pipeline.GetOrCreateBlitEncoder();
|
var blitEncoder = _pipeline.GetOrCreateBlitEncoder();
|
||||||
|
|
||||||
MTLBuffer src = _device.NewBuffer((ulong)data.Length, MTLResourceOptions.ResourceStorageModeManaged);
|
using MTLBuffer src = _device.NewBuffer((ulong)data.Length, MTLResourceOptions.ResourceStorageModeManaged);
|
||||||
|
{
|
||||||
var span = new Span<byte>(src.Contents.ToPointer(), data.Length);
|
var span = new Span<byte>(src.Contents.ToPointer(), data.Length);
|
||||||
data.CopyTo(span);
|
data.CopyTo(span);
|
||||||
src.DidModifyRange(new NSRange
|
src.DidModifyRange(new NSRange
|
||||||
|
@ -227,6 +228,7 @@ namespace Ryujinx.Graphics.Metal
|
||||||
MTLBuffer dst = new(Unsafe.As<BufferHandle, IntPtr>(ref buffer));
|
MTLBuffer dst = new(Unsafe.As<BufferHandle, IntPtr>(ref buffer));
|
||||||
blitEncoder.CopyFromBuffer(src, 0, dst, (ulong)offset, (ulong)data.Length);
|
blitEncoder.CopyFromBuffer(src, 0, dst, (ulong)offset, (ulong)data.Length);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdateCounters()
|
public void UpdateCounters()
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,7 +63,9 @@ namespace Ryujinx.Graphics.Metal
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
return;
|
VertexFunction.Dispose();
|
||||||
|
FragmentFunction.Dispose();
|
||||||
|
ComputeFunction.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@ namespace Ryujinx.Graphics.Metal
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
_mtlSamplerState.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -329,6 +329,7 @@ namespace Ryujinx.Graphics.Metal
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
MTLTexture.SetPurgeableState(MTLPurgeableState.Volatile);
|
MTLTexture.SetPurgeableState(MTLPurgeableState.Volatile);
|
||||||
|
MTLTexture.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue