mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] egl: add graph tracking time taken to import frame
This tracks the time taken to load the frame buffer into an OpenGL texture.
This commit is contained in:
parent
552a37122a
commit
009ae02e32
@ -103,6 +103,9 @@ struct Inst
|
||||
|
||||
bool hadOverlay;
|
||||
_Atomic(struct DesktopDamage *) desktopDamage;
|
||||
|
||||
RingBuffer importTimings;
|
||||
GraphHandle importGraph;
|
||||
};
|
||||
|
||||
static struct Option egl_options[] =
|
||||
@ -210,6 +213,9 @@ bool egl_create(void ** opaque, const LG_RendererParams params, bool * needsOpen
|
||||
|
||||
atomic_init(&this->desktopDamage, NULL);
|
||||
|
||||
this->importTimings = ringbuffer_new(256, sizeof(float));
|
||||
this->importGraph = app_registerGraph("IMPORT", this->importTimings);
|
||||
|
||||
*needsOpenGL = false;
|
||||
return true;
|
||||
}
|
||||
@ -228,6 +234,9 @@ void egl_deinitialize(void * opaque)
|
||||
if (this->imgui)
|
||||
ImGui_ImplOpenGL3_Shutdown();
|
||||
|
||||
app_unregisterGraph(this->importGraph);
|
||||
ringbuffer_free(&this->importTimings);
|
||||
|
||||
egl_desktop_free(&this->desktop);
|
||||
egl_cursor_free (&this->cursor);
|
||||
egl_splash_free (&this->splash);
|
||||
@ -495,11 +504,13 @@ bool egl_on_frame(void * opaque, const FrameBuffer * frame, int dmaFd,
|
||||
{
|
||||
struct Inst * this = (struct Inst *)opaque;
|
||||
|
||||
uint64_t start = nanotime();
|
||||
if (!egl_desktop_update(this->desktop, frame, dmaFd))
|
||||
{
|
||||
DEBUG_INFO("Failed to to update the desktop");
|
||||
return false;
|
||||
}
|
||||
ringbuffer_push(this->importTimings, &(float){ (nanotime() - start) * 1e-6f });
|
||||
|
||||
this->start = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user