Skip to content

Commit

Permalink
Log asset stats
Browse files Browse the repository at this point in the history
  • Loading branch information
azrogers committed Sep 18, 2024
1 parent b0f37ec commit 6b43702
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
13 changes: 12 additions & 1 deletion Source/CesiumRuntime/Private/Cesium3DTileset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ class UnrealResourcePreparer
TUniquePtr<CreateGltfOptions::CreateModelOptions> options =
MakeUnique<CreateGltfOptions::CreateModelOptions>(
std::move(tileLoadResult));
if (!options->getModel()) {
if (!options->pModel) {
return asyncSystem.createResolvedFuture(
Cesium3DTilesSelection::TileLoadResultAndRenderResources{
std::move(options->tileLoadResult),
Expand Down Expand Up @@ -1901,6 +1901,17 @@ void ACesium3DTileset::updateLastViewUpdateResultState(
}
}

if (this->LogAssetStats && this->_pTileset) {
const CesiumGltf::SingleAssetDepot<CesiumGltf::ImageCesium>* imageDepot =
this->_pTileset->getSharedAssetDepot().getImageDepot();
UE_LOG(
LogCesium,
Display,
TEXT("Images depot: %d distinct assets, %d total usages"),
imageDepot->getDistinctCount(),
imageDepot->getUsageCount());
}

if (!this->LogSelectionStats) {
return;
}
Expand Down
7 changes: 7 additions & 0 deletions Source/CesiumRuntime/Public/Cesium3DTileset.h
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,13 @@ class CESIUMRUNTIME_API ACesium3DTileset : public AActor {
UPROPERTY(EditAnywhere, Category = "Cesium|Debug")
bool LogSelectionStats = false;

/**
* If true, logs stats on the assets in this tileset's asset depot to the
* Output Log.
*/
UPROPERTY(EditAnywhere, Category = "Cesium|Debug")
bool LogAssetStats = false;

/**
* If true, draws debug text above each tile being rendered with information
* about that tile.
Expand Down

0 comments on commit 6b43702

Please sign in to comment.