Change OpenGL's post processing to use the new VideoCommon PP object.

Let's OpenGL's PostProcessing namespace be changed to a class inheriting from VideoCommon's PostProcessing class.
This commit is contained in:
Ryan Houdek
2014-07-29 11:57:02 -05:00
parent b8a21b3744
commit cced3b4a18
4 changed files with 148 additions and 71 deletions

View File

@ -641,6 +641,9 @@ void Renderer::Shutdown()
delete s_pfont;
s_pfont = nullptr;
s_ShowEFBCopyRegions.Destroy();
delete m_post_processor;
m_post_processor = nullptr;
}
void Renderer::Init()
@ -649,6 +652,8 @@ void Renderer::Init()
g_framebuffer_manager = new FramebufferManager(s_target_width, s_target_height,
s_MSAASamples);
m_post_processor = new OpenGLPostProcessing();
s_pfont = new RasterFont();
ProgramShaderCache::CompileShader(s_ShowEFBCopyRegions,
@ -1331,7 +1336,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangl
ResetAPIState();
PostProcessing::Update(s_backbuffer_width, s_backbuffer_height);
m_post_processor->Update(s_backbuffer_width, s_backbuffer_height);
UpdateDrawRectangle(s_backbuffer_width, s_backbuffer_height);
TargetRectangle flipped_trc = GetTargetRectangle();
@ -1354,7 +1359,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangl
if (g_ActiveConfig.bUseXFB)
{
// Render to the real/postprocessing buffer now.
PostProcessing::BindTargetFramebuffer();
m_post_processor->BindTargetFramebuffer();
// draw each xfb source
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetXFBFramebuffer());
@ -1413,7 +1418,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangl
FramebufferManager::ResolveAndGetRenderTarget(rc);
// Render to the real/postprocessing buffer now. (resolve have changed this in msaa mode)
PostProcessing::BindTargetFramebuffer();
m_post_processor->BindTargetFramebuffer();
// always the non-msaa fbo
GLuint fb = s_MSAASamples>1?FramebufferManager::GetResolvedFramebuffer():FramebufferManager::GetEFBFramebuffer();
@ -1424,7 +1429,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangl
GL_COLOR_BUFFER_BIT, GL_LINEAR);
}
PostProcessing::BlitToScreen();
m_post_processor->BlitToScreen();
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);