This one seems janky - other frontends (glx/egl LD_PRELOAD, Vulkan)
init their own global window_size.
Although in reality we use the initial data solely to set the imgui
"window" position and we immediatelly overwrite it, with the follow-up
call render_imgui().
Odds are this won't fix the glitchy (re)sizes but it's a step in the
right direction.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Currently we're destroying the window, from under the glfw's framework
feet.
Basically we do a use-after-free, as glfwWindowShouldClose() is called
and due to some miracle we don't crash out.
Since we suspend all rendering, there's no need to actually destroy the
window - just iconify/restore it. A simple show/hide was attempted but
empirically did not work.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Currently, if the user sets attribute we send dummy data to mangohud.
Avoid that by pulling the attrib handling into main and avoiding the
duplicate attribute name checking.
Kill off the no-longer relevant TODO while we're here.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Above all, we really don't need the gpu_busy_percent node, if the GPU
exposes a gpu_metrics node,
Although looking closer, the gpu_busy_percent check is meant for
something else - to distinguish between the card node (cardX) and the
card output node (cardX-output-foo).
To top it all up, the check at the very end implies that we can get a
case where gpu_metrics and gpu_busy_perfect is missing ... that's not
possible.
So instead, drop the early gpu_busy_perfect check and properly mandate
it later on.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
No longer applicable, since the libdrm path is gone and hwmon is
required - either partially or in full.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Currently we open the standalone busy, temp, gpu/memory clock and
power_usage nodes, even if gpu_metrics is present.
At the same time, we correctly ignore them when doing the read-only.
So just avoid opening them all together.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Currently we can get the load and temp stats either from the standalone
nodes or from the gpu_metrics (binary) sysfs node.
Fix the next to handle that.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
The code was added back in 2020 and seemingly never built. Just drop it
- if needed it can be git reverted at some point.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Currently we pipeline a bunch of commands alike cat | grep | sed, there
we can do all that job with a single sed invocation - use that.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>