From 7dd78e2c0aae3f88c7eab353e64a4f0f6ec4a830 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 25 Feb 2026 02:47:37 -0800 Subject: [PATCH] Fix missing water by finalizing each tile completely per frame Phase-splitting across frames caused water surfaces to not render correctly. Changed processReadyTiles to run all phases for each tile before moving to the next, with time budget checked between tiles. --- src/rendering/terrain_manager.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/rendering/terrain_manager.cpp b/src/rendering/terrain_manager.cpp index 824dbbba..be2e36f0 100644 --- a/src/rendering/terrain_manager.cpp +++ b/src/rendering/terrain_manager.cpp @@ -981,14 +981,13 @@ void TerrainManager::processReadyTiles() { } } - // Drive incremental finalization within time budget + // Finalize one complete tile per iteration, check budget between tiles. + // Each tile runs through all phases before moving to the next — this + // avoids subtle state issues from spreading GPU uploads across frames. while (!finalizingTiles_.empty()) { auto& ft = finalizingTiles_.front(); - bool done = advanceFinalization(ft); - - if (done) { - finalizingTiles_.pop_front(); - } + while (!advanceFinalization(ft)) {} + finalizingTiles_.pop_front(); auto now = std::chrono::high_resolution_clock::now(); float elapsedMs = std::chrono::duration(now - startTime).count();