From a6dfeed3189b43a2267f5819e91e7a1c105ef3a9 Mon Sep 17 00:00:00 2001 From: Filoppi Date: Sat, 9 Sep 2023 18:34:32 +0300 Subject: [PATCH] Video: make the "Auto" resolution setting also follow the max res setting, to avoid trying to create texture bigger than the maximum supported one --- Source/Core/VideoCommon/Present.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(Config::Get(Config::GFX_MAX_EFB_SCALE))); } void Presenter::SetSuggestedWindowSize(int width, int height)