diff options
author | gdkchan <gab.dark.100@gmail.com> | 2020-07-26 00:03:40 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-26 00:03:40 -0300 |
commit | 8dbcae1ff88927dc0734d5f0e24fbf8781d68590 (patch) | |
tree | d884544af874f385a7a374c8889683db2e4c1ccc /Ryujinx.Graphics.OpenGL/Window.cs | |
parent | 2678bf0010166e683364102221b52caebea8747e (diff) |
Implement BGRA texture support (#1418)
* Implement BGRA texture support
* Missing AppendLine
* Remove empty lines
* Address PR feedback
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Window.cs')
-rw-r--r-- | Ryujinx.Graphics.OpenGL/Window.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Window.cs b/Ryujinx.Graphics.OpenGL/Window.cs index b7dc3784..a2f4e4ce 100644 --- a/Ryujinx.Graphics.OpenGL/Window.cs +++ b/Ryujinx.Graphics.OpenGL/Window.cs @@ -51,10 +51,12 @@ namespace Ryujinx.Graphics.OpenGL GL.BindFramebuffer(FramebufferTarget.DrawFramebuffer, drawFramebuffer); GL.BindFramebuffer(FramebufferTarget.ReadFramebuffer, readFramebuffer); + TextureView viewConverted = view.Format.IsBgra8() ? _renderer.TextureCopy.BgraSwap(view) : view; + GL.FramebufferTexture( FramebufferTarget.ReadFramebuffer, FramebufferAttachment.ColorAttachment0, - view.Handle, + viewConverted.Handle, 0); GL.ReadBuffer(ReadBufferMode.ColorAttachment0); @@ -138,6 +140,11 @@ namespace Ryujinx.Graphics.OpenGL ((Pipeline)_renderer.Pipeline).RestoreScissor0Enable(); ((Pipeline)_renderer.Pipeline).RestoreRasterizerDiscard(); + + if (viewConverted != view) + { + viewConverted.Dispose(); + } } private int GetCopyFramebufferHandleLazy() |