[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

@@ -879,7 +879,7 @@ inline static void renderLetterBox(struct Inst * this)
}
static bool egl_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;
EGLint bufferAge = egl_buffer_age(this);
@@ -1072,6 +1072,7 @@ static bool egl_render(void * opaque, LG_RendererRotate rotate, const bool newFr
this->hadOverlay = hasOverlay;
this->cursorLast = cursorState;
preSwap(udata);
app_eglSwapBuffers(this->display, this->surface, damage, damageIdx);
return true;
}

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();