toggle DisableFrameThrottling setting by clicking on FPS display

s/jSurface/vkSurface
This commit is contained in:
Matesic Darko
2022-12-02 09:03:56 +01:00
committed by Billy Laws
parent 3168e8efc0
commit f850271e2d
3 changed files with 18 additions and 0 deletions

View File

@ -33,6 +33,7 @@ namespace skyline::gpu {
auto desc{presentationTrack.Serialize()};
desc.set_name("Presentation");
perfetto::TrackEvent::SetTrackDescriptor(presentationTrack, desc);
state.settings->disableFrameThrottling.AddCallback(std::bind(&PresentationEngine::OnDisableFrameThrottlingChanged, this, std::placeholders::_1));
}
PresentationEngine::~PresentationEngine() {
@ -341,6 +342,13 @@ namespace skyline::gpu {
swapchainImageCount = vkImages.size();
}
void PresentationEngine::OnDisableFrameThrottlingChanged(const bool &value) {
std::scoped_lock guard{mutex};
if (vkSurface && swapchainExtent && swapchainFormat)
UpdateSwapchain(swapchainFormat, swapchainExtent);
}
void PresentationEngine::UpdateSurface(jobject newSurface) {
std::scoped_lock guard{mutex};