MCPcopy Create free account
hub / github.com/JRickey/BattleShip / RenderPostProcessDiagnostics

Function RenderPostProcessDiagnostics

port/gui/PortMenu.cpp:310–348  ·  view source on GitHub ↗

Live status panel for the post-process chain. Reads Fast::GetPostProcessRuntimeDiagnostics(), which the chain publishes on every load / unload. Lets the user confirm at a glance: which shader is actually active (matches the cvar) which load path produced it (legacy .glsl / .glslp, or .slang) how many passes compiled the last error if a load failed Pair the on-screen state with the matching SPDLOG_

Source from the content-addressed store, hash-verified

308// ssb64.log to walk through the load pipeline — see
309// docs/crt_shader_testing_protocol.md.
310void RenderPostProcessDiagnostics(WidgetInfo& /*widget*/) {
311 const Fast::PostProcessRuntimeDiagnostics diag = Fast::GetPostProcessRuntimeDiagnostics();
312
313 ImGui::TextDisabled("Shader runtime diagnostics");
314 if (diag.active) {
315 ImGui::Text("Active: %s", diag.name.c_str());
316 ImGui::Text("Flavor: %s", diag.flavor.c_str());
317 ImGui::Text("Passes: %zu", diag.passCount);
318 } else if (!diag.lastError.empty()) {
319 ImGui::TextColored(ImVec4(0.95f, 0.45f, 0.35f, 1.0f), "Inactive — last error:");
320 ImGui::TextWrapped("%s", diag.lastError.c_str());
321 } else {
322 ImGui::TextDisabled("No shader loaded.");
323 }
324
325 // Reload button — flips the enabled cvar off then on to force the
326 // interpreter to redo the load (which re-runs all of the
327 // SPDLOG_INFO instrumentation in the load path). Helpful when
328 // tweaking sidecars or replacing files on disk during testing.
329 if (ImGui::Button("Reload active shader")) {
330 const char* currentRaw = CVarGetString("gPostProcessShader", "");
331 const std::string current = currentRaw ? currentRaw : std::string();
332 if (!current.empty()) {
333 CVarSetInteger("gPostProcessEnabled", 0);
334 // The interpreter's transition detection keys on the (name,
335 // enabled) pair, so we re-write both even though the name
336 // is unchanged — that re-arms the load path.
337 CVarSetString("gPostProcessShader", current.c_str());
338 CVarSetInteger("gPostProcessEnabled", 1);
339 }
340 }
341 if (ImGui::IsItemHovered()) {
342 ImGui::SetTooltip(
343 "Force the runtime to re-resolve, re-load, and re-compile the\n"
344 "currently-selected shader. Watch ssb64.log for the matching\n"
345 "Post-process: ... INFO lines. Useful after editing a shader\n"
346 "file on disk or its .lus.json sidecar.");
347 }
348}
349
350#if !defined(__ANDROID__)
351// Shader-pack downloader UI is gated off on Android (the libretro

Callers

nothing calls this directly

Calls 1

ButtonFunction · 0.85

Tested by

no test coverage detected