summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Present.cpp
diff options
context:
space:
mode:
authorFiloppi <filippotarpini@hotmail.it>2023-09-09 18:34:32 +0300
committerFiloppi <filippotarpini@hotmail.it>2023-12-18 02:00:25 +0200
commita6dfeed3189b43a2267f5819e91e7a1c105ef3a9 (patch)
treed3ce8673711c435e36c86de2a7270a6a94ceb433 /Source/Core/VideoCommon/Present.cpp
parentff03189a60739f4a316bed63da230deb15e98689 (diff)
Video: make the "Auto" resolution setting also follow the max res setting, to avoid trying to create texture bigger than the maximum supported one
Diffstat (limited to 'Source/Core/VideoCommon/Present.cpp')
-rw-r--r--Source/Core/VideoCommon/Present.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/Present.cpp b/Source/Core/VideoCommon/Present.cpp
index 3dfeebfe00..bf4b6af33b 100644
--- a/Source/Core/VideoCommon/Present.cpp
+++ b/Source/Core/VideoCommon/Present.cpp
@@ -4,6 +4,7 @@
#include "VideoCommon/Present.h"
#include "Common/ChunkFile.h"
+#include "Core/Config/GraphicsSettings.h"
#include "Core/HW/VideoInterface.h"
#include "Core/Host.h"
#include "Core/System.h"
@@ -417,7 +418,9 @@ u32 Presenter::AutoIntegralScale() const
source_width > 0 ? ((target_width + (source_width - 1)) / source_width) : 1;
const u32 height_scale =
source_height > 0 ? ((target_height + (source_height - 1)) / source_height) : 1;
- return std::max(width_scale, height_scale);
+ // Limit to the max to avoid creating textures larger than their max supported resolution.
+ return std::min(std::max(width_scale, height_scale),
+ static_cast<u32>(Config::Get(Config::GFX_MAX_EFB_SCALE)));
}
void Presenter::SetSuggestedWindowSize(int width, int height)