diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-04-25 23:11:26 -0300 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-04-25 23:12:26 -0300 |
| commit | a38a72b0622f89897bdcd01b6d00ea6bc142c34f (patch) | |
| tree | 2025cdddaa7ef6769ac69c51eeede0924ffcba5f /Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs | |
| parent | 211f7f69db4d84b82caa3ee62d4ecdfbbd95604d (diff) | |
Some small sync primitive fixes, logging fixes, started to implement the 2D engine on the GPU, fixed DrawArrays, implemented a few more shader instructions, made a start on nvdrv refactor, etc...
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs')
| -rw-r--r-- | Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs index 05a7288a..8f265f54 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs @@ -270,6 +270,31 @@ namespace Ryujinx.Graphics.Gal.OpenGL } } + public void GetBufferData(long Tag, Action<byte[]> Callback) + { + if (Fbs.TryGetValue(Tag, out FrameBuffer Fb)) + { + GL.BindFramebuffer(FramebufferTarget.ReadFramebuffer, Fb.Handle); + + byte[] Data = new byte[Fb.Width * Fb.Height * 4]; + + (PixelFormat Format, PixelType Type) = OGLEnumConverter.GetTextureFormat(GalTextureFormat.A8B8G8R8); + + GL.ReadPixels( + 0, + 0, + Fb.Width, + Fb.Height, + Format, + Type, + Data); + + Callback(Data); + + GL.BindFramebuffer(FramebufferTarget.ReadFramebuffer, CurrFbHandle); + } + } + private void SetViewport(Rect Viewport) { GL.Viewport( |
