diff --git a/GPU/Common/FramebufferCommon.h b/GPU/Common/FramebufferCommon.h index c3c5069dfa..97fd9204cb 100644 --- a/GPU/Common/FramebufferCommon.h +++ b/GPU/Common/FramebufferCommon.h @@ -236,6 +236,8 @@ public: void SetRenderSize(VirtualFramebuffer *vfb); void SetSafeSize(u16 w, u16 h); + virtual void Resized() = 0; + protected: void UpdateSize(); diff --git a/GPU/Directx9/GPU_DX9.cpp b/GPU/Directx9/GPU_DX9.cpp index e275c9adf6..826bcc6750 100644 --- a/GPU/Directx9/GPU_DX9.cpp +++ b/GPU/Directx9/GPU_DX9.cpp @@ -394,7 +394,7 @@ static const CommandTableEntry commandTable[] = { GPU_DX9::CommandInfo GPU_DX9::cmdInfo_[256]; GPU_DX9::GPU_DX9(GraphicsContext *gfxCtx) -: resized_(false), gfxCtx_(gfxCtx) { +: gfxCtx_(gfxCtx) { lastVsync_ = g_Config.bVSync ? 1 : 0; dxstate.SetVSyncInterval(g_Config.bVSync); @@ -2023,11 +2023,6 @@ void GPU_DX9::ClearCacheNextFrame() { textureCache_.ClearNextFrame(); } -void GPU_DX9::Resized() { - resized_ = true; - framebufferManagerDX9_->Resized(); -} - void GPU_DX9::ClearShaderCache() { shaderManager_->ClearCache(true); } diff --git a/GPU/Directx9/GPU_DX9.h b/GPU/Directx9/GPU_DX9.h index c97a6bff3b..c5de8cd987 100644 --- a/GPU/Directx9/GPU_DX9.h +++ b/GPU/Directx9/GPU_DX9.h @@ -37,6 +37,7 @@ class GPU_DX9 : public GPUCommon { public: GPU_DX9(GraphicsContext *gfxCtx); ~GPU_DX9(); + void CheckGPUFeatures(); void InitClear() override; void PreExecuteOp(u32 op, u32 diff) override; @@ -61,8 +62,6 @@ public: void DumpNextFrame() override; void DoState(PointerWrap &p) override; - // Called by the window system if the window size changed. This will be reflected in PSPCoreParam.pixel*. - void Resized() override; void ClearShaderCache() override; bool DecodeTexture(u8 *dest, const GPUgstate &state) override { return textureCache_.DecodeTexture(dest, state); @@ -182,7 +181,6 @@ private: static CommandInfo cmdInfo_[256]; - bool resized_; int lastVsync_; std::string reportingPrimaryInfo_; diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index d2e62efc54..b9d521534b 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -397,7 +397,7 @@ static const CommandTableEntry commandTable[] = { GPU_GLES::CommandInfo GPU_GLES::cmdInfo_[256]; GPU_GLES::GPU_GLES(GraphicsContext *ctx) -: resized_(false), gfxCtx_(ctx) { +: gfxCtx_(ctx) { UpdateVsyncInterval(true); CheckGPUFeatures(); @@ -2284,11 +2284,6 @@ void GPU_GLES::ClearCacheNextFrame() { textureCacheGL_->ClearNextFrame(); } -void GPU_GLES::Resized() { - resized_ = true; - framebufferManagerGL_->Resized(); -} - void GPU_GLES::ClearShaderCache() { shaderManager_->ClearCache(true); } diff --git a/GPU/GLES/GPU_GLES.h b/GPU/GLES/GPU_GLES.h index 4daadf7298..97e19feab7 100644 --- a/GPU/GLES/GPU_GLES.h +++ b/GPU/GLES/GPU_GLES.h @@ -65,8 +65,6 @@ public: void DumpNextFrame() override; void DoState(PointerWrap &p) override; - // Called by the window system if the window size changed. This will be reflected in PSPCoreParam.pixel*. - void Resized() override; void ClearShaderCache() override; void CleanupBeforeUI() override; bool DecodeTexture(u8 *dest, const GPUgstate &state) override { @@ -190,7 +188,6 @@ private: FragmentTestCache fragmentTestCache_; ShaderManager *shaderManager_; - bool resized_; int lastVsync_; std::string reportingPrimaryInfo_; diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index cd3c9229e1..bfc3a18ba9 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -26,7 +26,8 @@ GPUCommon::GPUCommon() : dumpNextFrame_(false), dumpThisFrame_(false), - framebufferManager_(nullptr) + framebufferManager_(nullptr), + resized_(false) { // This assert failed on GCC x86 32-bit (but not MSVC 32-bit!) before adding the // "padding" field at the end. This is important for save state compatibility. @@ -98,6 +99,11 @@ bool GPUCommon::BusyDrawing() { return false; } +void GPUCommon::Resized() { + resized_ = true; + framebufferManager_->Resized(); +} + u32 GPUCommon::DrawSync(int mode) { if (ThreadEnabled()) { // Sync first, because the CPU is usually faster than the emulated GPU. diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index 2b69994ab5..439bab20c5 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -34,6 +34,8 @@ public: interruptsEnabled_ = enable; } + void Resized() override; + void ExecuteOp(u32 op, u32 diff) override; void PreExecuteOp(u32 op, u32 diff) override; bool InterpretList(DisplayList &list) override; @@ -200,6 +202,7 @@ protected: bool dumpNextFrame_; bool dumpThisFrame_; bool interruptsEnabled_; + bool resized_; private: // For CPU/GPU sync. diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 721f8aa24e..63a110d0a7 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -393,7 +393,6 @@ static const CommandTableEntry commandTable[] = { GPU_Vulkan::GPU_Vulkan(GraphicsContext *ctx) : vulkan_((VulkanContext *)ctx->GetAPIContext()), drawEngine_(vulkan_), - resized_(false), gfxCtx_(ctx) { UpdateVsyncInterval(true); CheckGPUFeatures(); @@ -2135,11 +2134,6 @@ void GPU_Vulkan::ClearCacheNextFrame() { textureCacheVulkan_->ClearNextFrame(); } -void GPU_Vulkan::Resized() { - resized_ = true; - framebufferManagerVulkan_->Resized(); -} - void GPU_Vulkan::ClearShaderCache() { // TODO } diff --git a/GPU/Vulkan/GPU_Vulkan.h b/GPU/Vulkan/GPU_Vulkan.h index 865144f7fc..091f8f9624 100644 --- a/GPU/Vulkan/GPU_Vulkan.h +++ b/GPU/Vulkan/GPU_Vulkan.h @@ -67,8 +67,6 @@ public: void DumpNextFrame() override; void DoState(PointerWrap &p) override; - // Called by the window system if the window size changed. This will be reflected in PSPCoreParam.pixel*. - void Resized() override; void ClearShaderCache() override; bool DecodeTexture(u8 *dest, const GPUgstate &state) override { return false; @@ -188,7 +186,6 @@ private: // Manages state and pipeline objects PipelineManagerVulkan *pipelineManager_; - bool resized_; int lastVsync_; VkCommandBuffer curCmd_;