[client] main: don't include the swap into the render timings

If vsync is enabled the swap will block until vblank skewing the timing
metrics.
This commit is contained in:
Geoffrey McRae 2021-08-07 01:44:36 +10:00
parent 0ec66ba210
commit 162b1b93db
4 changed files with 13 additions and 5 deletions

View file

@ -463,7 +463,7 @@ static bool opengl_needs_render(void * opaque)
}
bool opengl_render(void * opaque, LG_RendererRotate rotate, const bool newFrame,
const bool invalidateWindow)
const bool invalidateWindow, void (*preSwap)(void * udata), void * udata)
{
struct Inst * this = (struct Inst *)opaque;
if (!this)
@ -503,6 +503,7 @@ bool opengl_render(void * opaque, LG_RendererRotate rotate, const bool newFrame,
ImGui_ImplOpenGL2_RenderDrawData(igGetDrawData());
}
preSwap(udata);
if (this->opt.preventBuffer)
{
app_glSwapBuffers();