0
0
mirror of https://github.com/Ishan09811/pine.git synced 2025-04-28 09:35:08 +00:00
This commit is contained in:
Ishan09811 2025-01-17 12:56:46 +05:30 committed by GitHub
parent 184ee1ab26
commit 89cc678cf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -112,6 +112,8 @@ namespace skyline::gpu {
auto texture{frame.textureView->texture};
if (frame.textureView->format != swapchainFormat || texture->dimensions != swapchainExtent)
UpdateSwapchain(frame.textureView->format, texture->dimensions);
auto startTime = std::chrono::high_resolution_clock::now();
int result;
if (frame.crop && frame.crop != windowCrop) {
@ -157,6 +159,15 @@ namespace skyline::gpu {
frameFence = nextImageTexture->cycle;
auto endTime = std::chrono::high_resolution_clock::now();
auto frameDuration = std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime);
const auto frameTimeThreshold = 16ms; // 16ms for 60 FPS
if (frameDuration > frameTimeThreshold) {
LOGW("Frame skipped due to long processing time: {}ms", frameDuration.count());
return; // Skip this frame
}
auto getMonotonicNsNow{[]() -> i64 {
timespec time;
if (clock_gettime(CLOCK_MONOTONIC, &time))