2023-08-07 22:10:38 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2023-08-13 13:33:38 +02:00
|
|
|
#include "Common/GPU/thin3d.h"
|
2023-08-07 22:10:38 +02:00
|
|
|
|
2023-08-15 15:20:01 +02:00
|
|
|
// See big comment in the CPP file.
|
|
|
|
|
|
2023-08-13 13:33:38 +02:00
|
|
|
namespace Draw {
|
|
|
|
|
class DrawContext;
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-18 13:44:32 +01:00
|
|
|
class FrameTiming {
|
|
|
|
|
public:
|
|
|
|
|
void DeferWaitUntil(double until, double *curTimePtr);
|
|
|
|
|
void PostSubmit();
|
|
|
|
|
void Reset(Draw::DrawContext *draw);
|
|
|
|
|
|
2023-08-13 13:33:38 +02:00
|
|
|
// Some backends won't allow changing this willy nilly.
|
|
|
|
|
Draw::PresentMode presentMode;
|
|
|
|
|
int presentInterval;
|
|
|
|
|
|
2023-12-18 13:44:32 +01:00
|
|
|
private:
|
|
|
|
|
double waitUntil_;
|
|
|
|
|
double *curTimePtr_;
|
2023-08-07 22:10:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern FrameTiming g_frameTiming;
|
2023-08-13 13:33:38 +02:00
|
|
|
|
|
|
|
|
Draw::PresentMode ComputePresentMode(Draw::DrawContext *draw, int *interval);
|
2023-12-18 13:44:32 +01:00
|
|
|
|
2024-11-21 15:47:37 +01:00
|
|
|
void WaitUntil(double now, double timestamp, const char *reason);
|