mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-22 14:39:18 +01:00
toggle DisableFrameThrottling setting by clicking on FPS display
s/jSurface/vkSurface
This commit is contained in:
parent
3168e8efc0
commit
f850271e2d
@ -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};
|
||||
|
||||
|
@ -105,6 +105,11 @@ namespace skyline::gpu {
|
||||
*/
|
||||
void UpdateSwapchain(texture::Format format, texture::Dimensions extent);
|
||||
|
||||
/**
|
||||
* @brief Handles DisableFrameThrottling setting changed event
|
||||
*/
|
||||
void OnDisableFrameThrottlingChanged(const bool &value);
|
||||
|
||||
public:
|
||||
PresentationEngine(const DeviceState &state, GPU &gpu);
|
||||
|
||||
|
@ -249,6 +249,11 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
|
||||
postDelayed(this, 250)
|
||||
}
|
||||
}, 250)
|
||||
setOnClickListener {
|
||||
preferenceSettings.disableFrameThrottling = !preferenceSettings.disableFrameThrottling
|
||||
var color = if (preferenceSettings.disableFrameThrottling) getColor(R.color.colorPerfStatsSecondary) else getColor(R.color.colorPerfStatsPrimary)
|
||||
binding.perfStats.setTextColor(color)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user