mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-27 03:04:16 +01:00
Fix V-Sync KEvent
construction order
The V-Sync `KEvent` would be used by the presentation thread prior to construction leading to dereferencing an invalid value, this has been fixed by changing the order of construction to move the construction of the presentation thread after the V-Sync event.
This commit is contained in:
parent
ffad246d67
commit
35133381b6
@ -26,9 +26,9 @@ namespace skyline::gpu {
|
||||
gpu{gpu},
|
||||
acquireFence{gpu.vkDevice, vk::FenceCreateInfo{}},
|
||||
presentationTrack{static_cast<u64>(trace::TrackIds::Presentation), perfetto::ProcessTrack::Current()},
|
||||
vsyncEvent{std::make_shared<kernel::type::KEvent>(state, true)},
|
||||
choreographerThread{&PresentationEngine::ChoreographerThread, this},
|
||||
presentationThread{&PresentationEngine::PresentationThread, this},
|
||||
vsyncEvent{std::make_shared<kernel::type::KEvent>(state, true)} {
|
||||
presentationThread{&PresentationEngine::PresentationThread, this} {
|
||||
auto desc{presentationTrack.Serialize()};
|
||||
desc.set_name("Presentation");
|
||||
perfetto::TrackEvent::SetTrackDescriptor(presentationTrack, desc);
|
||||
|
@ -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<kernel::type::KEvent> 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<kernel::type::KEvent> vsyncEvent; //!< Signalled every time a frame is drawn
|
||||
|
||||
PresentationEngine(const DeviceState &state, GPU &gpu);
|
||||
|
||||
~PresentationEngine();
|
||||
|
Loading…
Reference in New Issue
Block a user