From 5f372d6b1df2a6c87cf54e4f6eeb5c0e12383739 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 19 Jun 2026 11:37:04 +0200 Subject: [PATCH] VideoCommon: Reduce padding in PresentInfo This makes the struct 8 bytes smaller. --- Source/Core/VideoCommon/Present.cpp | 2 +- Source/Core/VideoCommon/VideoEvents.h | 50 +++++++++++++-------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Source/Core/VideoCommon/Present.cpp b/Source/Core/VideoCommon/Present.cpp index 7c62730667..f74b9a8fa4 100644 --- a/Source/Core/VideoCommon/Present.cpp +++ b/Source/Core/VideoCommon/Present.cpp @@ -234,9 +234,9 @@ void Presenter::ImmediateSwap(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_ PresentInfo present_info{ .frame_count = m_frame_count++, .present_count = m_present_count++, - .reason = PresentInfo::PresentReason::Immediate, .emulated_timestamp = ticks, .intended_present_time = m_next_swap_estimated_time, + .reason = PresentInfo::PresentReason::Immediate, }; auto& video_events = GetVideoEvents(); diff --git a/Source/Core/VideoCommon/VideoEvents.h b/Source/Core/VideoCommon/VideoEvents.h index fe30aa251b..f07ac631e4 100644 --- a/Source/Core/VideoCommon/VideoEvents.h +++ b/Source/Core/VideoCommon/VideoEvents.h @@ -16,31 +16,6 @@ class System; struct PresentInfo { - enum class PresentReason - { - Immediate, // FIFO is Presenting the XFB immediately, straight after the XFB copy - VideoInterface, // VideoInterface has triggered a present with a new frame - VideoInterfaceDuplicate, // VideoInterface has triggered a present with a duplicate frame - }; - - // The number of (unique) frames since the emulated console booted - u64 frame_count = 0; - - // The number of presents since the video backend was initialized. - // never goes backwards. - u64 present_count = 0; - - // The frame is identical to the previous frame - PresentReason reason = PresentReason::Immediate; - - // The exact emulated time of the when real hardware would have presented this frame - u64 emulated_timestamp = 0; - - TimePoint intended_present_time{}; - - // AfterPresent only: The actual time the frame was presented - TimePoint actual_present_time{}; - enum class PresentTimeAccuracy { // The Driver/OS has given us an exact timestamp of when the first line of the frame started @@ -58,9 +33,34 @@ struct PresentInfo Unimplemented, }; + enum class PresentReason + { + Immediate, // FIFO is Presenting the XFB immediately, straight after the XFB copy + VideoInterface, // VideoInterface has triggered a present with a new frame + VideoInterfaceDuplicate, // VideoInterface has triggered a present with a duplicate frame + }; + + // The number of (unique) frames since the emulated console booted + u64 frame_count = 0; + + // The number of presents since the video backend was initialized. + // never goes backwards. + u64 present_count = 0; + + // The exact emulated time of the when real hardware would have presented this frame + u64 emulated_timestamp = 0; + + TimePoint intended_present_time{}; + + // AfterPresent only: The actual time the frame was presented + TimePoint actual_present_time{}; + // Accuracy of actual_present_time PresentTimeAccuracy present_time_accuracy = PresentTimeAccuracy::Unimplemented; + // Where the presentation of the frame was triggered from + PresentReason reason = PresentReason::Immediate; + std::vector xfb_copy_hashes; };