Fix Metal Validation Error
This commit is contained in:
parent
f2c090fe55
commit
1790050a14
2 changed files with 8 additions and 5 deletions
|
@ -204,12 +204,15 @@ namespace Ryujinx.Graphics.Metal
|
||||||
MTLBuffer mtlBuffer = new(Unsafe.As<BufferHandle, IntPtr>(ref buffer));
|
MTLBuffer mtlBuffer = new(Unsafe.As<BufferHandle, IntPtr>(ref buffer));
|
||||||
var span = new Span<byte>(mtlBuffer.Contents.ToPointer(), (int)mtlBuffer.Length);
|
var span = new Span<byte>(mtlBuffer.Contents.ToPointer(), (int)mtlBuffer.Length);
|
||||||
data.CopyTo(span[offset..]);
|
data.CopyTo(span[offset..]);
|
||||||
|
if (mtlBuffer.StorageMode == MTLStorageMode.Managed)
|
||||||
|
{
|
||||||
mtlBuffer.DidModifyRange(new NSRange
|
mtlBuffer.DidModifyRange(new NSRange
|
||||||
{
|
{
|
||||||
location = (ulong)offset,
|
location = (ulong)offset,
|
||||||
length = (ulong)data.Length
|
length = (ulong)data.Length
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdateCounters()
|
public void UpdateCounters()
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace Ryujinx.Graphics.Metal
|
||||||
{
|
{
|
||||||
// 0 Frames = No capture
|
// 0 Frames = No capture
|
||||||
// Some games like Undertale trigger a stack overflow on capture end
|
// Some games like Undertale trigger a stack overflow on capture end
|
||||||
private const int MaxFramesPerCapture = 5;
|
private const int MaxFramesPerCapture = 0;
|
||||||
private const string CaptureLocation = "/Users/isaacmarovitz/Desktop/Captures/Trace-";
|
private const string CaptureLocation = "/Users/isaacmarovitz/Desktop/Captures/Trace-";
|
||||||
|
|
||||||
private readonly MTLDevice _device;
|
private readonly MTLDevice _device;
|
||||||
|
|
Loading…
Reference in a new issue