diff --git a/app/src/main/cpp/skyline/gpu/presentation_engine.cpp b/app/src/main/cpp/skyline/gpu/presentation_engine.cpp index 6276f242..9d967faa 100644 --- a/app/src/main/cpp/skyline/gpu/presentation_engine.cpp +++ b/app/src/main/cpp/skyline/gpu/presentation_engine.cpp @@ -26,9 +26,9 @@ namespace skyline::gpu { gpu{gpu}, acquireFence{gpu.vkDevice, vk::FenceCreateInfo{}}, presentationTrack{static_cast(trace::TrackIds::Presentation), perfetto::ProcessTrack::Current()}, + vsyncEvent{std::make_shared(state, true)}, choreographerThread{&PresentationEngine::ChoreographerThread, this}, - presentationThread{&PresentationEngine::PresentationThread, this}, - vsyncEvent{std::make_shared(state, true)} { + presentationThread{&PresentationEngine::PresentationThread, this} { auto desc{presentationTrack.Serialize()}; desc.set_name("Presentation"); perfetto::TrackEvent::SetTrackDescriptor(presentationTrack, desc); diff --git a/app/src/main/cpp/skyline/gpu/presentation_engine.h b/app/src/main/cpp/skyline/gpu/presentation_engine.h index 97e22eb1..03b3b5b7 100644 --- a/app/src/main/cpp/skyline/gpu/presentation_engine.h +++ b/app/src/main/cpp/skyline/gpu/presentation_engine.h @@ -47,6 +47,10 @@ namespace skyline::gpu { i64 averageFrametimeDeviationNs{}; //!< The average deviation of frametimes in nanoseconds perfetto::Track presentationTrack; //!< Perfetto track used for presentation events + public: + std::shared_ptr vsyncEvent; //!< Signalled every time a frame is drawn + + private: std::thread choreographerThread; //!< A thread for signalling the V-Sync event and measure the refresh cycle duration using AChoreographer ALooper *choreographerLooper{}; i64 lastChoreographerTime{}; //!< The timestamp of the last invocation of Choreographer::doFrame @@ -97,8 +101,6 @@ namespace skyline::gpu { void UpdateSwapchain(texture::Format format, texture::Dimensions extent); public: - std::shared_ptr vsyncEvent; //!< Signalled every time a frame is drawn - PresentationEngine(const DeviceState &state, GPU &gpu); ~PresentationEngine();