Skip to content

Commit

Permalink
Merge pull request #1066 from CesiumGS/no-priority-inversion
Browse files Browse the repository at this point in the history
Update use of cesium-native after the no-priority-inversion changes
  • Loading branch information
joseph-kaile authored Mar 22, 2023
2 parents e0acf84 + a7579a8 commit 69f7077
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
27 changes: 13 additions & 14 deletions Source/CesiumRuntime/Private/Cesium3DTileset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ ACesium3DTileset::ACesium3DTileset()
_pTileset(nullptr),

_lastTilesRendered(0),
_lastTilesLoadingLowPriority(0),
_lastTilesLoadingMediumPriority(0),
_lastTilesLoadingHighPriority(0),
_lastWorkerThreadTileLoadQueueLength(0),
_lastMainThreadTileLoadQueueLength(0),

_lastTilesVisited(0),
_lastTilesCulled(0),
Expand Down Expand Up @@ -1731,10 +1730,10 @@ void ACesium3DTileset::updateLastViewUpdateResultState(
}

if (result.tilesToRenderThisFrame.size() != this->_lastTilesRendered ||
result.tilesLoadingLowPriority != this->_lastTilesLoadingLowPriority ||
result.tilesLoadingMediumPriority !=
this->_lastTilesLoadingMediumPriority ||
result.tilesLoadingHighPriority != this->_lastTilesLoadingHighPriority ||
result.workerThreadTileLoadQueueLength !=
this->_lastWorkerThreadTileLoadQueueLength ||
result.mainThreadTileLoadQueueLength !=
this->_lastMainThreadTileLoadQueueLength ||
result.tilesVisited != this->_lastTilesVisited ||
result.culledTilesVisited != this->_lastCulledTilesVisited ||
result.tilesCulled != this->_lastTilesCulled ||
Expand All @@ -1744,9 +1743,10 @@ void ACesium3DTileset::updateLastViewUpdateResultState(
result.maxDepthVisited != this->_lastMaxDepthVisited) {

this->_lastTilesRendered = result.tilesToRenderThisFrame.size();
this->_lastTilesLoadingLowPriority = result.tilesLoadingLowPriority;
this->_lastTilesLoadingMediumPriority = result.tilesLoadingMediumPriority;
this->_lastTilesLoadingHighPriority = result.tilesLoadingHighPriority;
this->_lastWorkerThreadTileLoadQueueLength =
result.workerThreadTileLoadQueueLength;
this->_lastMainThreadTileLoadQueueLength =
result.mainThreadTileLoadQueueLength;

this->_lastTilesVisited = result.tilesVisited;
this->_lastCulledTilesVisited = result.culledTilesVisited;
Expand All @@ -1760,7 +1760,7 @@ void ACesium3DTileset::updateLastViewUpdateResultState(
LogCesium,
Display,
TEXT(
"%s: %d ms, Visited %d, Culled Visited %d, Rendered %d, Culled %d, Occluded %d, Waiting For Occlusion Results %d, Max Depth Visited: %d, Loading-Low %d, Loading-Medium %d, Loading-High %d, Loaded tiles %g%%"),
"%s: %d ms, Visited %d, Culled Visited %d, Rendered %d, Culled %d, Occluded %d, Waiting For Occlusion Results %d, Max Depth Visited: %d, Loading-Worker %d, Loading-Main %d, Loaded tiles %g%%"),
*this->GetName(),
(std::chrono::high_resolution_clock::now() - this->_startTime).count() /
1000000,
Expand All @@ -1771,9 +1771,8 @@ void ACesium3DTileset::updateLastViewUpdateResultState(
result.tilesOccluded,
result.tilesWaitingForOcclusionResults,
result.maxDepthVisited,
result.tilesLoadingLowPriority,
result.tilesLoadingMediumPriority,
result.tilesLoadingHighPriority,
result.workerThreadTileLoadQueueLength,
result.mainThreadTileLoadQueueLength,
this->LoadProgress);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/CesiumRuntime/Private/CesiumGltfComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void destroyHalfLoadedTexture(
}
class HalfConstructedReal : public UCesiumGltfComponent::HalfConstructed {
public:
LoadModelResult loadModelResult;
LoadModelResult loadModelResult{};

virtual ~HalfConstructedReal() {
// TODO: deal with metadata case, when metadata uses async texture creation
Expand Down
14 changes: 7 additions & 7 deletions Source/CesiumRuntime/Private/CesiumGltfComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,20 @@ class UCesiumGltfComponent : public USceneComponent {
virtual ~UCesiumGltfComponent();

UPROPERTY(EditAnywhere, Category = "Cesium")
UMaterialInterface* BaseMaterial;
UMaterialInterface* BaseMaterial = nullptr;

UPROPERTY(EditAnywhere, Category = "Cesium")
UMaterialInterface* BaseMaterialWithTranslucency;
UMaterialInterface* BaseMaterialWithTranslucency = nullptr;

UPROPERTY(EditAnywhere, Category = "Cesium")
UMaterialInterface* BaseMaterialWithWater;
UMaterialInterface* BaseMaterialWithWater = nullptr;

UPROPERTY(EditAnywhere, Category = "Rendering")
FCustomDepthParameters CustomDepthParameters;
FCustomDepthParameters CustomDepthParameters{};

FCesiumMetadataModel Metadata;
FCesiumMetadataModel Metadata{};

CesiumEncodedMetadataUtility::EncodedMetadata EncodedMetadata;
CesiumEncodedMetadataUtility::EncodedMetadata EncodedMetadata{};

void UpdateTransformFromCesium(const glm::dmat4& CesiumToUnrealTransform);

Expand All @@ -121,5 +121,5 @@ class UCesiumGltfComponent : public USceneComponent {

private:
UPROPERTY()
UTexture2D* Transparent1x1;
UTexture2D* Transparent1x1 = nullptr;
};
5 changes: 2 additions & 3 deletions Source/CesiumRuntime/Public/Cesium3DTileset.h
Original file line number Diff line number Diff line change
Expand Up @@ -1075,9 +1075,8 @@ class CESIUMRUNTIME_API ACesium3DTileset : public AActor {

// For debug output
uint32_t _lastTilesRendered;
uint32_t _lastTilesLoadingLowPriority;
uint32_t _lastTilesLoadingMediumPriority;
uint32_t _lastTilesLoadingHighPriority;
uint32_t _lastWorkerThreadTileLoadQueueLength;
uint32_t _lastMainThreadTileLoadQueueLength;
bool _activeLoading;

uint32_t _lastTilesVisited;
Expand Down

0 comments on commit 69f7077

Please sign in to comment.