From 8812fe6a3a1cb3152d367797912dc9459d323f89 Mon Sep 17 00:00:00 2001 From: Rodolfo Osvaldo Bogado Date: Thu, 25 Mar 2010 02:26:12 +0000 Subject: [PATCH] some fixes over my last commit, now the speed with xfb disabled must be at least equal to the speed before the xfb implementation. fixed fps counter. please give some testing to this changes to see if i going the right way. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5235 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoDX9/Src/Render.cpp | 12 ++++++++---- Source/Plugins/Plugin_VideoDX9/Src/main.cpp | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp index b49a9734e0..ad42d6bdb5 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp @@ -570,15 +570,17 @@ extern volatile u32 s_swapRequested; void Renderer::RenderToXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc) { - VideoFifo_CheckEFBAccess(); - XFBWrited = true; if(!fbWidth || !fbHeight) return; + VideoFifo_CheckEFBAccess(); // If we're about to write to a requested XFB, make sure the previous // contents make it to the screen first. - VideoFifo_CheckSwapRequestAt(xfbAddr, fbWidth, fbHeight); + if (g_ActiveConfig.bUseXFB) + { + VideoFifo_CheckSwapRequestAt(xfbAddr, fbWidth, fbHeight); + } FBManager.CopyToXFB(xfbAddr, fbWidth, fbHeight, sourceRc); - + XFBWrited = true; // XXX: Without the VI, how would we know what kind of field this is? So // just use progressive. if (!g_ActiveConfig.bUseXFB) @@ -1291,6 +1293,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight) } D3D::dev->SetRenderTarget(0, FBManager.GetEFBColorRTSurface()); D3D::dev->SetDepthStencilSurface(FBManager.GetEFBDepthRTSurface()); + } // --------------------------------------------------------------------- @@ -1318,6 +1321,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight) D3D::dev->SetDepthStencilSurface(FBManager.GetEFBDepthRTSurface()); UpdateViewport(); VertexShaderManager::SetViewportChanged(); + g_VideoInitialize.pCopiedToXFB(false); XFBWrited = false; } diff --git a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp index baf80d76ac..2bc3b44edc 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp @@ -356,7 +356,7 @@ void VideoFifo_CheckSwapRequestAt(u32 xfbAddr, u32 fbWidth, u32 fbHeight) // Run from the CPU thread (from VideoInterface.cpp) void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight) { - if (s_PluginInitialized) + if (s_PluginInitialized && g_ActiveConfig.bUseXFB) { // Make sure previous swap request has made it to the screen if (g_VideoInitialize.bOnThread)