From 4b89fab91c0bafd121dc2682d9f444ae55205339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 30 Aug 2023 23:42:00 +0200 Subject: [PATCH] NativeInitGraphics: Update core parameter pixel width/height (since we lose resized flag) --- GPU/Common/FramebufferManagerCommon.cpp | 2 ++ GPU/GPUCommonHW.cpp | 2 ++ UI/NativeApp.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index 5cd77dd8d3..8042a25452 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -2622,6 +2622,8 @@ void FramebufferManagerCommon::NotifyDisplayResized() { pixelHeight_ = PSP_CoreParameter().pixelHeight; presentation_->UpdateDisplaySize(pixelWidth_, pixelHeight_); + INFO_LOG(G3D, "FramebufferManagerCommon::NotifyDisplayResized: %dx%d", pixelWidth_, pixelHeight_); + // No drawing is allowed here. This includes anything that might potentially touch a command buffer, like creating images! // So we need to defer the post processing initialization. updatePostShaders_ = true; diff --git a/GPU/GPUCommonHW.cpp b/GPU/GPUCommonHW.cpp index 3929929ed6..18efa1b9a8 100644 --- a/GPU/GPUCommonHW.cpp +++ b/GPU/GPUCommonHW.cpp @@ -447,6 +447,8 @@ void GPUCommonHW::DeviceLost() { // Call at the start of the GPU implementation's DeviceRestore void GPUCommonHW::DeviceRestore(Draw::DrawContext *draw) { draw_ = draw; + displayResized_ = true; // re-check display bounds. + renderResized_ = true; framebufferManager_->DeviceRestore(draw_); textureCache_->DeviceRestore(draw_); shaderManager_->DeviceRestore(draw_); diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 9687f74517..76b7cf5faa 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -885,6 +885,8 @@ bool NativeInitGraphics(GraphicsContext *graphicsContext) { g_gameInfoCache = new GameInfoCache(); if (gpu) { + PSP_CoreParameter().pixelWidth = g_display.pixel_xres; + PSP_CoreParameter().pixelHeight = g_display.pixel_yres; gpu->DeviceRestore(g_draw); }