From c5a89b648383ee5ef3f4fe8285fbd2fcf71e3aad Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 21 Nov 2017 19:55:14 +1000 Subject: [PATCH] D3D: Remove BeginFrame/EndFrame These functions did not do anything anyway. There is also no need to present the backbuffer when shutting down. --- Source/Core/VideoBackends/D3D/D3DBase.cpp | 23 ----------------------- Source/Core/VideoBackends/D3D/D3DBase.h | 2 -- Source/Core/VideoBackends/D3D/Render.cpp | 5 ----- 3 files changed, 30 deletions(-) diff --git a/Source/Core/VideoBackends/D3D/D3DBase.cpp b/Source/Core/VideoBackends/D3D/D3DBase.cpp index 4cf5fb7524..e32ef95576 100644 --- a/Source/Core/VideoBackends/D3D/D3DBase.cpp +++ b/Source/Core/VideoBackends/D3D/D3DBase.cpp @@ -52,8 +52,6 @@ const D3D_FEATURE_LEVEL supported_feature_levels[NUM_SUPPORTED_FEATURE_LEVELS] = unsigned int xres, yres; -bool bFrameInProgress = false; - HRESULT LoadDXGI() { if (dxgi_dll_ref++ > 0) @@ -602,27 +600,6 @@ void Reset() SetDebugObjectName(backbuf->GetRTV(), "backbuffer render target view"); } -bool BeginFrame() -{ - if (bFrameInProgress) - { - PanicAlert("BeginFrame called although a frame is already in progress"); - return false; - } - bFrameInProgress = true; - return (device != nullptr); -} - -void EndFrame() -{ - if (!bFrameInProgress) - { - PanicAlert("EndFrame called although no frame is in progress"); - return; - } - bFrameInProgress = false; -} - void Present() { UINT present_flags = 0; diff --git a/Source/Core/VideoBackends/D3D/D3DBase.h b/Source/Core/VideoBackends/D3D/D3DBase.h index 36db9fae3d..6d5e9cc8c9 100644 --- a/Source/Core/VideoBackends/D3D/D3DBase.h +++ b/Source/Core/VideoBackends/D3D/D3DBase.h @@ -63,8 +63,6 @@ extern HWND hWnd; extern bool bFrameInProgress; void Reset(); -bool BeginFrame(); -void EndFrame(); void Present(); unsigned int GetBackBufferWidth(); diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index 762404d581..a14a71a24a 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -81,14 +81,11 @@ Renderer::Renderer() : ::Renderer(D3D::GetBackBufferWidth(), D3D::GetBackBufferH D3D11_VIEWPORT vp = CD3D11_VIEWPORT(0.f, 0.f, (float)m_target_width, (float)m_target_height); D3D::context->RSSetViewports(1, &vp); FramebufferManager::BindEFBRenderTarget(); - D3D::BeginFrame(); } Renderer::~Renderer() { TeardownDeviceObjects(); - D3D::EndFrame(); - D3D::Present(); D3D::Close(); } @@ -607,7 +604,6 @@ void Renderer::SwapImpl(AbstractTexture* texture, const EFBRectangle& xfb_region Renderer::DrawDebugText(); OSD::DrawMessages(); - D3D::EndFrame(); g_texture_cache->Cleanup(frameCount); @@ -668,7 +664,6 @@ void Renderer::SwapImpl(AbstractTexture* texture, const EFBRectangle& xfb_region // begin next frame RestoreAPIState(); - D3D::BeginFrame(); FramebufferManager::BindEFBRenderTarget(); SetViewport(); }