From ed1618fa673250b6bc9aa685e4e924f676d16ff3 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 15 Aug 2025 15:58:06 +1000 Subject: [PATCH 1/3] Don't get stuck in an endless loop if there are no frustums. --- Cesium3DTilesSelection/src/Tileset.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Cesium3DTilesSelection/src/Tileset.cpp b/Cesium3DTilesSelection/src/Tileset.cpp index 11360ba77..da06e19b4 100644 --- a/Cesium3DTilesSelection/src/Tileset.cpp +++ b/Cesium3DTilesSelection/src/Tileset.cpp @@ -334,6 +334,12 @@ const ViewUpdateResult& Tileset::updateViewGroupOffline( while (viewGroup.getPreviousLoadProgressPercentage() < 100.0f) { this->_externals.pAssetAccessor->tick(); this->loadTiles(); + + // If there are no frustums, we'll never make any progress. So break here to + // avoid getting stuck in an endless loop. + if (frustums.empty()) + break; + this->updateViewGroup(viewGroup, frustums, 0.0f); } From ccf0d99b99766fe3c08bb9ea958e315f356a075c Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 15 Aug 2025 16:22:43 +1000 Subject: [PATCH 2/3] Add test case and update CHANGES.md. --- CHANGES.md | 6 ++++++ .../test/TestTilesetSelectionAlgorithm.cpp | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 9226c7f63..f9d2de24b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # Change Log +### ? - ? + +##### Fixes :wrench: + +- Fixed a bug in `Tileset::updateViewGroupOffline` that would cause it to get stuck in an endless loop if invoked with no frustums. + ### v0.50.0 - 2025-08-01 ##### Breaking Changes :mega: diff --git a/Cesium3DTilesSelection/test/TestTilesetSelectionAlgorithm.cpp b/Cesium3DTilesSelection/test/TestTilesetSelectionAlgorithm.cpp index 12dd6e306..2c9b0fdff 100644 --- a/Cesium3DTilesSelection/test/TestTilesetSelectionAlgorithm.cpp +++ b/Cesium3DTilesSelection/test/TestTilesetSelectionAlgorithm.cpp @@ -550,6 +550,13 @@ TEST_CASE("Test replace refinement for render") { REQUIRE(result.culledTilesVisited == 0); } } + + SUBCASE( + "updateViewGroupOffline does not get stuck in an endless loop when no " + "frustums are given") { + std::vector empty; + tileset.updateViewGroupOffline(tileset.getDefaultViewGroup(), empty); + } } TEST_CASE("Test additive refinement") { From 2afa25b81d3597271553a3650418817d9481f717 Mon Sep 17 00:00:00 2001 From: Janine Liu <32226860+j9liu@users.noreply.github.com> Date: Mon, 18 Aug 2025 10:22:07 -0400 Subject: [PATCH 3/3] Update CHANGES.md --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index f9d2de24b..d8aa1d449 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ ##### Fixes :wrench: -- Fixed a bug in `Tileset::updateViewGroupOffline` that would cause it to get stuck in an endless loop if invoked with no frustums. +- Fixed a bug in `Tileset::updateViewGroupOffline` that would cause it to get stuck in an endless loop when invoked with no frustums. ### v0.50.0 - 2025-08-01