summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Present.cpp
diff options
context:
space:
mode:
authorFiloppi <filippotarpini@hotmail.it>2024-03-03 15:10:23 +0200
committerFiloppi <filippotarpini@hotmail.it>2024-04-08 22:54:45 +0300
commit66592f79f2230bf5589bccb1f51da72150bf89c9 (patch)
treec9c878f44e429437511d6f8e9aab0e1aa9a65e5b /Source/Core/VideoCommon/Present.cpp
parent72db62e17856265adefaaff6c7827989a2b362a4 (diff)
Video: remove enforced resolution least common multiple of 4 when dumping screenshots and not videos (only videos encoders have this limit).
NOTE: this will likely trigger FIFOCI differences.
Diffstat (limited to 'Source/Core/VideoCommon/Present.cpp')
-rw-r--r--Source/Core/VideoCommon/Present.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/Present.cpp b/Source/Core/VideoCommon/Present.cpp
index 3a026bedd5..7de27f5049 100644
--- a/Source/Core/VideoCommon/Present.cpp
+++ b/Source/Core/VideoCommon/Present.cpp
@@ -25,9 +25,6 @@
std::unique_ptr<VideoCommon::Presenter> g_presenter;
-// The video encoder needs the image to be a multiple of x samples.
-static constexpr int VIDEO_ENCODER_LCM = 4;
-
namespace VideoCommon
{
// Stretches the native/internal analog resolution aspect ratio from ~4:3 to ~16:9
@@ -246,16 +243,18 @@ void Presenter::ProcessFrameDumping(u64 ticks) const
int width = target_rect.GetWidth();
int height = target_rect.GetHeight();
- // Ensure divisibility by "VIDEO_ENCODER_LCM" and a min of 1 to make it compatible with all the
+ const int resolution_lcm = g_frame_dumper->GetRequiredResolutionLeastCommonMultiple();
+
+ // Ensure divisibility by the dumper LCM and a min of 1 to make it compatible with all the
// video encoders. Note that this is theoretically only necessary when recording videos and not
// screenshots.
// We always scale positively to make sure the least amount of information is lost.
//
// TODO: this should be added as black padding on the edges by the frame dumper.
- if ((width % VIDEO_ENCODER_LCM) != 0 || width == 0)
- width += VIDEO_ENCODER_LCM - (width % VIDEO_ENCODER_LCM);
- if ((height % VIDEO_ENCODER_LCM) != 0 || height == 0)
- height += VIDEO_ENCODER_LCM - (height % VIDEO_ENCODER_LCM);
+ if ((width % resolution_lcm) != 0 || width == 0)
+ width += resolution_lcm - (width % resolution_lcm);
+ if ((height % resolution_lcm) != 0 || height == 0)
+ height += resolution_lcm - (height % resolution_lcm);
// Remove any black borders, there would be no point in including them in the recording
target_rect.left = 0;