Flush buffers and texture data through a persistent mapped buffer. (#2481)

* Use persistent buffers to flush texture data

* Flush buffers via copy to persistent buffers.

* Log error when timing out, small refactoring.
This commit is contained in:
riperiperi 2021-07-16 22:10:20 +01:00 committed by GitHub
parent bb6fab2009
commit ca5ac37cd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 135 additions and 23 deletions

View file

@ -121,24 +121,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
public byte[] GetData()
{
int size = 0;
for (int level = 0; level < Info.Levels; level++)
{
size += Info.GetMipSize(level);
}
byte[] data = new byte[size];
unsafe
{
fixed (byte* ptr = data)
{
WriteTo((IntPtr)ptr);
}
}
return data;
return _renderer.PersistentBuffers.Default.GetTextureData(this);
}
public void WriteToPbo(int offset, bool forceBgra)