Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweaks to performance testing framework. #1200

Merged
merged 23 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bbd61c0
Tweaks to performance testing framework.
kring Aug 31, 2023
7614bb3
Add logic to start / end play session
csciguy8 Aug 31, 2023
4dd0060
Unfreeze updates when test ends, so we can see something
csciguy8 Aug 31, 2023
b9f594f
Update ion token for test (sync with default in samples project)
csciguy8 Sep 1, 2023
9c9ef24
Refactor scene setup code into separate files
csciguy8 Sep 1, 2023
b642e17
Add missing control path
csciguy8 Sep 5, 2023
291ac14
Rework tick logic to use latent commands
csciguy8 Sep 5, 2023
2fff0b4
Let tests define separable passes for setup / verification
csciguy8 Sep 5, 2023
9942bab
Remove extraneous include
csciguy8 Sep 5, 2023
7562b49
Add missing ifdef to fix non-Windows50 builds
csciguy8 Sep 5, 2023
98397dd
Merge branch 'simple-performance-test' into performance-test-tweaks
csciguy8 Sep 8, 2023
d92e84f
Fix non-unity build (broke this again, oops)
csciguy8 Sep 11, 2023
61feff1
Add cold / warm cache tests + test names to logging marks
csciguy8 Sep 11, 2023
a6a353b
Add runtime access to cache database. Let load tests reset cache for …
csciguy8 Sep 11, 2023
b1f22d8
Move clear db cache step to initial test setup
csciguy8 Sep 11, 2023
7a8b725
Fix formatting
csciguy8 Sep 12, 2023
e73fee9
Add trace events before calling updateView, updateViewOffline
csciguy8 Sep 18, 2023
fb130b1
Add wait before exiting play mode
csciguy8 Sep 18, 2023
4366558
Merge branch 'simple-performance-test' into performance-test-tweaks
csciguy8 Sep 19, 2023
7c93ae0
Update to renamed georeference functions
csciguy8 Sep 19, 2023
a3fd233
Update test to Cesium.Unit.X namespace
csciguy8 Sep 19, 2023
748e19a
Disable world bounds checks for test world
csciguy8 Sep 21, 2023
741e9a0
Merge branch 'simple-performance-test' into performance-test-tweaks
csciguy8 Sep 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions Source/CesiumRuntime/Private/Cesium3DTileset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,12 @@ void ACesium3DTileset::UpdateLoadStatus() {

this->LoadProgress = this->_pTileset->computeLoadProgress();

// If we have tiles to hide next frame, we haven't completely finished loading
// yet. We need to tick once more
if (!this->_tilesToHideNextFrame.empty()) {
this->LoadProgress = glm::min(this->LoadProgress, 99.9999f);
}
Comment on lines +888 to +890
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because tile hides are always delayed by one frame, it was possible before for the performance test to end (and suspend further updates) with tiles of multiple LODs visible simultaneously. This change makes it so that loading isn't 100% complete until these tiles have been hidden.


if (this->LoadProgress < 100 ||
this->_lastTilesWaitingForOcclusionResults > 0) {
this->_activeLoading = true;
Expand Down Expand Up @@ -2028,12 +2034,15 @@ void ACesium3DTileset::Tick(float DeltaTime) {
CreateViewStateFromViewParameters(camera, unrealWorldToCesiumTileset));
}

const Cesium3DTilesSelection::ViewUpdateResult& result =
this->_captureMovieMode
? this->_pTileset->updateViewOffline(frustums)
: this->_pTileset->updateView(frustums, DeltaTime);
Cesium3DTilesSelection::ViewUpdateResult result;
if (this->_captureMovieMode) {
TRACE_CPUPROFILER_EVENT_SCOPE(Cesium::updateViewOffline)
result = this->_pTileset->updateViewOffline(frustums);
} else {
TRACE_CPUPROFILER_EVENT_SCOPE(Cesium::updateView)
result = this->_pTileset->updateView(frustums, DeltaTime);
}
updateLastViewUpdateResultState(result);
this->UpdateLoadStatus();

removeCollisionForTiles(result.tilesFadingOut);

Expand Down Expand Up @@ -2066,6 +2075,8 @@ void ACesium3DTileset::Tick(float DeltaTime) {
updateTileFade(pTile, false);
}
}

this->UpdateLoadStatus();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be moved later, after _tilesToHideNextFrame has been set.

}

void ACesium3DTileset::EndPlay(const EEndPlayReason::Type EndPlayReason) {
Expand Down
20 changes: 14 additions & 6 deletions Source/CesiumRuntime/Private/CesiumRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,28 @@ std::string getCacheDatabaseName() {

} // namespace

std::shared_ptr<CesiumAsync::ICacheDatabase>& getCacheDatabase() {
static int MaxCacheItems =
GetDefault<UCesiumRuntimeSettings>()->MaxCacheItems;

static std::shared_ptr<CesiumAsync::ICacheDatabase> pCacheDatabase =
std::make_shared<CesiumAsync::SqliteCache>(
spdlog::default_logger(),
getCacheDatabaseName(),
MaxCacheItems);

return pCacheDatabase;
}

const std::shared_ptr<CesiumAsync::IAssetAccessor>& getAssetAccessor() {
static int RequestsPerCachePrune =
GetDefault<UCesiumRuntimeSettings>()->RequestsPerCachePrune;
static int MaxCacheItems =
GetDefault<UCesiumRuntimeSettings>()->MaxCacheItems;
static std::shared_ptr<CesiumAsync::IAssetAccessor> pAssetAccessor =
std::make_shared<CesiumAsync::GunzipAssetAccessor>(
std::make_shared<CesiumAsync::CachingAssetAccessor>(
spdlog::default_logger(),
std::make_shared<UnrealAssetAccessor>(),
std::make_shared<CesiumAsync::SqliteCache>(
spdlog::default_logger(),
getCacheDatabaseName(),
MaxCacheItems),
getCacheDatabase(),
RequestsPerCachePrune));
return pAssetAccessor;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using namespace CesiumUtility;

BEGIN_DEFINE_SPEC(
FCesiumGeoreferenceSpec,
"Cesium.Georeference",
"Cesium.Unit.Georeference",
EAutomationTestFlags::ApplicationContextMask |
EAutomationTestFlags::ProductFilter)

Expand Down
Loading