Remove flicker when switching between native and full resolution from the gl config box. Remove a couple of unnecessary framebuffer binds.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2623 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
a9c79e4c5c
commit
ab1aad3815
Source/Plugins/Plugin_VideoOGL/Src
|
@ -544,7 +544,8 @@ void ConfigDialog::UpdateGUI()
|
||||||
{
|
{
|
||||||
// This is only used together with the aspect ratio options
|
// This is only used together with the aspect ratio options
|
||||||
m_Crop->Enable(g_Config.bKeepAR43 || g_Config.bKeepAR169);
|
m_Crop->Enable(g_Config.bKeepAR43 || g_Config.bKeepAR169);
|
||||||
if (g_Config.bUseXFB) {
|
if (g_Config.bUseXFB)
|
||||||
|
{
|
||||||
// XFB looks much better if the copy comes from native resolution.
|
// XFB looks much better if the copy comes from native resolution.
|
||||||
g_Config.bNativeResolution = true;
|
g_Config.bNativeResolution = true;
|
||||||
m_NativeResolution->SetValue(true);
|
m_NativeResolution->SetValue(true);
|
||||||
|
|
|
@ -113,6 +113,7 @@ static bool s_bHaveFramebufferBlit = false;
|
||||||
static bool s_bHaveCoverageMSAA = false;
|
static bool s_bHaveCoverageMSAA = false;
|
||||||
static bool g_bBlendSeparate = false;
|
static bool g_bBlendSeparate = false;
|
||||||
static u32 s_blendMode;
|
static u32 s_blendMode;
|
||||||
|
static bool s_bNativeResolution = false;
|
||||||
|
|
||||||
static volatile bool s_bScreenshot = false;
|
static volatile bool s_bScreenshot = false;
|
||||||
static Common::CriticalSection s_criticalScreenshot;
|
static Common::CriticalSection s_criticalScreenshot;
|
||||||
|
@ -173,6 +174,7 @@ bool Renderer::Init()
|
||||||
bool bSuccess = true;
|
bool bSuccess = true;
|
||||||
s_blendMode = 0;
|
s_blendMode = 0;
|
||||||
s_MSAACoverageSamples = 0;
|
s_MSAACoverageSamples = 0;
|
||||||
|
s_bNativeResolution = g_Config.bNativeResolution;
|
||||||
switch (g_Config.iMultisampleMode)
|
switch (g_Config.iMultisampleMode)
|
||||||
{
|
{
|
||||||
case MULTISAMPLE_OFF: s_MSAASamples = 1; break;
|
case MULTISAMPLE_OFF: s_MSAASamples = 1; break;
|
||||||
|
@ -540,12 +542,12 @@ bool Renderer::InitializeGL()
|
||||||
// ------------------------
|
// ------------------------
|
||||||
int Renderer::GetTargetWidth()
|
int Renderer::GetTargetWidth()
|
||||||
{
|
{
|
||||||
return g_Config.bNativeResolution ? EFB_WIDTH : s_targetwidth;
|
return s_bNativeResolution ? EFB_WIDTH : s_targetwidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Renderer::GetTargetHeight()
|
int Renderer::GetTargetHeight()
|
||||||
{
|
{
|
||||||
return g_Config.bNativeResolution ? EFB_HEIGHT : s_targetheight;
|
return s_bNativeResolution ? EFB_HEIGHT : s_targetheight;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Renderer::GetTargetScaleX()
|
float Renderer::GetTargetScaleX()
|
||||||
|
@ -591,7 +593,6 @@ GLuint Renderer::ResolveAndGetRenderTarget(const TRectangle &source_rect)
|
||||||
glBlitFramebufferEXT(flipped_rect.left, flipped_rect.top, flipped_rect.right, flipped_rect.bottom,
|
glBlitFramebufferEXT(flipped_rect.left, flipped_rect.top, flipped_rect.right, flipped_rect.bottom,
|
||||||
flipped_rect.left, flipped_rect.top, flipped_rect.right, flipped_rect.bottom,
|
flipped_rect.left, flipped_rect.top, flipped_rect.right, flipped_rect.bottom,
|
||||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, s_uFramebuffer);
|
|
||||||
|
|
||||||
// Return the resolved target.
|
// Return the resolved target.
|
||||||
return s_ResolvedRenderTarget;
|
return s_ResolvedRenderTarget;
|
||||||
|
@ -617,7 +618,6 @@ GLuint Renderer::ResolveAndGetFakeZTarget(const TRectangle &source_rect)
|
||||||
glBlitFramebufferEXT(flipped_rect.left, flipped_rect.top, flipped_rect.right, flipped_rect.bottom,
|
glBlitFramebufferEXT(flipped_rect.left, flipped_rect.top, flipped_rect.right, flipped_rect.bottom,
|
||||||
flipped_rect.left, flipped_rect.top, flipped_rect.right, flipped_rect.bottom,
|
flipped_rect.left, flipped_rect.top, flipped_rect.right, flipped_rect.bottom,
|
||||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, s_uFramebuffer);
|
|
||||||
|
|
||||||
// Return the resolved target.
|
// Return the resolved target.
|
||||||
return s_ResolvedFakeZTarget;
|
return s_ResolvedFakeZTarget;
|
||||||
|
@ -841,7 +841,7 @@ void Renderer::FlushZBufferAlphaToTarget()
|
||||||
|
|
||||||
// TODO: This code should not have to bother with stretchtofit checking -
|
// TODO: This code should not have to bother with stretchtofit checking -
|
||||||
// all necessary scale initialization should be done elsewhere.
|
// all necessary scale initialization should be done elsewhere.
|
||||||
if (g_Config.bNativeResolution)
|
if (s_bNativeResolution)
|
||||||
{
|
{
|
||||||
//TODO: Do Correctly in a bit
|
//TODO: Do Correctly in a bit
|
||||||
float FactorW = 640.f / (float)OpenGL_GetBackbufferWidth();
|
float FactorW = 640.f / (float)OpenGL_GetBackbufferWidth();
|
||||||
|
@ -1123,6 +1123,7 @@ void Renderer::Swap(const TRectangle& rc)
|
||||||
|
|
||||||
// Place messages on the picture, then copy it to the screen
|
// Place messages on the picture, then copy it to the screen
|
||||||
SwapBuffers();
|
SwapBuffers();
|
||||||
|
s_bNativeResolution = g_Config.bNativeResolution;
|
||||||
|
|
||||||
RestoreGLState();
|
RestoreGLState();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue