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