From ca5ac37cd638222e7475ac8f632b878126f3462d Mon Sep 17 00:00:00 2001 From: riperiperi Date: Fri, 16 Jul 2021 22:10:20 +0100 Subject: 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. --- Ryujinx.Graphics.OpenGL/Image/TextureView.cs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'Ryujinx.Graphics.OpenGL/Image/TextureView.cs') diff --git a/Ryujinx.Graphics.OpenGL/Image/TextureView.cs b/Ryujinx.Graphics.OpenGL/Image/TextureView.cs index 8e8d3c78..770e99a0 100644 --- a/Ryujinx.Graphics.OpenGL/Image/TextureView.cs +++ b/Ryujinx.Graphics.OpenGL/Image/TextureView.cs @@ -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) -- cgit v1.2.3