diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs index 818af3b3..cca61e18 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs @@ -184,6 +184,10 @@ namespace Ryujinx.Graphics.Gal.OpenGL { EnsureInitialized(); + bool AlphaBlendEnable = GL.GetInteger(GetPName.Blend) != 0; + + GL.Disable(EnableCap.Blend); + GL.ActiveTexture(TextureUnit.Texture0); GL.BindTexture(TextureTarget.Texture2D, CurrTexHandle); @@ -192,6 +196,10 @@ namespace Ryujinx.Graphics.Gal.OpenGL GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0); + GL.Clear( + ClearBufferMask.ColorBufferBit | + ClearBufferMask.DepthBufferBit); + GL.BindVertexArray(VaoHandle); GL.UseProgram(Shader.Handle); @@ -202,6 +210,11 @@ namespace Ryujinx.Graphics.Gal.OpenGL GL.BindFramebuffer(FramebufferTarget.Framebuffer, CurrFbHandle); GL.UseProgram(CurrentProgram); + + if (AlphaBlendEnable) + { + GL.Enable(EnableCap.Blend); + } } } @@ -289,9 +302,11 @@ namespace Ryujinx.Graphics.Gal.OpenGL { GL.BindTexture(TextureTarget.Texture2D, Handle); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear); + const int MinFilter = (int)TextureMinFilter.Linear; + const int MagFilter = (int)TextureMagFilter.Linear; - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); + GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, MinFilter); + GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, MagFilter); (PixelFormat Format, PixelType Type) = OGLEnumConverter.GetTextureFormat(GalTextureFormat.A8B8G8R8); diff --git a/Ryujinx.Graphics/Gpu/NvGpuEngine3d.cs b/Ryujinx.Graphics/Gpu/NvGpuEngine3d.cs index 1142e4aa..fd13367c 100644 --- a/Ryujinx.Graphics/Gpu/NvGpuEngine3d.cs +++ b/Ryujinx.Graphics/Gpu/NvGpuEngine3d.cs @@ -168,7 +168,7 @@ namespace Ryujinx.Graphics.Gpu private void SetAlphaBlending() { //TODO: Support independent blend properly. - bool Enable = (ReadRegister(NvGpuEngine3dReg.IBlendEnable) & 1) != 0; + bool Enable = (ReadRegister(NvGpuEngine3dReg.IBlendNEnable) & 1) != 0; Gpu.Renderer.SetBlendEnable(Enable); diff --git a/Ryujinx.Graphics/Gpu/NvGpuEngine3dReg.cs b/Ryujinx.Graphics/Gpu/NvGpuEngine3dReg.cs index cb0b9d98..4f1dce94 100644 --- a/Ryujinx.Graphics/Gpu/NvGpuEngine3dReg.cs +++ b/Ryujinx.Graphics/Gpu/NvGpuEngine3dReg.cs @@ -16,6 +16,7 @@ namespace Ryujinx.Graphics.Gpu BlendFuncSrcAlpha = 0x4d4, BlendFuncDstAlpha = 0x4d6, BlendEnableMaster = 0x4d7, + IBlendNEnable = 0x4d8, VertexArrayElemBase = 0x50d, TexHeaderPoolOffset = 0x55d, TexSamplerPoolOffset = 0x557,