mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-06 10:44:01 +00:00
[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:
@@ -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;
|
||||
}
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user