Merge pull request #12698 from iwubcode/xfb_copy_hash_in_present

VideoCommon: add xfbs hashes to present info if available
This commit is contained in:
Admiral H. Curtiss 2024-04-18 17:11:49 +02:00 committed by GitHub
commit 8268ae1cf7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 0 deletions

View File

@ -175,6 +175,25 @@ void Presenter::ViSwap(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height,
present_info.reason = PresentInfo::PresentReason::VideoInterface; present_info.reason = PresentInfo::PresentReason::VideoInterface;
} }
if (m_xfb_entry)
{
// With no references, this XFB copy wasn't stitched together
// so just use its name directly
if (m_xfb_entry->references.empty())
{
if (!m_xfb_entry->texture_info_name.empty())
present_info.xfb_copy_hashes.push_back(m_xfb_entry->texture_info_name);
}
else
{
for (const auto& reference : m_xfb_entry->references)
{
if (!reference->texture_info_name.empty())
present_info.xfb_copy_hashes.push_back(reference->texture_info_name);
}
}
}
BeforePresentEvent::Trigger(present_info); BeforePresentEvent::Trigger(present_info);
if (!is_duplicate || !g_ActiveConfig.bSkipPresentingDuplicateXFBs) if (!is_duplicate || !g_ActiveConfig.bSkipPresentingDuplicateXFBs)

View File

@ -3,6 +3,9 @@
#pragma once #pragma once
#include <string_view>
#include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/HookableEvent.h" #include "Common/HookableEvent.h"
@ -71,6 +74,8 @@ struct PresentInfo
// Accuracy of actual_present_time // Accuracy of actual_present_time
PresentTimeAccuracy present_time_accuracy = PresentTimeAccuracy::Unimplemented; PresentTimeAccuracy present_time_accuracy = PresentTimeAccuracy::Unimplemented;
std::vector<std::string_view> xfb_copy_hashes;
}; };
// An event called just as a frame is queued for presentation. // An event called just as a frame is queued for presentation.