mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
1. This should fix Issue 1625 (Bizarre Auto Frame Limit)
Now the frame limiter yields on CPU thread, not as before on GPU thread mistakenly 2. Fixed clear of VI interrupts I guess VI interrupts are not used at all, because they were never cleared before 3. Made GPU thread 0% processor usage when paused whatever your active config is. I tried the event approach but somehow the thread resume latency is excessively long (Who can tell me why?) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4790 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -535,6 +535,7 @@ void Renderer::RenderToXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRect
|
||||
DEBUGGER_PAUSE_LOG_AT(NEXT_XFB_CMD,false,{printf("RenderToXFB - disabled");});
|
||||
return;
|
||||
}
|
||||
|
||||
Renderer::ResetAPIState();
|
||||
// Set the backbuffer as the rendering target
|
||||
D3D::dev->SetDepthStencilSurface(NULL);
|
||||
@ -543,7 +544,6 @@ void Renderer::RenderToXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRect
|
||||
D3DDumpFrame();
|
||||
EFBTextureToD3DBackBuffer(sourceRc);
|
||||
D3D::EndFrame();
|
||||
|
||||
|
||||
DEBUGGER_LOG_AT((NEXT_XFB_CMD|NEXT_EFB_CMD|NEXT_FRAME),
|
||||
{printf("StretchRect, EFB->XFB\n");});
|
||||
@ -553,6 +553,7 @@ void Renderer::RenderToXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRect
|
||||
xfbAddr, fbWidth, fbHeight,
|
||||
sourceRc.left, sourceRc.top, sourceRc.right, sourceRc.bottom);}
|
||||
);
|
||||
|
||||
Swap(0,FIELD_PROGRESSIVE,0,0); // we used to swap the buffer here, now we will wait
|
||||
// until the XFB pointer is updated by VI
|
||||
D3D::BeginFrame();
|
||||
@ -959,9 +960,9 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||
// Make any new configuration settings active.
|
||||
UpdateActiveConfig();
|
||||
|
||||
//TODO: Resize backbuffer if window size has changed. This code crashes, debug it.
|
||||
g_VideoInitialize.pCopiedToXFB(false);
|
||||
|
||||
//TODO: Resize backbuffer if window size has changed. This code crashes, debug it.
|
||||
CheckForResize();
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
@ -312,6 +312,7 @@ void DoState(unsigned char **ptr, int mode) {
|
||||
|
||||
void EmuStateChange(PLUGIN_EMUSTATE newState)
|
||||
{
|
||||
Fifo_RunLoop((newState == PLUGIN_EMUSTATE_PLAY) ? true : false);
|
||||
}
|
||||
|
||||
void Video_EnterLoop()
|
||||
@ -333,7 +334,7 @@ void Video_SetRendering(bool bEnabled) {
|
||||
// Run from the graphics thread
|
||||
void VideoFifo_CheckSwapRequest()
|
||||
{
|
||||
// CPU swap, not finished, seems to be working fine for dual-core for now
|
||||
// swap unimplemented
|
||||
return;
|
||||
|
||||
if (s_swapRequested)
|
||||
@ -351,12 +352,15 @@ void VideoFifo_CheckSwapRequest()
|
||||
// Run from the graphics thread
|
||||
void VideoFifo_CheckSwapRequestAt(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
|
||||
{
|
||||
// CPU swap unimplemented
|
||||
// swap unimplemented
|
||||
}
|
||||
|
||||
// Run from the CPU thread (from VideoInterface.cpp)
|
||||
void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||
{
|
||||
// swap unimplemented
|
||||
return;
|
||||
|
||||
s_beginFieldArgs.xfbAddr = xfbAddr;
|
||||
s_beginFieldArgs.field = field;
|
||||
s_beginFieldArgs.fbWidth = fbWidth;
|
||||
@ -365,14 +369,11 @@ void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||
|
||||
if (s_initialized)
|
||||
{
|
||||
|
||||
// Make sure previous swap request has made it to the screen
|
||||
if (g_VideoInitialize.bOnThread)
|
||||
{
|
||||
// It seems to be working fine in this way for now without using AtomicLoadAcquire
|
||||
// ector, please check here
|
||||
//while (Common::AtomicLoadAcquire(s_swapRequested))
|
||||
// Common::YieldCPU();
|
||||
//Common::YieldCPU();
|
||||
}
|
||||
else
|
||||
VideoFifo_CheckSwapRequest();
|
||||
|
@ -597,6 +597,9 @@ void Renderer::SetBlendMode(bool forceUpdate)
|
||||
|
||||
u32 Renderer::AccessEFB(EFBAccessType type, int x, int y)
|
||||
{
|
||||
if(!g_ActiveConfig.bEFBAccessEnable)
|
||||
return 0;
|
||||
|
||||
// Get the rectangular target region covered by the EFB pixel.
|
||||
EFBRectangle efbPixelRc;
|
||||
efbPixelRc.left = x;
|
||||
|
@ -379,6 +379,7 @@ void DoState(unsigned char **ptr, int mode) {
|
||||
|
||||
void EmuStateChange(PLUGIN_EMUSTATE newState)
|
||||
{
|
||||
Fifo_RunLoop((newState == PLUGIN_EMUSTATE_PLAY) ? true : false);
|
||||
}
|
||||
|
||||
// This is called after Video_Initialize() from the Core
|
||||
@ -494,9 +495,6 @@ void VideoFifo_CheckSwapRequest()
|
||||
g_VideoInitialize.pCopiedToXFB(false);
|
||||
}
|
||||
|
||||
// TODO : This just updates the frame counter, so we may change this func's name as well
|
||||
g_VideoInitialize.pCopiedToXFB(true);
|
||||
|
||||
Common::AtomicStoreRelease(s_swapRequested, FALSE);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user