diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index d7c4870980f3..1ea7935e7b2c 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -690,7 +690,8 @@ void __DisplayFlip(int cyclesLate) { } void hleAfterFlip(u64 userdata, int cyclesLate) { - gpu->BeginFrame(); // doesn't really matter if begin or end of frame. + gpu->PSPFrame(); + PPGeNotifyFrame(); // This seems like as good a time as any to check if the config changed. diff --git a/GPU/D3D11/GPU_D3D11.cpp b/GPU/D3D11/GPU_D3D11.cpp index c92b8ad2f5e3..bb07131b5f79 100644 --- a/GPU/D3D11/GPU_D3D11.cpp +++ b/GPU/D3D11/GPU_D3D11.cpp @@ -127,8 +127,8 @@ void GPU_D3D11::DeviceRestore(Draw::DrawContext *draw) { // Nothing needed. } -void GPU_D3D11::BeginFrame() { - GPUCommonHW::BeginFrame(); +void GPU_D3D11::BeginHostFrame() { + GPUCommonHW::BeginHostFrame(); textureCache_->StartFrame(); drawEngine_.BeginFrame(); diff --git a/GPU/D3D11/GPU_D3D11.h b/GPU/D3D11/GPU_D3D11.h index a2e374c6f000..e1d7c5115d79 100644 --- a/GPU/D3D11/GPU_D3D11.h +++ b/GPU/D3D11/GPU_D3D11.h @@ -44,7 +44,7 @@ class GPU_D3D11 : public GPUCommonHW { void FinishDeferred() override; private: - void BeginFrame() override; + void BeginHostFrame() override; ID3D11Device *device_; ID3D11DeviceContext *context_; diff --git a/GPU/Directx9/GPU_DX9.cpp b/GPU/Directx9/GPU_DX9.cpp index b8cca50d99c2..cd821ad71cdf 100644 --- a/GPU/Directx9/GPU_DX9.cpp +++ b/GPU/Directx9/GPU_DX9.cpp @@ -118,11 +118,12 @@ void GPU_DX9::ReapplyGfxState() { GPUCommonHW::ReapplyGfxState(); } -void GPU_DX9::BeginFrame() { +void GPU_DX9::BeginHostFrame() { + GPUCommonHW::BeginHostFrame(); + textureCache_->StartFrame(); drawEngine_.BeginFrame(); - GPUCommonHW::BeginFrame(); shaderManagerDX9_->DirtyLastShader(); framebufferManager_->BeginFrame(); diff --git a/GPU/Directx9/GPU_DX9.h b/GPU/Directx9/GPU_DX9.h index f18ffeb77e46..78468a016933 100644 --- a/GPU/Directx9/GPU_DX9.h +++ b/GPU/Directx9/GPU_DX9.h @@ -46,7 +46,7 @@ class GPU_DX9 : public GPUCommonHW { void FinishDeferred() override; private: - void BeginFrame() override; + void BeginHostFrame() override; LPDIRECT3DDEVICE9 device_; LPDIRECT3DDEVICE9EX deviceEx_; diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index e4eaa274c59c..4a53aa740a72 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -245,23 +245,6 @@ void GPU_GLES::BeginHostFrame() { GPUCommonHW::BeginHostFrame(); drawEngine_.BeginFrame(); - if (gstate_c.useFlagsChanged) { - // TODO: It'd be better to recompile them in the background, probably? - // This most likely means that saw equal depth changed. - WARN_LOG(G3D, "Shader use flags changed, clearing all shaders and depth buffers"); - shaderManager_->ClearShaders(); - framebufferManager_->ClearAllDepthBuffers(); - gstate_c.useFlagsChanged = false; - } -} - -void GPU_GLES::EndHostFrame() { - drawEngine_.EndFrame(); -} - -void GPU_GLES::BeginFrame() { - GPUCommonHW::BeginFrame(); - textureCache_->StartFrame(); // Save the cache from time to time. TODO: How often? We save on exit, so shouldn't need to do this all that often. @@ -276,6 +259,18 @@ void GPU_GLES::BeginFrame() { framebufferManager_->BeginFrame(); fragmentTestCache_.Decimate(); + if (gstate_c.useFlagsChanged) { + // TODO: It'd be better to recompile them in the background, probably? + // This most likely means that saw equal depth changed. + WARN_LOG(G3D, "Shader use flags changed, clearing all shaders and depth buffers"); + shaderManager_->ClearShaders(); + framebufferManager_->ClearAllDepthBuffers(); + gstate_c.useFlagsChanged = false; + } +} + +void GPU_GLES::EndHostFrame() { + drawEngine_.EndFrame(); } void GPU_GLES::FinishDeferred() { diff --git a/GPU/GLES/GPU_GLES.h b/GPU/GLES/GPU_GLES.h index b6ae9492fb1d..d05b85819b5a 100644 --- a/GPU/GLES/GPU_GLES.h +++ b/GPU/GLES/GPU_GLES.h @@ -54,8 +54,6 @@ class GPU_GLES : public GPUCommonHW { private: void BuildReportingInfo() override; - void BeginFrame() override; - FramebufferManagerGLES *framebufferManagerGL_; TextureCacheGLES *textureCacheGL_; DrawEngineGLES drawEngine_; diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index ac8c557156d3..e06b8390fd98 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -709,7 +709,7 @@ bool GPUCommon::InterpretList(DisplayList &list) { return gpuState == GPUSTATE_DONE || gpuState == GPUSTATE_ERROR; } -void GPUCommon::BeginFrame() { +void GPUCommon::PSPFrame() { immCount_ = 0; if (dumpNextFrame_) { NOTICE_LOG(G3D, "DUMPING THIS FRAME"); diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index 96cdf5d1988d..0bc8d5f5a48b 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -248,7 +248,7 @@ class GPUCommon : public GPUInterface, public GPUDebugInterface { } } - void BeginFrame() override; + void PSPFrame() override; virtual void CheckDepthUsage(VirtualFramebuffer *vfb) {} virtual void FastRunLoop(DisplayList &list) = 0; diff --git a/GPU/GPUCommonHW.cpp b/GPU/GPUCommonHW.cpp index 3bce75f53b3f..744bec47f4ed 100644 --- a/GPU/GPUCommonHW.cpp +++ b/GPU/GPUCommonHW.cpp @@ -501,8 +501,8 @@ void GPUCommonHW::UpdateCmdInfo() { } } -void GPUCommonHW::BeginFrame() { - GPUCommon::BeginFrame(); +void GPUCommonHW::BeginHostFrame() { + GPUCommon::BeginHostFrame(); if (drawEngineCommon_->EverUsedExactEqualDepth() && !sawExactEqualDepth_) { sawExactEqualDepth_ = true; gstate_c.SetUseFlags(CheckGPUFeatures()); diff --git a/GPU/GPUCommonHW.h b/GPU/GPUCommonHW.h index fb536893c388..05673e2d84a0 100644 --- a/GPU/GPUCommonHW.h +++ b/GPU/GPUCommonHW.h @@ -14,7 +14,7 @@ class GPUCommonHW : public GPUCommon { void DeviceLost() override; void DeviceRestore(Draw::DrawContext *draw) override; - void BeginFrame() override; + void BeginHostFrame() override; u32 CheckGPUFeatures() const override; diff --git a/GPU/GPUInterface.h b/GPU/GPUInterface.h index 8e526b541cb4..efaf4f776d3b 100644 --- a/GPU/GPUInterface.h +++ b/GPU/GPUInterface.h @@ -214,7 +214,7 @@ class GPUInterface { // Framebuffer management virtual void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) = 0; - virtual void BeginFrame() = 0; // Can be a good place to draw the "memory" framebuffer for accelerated plugins + virtual void PSPFrame() = 0; virtual void CopyDisplayToOutput(bool reallyDirty) = 0; // Tells the GPU to update the gpuStats structure.