Add --renderer for displays with no usable GPU; gate the header reading
GTK4 defaults to Vulkan, and an X11-forwarded display has no device to make a swapchain from; the plot is a GtkGLArea, so it then asks for a GL context that is not there either. --renderer cairo is the software preset for that display: it exports GSK_RENDERER=cairo and LIBGL_ALWAYS_SOFTWARE=1 in main() before gtk_init()/adw_init(), because both are read when the renderer and the context are created. --renderer gl is the faster choice when indirect GL works, and --renderer vulkan makes the default explicit. Nothing is exported, and GTK's own choice stands, when the option is absent. The once-a-second header line is now behind UDPSCOPE_PROBE_HEADER, following the [notrace] rule: its widths are still sampled for the exit dump, but the line is detail behind that reading rather than output every run prints. UDPSCOPE_PROBE_RENDERER prints the exported pair before GTK starts and the GskRenderer GTK actually built. README, the manual's overview and docs/claude record the two symptoms and the cure.
This commit is contained in:
1 parent
ac054a30c9
commit
fcf268d249
9 files changed
+151
-7
No files matched your search
@@ -62,6 +62,12 @@ void print_usage(std::FILE* out, const char* argv0) {
|
||||
" time is then kept for export only\n"
|
||||
" --open FILE open an exported waveform (.npy) instead of a live source:\n"
|
||||
" signals from its columns, no socket, no acquisition\n"
|
||||
" --renderer NAME render with cairo (software), gl or vulkan. cairo also\n"
|
||||
" exports LIBGL_ALWAYS_SOFTWARE=1, because the plot is a\n"
|
||||
" GtkGLArea and still needs a GL context. Over SSH/X11\n"
|
||||
" forwarding use cairo: Vulkan cannot make a swapchain there\n"
|
||||
" and the GL area has no hardware context, so the window\n"
|
||||
" never paints or allocates\n"
|
||||
" -h, --help this text\n",
|
||||
argv0);
|
||||
}
|
||||
@@ -113,6 +119,15 @@ Config parse_args(int argc, char** argv) {
|
||||
c.capture_packets = static_cast<std::uint32_t>(n);
|
||||
} else if (a == "--open" || a.rfind("--open=", 0) == 0) {
|
||||
c.open_waveform = value_of(argc, argv, i, "--open");
|
||||
} else if (a == "--renderer" || a.rfind("--renderer=", 0) == 0) {
|
||||
const std::string v = value_of(argc, argv, i, "--renderer");
|
||||
// Only the three a source or a forwarded display actually chooses between. Anything
|
||||
// GTK does not know would fall back with a warning and leave the user reading a
|
||||
// renderer failure that is really a typo, so it is refused here instead.
|
||||
if (v != "cairo" && v != "gl" && v != "vulkan") {
|
||||
fail("--renderer must be cairo, gl or vulkan: " + v);
|
||||
}
|
||||
c.renderer = v;
|
||||
} else if (a == "--relative-time") {
|
||||
c.relative_time = true;
|
||||
c.relative_time_specified = true;
|
||||
|
||||
Reference in new issue
Block a user