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.
This commit is contained in:
Ryan Houdek 2014-08-26 07:08:37 -05:00
parent 81048f38f8
commit ca68526ec7
1 changed files with 11 additions and 1 deletions
Source/Core/VideoBackends/OGL

View File

@ -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()