From b427ead0cc46ae6e35568a85228f6261204a197f Mon Sep 17 00:00:00 2001 From: anthony Date: Fri, 7 Oct 2016 19:55:47 -0700 Subject: [PATCH] Remove Frameskip --- Source/Core/Core/BootManager.cpp | 15 ----- Source/Core/Core/Movie.cpp | 38 ------------ Source/Core/Core/Movie.h | 3 - Source/Core/Core/State.cpp | 2 +- Source/Core/DolphinWX/Frame.cpp | 1 - Source/Core/DolphinWX/Frame.h | 1 - Source/Core/DolphinWX/FrameTools.cpp | 15 ----- Source/Core/DolphinWX/Globals.h | 10 ---- Source/Core/VideoBackends/D3D/Render.cpp | 3 +- Source/Core/VideoBackends/D3D12/Render.cpp | 3 +- Source/Core/VideoBackends/OGL/Render.cpp | 3 +- .../Core/VideoBackends/Software/DebugUtil.cpp | 46 ++++++--------- .../Core/VideoBackends/Software/EfbCopy.cpp | 41 ++++++------- .../VideoBackends/Software/SWRenderer.cpp | 59 +++++++++---------- Source/Core/VideoCommon/BPStructs.cpp | 19 +++--- Source/Core/VideoCommon/Fifo.cpp | 13 ---- Source/Core/VideoCommon/Fifo.h | 2 - Source/Core/VideoCommon/OpcodeDecoding.cpp | 3 +- .../Core/VideoCommon/VertexLoaderManager.cpp | 5 +- Source/Core/VideoCommon/VertexLoaderManager.h | 3 +- 20 files changed, 82 insertions(+), 203 deletions(-) diff --git a/Source/Core/Core/BootManager.cpp b/Source/Core/Core/BootManager.cpp index e4dad38079ab..6324aa40f5b3 100644 --- a/Source/Core/Core/BootManager.cpp +++ b/Source/Core/Core/BootManager.cpp @@ -56,7 +56,6 @@ struct ConfigCache // alone on restore (false) bool bSetEmulationSpeed; bool bSetVolume; - bool bSetFrameSkip; std::array bSetWiimoteSource; std::array bSetPads; std::array bSetEXIDevice; @@ -80,7 +79,6 @@ struct ConfigCache int iSelectedLanguage; int iCPUCore; int Volume; - unsigned int frameSkip; float m_EmulationSpeed; std::string strBackend; std::string sBackend; @@ -112,7 +110,6 @@ void ConfigCache::SaveConfig(const SConfig& config) iCPUCore = config.iCPUCore; Volume = config.m_Volume; m_EmulationSpeed = config.m_EmulationSpeed; - frameSkip = config.m_FrameSkip; strBackend = config.m_strVideoBackend; sBackend = config.sBackend; m_strGPUDeterminismMode = config.m_strGPUDeterminismMode; @@ -123,7 +120,6 @@ void ConfigCache::SaveConfig(const SConfig& config) bSetEmulationSpeed = false; bSetVolume = false; - bSetFrameSkip = false; bSetWiimoteSource.fill(false); bSetPads.fill(false); bSetEXIDevice.fill(false); @@ -182,12 +178,6 @@ void ConfigCache::RestoreConfig(SConfig* config) if (bSetEmulationSpeed) config->m_EmulationSpeed = m_EmulationSpeed; - if (bSetFrameSkip) - { - config->m_FrameSkip = frameSkip; - Movie::SetFrameSkipping(frameSkip); - } - for (unsigned int i = 0; i < MAX_EXI_CHANNELS; ++i) { if (bSetEXIDevice[i]) @@ -264,11 +254,6 @@ bool BootCore(const std::string& _rFilename) if (core_section->Get("EmulationSpeed", &SConfig::GetInstance().m_EmulationSpeed, SConfig::GetInstance().m_EmulationSpeed)) config_cache.bSetEmulationSpeed = true; - if (core_section->Get("FrameSkip", &SConfig::GetInstance().m_FrameSkip)) - { - config_cache.bSetFrameSkip = true; - Movie::SetFrameSkipping(SConfig::GetInstance().m_FrameSkip); - } if (dsp_section->Get("Volume", &SConfig::GetInstance().m_Volume, SConfig::GetInstance().m_Volume)) diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp index c77bee78a7a6..5dcab9d44909 100644 --- a/Source/Core/Core/Movie.cpp +++ b/Source/Core/Core/Movie.cpp @@ -44,8 +44,6 @@ // The chunk to allocate movie data in multiples of. #define DTM_BASE_LENGTH (1024) -static std::mutex cs_frameSkip; - namespace Movie { static bool s_bFrameStep = false; @@ -53,8 +51,6 @@ static bool s_bReadOnly = true; static u32 s_rerecords = 0; static PlayMode s_playMode = MODE_NONE; -static u32 s_framesToSkip = 0, s_frameSkipCounter = 0; - static u8 s_numPads = 0; static ControllerState s_padState; static DTMHeader tmpHeader; @@ -211,9 +207,6 @@ void FrameUpdate() CPU::Break(); } - if (s_framesToSkip) - FrameSkipping(); - s_bPolled = false; } @@ -247,7 +240,6 @@ void Init() s_tickCountAtLastInput = 0; } - s_frameSkipCounter = s_framesToSkip; memset(&s_padState, 0, sizeof(s_padState)); if (!tmpHeader.bFromSaveState || !IsPlayingInput()) Core::SetStateFileName(""); @@ -278,20 +270,6 @@ void InputUpdate() } } -// NOTE: Host Thread -void SetFrameSkipping(unsigned int framesToSkip) -{ - std::lock_guard lk(cs_frameSkip); - - s_framesToSkip = framesToSkip; - s_frameSkipCounter = 0; - - // Don't forget to re-enable rendering in case it wasn't... - // as this won't be changed anymore when frameskip is turned off - if (framesToSkip == 0) - Fifo::SetRendering(true); -} - // NOTE: CPU Thread void SetPolledDevice() { @@ -324,22 +302,6 @@ void SetReadOnly(bool bEnabled) s_bReadOnly = bEnabled; } -// NOTE: GPU Thread -void FrameSkipping() -{ - // Frameskipping will desync movie playback - if (!Core::g_want_determinism) - { - std::lock_guard lk(cs_frameSkip); - - s_frameSkipCounter++; - if (s_frameSkipCounter > s_framesToSkip || Core::ShouldSkipFrame(s_frameSkipCounter) == false) - s_frameSkipCounter = 0; - - Fifo::SetRendering(!s_frameSkipCounter); - } -} - bool IsRecordingInput() { return (s_playMode == MODE_RECORDING); diff --git a/Source/Core/Core/Movie.h b/Source/Core/Core/Movie.h index f21745464ef5..ee9f79539ad5 100644 --- a/Source/Core/Core/Movie.h +++ b/Source/Core/Core/Movie.h @@ -158,9 +158,6 @@ void ChangeWiiPads(bool instantly = false); void DoFrameStep(); void SetReadOnly(bool bEnabled); -void SetFrameSkipping(unsigned int framesToSkip); -void FrameSkipping(); - bool BeginRecordingInput(int controllers); void RecordInput(GCPadStatus* PadStatus, int controllerID); void RecordWiimote(int wiimote, u8* data, u8 size); diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index c1efa7d2d92e..c0c8e2d90dd0 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -71,7 +71,7 @@ static Common::Event g_compressAndDumpStateSyncEvent; static std::thread g_save_thread; // Don't forget to increase this after doing changes on the savestate system -static const u32 STATE_VERSION = 62; // Last changed in PR 4195 +static const u32 STATE_VERSION = 63; // Last changed in PR 4322 // Maps savestate versions to Dolphin versions. // Versions after 42 don't need to be added to this list, diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 01caa28fa6e1..5d810f0b116d 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -307,7 +307,6 @@ EVT_MENU_RANGE(IDM_LOAD_SLOT_1, IDM_LOAD_SLOT_10, CFrame::OnLoadState) EVT_MENU_RANGE(IDM_LOAD_LAST_1, IDM_LOAD_LAST_10, CFrame::OnLoadLastState) EVT_MENU_RANGE(IDM_SAVE_SLOT_1, IDM_SAVE_SLOT_10, CFrame::OnSaveState) EVT_MENU_RANGE(IDM_SELECT_SLOT_1, IDM_SELECT_SLOT_10, CFrame::OnSelectSlot) -EVT_MENU_RANGE(IDM_FRAME_SKIP_0, IDM_FRAME_SKIP_9, CFrame::OnFrameSkip) EVT_MENU_RANGE(IDM_DRIVE1, IDM_DRIVE24, CFrame::OnBootDrive) EVT_MENU_RANGE(IDM_CONNECT_WIIMOTE1, IDM_CONNECT_BALANCEBOARD, CFrame::OnConnectWiimote) EVT_MENU_RANGE(IDM_LIST_WAD, IDM_LIST_DRIVES, CFrame::GameListChanged) diff --git a/Source/Core/DolphinWX/Frame.h b/Source/Core/DolphinWX/Frame.h index 380437205bfd..646d1d2b0b06 100644 --- a/Source/Core/DolphinWX/Frame.h +++ b/Source/Core/DolphinWX/Frame.h @@ -283,7 +283,6 @@ class CFrame : public CRenderFrame void OnUndoLoadState(wxCommandEvent& event); void OnUndoSaveState(wxCommandEvent& event); - void OnFrameSkip(wxCommandEvent& event); void OnFrameStep(wxCommandEvent& event); void OnConfigMain(wxCommandEvent& event); // Options diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index ecc692f11319..f2c47fdb8e32 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -135,13 +135,6 @@ wxMenuBar* CFrame::CreateMenu() emulationMenu->Append(IDM_TOGGLE_FULLSCREEN, GetMenuLabel(HK_FULLSCREEN)); emulationMenu->Append(IDM_FRAMESTEP, GetMenuLabel(HK_FRAME_ADVANCE), wxEmptyString); - wxMenu* skippingMenu = new wxMenu; - emulationMenu->AppendSubMenu(skippingMenu, _("Frame S&kipping")); - for (int i = 0; i < 10; i++) - skippingMenu->AppendRadioItem(IDM_FRAME_SKIP_0 + i, wxString::Format("%i", i)); - skippingMenu->Check(IDM_FRAME_SKIP_0 + SConfig::GetInstance().m_FrameSkip, true); - Movie::SetFrameSkipping(SConfig::GetInstance().m_FrameSkip); - emulationMenu->AppendSeparator(); emulationMenu->Append(IDM_SCREENSHOT, GetMenuLabel(HK_SCREENSHOT)); @@ -1643,14 +1636,6 @@ void CFrame::OnSaveState(wxCommandEvent& event) } } -void CFrame::OnFrameSkip(wxCommandEvent& event) -{ - int amount = event.GetId() - IDM_FRAME_SKIP_0; - - Movie::SetFrameSkipping((unsigned int)amount); - SConfig::GetInstance().m_FrameSkip = amount; -} - void CFrame::OnSelectSlot(wxCommandEvent& event) { m_saveSlot = event.GetId() - IDM_SELECT_SLOT_1 + 1; diff --git a/Source/Core/DolphinWX/Globals.h b/Source/Core/DolphinWX/Globals.h index 8af0665f0fd4..0f4db06b72d8 100644 --- a/Source/Core/DolphinWX/Globals.h +++ b/Source/Core/DolphinWX/Globals.h @@ -73,16 +73,6 @@ enum IDM_SELECT_SLOT_10, IDM_SAVE_SELECTED_SLOT, IDM_LOAD_SELECTED_SLOT, - IDM_FRAME_SKIP_0, - IDM_FRAME_SKIP_1, - IDM_FRAME_SKIP_2, - IDM_FRAME_SKIP_3, - IDM_FRAME_SKIP_4, - IDM_FRAME_SKIP_5, - IDM_FRAME_SKIP_6, - IDM_FRAME_SKIP_7, - IDM_FRAME_SKIP_8, - IDM_FRAME_SKIP_9, IDM_PLAY, IDM_STOP, IDM_RESET, diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index fa0fe3581eb9..fa52b40d1270 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -765,8 +765,7 @@ void formatBufferDump(const u8* in, u8* out, int w, int h, int p) void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const EFBRectangle& rc, float Gamma) { - if (Fifo::WillSkipCurrentFrame() || (!XFBWrited && !g_ActiveConfig.RealXFBEnabled()) || - !fbWidth || !fbHeight) + if ((!XFBWrited && !g_ActiveConfig.RealXFBEnabled()) || !fbWidth || !fbHeight) { RepeatFrameDumpFrame(); Core::Callback_VideoCopiedToXFB(false); diff --git a/Source/Core/VideoBackends/D3D12/Render.cpp b/Source/Core/VideoBackends/D3D12/Render.cpp index fb1740d9ac0d..de3859f80184 100644 --- a/Source/Core/VideoBackends/D3D12/Render.cpp +++ b/Source/Core/VideoBackends/D3D12/Render.cpp @@ -708,8 +708,7 @@ void formatBufferDump(const u8* in, u8* out, int w, int h, int p) void Renderer::SwapImpl(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height, const EFBRectangle& rc, float gamma) { - if (Fifo::WillSkipCurrentFrame() || (!XFBWrited && !g_ActiveConfig.RealXFBEnabled()) || - !fb_width || !fb_height) + if ((!XFBWrited && !g_ActiveConfig.RealXFBEnabled()) || !fb_width || !fb_height) { RepeatFrameDumpFrame(); Core::Callback_VideoCopiedToXFB(false); diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 2f53d0e9a6a2..d89253ab8d5a 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -1350,8 +1350,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, glDisable(GL_DEBUG_OUTPUT); } - if (Fifo::WillSkipCurrentFrame() || (!XFBWrited && !g_ActiveConfig.RealXFBEnabled()) || - !fbWidth || !fbHeight) + if ((!XFBWrited && !g_ActiveConfig.RealXFBEnabled()) || !fbWidth || !fbHeight) { RepeatFrameDumpFrame(); Core::Callback_VideoCopiedToXFB(false); diff --git a/Source/Core/VideoBackends/Software/DebugUtil.cpp b/Source/Core/VideoBackends/Software/DebugUtil.cpp index f1aeaea9feef..481c66cf713b 100644 --- a/Source/Core/VideoBackends/Software/DebugUtil.cpp +++ b/Source/Core/VideoBackends/Software/DebugUtil.cpp @@ -192,40 +192,32 @@ void CopyTempBuffer(s16 x, s16 y, int bufferBase, int subBuffer, const char* nam void OnObjectBegin() { - if (!Fifo::WillSkipCurrentFrame()) - { - if (g_ActiveConfig.bDumpTextures && - stats.thisFrame.numDrawnObjects >= g_ActiveConfig.drawStart && - stats.thisFrame.numDrawnObjects < g_ActiveConfig.drawEnd) - DumpActiveTextures(); - } + if (g_ActiveConfig.bDumpTextures && stats.thisFrame.numDrawnObjects >= g_ActiveConfig.drawStart && + stats.thisFrame.numDrawnObjects < g_ActiveConfig.drawEnd) + DumpActiveTextures(); } void OnObjectEnd() { - if (!Fifo::WillSkipCurrentFrame()) - { - if (g_ActiveConfig.bDumpObjects && - stats.thisFrame.numDrawnObjects >= g_ActiveConfig.drawStart && - stats.thisFrame.numDrawnObjects < g_ActiveConfig.drawEnd) - DumpEfb(StringFromFormat("%sobject%i.png", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), - stats.thisFrame.numDrawnObjects)); + if (g_ActiveConfig.bDumpObjects && stats.thisFrame.numDrawnObjects >= g_ActiveConfig.drawStart && + stats.thisFrame.numDrawnObjects < g_ActiveConfig.drawEnd) + DumpEfb(StringFromFormat("%sobject%i.png", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), + stats.thisFrame.numDrawnObjects)); - for (int i = 0; i < NUM_OBJECT_BUFFERS; i++) + for (int i = 0; i < NUM_OBJECT_BUFFERS; i++) + { + if (DrawnToBuffer[i]) { - if (DrawnToBuffer[i]) - { - DrawnToBuffer[i] = false; - std::string filename = StringFromFormat( - "%sobject%i_%s(%i).png", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), - stats.thisFrame.numDrawnObjects, ObjectBufferName[i], i - BufferBase[i]); - - TextureToPng((u8*)ObjectBuffer[i], EFB_WIDTH * 4, filename, EFB_WIDTH, EFB_HEIGHT, true); - memset(ObjectBuffer[i], 0, EFB_WIDTH * EFB_HEIGHT * sizeof(u32)); - } - } + DrawnToBuffer[i] = false; + std::string filename = + StringFromFormat("%sobject%i_%s(%i).png", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), + stats.thisFrame.numDrawnObjects, ObjectBufferName[i], i - BufferBase[i]); - stats.thisFrame.numDrawnObjects++; + TextureToPng((u8*)ObjectBuffer[i], EFB_WIDTH * 4, filename, EFB_WIDTH, EFB_HEIGHT, true); + memset(ObjectBuffer[i], 0, EFB_WIDTH * EFB_HEIGHT * sizeof(u32)); + } } + + stats.thisFrame.numDrawnObjects++; } } diff --git a/Source/Core/VideoBackends/Software/EfbCopy.cpp b/Source/Core/VideoBackends/Software/EfbCopy.cpp index c2c63f8a9eda..26afc6c779d3 100644 --- a/Source/Core/VideoBackends/Software/EfbCopy.cpp +++ b/Source/Core/VideoBackends/Software/EfbCopy.cpp @@ -67,34 +67,31 @@ void CopyEfb() rc.right = rc.left + (int)bpmem.copyTexSrcWH.x + 1; rc.bottom = rc.top + (int)bpmem.copyTexSrcWH.y + 1; - if (!Fifo::WillSkipCurrentFrame()) + if (bpmem.triggerEFBCopy.copy_to_xfb) { - if (bpmem.triggerEFBCopy.copy_to_xfb) - { - float yScale; - if (bpmem.triggerEFBCopy.scale_invert) - yScale = 256.0f / (float)bpmem.dispcopyyscale; - else - yScale = (float)bpmem.dispcopyyscale / 256.0f; - - float xfbLines = ((bpmem.copyTexSrcWH.y + 1.0f) * yScale); + float yScale; + if (bpmem.triggerEFBCopy.scale_invert) + yScale = 256.0f / (float)bpmem.dispcopyyscale; + else + yScale = (float)bpmem.dispcopyyscale / 256.0f; - if (yScale != 1.0) - WARN_LOG(VIDEO, "yScale of %f is currently unsupported", yScale); + float xfbLines = ((bpmem.copyTexSrcWH.y + 1.0f) * yScale); - if ((u32)xfbLines > MAX_XFB_HEIGHT) - { - INFO_LOG(VIDEO, "Tried to scale EFB to too many XFB lines (%f)", xfbLines); - xfbLines = MAX_XFB_HEIGHT; - } + if (yScale != 1.0) + WARN_LOG(VIDEO, "yScale of %f is currently unsupported", yScale); - CopyToXfb(bpmem.copyTexDest << 5, bpmem.copyMipMapStrideChannels << 4, (u32)xfbLines, rc, - s_gammaLUT[bpmem.triggerEFBCopy.gamma]); - } - else + if ((u32)xfbLines > MAX_XFB_HEIGHT) { - CopyToRam(); // FIXME: should use the rectangle we have already created above + INFO_LOG(VIDEO, "Tried to scale EFB to too many XFB lines (%f)", xfbLines); + xfbLines = MAX_XFB_HEIGHT; } + + CopyToXfb(bpmem.copyTexDest << 5, bpmem.copyMipMapStrideChannels << 4, (u32)xfbLines, rc, + s_gammaLUT[bpmem.triggerEFBCopy.gamma]); + } + else + { + CopyToRam(); // FIXME: should use the rectangle we have already created above } } } diff --git a/Source/Core/VideoBackends/Software/SWRenderer.cpp b/Source/Core/VideoBackends/Software/SWRenderer.cpp index a170bc6afb69..fcab41aebc5c 100644 --- a/Source/Core/VideoBackends/Software/SWRenderer.cpp +++ b/Source/Core/VideoBackends/Software/SWRenderer.cpp @@ -112,42 +112,39 @@ void SWRenderer::UpdateColorTexture(EfbInterface::yuv422_packed* xfb, u32 fbWidt void SWRenderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const EFBRectangle& rc, float Gamma) { - if (!Fifo::WillSkipCurrentFrame()) + if (g_ActiveConfig.bUseXFB) { - if (g_ActiveConfig.bUseXFB) - { - EfbInterface::yuv422_packed* xfb = (EfbInterface::yuv422_packed*)Memory::GetPointer(xfbAddr); - UpdateColorTexture(xfb, fbWidth, fbHeight); - } - else - { - EfbInterface::BypassXFB(GetCurrentColorTexture(), fbWidth, fbHeight, rc, Gamma); - } + EfbInterface::yuv422_packed* xfb = (EfbInterface::yuv422_packed*)Memory::GetPointer(xfbAddr); + UpdateColorTexture(xfb, fbWidth, fbHeight); + } + else + { + EfbInterface::BypassXFB(GetCurrentColorTexture(), fbWidth, fbHeight, rc, Gamma); + } - // Save screenshot - if (s_bScreenshot) - { - std::lock_guard lk(s_criticalScreenshot); + // Save screenshot + if (s_bScreenshot) + { + std::lock_guard lk(s_criticalScreenshot); - if (TextureToPng(GetCurrentColorTexture(), fbWidth * 4, s_sScreenshotName, fbWidth, fbHeight, - false)) - OSD::AddMessage("Screenshot saved to " + s_sScreenshotName); + if (TextureToPng(GetCurrentColorTexture(), fbWidth * 4, s_sScreenshotName, fbWidth, fbHeight, + false)) + OSD::AddMessage("Screenshot saved to " + s_sScreenshotName); - // Reset settings - s_sScreenshotName.clear(); - s_bScreenshot = false; - s_screenshotCompleted.Set(); - } + // Reset settings + s_sScreenshotName.clear(); + s_bScreenshot = false; + s_screenshotCompleted.Set(); + } - if (SConfig::GetInstance().m_DumpFrames) - { - static int frame_index = 0; - TextureToPng(GetCurrentColorTexture(), fbWidth * 4, - StringFromFormat("%sframe%i_color.png", - File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), frame_index), - fbWidth, fbHeight, true); - frame_index++; - } + if (SConfig::GetInstance().m_DumpFrames) + { + static int frame_index = 0; + TextureToPng(GetCurrentColorTexture(), fbWidth * 4, + StringFromFormat("%sframe%i_color.png", + File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), frame_index), + fbWidth, fbHeight, true); + frame_index++; } OSD::DoCallbacks(OSD::CallbackType::OnFrame); diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp index 5355c0b2c1ad..f9bd1908de41 100644 --- a/Source/Core/VideoCommon/BPStructs.cpp +++ b/Source/Core/VideoCommon/BPStructs.cpp @@ -380,19 +380,16 @@ static void BPWritten(const BPCmd& bp) // ------------------------- case BPMEM_CLEARBBOX1: case BPMEM_CLEARBBOX2: - // Don't compute bounding box if this frame is being skipped! - // Wrong but valid values are better than bogus values... - if (!Fifo::WillSkipCurrentFrame()) - { - u8 offset = bp.address & 2; - BoundingBox::active = true; + { + u8 offset = bp.address & 2; + BoundingBox::active = true; - if (g_ActiveConfig.backend_info.bSupportsBBox && g_ActiveConfig.bBBoxEnable) - { - g_renderer->BBoxWrite(offset, bp.newvalue & 0x3ff); - g_renderer->BBoxWrite(offset + 1, bp.newvalue >> 10); - } + if (g_ActiveConfig.backend_info.bSupportsBBox && g_ActiveConfig.bBBoxEnable) + { + g_renderer->BBoxWrite(offset, bp.newvalue & 0x3ff); + g_renderer->BBoxWrite(offset + 1, bp.newvalue >> 10); } + } return; case BPMEM_TEXINVALIDATE: // TODO: Needs some restructuring in TextureCacheBase. diff --git a/Source/Core/VideoCommon/Fifo.cpp b/Source/Core/VideoCommon/Fifo.cpp index 4ca76cae71e8..d3f970382338 100644 --- a/Source/Core/VideoCommon/Fifo.cpp +++ b/Source/Core/VideoCommon/Fifo.cpp @@ -34,8 +34,6 @@ namespace Fifo static constexpr u32 FIFO_SIZE = 2 * 1024 * 1024; static constexpr int GPU_TIME_SLOT_SIZE = 1000; -static bool s_skip_current_frame = false; - static Common::BlockingLoop s_gpu_mainloop; static Common::Flag s_emu_running_state; @@ -86,7 +84,6 @@ void DoState(PointerWrap& p) s_video_buffer_seen_ptr = s_video_buffer_pp_read_ptr = s_video_buffer_read_ptr; } - p.Do(s_skip_current_frame); p.Do(s_sync_ticks); } @@ -130,16 +127,6 @@ void Shutdown() s_fifo_aux_read_ptr = nullptr; } -void SetRendering(bool enabled) -{ - s_skip_current_frame = !enabled; -} - -bool WillSkipCurrentFrame() -{ - return s_skip_current_frame; -} - // May be executed from any thread, even the graphics thread. // Created to allow for self shutdown. void ExitGpuLoop() diff --git a/Source/Core/VideoCommon/Fifo.h b/Source/Core/VideoCommon/Fifo.h index ffe90c3ed9db..3b0114844eab 100644 --- a/Source/Core/VideoCommon/Fifo.h +++ b/Source/Core/VideoCommon/Fifo.h @@ -44,7 +44,5 @@ void ExitGpuLoop(); void EmulatorState(bool running); bool AtBreakpoint(); void ResetVideoBuffer(); -void SetRendering(bool bEnabled); -bool WillSkipCurrentFrame(); } // namespace Fifo diff --git a/Source/Core/VideoCommon/OpcodeDecoding.cpp b/Source/Core/VideoCommon/OpcodeDecoding.cpp index badc794cfe5b..a0b73effaf3d 100644 --- a/Source/Core/VideoCommon/OpcodeDecoding.cpp +++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp @@ -264,8 +264,7 @@ u8* Run(DataReader src, u32* cycles, bool in_display_list) u16 num_vertices = src.Read(); int bytes = VertexLoaderManager::RunVertices( cmd_byte & GX_VAT_MASK, // Vertex loader index (0 - 7) - (cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT, num_vertices, src, - Fifo::WillSkipCurrentFrame(), is_preprocess); + (cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT, num_vertices, src, is_preprocess); if (bytes < 0) goto end; diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp index 6579802445f7..7f8c79c77dac 100644 --- a/Source/Core/VideoCommon/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp @@ -180,8 +180,7 @@ static VertexLoaderBase* RefreshLoader(int vtx_attr_group, bool preprocess = fal return loader; } -int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bool skip_drawing, - bool is_preprocess) +int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bool is_preprocess) { if (!count) return 0; @@ -192,7 +191,7 @@ int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bo if ((int)src.size() < size) return -1; - if (skip_drawing || is_preprocess) + if (is_preprocess) return size; // If the native vertex format changed, force a flush. diff --git a/Source/Core/VideoCommon/VertexLoaderManager.h b/Source/Core/VideoCommon/VertexLoaderManager.h index f8a42353419c..bff6d4e8eba2 100644 --- a/Source/Core/VideoCommon/VertexLoaderManager.h +++ b/Source/Core/VideoCommon/VertexLoaderManager.h @@ -27,8 +27,7 @@ void MarkAllDirty(); NativeVertexFormatMap* GetNativeVertexFormatMap(); // Returns -1 if buf_size is insufficient, else the amount of bytes consumed -int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bool skip_drawing, - bool is_preprocess); +int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bool is_preprocess); // For debugging void AppendListToString(std::string* dest);