Video: Change the frame dumper to actually use the raw emulation output resolution, avoiding any scaling if possible.

This should make comparisons much more reliable as pixels wouldn't be smushed together or stretched.
This commit is contained in:
Filoppi 2023-12-18 00:52:31 +02:00
parent 4421cc471d
commit d6230bbad8
2 changed files with 9 additions and 7 deletions

View File

@ -339,9 +339,8 @@ void AdvancedWidget::AddDescriptions()
QT_TR_NOOP("Loads graphics mods from User/Load/GraphicsMods/.<br><br><dolphin_emphasis>If "
"unsure, leave this unchecked.</dolphin_emphasis>");
static const char TR_INTERNAL_RESOLUTION_FRAME_DUMPING_DESCRIPTION[] = QT_TR_NOOP(
"Creates frame dumps and screenshots at the internal resolution of the renderer, rather than "
"the size of the window it is displayed within.<br><br>If the aspect ratio is widescreen, "
"the output image will be scaled horizontally to preserve the vertical resolution.<br><br>"
"Creates frame dumps and screenshots at the raw internal resolution of the renderer,"
"rather than using the size it is displayed within the window.<br><br>"
"<dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
#if defined(HAVE_FFMPEG)
static const char TR_USE_FFV1_DESCRIPTION[] =

View File

@ -214,14 +214,17 @@ void Presenter::ProcessFrameDumping(u64 ticks) const
MathUtil::Rectangle<int> target_rect;
if (!g_ActiveConfig.bInternalResolutionFrameDumps && !g_gfx->IsHeadless())
{
// This is already scaled by "VIDEO_ENCODER_LCM"
target_rect = GetTargetRectangle();
}
else
{
int width, height;
std::tie(width, height) =
CalculateOutputDimensions(m_xfb_rect.GetWidth(), m_xfb_rect.GetHeight());
target_rect = MathUtil::Rectangle<int>(0, 0, width, height);
target_rect = m_xfb_rect;
ASSERT(target_rect.top == 0 && target_rect.left == 0);
// 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
target_rect.right += VIDEO_ENCODER_LCM - (target_rect.GetWidth() % VIDEO_ENCODER_LCM);
target_rect.bottom += VIDEO_ENCODER_LCM - (target_rect.GetHeight() % VIDEO_ENCODER_LCM);
}
g_frame_dumper->DumpCurrentFrame(m_xfb_entry->texture.get(), m_xfb_rect, target_rect, ticks,