feat: Add Known Issues and Next Steps for G3 Renderer Migration
- Documented known issues specific to macOS, including crashes during window resizing and occasional loading indicators during texture processing. - Outlined high, medium, and low priority stability improvements for future sessions, focusing on texture processing, event handling, and resource management. - Updated the document version and added testing recommendations to ensure thorough validation before the next major change.
This commit is contained in:
@@ -114,3 +114,4 @@ void Controller::OnExit() {
|
||||
|
||||
} // namespace core
|
||||
} // namespace yaze
|
||||
|
||||
|
||||
@@ -51,6 +51,9 @@ void ImGuiAssertionHandler(const char* expr, const char* file, int line,
|
||||
namespace yaze {
|
||||
namespace core {
|
||||
|
||||
// Global flag for window resize state (used by emulator to pause)
|
||||
bool g_window_is_resizing = false;
|
||||
|
||||
absl::Status CreateWindow(Window& window, gfx::IRenderer* renderer, int flags) {
|
||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) != 0) {
|
||||
return absl::InternalError(
|
||||
@@ -200,14 +203,18 @@ absl::Status HandleEvents(Window& window) {
|
||||
// Update display size for both resize and size_changed events
|
||||
io.DisplaySize.x = static_cast<float>(event.window.data1);
|
||||
io.DisplaySize.y = static_cast<float>(event.window.data2);
|
||||
g_window_is_resizing = true;
|
||||
break;
|
||||
case SDL_WINDOWEVENT_MINIMIZED:
|
||||
case SDL_WINDOWEVENT_HIDDEN:
|
||||
// Window is minimized/hidden - nothing to render
|
||||
// Window is minimized/hidden
|
||||
g_window_is_resizing = false;
|
||||
break;
|
||||
case SDL_WINDOWEVENT_RESTORED:
|
||||
case SDL_WINDOWEVENT_SHOWN:
|
||||
// Window is restored - resume normal operation
|
||||
case SDL_WINDOWEVENT_EXPOSED:
|
||||
// Window is restored - clear resize flag
|
||||
g_window_is_resizing = false;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
#include <vector>
|
||||
|
||||
#include "app/core/window.h"
|
||||
|
||||
namespace yaze::core {
|
||||
extern bool g_window_is_resizing;
|
||||
}
|
||||
|
||||
#include "app/emu/cpu/internal/opcodes.h"
|
||||
#include "app/emu/debug/disassembly_viewer.h"
|
||||
#include "app/gui/color.h"
|
||||
@@ -125,16 +130,27 @@ void Emulator::Run(Rom* rom) {
|
||||
|
||||
RenderNavBar();
|
||||
|
||||
// Auto-pause emulator when window loses focus to save CPU/battery
|
||||
static bool was_running_before_focus_loss = false;
|
||||
// Auto-pause emulator during window operations to prevent macOS crashes
|
||||
static bool was_running_before_pause = false;
|
||||
bool window_has_focus = ImGui::IsWindowFocused(ImGuiFocusedFlags_RootWindow);
|
||||
|
||||
if (!window_has_focus && running_) {
|
||||
was_running_before_focus_loss = true;
|
||||
// Check if window is being resized (set in HandleEvents)
|
||||
if (yaze::core::g_window_is_resizing && running_) {
|
||||
was_running_before_pause = true;
|
||||
running_ = false;
|
||||
} else if (window_has_focus && !running_ && was_running_before_focus_loss) {
|
||||
} else if (!yaze::core::g_window_is_resizing && !running_ && was_running_before_pause) {
|
||||
// Auto-resume after resize completes
|
||||
running_ = true;
|
||||
was_running_before_pause = false;
|
||||
}
|
||||
|
||||
// Also pause when window loses focus to save CPU/battery
|
||||
if (!window_has_focus && running_ && !was_running_before_pause) {
|
||||
was_running_before_pause = true;
|
||||
running_ = false;
|
||||
} else if (window_has_focus && !running_ && was_running_before_pause && !yaze::core::g_window_is_resizing) {
|
||||
// Don't auto-resume - let user manually resume
|
||||
was_running_before_focus_loss = false;
|
||||
was_running_before_pause = false;
|
||||
}
|
||||
|
||||
if (running_) {
|
||||
|
||||
Reference in New Issue
Block a user