diff --git a/src/AcDream.App/Rendering/Wb/WbMeshAdapter.cs b/src/AcDream.App/Rendering/Wb/WbMeshAdapter.cs index 23b2d68..0d8dee8 100644 --- a/src/AcDream.App/Rendering/Wb/WbMeshAdapter.cs +++ b/src/AcDream.App/Rendering/Wb/WbMeshAdapter.cs @@ -1,5 +1,7 @@ using System; using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; using AcDream.Core.Meshing; using AcDream.Core.Rendering; using Chorizite.OpenGLSDLBackend; @@ -143,13 +145,39 @@ public sealed class WbMeshAdapter : IDisposable, IWbMeshAdapter // isSetup: false — acdream's MeshRefs already carry expanded // per-part GfxObj ids (0x01XXXXXX). WB's Setup-expansion path is // unused. - _ = _meshManager.PrepareMeshDataAsync(id, isSetup: false); + var prepTask = _meshManager.PrepareMeshDataAsync(id, isSetup: false); // [indoor-upload] requested probe — only for EnvCell ids. if (RenderingDiagnostics.IsEnvCellId(id) && RenderingDiagnostics.ProbeIndoorUploadEnabled) { _pendingEnvCellRequests.Add(id); Console.WriteLine($"[indoor-upload] requested cellId=0x{id:X8}"); + + // Phase 2 — surface what WB's catch block silently swallows. + // ObjectMeshManager.PrepareMeshData has a try/catch at line 589 + // that calls _logger.LogError(ex, ...) — but we construct + // ObjectMeshManager with NullLogger.Instance so the log is + // dropped. This continuation captures the same data scoped to + // EnvCell ids only. Runs on ThreadPool; non-blocking. Zero cost + // when the probe is off. + ulong cellId = id; + _ = prepTask.ContinueWith(t => + { + if (t.IsFaulted && t.Exception is not null) + { + var ex = t.Exception.InnerException ?? t.Exception; + var stack = (ex.StackTrace ?? "").Split('\n') + .Take(3).Select(s => s.Trim()).Where(s => s.Length > 0); + Console.WriteLine( + $"[indoor-upload] FAILED cellId=0x{cellId:X8} " + + $"exception={ex.GetType().Name}: {ex.Message} " + + $"stack=[{string.Join(" | ", stack)}]"); + } + else if (t.IsCompletedSuccessfully && t.Result is null) + { + Console.WriteLine($"[indoor-upload] NULL_RESULT cellId=0x{cellId:X8}"); + } + }, TaskScheduler.Default); } } }