fixed fps limiting when using using virtual xfb, now fps = vps, in fact now real xfb is as fast as no using xfb, i'm thinking now that the correct thing is leave it enabled as default, and even remove the option.
the problem is one strange behavior i found, in opengl when xfb is enable, frame limit causes the frame rate to be limited exact half the correct speed, so if you choose auto and the game uses 30 fps you get 15 fps so in opengl, you have to limit to the exact double of the game speed, 100 to pal games and 120 to ntsc. in d3d this not happened every time, it just happen when you change some time consuming setting like changing the ssaa or resizing the window, in that case you have to disable and re enable frame limit to get the correct fps to all the devs please if you can help me debug this, will give you a lot of thanks as i'm short in time to debug this error and is driving me crazy not to find the source of the problem. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5249 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
6bcae13ff8
commit
49d568488c
|
@ -208,7 +208,8 @@ void FramebufferManager::Destroy()
|
||||||
|
|
||||||
for (VirtualXFBListType::iterator it = m_virtualXFBList.begin(); it != m_virtualXFBList.end(); ++it)
|
for (VirtualXFBListType::iterator it = m_virtualXFBList.begin(); it != m_virtualXFBList.end(); ++it)
|
||||||
{
|
{
|
||||||
it->xfbSource.texture->Release();
|
if(it->xfbSource.texture)
|
||||||
|
it->xfbSource.texture->Release();
|
||||||
}
|
}
|
||||||
m_virtualXFBList.clear();
|
m_virtualXFBList.clear();
|
||||||
if(m_realXFBSource.texture)
|
if(m_realXFBSource.texture)
|
||||||
|
|
|
@ -86,7 +86,6 @@ static bool s_bScreenshot = false;
|
||||||
static Common::CriticalSection s_criticalScreenshot;
|
static Common::CriticalSection s_criticalScreenshot;
|
||||||
static char s_sScreenshotName[1024];
|
static char s_sScreenshotName[1024];
|
||||||
static LPDIRECT3DSURFACE9 ScreenShootMEMSurface = NULL;
|
static LPDIRECT3DSURFACE9 ScreenShootMEMSurface = NULL;
|
||||||
extern volatile u32 s_swapRequested;
|
|
||||||
|
|
||||||
|
|
||||||
// State translation lookup tables
|
// State translation lookup tables
|
||||||
|
@ -1013,29 +1012,27 @@ void Renderer::SetBlendMode(bool forceUpdate)
|
||||||
|
|
||||||
void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||||
{
|
{
|
||||||
if(!fbWidth || !fbHeight)
|
if (g_bSkipCurrentFrame || !XFBWrited || !fbWidth || !fbHeight)
|
||||||
|
{
|
||||||
|
g_VideoInitialize.pCopiedToXFB(false);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
// this function is called after the XFB field is changed, not after
|
// this function is called after the XFB field is changed, not after
|
||||||
// EFB is copied to XFB. In this way, flickering is reduced in games
|
// EFB is copied to XFB. In this way, flickering is reduced in games
|
||||||
// and seems to also give more FPS in ZTP
|
// and seems to also give more FPS in ZTP
|
||||||
if(!XFBWrited)
|
|
||||||
return;
|
|
||||||
if (field == FIELD_LOWER)
|
if (field == FIELD_LOWER)
|
||||||
xfbAddr -= fbWidth * 2;
|
xfbAddr -= fbWidth * 2;
|
||||||
|
|
||||||
u32 xfbCount = 0;
|
u32 xfbCount = 0;
|
||||||
const XFBSource** xfbSourceList = FBManager.GetXFBSource(xfbAddr, fbWidth, fbHeight, xfbCount);
|
const XFBSource** xfbSourceList = FBManager.GetXFBSource(xfbAddr, fbWidth, fbHeight, xfbCount);
|
||||||
if (!xfbSourceList || xfbCount == 0)
|
if (!xfbSourceList || xfbCount == 0)
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_bSkipCurrentFrame)
|
|
||||||
{
|
{
|
||||||
g_VideoInitialize.pCopiedToXFB(false);
|
g_VideoInitialize.pCopiedToXFB(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Renderer::ResetAPIState();
|
Renderer::ResetAPIState();
|
||||||
// Set the backbuffer as the rendering target
|
// Set the backbuffer as the rendering target
|
||||||
D3D::dev->SetDepthStencilSurface(NULL);
|
D3D::dev->SetDepthStencilSurface(NULL);
|
||||||
|
|
|
@ -359,6 +359,12 @@ void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||||
if (s_PluginInitialized && g_ActiveConfig.bUseXFB)
|
if (s_PluginInitialized && g_ActiveConfig.bUseXFB)
|
||||||
{
|
{
|
||||||
// Make sure previous swap request has made it to the screen
|
// Make sure previous swap request has made it to the screen
|
||||||
|
s_beginFieldArgs.xfbAddr = xfbAddr;
|
||||||
|
s_beginFieldArgs.field = field;
|
||||||
|
s_beginFieldArgs.fbWidth = fbWidth;
|
||||||
|
s_beginFieldArgs.fbHeight = fbHeight;
|
||||||
|
|
||||||
|
Common::AtomicStoreRelease(s_swapRequested, TRUE);
|
||||||
if (g_VideoInitialize.bOnThread)
|
if (g_VideoInitialize.bOnThread)
|
||||||
{
|
{
|
||||||
while (Common::AtomicLoadAcquire(s_swapRequested) && !s_FifoShuttingDown)
|
while (Common::AtomicLoadAcquire(s_swapRequested) && !s_FifoShuttingDown)
|
||||||
|
@ -368,12 +374,6 @@ void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||||
else
|
else
|
||||||
VideoFifo_CheckSwapRequest();
|
VideoFifo_CheckSwapRequest();
|
||||||
|
|
||||||
s_beginFieldArgs.xfbAddr = xfbAddr;
|
|
||||||
s_beginFieldArgs.field = field;
|
|
||||||
s_beginFieldArgs.fbWidth = fbWidth;
|
|
||||||
s_beginFieldArgs.fbHeight = fbHeight;
|
|
||||||
|
|
||||||
Common::AtomicStoreRelease(s_swapRequested, TRUE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,5 +22,6 @@
|
||||||
#include "Render.h"
|
#include "Render.h"
|
||||||
|
|
||||||
extern SVideoInitialize g_VideoInitialize;
|
extern SVideoInitialize g_VideoInitialize;
|
||||||
|
extern volatile u32 s_swapRequested;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -761,11 +761,12 @@ void OpenGL_Update()
|
||||||
int height = rcWindow.bottom - rcWindow.top;
|
int height = rcWindow.bottom - rcWindow.top;
|
||||||
|
|
||||||
// If we are rendering to a child window
|
// If we are rendering to a child window
|
||||||
if (EmuWindow::GetParentWnd() != 0)
|
if (EmuWindow::GetParentWnd() != 0 && (s_backbuffer_width != width || s_backbuffer_height != height) && width >= 4 && height >= 4)
|
||||||
|
{
|
||||||
::MoveWindow(EmuWindow::GetWnd(), 0, 0, width, height, FALSE);
|
::MoveWindow(EmuWindow::GetWnd(), 0, 0, width, height, FALSE);
|
||||||
|
s_backbuffer_width = width;
|
||||||
s_backbuffer_width = width;
|
s_backbuffer_height = height;
|
||||||
s_backbuffer_height = height;
|
}
|
||||||
|
|
||||||
#elif defined(HAVE_X11) && HAVE_X11
|
#elif defined(HAVE_X11) && HAVE_X11
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -801,13 +801,11 @@ void Renderer::RenderToXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRect
|
||||||
// This function has the final picture. We adjust the aspect ratio here.
|
// This function has the final picture. We adjust the aspect ratio here.
|
||||||
void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||||
{
|
{
|
||||||
if (s_skipSwap)
|
if (g_bSkipCurrentFrame || !XFBWrited || !fbWidth || !fbHeight)
|
||||||
{
|
{
|
||||||
g_VideoInitialize.pCopiedToXFB(false);
|
g_VideoInitialize.pCopiedToXFB(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!XFBWrited)
|
|
||||||
return;
|
|
||||||
if (field == FIELD_LOWER)
|
if (field == FIELD_LOWER)
|
||||||
xfbAddr -= fbWidth * 2;
|
xfbAddr -= fbWidth * 2;
|
||||||
|
|
||||||
|
@ -815,6 +813,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||||
const XFBSource** xfbSourceList = g_framebufferManager.GetXFBSource(xfbAddr, fbWidth, fbHeight, xfbCount);
|
const XFBSource** xfbSourceList = g_framebufferManager.GetXFBSource(xfbAddr, fbWidth, fbHeight, xfbCount);
|
||||||
if (!xfbSourceList)
|
if (!xfbSourceList)
|
||||||
{
|
{
|
||||||
|
g_VideoInitialize.pCopiedToXFB(false);
|
||||||
WARN_LOG(VIDEO, "Failed to get video for this frame");
|
WARN_LOG(VIDEO, "Failed to get video for this frame");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -518,7 +518,12 @@ void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||||
{
|
{
|
||||||
if (s_PluginInitialized && g_ActiveConfig.bUseXFB)
|
if (s_PluginInitialized && g_ActiveConfig.bUseXFB)
|
||||||
{
|
{
|
||||||
// Make sure previous swap request has made it to the screen
|
s_beginFieldArgs.xfbAddr = xfbAddr;
|
||||||
|
s_beginFieldArgs.field = field;
|
||||||
|
s_beginFieldArgs.fbWidth = fbWidth;
|
||||||
|
s_beginFieldArgs.fbHeight = fbHeight;
|
||||||
|
|
||||||
|
Common::AtomicStoreRelease(s_swapRequested, TRUE);
|
||||||
if (g_VideoInitialize.bOnThread)
|
if (g_VideoInitialize.bOnThread)
|
||||||
{
|
{
|
||||||
while (Common::AtomicLoadAcquire(s_swapRequested) && !s_FifoShuttingDown)
|
while (Common::AtomicLoadAcquire(s_swapRequested) && !s_FifoShuttingDown)
|
||||||
|
@ -527,13 +532,6 @@ void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
VideoFifo_CheckSwapRequest();
|
VideoFifo_CheckSwapRequest();
|
||||||
|
|
||||||
s_beginFieldArgs.xfbAddr = xfbAddr;
|
|
||||||
s_beginFieldArgs.field = field;
|
|
||||||
s_beginFieldArgs.fbWidth = fbWidth;
|
|
||||||
s_beginFieldArgs.fbHeight = fbHeight;
|
|
||||||
|
|
||||||
Common::AtomicStoreRelease(s_swapRequested, TRUE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue