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:
Billy Laws
2022-07-29 03:16:06 +05:30
committed by PixelyIon
parent ffad246d67
commit 35133381b6
2 changed files with 6 additions and 4 deletions

View File

@ -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);