From 11e26c909d4381147f572a2837fc1944b0ffcd86 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 13 Aug 2026 09:15:17 +0200 Subject: [PATCH] diag #387: permanent evidence lines on the resize chain (event, swapchain recreate, resolution apply) Three rare-event log lines so any future resize report is diagnosable from the launch log alone: 'window: framebuffer resize event WxH', 'vulkan: swapchain recreated WxH ok=', and 'display: resolution pick WxH (window was WxH)'. An instrumented live run on the Windows AMD box shows the full chain firing for both the programmatic resolution apply and external window resizes, and screen captures at 784x561 vs 1584x861 confirm fixed-pixel UI with a true pixel-count re-render. Co-Authored-By: Claude Fable 5 --- src/AcDream.App/Rendering/GameWindow.cs | 7 ++++++- src/AcDream.App/Rendering/Gpu/Vk/VulkanGraphicsContext.cs | 7 ++++++- src/AcDream.App/Settings/RuntimeSettingsTargets.cs | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index 5baab269..d55788e3 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -1625,7 +1625,12 @@ public sealed class GameWindow : /// previously off the new viewport snap back to default positions. /// private void OnFramebufferResize(Silk.NET.Maths.Vector2D newSize) - => _framebufferResize.Resize(newSize); + { + // #387 evidence line (permanent — resize events are rare and this is + // the only trace of whether the native event fired at all). + Console.WriteLine($"window: framebuffer resize event {newSize.X}x{newSize.Y}"); + _framebufferResize.Resize(newSize); + } private void OnClosing() => CompleteShutdown(releaseNativeWindow: false); diff --git a/src/AcDream.App/Rendering/Gpu/Vk/VulkanGraphicsContext.cs b/src/AcDream.App/Rendering/Gpu/Vk/VulkanGraphicsContext.cs index 0441ada8..cedef45b 100644 --- a/src/AcDream.App/Rendering/Gpu/Vk/VulkanGraphicsContext.cs +++ b/src/AcDream.App/Rendering/Gpu/Vk/VulkanGraphicsContext.cs @@ -409,12 +409,17 @@ internal sealed unsafe class VulkanGraphicsContext : IDisposable if (VulkanSwapchainRecreationPolicy.OnFramebufferSize(width, height) == VulkanSwapchainAction.Idle) { + // No log here: while minimised this runs at frame rate. return false; } VulkanInterop.Check(_vk!.DeviceWaitIdle(_device), "vkDeviceWaitIdle (recreate)"); _recreateAtFrameBoundary = false; - return _swapchain!.Recreate(_pacing, width, height); + bool recreated = _swapchain!.Recreate(_pacing, width, height); + // #387 evidence line (permanent): the ONLY trace of the swapchain + // extent actually changing after startup. + _log($"vulkan: swapchain recreated {width}x{height} ok={recreated}"); + return recreated; } /// diff --git a/src/AcDream.App/Settings/RuntimeSettingsTargets.cs b/src/AcDream.App/Settings/RuntimeSettingsTargets.cs index 91fc945b..e1729a07 100644 --- a/src/AcDream.App/Settings/RuntimeSettingsTargets.cs +++ b/src/AcDream.App/Settings/RuntimeSettingsTargets.cs @@ -60,6 +60,10 @@ internal sealed class SilkRuntimeDisplayWindowTarget : IRuntimeDisplayWindowTarg TryParseResolution(display.Resolution, out int width, out int height); if (haveResolution && (_window.Size.X != width || _window.Size.Y != height)) { + // #387 evidence line (permanent): the resolution-pick write path. + Console.WriteLine( + $"display: resolution pick {width}x{height} " + + $"(window was {_window.Size.X}x{_window.Size.Y})"); _window.Size = new Vector2D(width, height); }