summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2014-08-26 07:08:37 -0500
committerRyan Houdek <Sonicadvance1@gmail.com>2014-08-28 10:16:39 -0500
commitca68526ec776069669cf4fa0f11a917d9a9db877 (patch)
treed3df0a546102faa6ac2ae597a913b8d12c1469b2 /Source/Core/VideoBackends
parent81048f38f8fe625b4fc4699be3969d1e53f94939 (diff)
Clear the texture used by PP shaders prior to use.
We were generating a texture without ever setting the data to a known value. This happened on the old code as well, just that PP shaders are receiving some love and people are using it and noticing some of its issues.
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/OGL/PostProcessing.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/Core/VideoBackends/OGL/PostProcessing.cpp b/Source/Core/VideoBackends/OGL/PostProcessing.cpp
index 311756d063..648ed5c76a 100644
--- a/Source/Core/VideoBackends/OGL/PostProcessing.cpp
+++ b/Source/Core/VideoBackends/OGL/PostProcessing.cpp
@@ -55,7 +55,17 @@ OpenGLPostProcessing::~OpenGLPostProcessing()
void OpenGLPostProcessing::BindTargetFramebuffer()
{
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_enable ? m_fbo : 0);
+ if (m_enable)
+ {
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fbo);
+ // Clear the buffer so there isn't any remaining garbage from the previous post processing shader frame
+ glClear(GL_COLOR_BUFFER_BIT);
+ }
+ else
+ {
+ // Bind to default framebuffer if we aren't post processing
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+ }
}
void OpenGLPostProcessing::BlitToScreen()