diff options
| author | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-28 07:47:45 -0400 |
|---|---|---|
| committer | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-28 07:47:45 -0400 |
| commit | 32d876ded1aefc52f839d65570e3e3c43ec04415 (patch) | |
| tree | 9030b5090a857d943b5b0341c499af7184abb192 /src/video_core/macro.cpp | |
| parent | 598bb7750c71ea1378724ddfe9418f27330fa279 (diff) | |
nx2: read debug switches once; key scripts from a file
Several debug switches were read with std::getenv on every macro call, QMD,
semaphore write or draw. The UCRT getenv locks and scans the environment,
thousands of times a frame; a long EDEN_NX2_KEY_SCRIPT made title 4 crawl
at 2 fps. Each is now read once. EDEN_NX2_KEY_SCRIPT=@<file> reads the
script from a file. gdbrsp.py gains 'hits' (log registers, frame chain and
object words at breakpoints, following the stopped thread).
Diffstat (limited to 'src/video_core/macro.cpp')
| -rw-r--r-- | src/video_core/macro.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/video_core/macro.cpp b/src/video_core/macro.cpp index 06c649260d..e6279deab4 100644 --- a/src/video_core/macro.cpp +++ b/src/video_core/macro.cpp @@ -1346,7 +1346,8 @@ void MacroEngine::Execute(Core::System& system, Engines::Maxwell3D& maxwell3d, u maxwell3d.RefreshParameters(); const auto context = reinterpret_cast<std::uintptr_t>(this); static std::unordered_set<std::uintptr_t> captured_contexts; - if (std::getenv("EDEN_NATIVE_FRAME_CAPTURE") && captured_contexts.insert(context).second) { + static const bool capture = std::getenv("EDEN_NATIVE_FRAME_CAPTURE") != nullptr; + if (capture && captured_contexts.insert(context).second) { std::ofstream dump("native-graphics-mme-" + std::to_string(context) + ".bin", std::ios::binary); dump.write(reinterpret_cast<const char*>(native_code.data()), sizeof(native_code)); } @@ -1393,7 +1394,8 @@ void MacroEngine::Execute(Core::System& system, Engines::Maxwell3D& maxwell3d, u }); if (!result.success) { native_execution_failed = true; - if (std::getenv("EDEN_NATIVE_DRAW_DIAGNOSTICS")) { + if (static const bool diagnostics = std::getenv("EDEN_NATIVE_DRAW_DIAGNOSTICS") != nullptr; + diagnostics) { std::ofstream dump("native-mme-" + std::to_string(method) + ".bin", std::ios::binary); dump.write(reinterpret_cast<const char*>(native_code.data()), sizeof(native_code)); } |
