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

Update cesium-unreal for shared asset changes #1536

Merged
merged 5 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions Source/CesiumRuntime/Private/Cesium3DTileset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "Cesium3DTilesSelection/Tile.h"
#include "Cesium3DTilesSelection/TilesetLoadFailureDetails.h"
#include "Cesium3DTilesSelection/TilesetOptions.h"
#include "Cesium3DTilesSelection/TilesetSharedAssetSystem.h"
#include "Cesium3DTilesetLoadFailureDetails.h"
#include "Cesium3DTilesetRoot.h"
#include "CesiumActors.h"
Expand Down Expand Up @@ -2045,17 +2046,16 @@ void ACesium3DTileset::updateLastViewUpdateResultState(
}

if (this->LogAssetStats && this->_pTileset) {
const CesiumAsync::SharedAssetDepot<CesiumGltf::ImageAsset>& imageDepot =
*this->_pTileset->getSharedAssetSystem().pImage;
const Cesium3DTilesSelection::TilesetSharedAssetSystem::ImageDepot&
imageDepot = *this->_pTileset->getSharedAssetSystem().pImage;
UE_LOG(
LogCesium,
Display,
TEXT(
"Images depot: %d distinct assets, %d total usages, %d assets pending deletion, %d total size in bytes"),
imageDepot.getDistinctCount(),
imageDepot.getUsageCount(),
imageDepot.getDeletionCandidateCount(),
imageDepot.getDeletionCandidateTotalSizeBytes());
"Images shared asset depot: %d distinct assets, %d inactive assets pending deletion (%d bytes)"),
imageDepot.getAssetCount(),
imageDepot.getInactiveAssetCount(),
imageDepot.getInactiveAssetTotalSizeBytes());
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions Source/CesiumRuntime/Private/CesiumTextureResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ void FCesiumTextureResourceDeleter::operator()(FCesiumTextureResource* p) {

FTexture2DRHIRef textureReference =
CreateRHITexture2D_Async(imageCesium, *maybePixelFormat, sRGB);
textureReference->SetName(
FName(UTF8_TO_TCHAR(imageCesium.getUniqueAssetId().c_str())));
// textureReference->SetName(
// FName(UTF8_TO_TCHAR(imageCesium.getUniqueAssetId().c_str())));
auto pResult = TUniquePtr<
FCesiumUseExistingTextureResource,
FCesiumTextureResourceDeleter>(new FCesiumUseExistingTextureResource(
Expand Down Expand Up @@ -670,9 +670,9 @@ FTextureRHIRef FCesiumCreateNewTextureResource::InitializeTextureRHI() {
// Use the asset ID as the name of the texture so it will be visible in the
// Render Resource Viewer.
FString debugName = TEXT("CesiumTextureUtility");
if (!this->_image.getUniqueAssetId().empty()) {
debugName = UTF8_TO_TCHAR(this->_image.getUniqueAssetId().c_str());
}
// if (!this->_image.getUniqueAssetId().empty()) {
// debugName = UTF8_TO_TCHAR(this->_image.getUniqueAssetId().c_str());
// }

FRHIResourceCreateInfo createInfo{*debugName};
createInfo.BulkData = nullptr;
Expand Down
5 changes: 3 additions & 2 deletions Source/CesiumRuntime/Private/Tests/Cesium3DTileset.spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "Misc/AutomationTest.h"
#include "Tests/AutomationCommon.h"
#include "Tests/AutomationTestSettings.h"
#include <Cesium3DTilesSelection/TilesetSharedAssetSystem.h>
#include <CesiumAsync/ICacheDatabase.h>

#define TEST_SCREEN_WIDTH 1280
Expand Down Expand Up @@ -72,9 +73,9 @@ static void setupForSharedImages(SceneGenerationContext& context) {
void tilesetPass(
SceneGenerationContext& context,
TestPass::TestingParameter parameter) {
CesiumGltfReader::GltfSharedAssetSystem& assetSystem =
Cesium3DTilesSelection::TilesetSharedAssetSystem& assetSystem =
context.tilesets[0]->GetTileset()->getSharedAssetSystem();
assert(assetDepot.getImagesCount() == 2);
check(assetSystem.pImage->getAssetCount() == 2);
}

bool FCesium3DTilesetSharedImages::RunTest(const FString& Parameters) {
Expand Down
2 changes: 1 addition & 1 deletion extern/cesium-native
Submodule cesium-native updated 50 files
+11 −0 CHANGES.md
+4 −3 Cesium3DTilesSelection/include/Cesium3DTilesSelection/Tileset.h
+18 −0 Cesium3DTilesSelection/include/Cesium3DTilesSelection/TilesetSharedAssetSystem.h
+3 −3 Cesium3DTilesSelection/src/TileContentLoadInfo.cpp
+4 −5 Cesium3DTilesSelection/src/TileContentLoadInfo.h
+2 −4 Cesium3DTilesSelection/src/Tileset.cpp
+6 −6 Cesium3DTilesSelection/src/TilesetContentManager.cpp
+4 −4 Cesium3DTilesSelection/src/TilesetContentManager.h
+2 −3 Cesium3DTilesSelection/src/TilesetJsonLoader.h
+34 −0 Cesium3DTilesSelection/src/TilesetSharedAssetSystem.cpp
+18 −1 Cesium3DTilesSelection/test/TestTilesetContentManager.cpp
+2 −1 CesiumAsync/include/CesiumAsync/IAssetAccessor.h
+43 −0 CesiumAsync/include/CesiumAsync/IDepotOwningAsset.h
+67 −0 CesiumAsync/include/CesiumAsync/NetworkAssetDescriptor.h
+52 −56 CesiumAsync/include/CesiumAsync/SharedAsset.h
+349 −179 CesiumAsync/include/CesiumAsync/SharedAssetDepot.h
+1 −1 CesiumAsync/src/GunzipAssetAccessor.cpp
+72 −0 CesiumAsync/src/NetworkAssetDescriptor.cpp
+1 −0 CesiumAsync/test/MockAssetAccessor.h
+125 −0 CesiumAsync/test/TestSharedAssetDepot.cpp
+1 −5 CesiumGeometry/include/CesiumGeometry/QuadtreeTileID.h
+12 −0 CesiumGeometry/include/CesiumGeometry/Transforms.h
+15 −0 CesiumGeometry/src/QuadtreeTileID.cpp
+41 −0 CesiumGeometry/src/Transforms.cpp
+73 −18 CesiumGeometry/test/TestTransforms.cpp
+1 −2 CesiumGltf/include/CesiumGltf/Image.h
+1 −1 CesiumGltfReader/include/CesiumGltfReader/GltfReader.h
+10 −8 CesiumGltfReader/include/CesiumGltfReader/GltfSharedAssetSystem.h
+57 −0 CesiumGltfReader/include/CesiumGltfReader/NetworkImageAssetDescriptor.h
+80 −81 CesiumGltfReader/src/GltfReader.cpp
+13 −3 CesiumGltfReader/src/GltfSharedAssetSystem.cpp
+74 −0 CesiumGltfReader/src/NetworkImageAssetDescriptor.cpp
+1 −0 CesiumNativeTests/include/CesiumNativeTests/SimpleAssetAccessor.h
+1 −0 CesiumNativeTests/src/FileAccessor.cpp
+1 −0 CesiumRasterOverlays/include/CesiumRasterOverlays/RasterOverlay.h
+1 −0 CesiumUtility/CMakeLists.txt
+29 −5 CesiumUtility/include/CesiumUtility/DoublyLinkedList.h
+16 −0 CesiumUtility/include/CesiumUtility/ErrorList.h
+0 −14 CesiumUtility/include/CesiumUtility/Gunzip.h
+45 −0 CesiumUtility/include/CesiumUtility/Gzip.h
+11 −0 CesiumUtility/include/CesiumUtility/Hash.h
+86 −0 CesiumUtility/include/CesiumUtility/Result.h
+8 −0 CesiumUtility/src/ErrorList.cpp
+0 −51 CesiumUtility/src/Gunzip.cpp
+103 −0 CesiumUtility/src/Gzip.cpp
+79 −0 CesiumUtility/src/Hash.cpp
+79 −0 CesiumUtility/test/TestGzip.cpp
+ CesiumUtility/test/data/Gzip/CesiumMilkTruck.png
+ CesiumUtility/test/data/Gzip/CesiumMilkTruck.png.gz
+ CesiumUtility/test/data/Gzip/CesiumMilkTruck.png.gz.invalid
Loading