diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5626c8b3..f92377b1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -384,3 +384,121 @@ jobs: test-package-base-name: "CesiumForUnreal-54" visual-studio-version: "2022" visual-studio-components: "Microsoft.VisualStudio.Component.VC.14.34.17.4.x86.x64,Microsoft.VisualStudio.Component.Windows10SDK.18362" + Windows55: + uses: ./.github/workflows/buildWindows.yml + secrets: inherit + with: + runner-label: "windows-2022" + unreal-engine-version: "5.5.0" + unreal-engine-zip: "s3://cesium-unreal-engine/5.5.0/UE_5.5.zip" + unreal-program-name: "UE_5.5" + upload-package-base-name: "CesiumForUnreal-55-windows" + # These are specified in the Unreal Engine release notes under "IDE Version the Build farm compiles against" + # and using them ensures we're compiling our plugin in the exact same way that Unreal Engine itself is compiled. + cmake-generator: "Visual Studio 17 2022" + cmake-toolchain: "version=14.38" + cmake-platform: "x64,version=10.0.22621.0" + visual-studio-version: "2022" + visual-studio-components: "Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64,Microsoft.VisualStudio.Component.Windows11SDK.22621" + TestWindows55: + needs: [Windows55] + uses: ./.github/workflows/testWindows.yml + secrets: inherit + with: + runner-label: windows-2022 + unreal-engine-zip: "s3://cesium-unreal-engine/5.5.0/UE_5.5.zip" + unreal-program-name: "UE_5.5" + test-package-base-name: "CesiumForUnreal-55-windows" + Android55: + uses: ./.github/workflows/buildAndroid.yml + secrets: inherit + with: + runner-label: windows-2022 + unreal-engine-version: "5.5.0" + unreal-engine-zip: "s3://cesium-unreal-engine/5.5.0/UE_5.5.zip" + unreal-program-name: "UE_5.5" + upload-package-base-name: "CesiumForUnreal-55-android" + android-ndk-version: "r25b" + Linux55: + uses: ./.github/workflows/buildLinux.yml + secrets: inherit + with: + runner-label: ubuntu-22.04 + unreal-engine-version: "5.5.0" + unreal-engine-zip: "s3://cesium-unreal-engine/5.5.0/Linux_Unreal_Engine_5.5.0.zip" + unreal-program-name: "UE_5.5" + upload-package-base-name: "CesiumForUnreal-55-linux" + clang-version: "v23_clang-18.1.0-rockylinux8" + Apple55: + uses: ./.github/workflows/buildApple.yml + secrets: inherit + with: + runner-label: macos-14 + unreal-engine-version: "5.5.0" + unreal-engine-zip: "s3://cesium-unreal-engine/5.5.0/UE_55_macOS.zip" + unreal-program-name: "UE_5.5" + upload-package-base-name: "CesiumForUnreal-55-apple" + xcode-version: "15.4" + Combine55: + runs-on: ubuntu-latest + needs: [Windows55, Android55, Linux55, Apple55] + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Set environment variables + run: | + export CESIUM_UNREAL_VERSION=$GITHUB_REF_NAME + export BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-55-${CESIUM_UNREAL_VERSION}" + export BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME="CesiumForUnreal-55-SourceOnly-${CESIUM_UNREAL_VERSION}" + # Make these available to subsequent steps + echo "CESIUM_UNREAL_VERSION=$CESIUM_UNREAL_VERSION" >> $GITHUB_ENV + echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_PACKAGE_NAME" >> $GITHUB_ENV + echo "BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME" >> $GITHUB_ENV + - name: Download Apple build + uses: actions/download-artifact@v4 + with: + name: CesiumForUnreal-55-apple-${{ env.CESIUM_UNREAL_VERSION}} + path: combine + - name: Download Android build + uses: actions/download-artifact@v4 + with: + name: CesiumForUnreal-55-android-${{ env.CESIUM_UNREAL_VERSION}} + path: combine + - name: Download Linux build + uses: actions/download-artifact@v4 + with: + name: CesiumForUnreal-55-linux-${{ env.CESIUM_UNREAL_VERSION}} + path: combine + - name: Download Windows build + uses: actions/download-artifact@v4 + with: + name: CesiumForUnreal-55-windows-${{ env.CESIUM_UNREAL_VERSION}} + path: combine + - name: Publish combined package artifact + if: ${{ success() }} + uses: actions/upload-artifact@v4 + with: + name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}} + path: combine + - name: Publish combined package artifact for the Unreal Marketplace + if: ${{ success() }} + uses: actions/upload-artifact@v4 + with: + name: ${{ env.BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME}} + path: | + combine + # These are built by Epic, and including them seems to confuse their process. + !combine/CesiumForUnreal/Binaries/**/* + !combine/CesiumForUnreal/Intermediate/**/* + TestPackage55: + needs: [Combine55] + uses: ./.github/workflows/testPackageOnWindows.yml + secrets: inherit + with: + runner-label: windows-2022 + unreal-engine-zip: "s3://cesium-unreal-engine/5.5.0/UE_5.5.zip" + unreal-program-name: "UE_5.5" + unreal-engine-association: "5.5" + test-package-base-name: "CesiumForUnreal-55" + visual-studio-version: "2022" + visual-studio-components: "Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64,Microsoft.VisualStudio.Component.Windows11SDK.22621" diff --git a/.github/workflows/buildApple.yml b/.github/workflows/buildApple.yml index 157b6d268..86b1173b3 100644 --- a/.github/workflows/buildApple.yml +++ b/.github/workflows/buildApple.yml @@ -25,6 +25,15 @@ jobs: build: runs-on: ${{ inputs.runner-label }} steps: + - name: Customize BuildConfiguration.xml + run: | + mkdir -p ~/.config/Unreal\ Engine/UnrealBuildTool + # - We limit parallel actions because our builds use a lot more memory than UBT thinks they will. + # - We set the source code control Provider to None so UBT includes all files in the unity build. + printf '\n\n \n 2\n \n None\n\n' > ~/.config/Unreal\ Engine/UnrealBuildTool/BuildConfiguration.xml + # In UE 5.5, UBT apparently loads from ~/Documents instead of ~/.config + mkdir -p ~/Documents/Unreal\ Engine/UnrealBuildTool + cp ~/.config/Unreal\ Engine/UnrealBuildTool/BuildConfiguration.xml ~/Documents/Unreal\ Engine/UnrealBuildTool/BuildConfiguration.xml - name: Make some more disk space run: | df -h @@ -121,12 +130,6 @@ jobs: - name: Remove extern directory run: | rm -rf extern - - name: Customize BuildConfiguration.xml - run: | - mkdir -p ~/.config/Unreal\ Engine/UnrealBuildTool - # - We limit parallel actions because our builds use a lot more memory than UBT thinks they will. - # - We set the source code control Provider to None so UBT includes all files in the unity build. - printf '\n\n \n 2\n \n None\n\n' > ~/.config/Unreal\ Engine/UnrealBuildTool/BuildConfiguration.xml - name: Build plugin for macOS and iOS run: | sed -i '' 's/\"EngineVersion\": \"5.2.0\"/\"EngineVersion\": \"${{ inputs.unreal-engine-version }}\"/g' CesiumForUnreal.uplugin diff --git a/.github/workflows/buildLinux.yml b/.github/workflows/buildLinux.yml index 11a83db52..9ddea5628 100644 --- a/.github/workflows/buildLinux.yml +++ b/.github/workflows/buildLinux.yml @@ -34,10 +34,12 @@ jobs: sudo swapon --show cat /proc/meminfo apt list --installed + sudo dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n + sudo snap list - name: Removed unneeded packages to gain disk space run: | sudo apt update - sudo apt remove google-chrome-stable clang-13 clang-14 clang-15 llvm-13-dev llvm-13-linker-tools llvm-13-runtime llvm-13-tools llvm-13 llvm-14-dev llvm-14-linker-tools llvm-14-runtime llvm-14-tools llvm-14 llvm-15-dev llvm-15-linker-tools llvm-15-runtime llvm-15-tools llvm-15 x11-common xserver-common aspnetcore-runtime-6.0 aspnetcore-runtime-7.0 aspnetcore-runtime-8.0 aspnetcore-targeting-pack-6.0 aspnetcore-targeting-pack-7.0 aspnetcore-targeting-pack-8.0 docker-ce-cli docker-ce dotnet-apphost-pack-6.0 dotnet-apphost-pack-7.0 dotnet-apphost-pack-8.0 dotnet-host dotnet-hostfxr-6.0 dotnet-hostfxr-7.0 dotnet-hostfxr-8.0 dotnet-runtime-6.0 dotnet-runtime-7.0 dotnet-runtime-8.0 dotnet-runtime-deps-6.0 dotnet-runtime-deps-7.0 dotnet-runtime-deps-8.0 dotnet-sdk-6.0 dotnet-sdk-7.0 dotnet-sdk-8.0 dotnet-targeting-pack-6.0 dotnet-targeting-pack-7.0 dotnet-targeting-pack-8.0 eatmydata emacsen-common firebird3.0-common-doc firebird3.0-common firefox kubectl mercurial-common mercurial microsoft-edge-stable mssql-tools mysql-client-8.0 mysql-client-core-8.0 mysql-client mysql-common mysql-server-8.0 php8.1 postgresql-14 + sudo apt remove google-chrome-stable clang-13 clang-14 clang-15 llvm-13-dev llvm-13-linker-tools llvm-13-runtime llvm-13-tools llvm-13 llvm-14-dev llvm-14-linker-tools llvm-14-runtime llvm-14-tools llvm-14 llvm-15-dev llvm-15-linker-tools llvm-15-runtime llvm-15-tools llvm-15 x11-common xserver-common aspnetcore-runtime-6.0 aspnetcore-runtime-7.0 aspnetcore-runtime-8.0 aspnetcore-targeting-pack-6.0 aspnetcore-targeting-pack-7.0 aspnetcore-targeting-pack-8.0 docker-ce-cli docker-ce dotnet-apphost-pack-6.0 dotnet-apphost-pack-7.0 dotnet-apphost-pack-8.0 dotnet-host dotnet-hostfxr-6.0 dotnet-hostfxr-7.0 dotnet-hostfxr-8.0 dotnet-runtime-6.0 dotnet-runtime-7.0 dotnet-runtime-8.0 dotnet-runtime-deps-6.0 dotnet-runtime-deps-7.0 dotnet-runtime-deps-8.0 dotnet-sdk-6.0 dotnet-sdk-7.0 dotnet-sdk-8.0 dotnet-targeting-pack-6.0 dotnet-targeting-pack-7.0 dotnet-targeting-pack-8.0 eatmydata emacsen-common firebird3.0-common-doc firebird3.0-common firefox kubectl mercurial-common mercurial microsoft-edge-stable mssql-tools mysql-client-8.0 mysql-client-core-8.0 mysql-client mysql-common mysql-server-8.0 php8.1 postgresql-14 azure-cli microsoft-edge-stable google-cloud-cli temurin-21-jdk temurin-17-jdk temurin-11-jdk temurin-8-jdk powershell google-cloud-cli-anthoscli mysql-server-core-8.0 containerd.io libllvm15 libllvm14 libllvm13 mono-devel libclang-common-15-dev libclang-common-14-dev libclang-common-13-dev df -h - name: Create some space to work in /mnt run: | diff --git a/CHANGES.md b/CHANGES.md index 760195366..f3f8b5d62 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,8 +2,11 @@ ### ? - 2024-12-02 +This is the last release of Cesium for Unreal that will support Unreal Engine v5.2. Future versions will require Unreal Engine v5.3+. + ##### Additions :tada: +- Added support for Unreal Engine 5.5. - Added a "From Ellipsoid" option to `Cesium3DTileset` to generate a tileset by tesselating the surface of the ellipsoid, producing a simple globe tileset without terrain features. ##### Fixes :wrench: diff --git a/Shaders/Private/CesiumPointAttenuationVertexFactory.ush b/Shaders/Private/CesiumPointAttenuationVertexFactory.ush index 6574e9c04..57ed480d5 100644 --- a/Shaders/Private/CesiumPointAttenuationVertexFactory.ush +++ b/Shaders/Private/CesiumPointAttenuationVertexFactory.ush @@ -4,6 +4,10 @@ CesiumPointAttenuationVertexFactory.ush: point attenuation vertex factory shader code. =============================================================================*/ +#ifndef ENGINE_VERSION_5_5_OR_HIGHER +#define ENGINE_VERSION_5_5_OR_HIGHER 0 +#endif + #include "/Engine/Private/Common.ush" #include "/Engine/Private/VertexFactoryCommon.ush" @@ -40,7 +44,7 @@ struct FVertexFactoryInput #endif }; -/** +/** * Per-vertex inputs. Used by passes with a trimmed down position-only shader. */ struct FPositionOnlyVertexFactoryInput @@ -54,7 +58,7 @@ struct FPositionOnlyVertexFactoryInput #endif }; -/** +/** * Per-vertex inputs. Used by passes with a trimmed down position-and-normal-only shader. */ struct FPositionAndNormalOnlyVertexFactoryInput @@ -83,7 +87,7 @@ struct FVertexFactoryIntermediates half TangentToWorldSign; half4 Color; - + /** Cached primitive and instance data */ FSceneDataIntermediates SceneData; }; @@ -119,7 +123,7 @@ half3x3 CalculateTangentToLocal(uint PointIndex, out float TangentSign) { half3 TangentInputX = PackedTangentsBuffer[2 * PointIndex + 0].xyz; half4 TangentInputZ = PackedTangentsBuffer[2 * PointIndex + 1].xyzw; - + half3 TangentX = TangentBias(TangentInputX); half4 TangentZ = TangentBias(TangentInputZ); @@ -127,7 +131,7 @@ half3x3 CalculateTangentToLocal(uint PointIndex, out float TangentSign) // Derive the binormal by getting the cross product of the normal and tangent half3 TangentY = cross(TangentZ.xyz, TangentX) * TangentZ.w; - + // Recalculate TangentX off of the other two vectors // This corrects quantization errors since TangentX was passed in as a quantized vertex input half3x3 Result; @@ -158,7 +162,7 @@ FVertexFactoryIntermediates GetVertexFactoryIntermediates(FVertexFactoryInput In { FVertexFactoryIntermediates Intermediates = (FVertexFactoryIntermediates)0; Intermediates.SceneData = VF_GPUSCENE_GET_INTERMEDIATES(Input); - + uint PointIndex = Input.VertexId / 4; uint CornerIndex = Input.VertexId - (PointIndex * 4); @@ -213,19 +217,19 @@ FVertexFactoryInterpolantsVSToPS VertexFactoryGetInterpolantsVSToPS( Interpolants.TangentToWorld0 = float4(Intermediates.TangentToWorld[0], 0); Interpolants.TangentToWorld2 = float4(Intermediates.TangentToWorld[2], Intermediates.TangentToWorldSign); Interpolants.Color = Intermediates.Color; - + #if NUM_TEX_COORD_INTERPOLATORS float2 CustomizedUVs[NUM_TEX_COORD_INTERPOLATORS]; GetMaterialCustomizedUVs(VertexParameters, CustomizedUVs); GetCustomInterpolators(VertexParameters, CustomizedUVs); - + UNROLL for (int CoordinateIndex = 0; CoordinateIndex < NUM_TEX_COORD_INTERPOLATORS; CoordinateIndex++) { SetUV(Interpolants, CoordinateIndex, CustomizedUVs[CoordinateIndex]); } #endif - + #if INSTANCED_STEREO Interpolants.EyeIndex = 0; #endif @@ -253,6 +257,13 @@ float4 VertexFactoryGetWorldPosition(FPositionAndNormalOnlyVertexFactoryInput In return GetWorldPosition(Input.VertexId); } +// local position relative to instance +float3 VertexFactoryGetInstanceSpacePosition(FVertexFactoryInput Input, FVertexFactoryIntermediates Intermediates) +{ + // No support for instancing, so instance == primitive + return Intermediates.Position; +} + float3 VertexFactoryGetWorldNormal(FPositionAndNormalOnlyVertexFactoryInput Input) { float3 PointNormal = GetPointNormal(Input.VertexId); @@ -275,6 +286,13 @@ float4 VertexFactoryGetPreviousWorldPosition(FVertexFactoryInput Input, FVertexF #endif } +// local position relative to instance +float3 VertexFactoryGetPreviousInstanceSpacePosition(FVertexFactoryInput Input, FVertexFactoryIntermediates Intermediates) +{ + // No support for instancing, so instance == primitive + return Intermediates.Position; +} + float4 ApplyAttenuation(float4 WorldPosition, uint CornerIndex) { // These offsets generate the quad like so: // 1 --- 2 @@ -333,10 +351,24 @@ FMaterialVertexParameters GetMaterialVertexParameters( FVertexFactoryInput Input, FVertexFactoryIntermediates Intermediates, float3 WorldPosition, - half3x3 TangentToLocal) + half3x3 TangentToLocal, + bool bIsPreviousFrame = false) { +#if ENGINE_VERSION_5_5_OR_HIGHER + FMaterialVertexParameters Result = MakeInitializedMaterialVertexParameters(); + if (bIsPreviousFrame) + { + Result.PositionInstanceSpace = VertexFactoryGetPreviousInstanceSpacePosition(Input, Intermediates); + } + else + { + Result.PositionInstanceSpace = VertexFactoryGetInstanceSpacePosition(Input, Intermediates); + } + Result.PositionPrimitiveSpace = Result.PositionInstanceSpace; // No support for instancing, so instance == primitive +#else FMaterialVertexParameters Result = (FMaterialVertexParameters)0; - +#endif + Result.SceneData = Intermediates.SceneData; Result.WorldPosition = WorldPosition; Result.TangentToWorld = Intermediates.TangentToWorld; @@ -353,7 +385,9 @@ FMaterialVertexParameters GetMaterialVertexParameters( Result.TexCoords[CoordinateIndex] = TexCoordBuffer[NumTexCoords * Intermediates.PointIndex + ClampedCoordinateIndex]; } #endif - + + Result.LWCData = MakeMaterialLWCData(Result); + return Result; } @@ -439,7 +473,7 @@ FVertexFactoryRayTracingInterpolants VertexFactoryInterpolate( float bInterp) { FVertexFactoryRayTracingInterpolants O; - + INTERPOLATE_MEMBER(InterpolantsVSToPS.TangentToWorld0.xyz); INTERPOLATE_MEMBER(InterpolantsVSToPS.TangentToWorld2); diff --git a/Source/CesiumRuntime/Private/Cesium3DTileset.cpp b/Source/CesiumRuntime/Private/Cesium3DTileset.cpp index 4bf046a1b..28f6ea89b 100644 --- a/Source/CesiumRuntime/Private/Cesium3DTileset.cpp +++ b/Source/CesiumRuntime/Private/Cesium3DTileset.cpp @@ -2178,9 +2178,6 @@ void ACesium3DTileset::Tick(float DeltaTime) { updateTilesetOptionsFromProperties(); std::vector cameras = this->GetCameras(); - if (cameras.empty()) { - return; - } glm::dmat4 ueTilesetToUeWorld = VecMath::createMatrix4D(this->GetActorTransform().ToMatrixWithScale()); diff --git a/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.cpp b/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.cpp index 9528d8734..6c18d36d8 100644 --- a/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.cpp +++ b/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.cpp @@ -524,13 +524,13 @@ EncodedPropertyTable encodePropertyTableAnyThreadPart( CesiumEncodedMetadataParseColorFromString::encode( *pDescription, property, - gsl::span(pImage->pixelData), + std::span(pImage->pixelData), encodedFormat.bytesPerChannel * encodedFormat.channels); } else /* info.Conversion == ECesiumEncodedMetadataConversion::Coerce */ { CesiumEncodedMetadataCoerce::encode( *pDescription, property, - gsl::span(pImage->pixelData), + std::span(pImage->pixelData), encodedFormat.bytesPerChannel * encodedFormat.channels); } diff --git a/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.h b/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.h index 0bb838505..45f3ece2b 100644 --- a/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.h +++ b/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.h @@ -11,6 +11,7 @@ #include "Templates/SharedPointer.h" #include "Templates/UniquePtr.h" #include +#include #include struct FCesiumFeatureIdSet; diff --git a/Source/CesiumRuntime/Private/CesiumEncodedMetadataConversions.cpp b/Source/CesiumRuntime/Private/CesiumEncodedMetadataConversions.cpp index 3384878a2..7ac5a7b4b 100644 --- a/Source/CesiumRuntime/Private/CesiumEncodedMetadataConversions.cpp +++ b/Source/CesiumRuntime/Private/CesiumEncodedMetadataConversions.cpp @@ -135,7 +135,7 @@ template void coerceAndEncodeArrays( const FCesiumPropertyTablePropertyDescription& propertyDescription, const FCesiumPropertyTableProperty& property, - const gsl::span& textureData, + const std::span& textureData, size_t pixelSize) { int64 propertySize = UCesiumPropertyTablePropertyBlueprintLibrary::GetPropertySize(property); @@ -180,7 +180,7 @@ void coerceAndEncodeArrays( template void coerceAndEncodeScalars( const FCesiumPropertyTableProperty& property, - const gsl::span& textureData) { + const std::span& textureData) { int64 propertySize = UCesiumPropertyTablePropertyBlueprintLibrary::GetPropertySize(property); if (textureData.size() < propertySize * sizeof(T)) { @@ -208,7 +208,7 @@ void coerceAndEncodeScalars( template void coerceAndEncodeVec2s( const FCesiumPropertyTableProperty& property, - const gsl::span& textureData, + const std::span& textureData, size_t pixelSize) { int64 propertySize = UCesiumPropertyTablePropertyBlueprintLibrary::GetPropertySize(property); @@ -254,7 +254,7 @@ void coerceAndEncodeVec2s( template void coerceAndEncodeVec3s( const FCesiumPropertyTableProperty& property, - const gsl::span& textureData, + const std::span& textureData, size_t pixelSize) { int64 propertySize = UCesiumPropertyTablePropertyBlueprintLibrary::GetPropertySize(property); @@ -298,7 +298,7 @@ void coerceAndEncodeVec3s( template void coerceAndEncodeVec4s( const FCesiumPropertyTableProperty& property, - const gsl::span& textureData, + const std::span& textureData, size_t pixelSize) { int64 propertySize = UCesiumPropertyTablePropertyBlueprintLibrary::GetPropertySize(property); @@ -383,7 +383,7 @@ bool CesiumEncodedMetadataCoerce::canEncode( void CesiumEncodedMetadataCoerce::encode( const FCesiumPropertyTablePropertyDescription& propertyDescription, const FCesiumPropertyTableProperty& property, - const gsl::span& textureData, + const std::span& textureData, size_t pixelSize) { if (propertyDescription.PropertyDetails.bIsArray) { if (propertyDescription.EncodingDetails.ComponentType == @@ -497,7 +497,7 @@ glm::u8vec3 getRgbColorFromString(const FString& rgbString) { template void parseAndEncodeColors( const FCesiumPropertyTableProperty& property, - const gsl::span& textureData, + const std::span& textureData, size_t pixelSize) { int64 propertySize = UCesiumPropertyTablePropertyBlueprintLibrary::GetPropertySize(property); @@ -555,7 +555,7 @@ bool CesiumEncodedMetadataParseColorFromString::canEncode( void CesiumEncodedMetadataParseColorFromString::encode( const FCesiumPropertyTablePropertyDescription& propertyDescription, const FCesiumPropertyTableProperty& property, - const gsl::span& textureData, + const std::span& textureData, size_t pixelSize) { if (propertyDescription.EncodingDetails.ComponentType == ECesiumEncodedMetadataComponentType::Uint8) { diff --git a/Source/CesiumRuntime/Private/CesiumEncodedMetadataConversions.h b/Source/CesiumRuntime/Private/CesiumEncodedMetadataConversions.h index 09ad5fb60..d3ed133e6 100644 --- a/Source/CesiumRuntime/Private/CesiumEncodedMetadataConversions.h +++ b/Source/CesiumRuntime/Private/CesiumEncodedMetadataConversions.h @@ -3,7 +3,7 @@ #pragma once #include "HAL/Platform.h" -#include +#include enum class ECesiumMetadataType : uint8; enum class ECesiumEncodedMetadataType : uint8; @@ -80,7 +80,7 @@ struct CesiumEncodedMetadataCoerce { static void encode( const FCesiumPropertyTablePropertyDescription& propertyDescription, const FCesiumPropertyTableProperty& property, - const gsl::span& pTextureData, + const std::span& pTextureData, size_t pixelSize); }; @@ -113,6 +113,6 @@ struct CesiumEncodedMetadataParseColorFromString { static void encode( const FCesiumPropertyTablePropertyDescription& propertyDescription, const FCesiumPropertyTableProperty& property, - const gsl::span& textureData, + const std::span& textureData, size_t pixelSize); }; diff --git a/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp b/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp index a5e094c96..c502adb2a 100644 --- a/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp +++ b/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp @@ -1715,6 +1715,12 @@ static void loadPrimitive( LODResources.bHasReversedIndices = false; LODResources.bHasReversedDepthOnlyIndices = false; +#if ENGINE_VERSION_5_5_OR_HIGHER + // UE 5.5 requires that we do this in order to avoid a crash when ray tracing + // is enabled. + RenderData->InitializeRayTracingRepresentationFromRenderingLODs(); +#endif + primitiveResult.meshIndex = options.pMeshOptions->meshIndex; primitiveResult.primitiveIndex = options.primitiveIndex; primitiveResult.RenderData = std::move(RenderData); diff --git a/Source/CesiumRuntime/Private/CesiumPointAttenuationVertexFactory.cpp b/Source/CesiumRuntime/Private/CesiumPointAttenuationVertexFactory.cpp index dcf34fcbc..f62abe9f3 100644 --- a/Source/CesiumRuntime/Private/CesiumPointAttenuationVertexFactory.cpp +++ b/Source/CesiumRuntime/Private/CesiumPointAttenuationVertexFactory.cpp @@ -171,6 +171,15 @@ bool FCesiumPointAttenuationVertexFactory::ShouldCompilePermutation( Parameters.MaterialParameters.bIsSpecialEngineMaterial; } +void FCesiumPointAttenuationVertexFactory::ModifyCompilationEnvironment( + const FVertexFactoryShaderPermutationParameters& Parameters, + FShaderCompilerEnvironment& OutEnvironment) { + FLocalVertexFactory::ModifyCompilationEnvironment(Parameters, OutEnvironment); +#if ENGINE_VERSION_5_5_OR_HIGHER + OutEnvironment.SetDefine(TEXT("ENGINE_VERSION_5_5_OR_HIGHER"), TEXT("1")); +#endif +} + void FCesiumPointAttenuationVertexFactory::INIT_RHI_SIGNATURE { FVertexDeclarationElementList Elements; Elements.Add(AccessStreamComponent( diff --git a/Source/CesiumRuntime/Private/CesiumPointAttenuationVertexFactory.h b/Source/CesiumRuntime/Private/CesiumPointAttenuationVertexFactory.h index 2afe0cab6..0b09a7900 100644 --- a/Source/CesiumRuntime/Private/CesiumPointAttenuationVertexFactory.h +++ b/Source/CesiumRuntime/Private/CesiumPointAttenuationVertexFactory.h @@ -70,6 +70,10 @@ class FCesiumPointAttenuationVertexFactory : public FLocalVertexFactory { static bool ShouldCompilePermutation( const FVertexFactoryShaderPermutationParameters& Parameters); + static void ModifyCompilationEnvironment( + const FVertexFactoryShaderPermutationParameters& Parameters, + FShaderCompilerEnvironment& OutEnvironment); + private: virtual void INIT_RHI_SIGNATURE override; virtual void ReleaseRHI() override; diff --git a/Source/CesiumRuntime/Private/CesiumSunSky.cpp b/Source/CesiumRuntime/Private/CesiumSunSky.cpp index 6d24f79c7..4f09410e8 100644 --- a/Source/CesiumRuntime/Private/CesiumSunSky.cpp +++ b/Source/CesiumRuntime/Private/CesiumSunSky.cpp @@ -224,6 +224,8 @@ void ACesiumSunSky::EndPlay(const EEndPlayReason::Type EndPlayReason) { this->_transformUpdatedSubscription); this->_transformUpdatedSubscription.Reset(); } + + Super::EndPlay(EndPlayReason); } void ACesiumSunSky::Serialize(FArchive& Ar) { diff --git a/Source/CesiumRuntime/Private/Tests/CesiumCameraManager.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumCameraManager.spec.cpp index f1372ef20..a852d540c 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumCameraManager.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumCameraManager.spec.cpp @@ -8,7 +8,9 @@ BEGIN_DEFINE_SPEC( FCesiumCameraManagerSpec, "Cesium.Unit.CameraManager", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) END_DEFINE_SPEC(FCesiumCameraManagerSpec) diff --git a/Source/CesiumRuntime/Private/Tests/CesiumFeatureIdAttribute.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumFeatureIdAttribute.spec.cpp index 4cb47a251..0abfb1ca8 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumFeatureIdAttribute.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumFeatureIdAttribute.spec.cpp @@ -8,7 +8,9 @@ BEGIN_DEFINE_SPEC( FCesiumFeatureIdAttributeSpec, "Cesium.Unit.FeatureIdAttribute", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) CesiumGltf::Model model; CesiumGltf::MeshPrimitive* pPrimitive; diff --git a/Source/CesiumRuntime/Private/Tests/CesiumFeatureIdSet.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumFeatureIdSet.spec.cpp index 881fe1d0c..7da2be043 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumFeatureIdSet.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumFeatureIdSet.spec.cpp @@ -10,7 +10,9 @@ BEGIN_DEFINE_SPEC( FCesiumFeatureIdSetSpec, "Cesium.Unit.FeatureIdSet", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) CesiumGltf::Model model; CesiumGltf::MeshPrimitive* pPrimitive; diff --git a/Source/CesiumRuntime/Private/Tests/CesiumFeatureIdTexture.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumFeatureIdTexture.spec.cpp index 370dd3688..982d475a6 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumFeatureIdTexture.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumFeatureIdTexture.spec.cpp @@ -11,7 +11,9 @@ BEGIN_DEFINE_SPEC( FCesiumFeatureIdTextureSpec, "Cesium.Unit.FeatureIdTexture", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) CesiumGltf::Model model; CesiumGltf::MeshPrimitive* pPrimitive; diff --git a/Source/CesiumRuntime/Private/Tests/CesiumGeoreference.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumGeoreference.spec.cpp index 779b24cb0..754b26e42 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumGeoreference.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumGeoreference.spec.cpp @@ -13,7 +13,9 @@ using namespace CesiumUtility; BEGIN_DEFINE_SPEC( FCesiumGeoreferenceSpec, "Cesium.Unit.Georeference", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) TObjectPtr pGeoreferenceNullIsland; diff --git a/Source/CesiumRuntime/Private/Tests/CesiumGlobeAnchor.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumGlobeAnchor.spec.cpp index 6d51c2ddd..897ab41fb 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumGlobeAnchor.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumGlobeAnchor.spec.cpp @@ -9,7 +9,9 @@ BEGIN_DEFINE_SPEC( FCesiumGlobeAnchorSpec, "Cesium.Unit.GlobeAnchor", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) TObjectPtr pActor; diff --git a/Source/CesiumRuntime/Private/Tests/CesiumMetadataPickingBlueprintLibrary.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumMetadataPickingBlueprintLibrary.spec.cpp index ff8c52312..099c59381 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumMetadataPickingBlueprintLibrary.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumMetadataPickingBlueprintLibrary.spec.cpp @@ -13,7 +13,9 @@ BEGIN_DEFINE_SPEC( FCesiumMetadataPickingSpec, "Cesium.Unit.MetadataPicking", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) CesiumGltf::Model model; CesiumGltf::MeshPrimitive* pPrimitive; diff --git a/Source/CesiumRuntime/Private/Tests/CesiumMetadataValue.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumMetadataValue.spec.cpp index 49858c73e..be829c7e3 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumMetadataValue.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumMetadataValue.spec.cpp @@ -9,7 +9,9 @@ BEGIN_DEFINE_SPEC( FCesiumMetadataValueSpec, "Cesium.Unit.MetadataValue", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) END_DEFINE_SPEC(FCesiumMetadataValueSpec) diff --git a/Source/CesiumRuntime/Private/Tests/CesiumOriginShiftComponent.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumOriginShiftComponent.spec.cpp index e9a2d1efd..1b6e4be11 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumOriginShiftComponent.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumOriginShiftComponent.spec.cpp @@ -18,7 +18,9 @@ BEGIN_DEFINE_SPEC( FCesiumOriginShiftComponentSpec, "Cesium.Unit.OriginShiftComponent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) TObjectPtr pWorld; diff --git a/Source/CesiumRuntime/Private/Tests/CesiumPrimitiveFeatures.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumPrimitiveFeatures.spec.cpp index 63fac56c6..7dd21d9f1 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumPrimitiveFeatures.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumPrimitiveFeatures.spec.cpp @@ -8,7 +8,9 @@ BEGIN_DEFINE_SPEC( FCesiumPrimitiveFeaturesSpec, "Cesium.Unit.PrimitiveFeatures", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) CesiumGltf::Model model; CesiumGltf::MeshPrimitive* pPrimitive; diff --git a/Source/CesiumRuntime/Private/Tests/CesiumPropertyArray.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumPropertyArray.spec.cpp index 6eae0eb5d..1c5e51b02 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumPropertyArray.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumPropertyArray.spec.cpp @@ -7,7 +7,9 @@ BEGIN_DEFINE_SPEC( FCesiumPropertyArraySpec, "Cesium.Unit.PropertyArray", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) END_DEFINE_SPEC(FCesiumPropertyArraySpec) diff --git a/Source/CesiumRuntime/Private/Tests/CesiumPropertyTable.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumPropertyTable.spec.cpp index 5b90f4261..d04e56a61 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumPropertyTable.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumPropertyTable.spec.cpp @@ -10,7 +10,9 @@ BEGIN_DEFINE_SPEC( FCesiumPropertyTableSpec, "Cesium.Unit.PropertyTable", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) CesiumGltf::Model model; CesiumGltf::ExtensionModelExtStructuralMetadata* pExtension; diff --git a/Source/CesiumRuntime/Private/Tests/CesiumPropertyTableProperty.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumPropertyTableProperty.spec.cpp index a36ac49cb..e158006f3 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumPropertyTableProperty.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumPropertyTableProperty.spec.cpp @@ -9,7 +9,9 @@ BEGIN_DEFINE_SPEC( FCesiumPropertyTablePropertySpec, "Cesium.Unit.PropertyTableProperty", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) END_DEFINE_SPEC(FCesiumPropertyTablePropertySpec) @@ -96,7 +98,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( @@ -177,7 +179,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( @@ -239,9 +241,9 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, size, - gsl::span(data.data(), data.size()), - gsl::span(), - gsl::span(), + std::span(data.data(), data.size()), + std::span(), + std::span(), PropertyComponentType::None, PropertyComponentType::None); @@ -305,11 +307,11 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, size, - gsl::span(data.data(), data.size()), - gsl::span( + std::span(data.data(), data.size()), + std::span( offsetsData.data(), offsetsData.size()), - gsl::span(), + std::span(), PropertyComponentType::Uint16, PropertyComponentType::None); @@ -382,7 +384,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( @@ -497,7 +499,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( @@ -693,7 +695,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(8), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -729,7 +731,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(8), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -786,9 +788,9 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size()), - gsl::span(), - gsl::span(offsetsData.data(), offsetsData.size()), + std::span(data.data(), data.size()), + std::span(), + std::span(offsetsData.data(), offsetsData.size()), PropertyComponentType::None, PropertyComponentType::Uint32); @@ -844,7 +846,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -880,7 +882,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -917,7 +919,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -961,7 +963,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1023,7 +1025,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1063,7 +1065,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1106,7 +1108,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1150,7 +1152,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1216,7 +1218,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1256,7 +1258,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1297,7 +1299,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1341,7 +1343,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1405,7 +1407,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1441,7 +1443,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1482,7 +1484,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1531,7 +1533,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1585,7 +1587,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1625,7 +1627,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1663,7 +1665,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1720,9 +1722,9 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size()), - gsl::span(), - gsl::span(offsetsData.data(), offsetsData.size()), + std::span(data.data(), data.size()), + std::span(), + std::span(offsetsData.data(), offsetsData.size()), PropertyComponentType::None, PropertyComponentType::Uint8); FCesiumPropertyTableProperty property(propertyView); @@ -1771,7 +1773,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1829,7 +1831,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1874,7 +1876,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1915,7 +1917,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -1965,7 +1967,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2030,7 +2032,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2075,7 +2077,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2117,7 +2119,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2175,9 +2177,9 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size()), - gsl::span(), - gsl::span(offsetsData.data(), offsetsData.size()), + std::span(data.data(), data.size()), + std::span(), + std::span(offsetsData.data(), offsetsData.size()), PropertyComponentType::None, PropertyComponentType::Uint8); FCesiumPropertyTableProperty property(propertyView); @@ -2229,7 +2231,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2291,7 +2293,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2336,7 +2338,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2378,7 +2380,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2433,7 +2435,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2498,7 +2500,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2543,7 +2545,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2585,7 +2587,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2640,7 +2642,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2702,7 +2704,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2747,7 +2749,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2789,7 +2791,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2851,9 +2853,9 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size()), - gsl::span(), - gsl::span(offsetsData.data(), offsetsData.size()), + std::span(data.data(), data.size()), + std::span(), + std::span(offsetsData.data(), offsetsData.size()), PropertyComponentType::None, PropertyComponentType::Uint8); FCesiumPropertyTableProperty property(propertyView); @@ -2905,7 +2907,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -2967,7 +2969,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -3012,7 +3014,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -3058,7 +3060,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -3125,9 +3127,9 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size()), - gsl::span(), - gsl::span(offsetsData.data(), offsetsData.size()), + std::span(data.data(), data.size()), + std::span(), + std::span(offsetsData.data(), offsetsData.size()), PropertyComponentType::None, PropertyComponentType::Uint8); FCesiumPropertyTableProperty property(propertyView); @@ -3179,7 +3181,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -3252,7 +3254,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -3308,7 +3310,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -3371,7 +3373,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -3424,7 +3426,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -3474,7 +3476,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -3537,7 +3539,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -3588,7 +3590,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "PropertyTablePropertyStatus", @@ -3652,9 +3654,9 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, size, - gsl::span(data.data(), data.size()), - gsl::span(), - gsl::span(), + std::span(data.data(), data.size()), + std::span(), + std::span(), PropertyComponentType::None, PropertyComponentType::None); FCesiumPropertyTableProperty property(propertyView); @@ -3710,9 +3712,9 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, size, - gsl::span(data.data(), data.size()), - gsl::span(), - gsl::span(), + std::span(data.data(), data.size()), + std::span(), + std::span(), PropertyComponentType::None, PropertyComponentType::None); FCesiumPropertyTableProperty property(propertyView); @@ -3778,11 +3780,11 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, size, - gsl::span(data.data(), data.size()), - gsl::span( + std::span(data.data(), data.size()), + std::span( offsetsData.data(), offsetsData.size()), - gsl::span(), + std::span(), PropertyComponentType::Uint16, PropertyComponentType::None); FCesiumPropertyTableProperty property(propertyView); @@ -3854,9 +3856,9 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, size, - gsl::span(data.data(), data.size()), - gsl::span(), - gsl::span(), + std::span(data.data(), data.size()), + std::span(), + std::span(), PropertyComponentType::None, PropertyComponentType::None); FCesiumPropertyTableProperty property(propertyView); @@ -3942,9 +3944,9 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, size, - gsl::span(data.data(), data.size()), - gsl::span(), - gsl::span(), + std::span(data.data(), data.size()), + std::span(), + std::span(), PropertyComponentType::None, PropertyComponentType::None); FCesiumPropertyTableProperty property(propertyView); @@ -4045,7 +4047,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -4087,7 +4089,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -4137,7 +4139,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -4184,7 +4186,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", @@ -4242,7 +4244,7 @@ void FCesiumPropertyTablePropertySpec::Define() { propertyTableProperty, classProperty, static_cast(values.size()), - gsl::span(data.data(), data.size())); + std::span(data.data(), data.size())); FCesiumPropertyTableProperty property(propertyView); TestEqual( "status", diff --git a/Source/CesiumRuntime/Private/Tests/CesiumPropertyTexture.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumPropertyTexture.spec.cpp index 430a7e3c0..8465832f7 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumPropertyTexture.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumPropertyTexture.spec.cpp @@ -12,7 +12,9 @@ BEGIN_DEFINE_SPEC( FCesiumPropertyTextureSpec, "Cesium.Unit.PropertyTexture", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) CesiumGltf::Model model; CesiumGltf::MeshPrimitive* pPrimitive; diff --git a/Source/CesiumRuntime/Private/Tests/CesiumPropertyTextureProperty.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumPropertyTextureProperty.spec.cpp index 63940ebc0..0c23881d2 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumPropertyTextureProperty.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumPropertyTextureProperty.spec.cpp @@ -9,7 +9,9 @@ BEGIN_DEFINE_SPEC( FCesiumPropertyTexturePropertySpec, "Cesium.Unit.PropertyTextureProperty", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) const std::vector texCoords{ FVector2D(0, 0), diff --git a/Source/CesiumRuntime/Private/Tests/CesiumTestHelpers.h b/Source/CesiumRuntime/Private/Tests/CesiumTestHelpers.h index f6595478d..932eebd6d 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumTestHelpers.h +++ b/Source/CesiumRuntime/Private/Tests/CesiumTestHelpers.h @@ -193,9 +193,9 @@ template T* findInPlay(T* pEditorObject) { if (!pPlayOwner) return nullptr; return getComponentWithTag(pPlayOwner, getUniqueTag(pEditorObject)); + } else { + return nullptr; } - - return nullptr; } /// diff --git a/Source/CesiumRuntime/Private/Tests/CesiumTextureUtility.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumTextureUtility.spec.cpp index 764efa69d..fea05be2a 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumTextureUtility.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumTextureUtility.spec.cpp @@ -15,7 +15,7 @@ using namespace CesiumUtility; BEGIN_DEFINE_SPEC( CesiumTextureUtilitySpec, "Cesium.Unit.CesiumTextureUtility", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | EAutomationTestFlags::ProductFilter | EAutomationTestFlags::NonNullRHI) std::vector originalPixels; std::vector originalMipPixels; diff --git a/Source/CesiumRuntime/Private/Tests/GeoTransforms.spec.cpp b/Source/CesiumRuntime/Private/Tests/GeoTransforms.spec.cpp index 2ab9e6f9d..117f0b018 100644 --- a/Source/CesiumRuntime/Private/Tests/GeoTransforms.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/GeoTransforms.spec.cpp @@ -11,7 +11,9 @@ using namespace CesiumUtility; BEGIN_DEFINE_SPEC( FGeoTransformsSpec, "Cesium.Unit.GeoTransforms", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) END_DEFINE_SPEC(FGeoTransformsSpec) diff --git a/Source/CesiumRuntime/Private/Tests/GlobeAwareDefaultPawn.spec.cpp b/Source/CesiumRuntime/Private/Tests/GlobeAwareDefaultPawn.spec.cpp index fbe751339..84098476d 100644 --- a/Source/CesiumRuntime/Private/Tests/GlobeAwareDefaultPawn.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/GlobeAwareDefaultPawn.spec.cpp @@ -17,7 +17,9 @@ BEGIN_DEFINE_SPEC( FGlobeAwareDefaultPawnSpec, "Cesium.Unit.GlobeAwareDefaultPawn", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) FDelegateHandle subscriptionPostPIEStarted; diff --git a/Source/CesiumRuntime/Private/Tests/SampleHeightMostDetailed.spec.cpp b/Source/CesiumRuntime/Private/Tests/SampleHeightMostDetailed.spec.cpp index 6f766faff..479e63beb 100644 --- a/Source/CesiumRuntime/Private/Tests/SampleHeightMostDetailed.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/SampleHeightMostDetailed.spec.cpp @@ -10,7 +10,9 @@ BEGIN_DEFINE_SPEC( FSampleHeightMostDetailedSpec, "Cesium.Unit.SampleHeightMostDetailed", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) TObjectPtr pTileset; diff --git a/Source/CesiumRuntime/Private/Tests/SubLevels.spec.cpp b/Source/CesiumRuntime/Private/Tests/SubLevels.spec.cpp index 3cd88dca3..383c17b19 100644 --- a/Source/CesiumRuntime/Private/Tests/SubLevels.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/SubLevels.spec.cpp @@ -18,7 +18,9 @@ BEGIN_DEFINE_SPEC( FSubLevelsSpec, "Cesium.Unit.SubLevels", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) TObjectPtr pWorld; diff --git a/Source/CesiumRuntime/Private/Tests/UnrealAssetAccessor.spec.cpp b/Source/CesiumRuntime/Private/Tests/UnrealAssetAccessor.spec.cpp index 23ad0b24d..48f9e46fa 100644 --- a/Source/CesiumRuntime/Private/Tests/UnrealAssetAccessor.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/UnrealAssetAccessor.spec.cpp @@ -12,7 +12,9 @@ BEGIN_DEFINE_SPEC( FUnrealAssetAccessorSpec, "Cesium.Unit.UnrealAssetAccessor", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) FString Filename; @@ -31,7 +33,7 @@ void TestAccessorRequest(const FString& Uri, const std::string& expectedData) { if (!Response) return; - gsl::span data = Response->data(); + std::span data = Response->data(); TestEqual("data length", data.size(), expectedData.size()); std::string s( reinterpret_cast(data.data()), diff --git a/Source/CesiumRuntime/Private/Tests/UnrealMetadataConversions.spec.cpp b/Source/CesiumRuntime/Private/Tests/UnrealMetadataConversions.spec.cpp index f4c9e9af0..f4e81ea48 100644 --- a/Source/CesiumRuntime/Private/Tests/UnrealMetadataConversions.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/UnrealMetadataConversions.spec.cpp @@ -9,7 +9,9 @@ BEGIN_DEFINE_SPEC( FUnrealMetadataConversionsSpec, "Cesium.Unit.MetadataConversions", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | + EAutomationTestFlags::ServerContext | + EAutomationTestFlags::CommandletContext | EAutomationTestFlags::ProductFilter) END_DEFINE_SPEC(FUnrealMetadataConversionsSpec) diff --git a/Source/CesiumRuntime/Private/UnrealAssetAccessor.cpp b/Source/CesiumRuntime/Private/UnrealAssetAccessor.cpp index d26da1e2b..6ede3bb33 100644 --- a/Source/CesiumRuntime/Private/UnrealAssetAccessor.cpp +++ b/Source/CesiumRuntime/Private/UnrealAssetAccessor.cpp @@ -59,9 +59,9 @@ class UnrealAssetResponse : public CesiumAsync::IAssetResponse { return this->_headers; } - virtual gsl::span data() const override { + virtual std::span data() const override { const TArray& content = this->_pResponse->GetContent(); - return gsl::span( + return std::span( reinterpret_cast(content.GetData()), content.Num()); } @@ -235,7 +235,7 @@ UnrealAssetAccessor::request( const std::string& verb, const std::string& url, const std::vector& headers, - const gsl::span& contentPayload) { + const std::span& contentPayload) { const FString& userAgent = this->_userAgent; const TMap& cesiumRequestHeaders = @@ -319,8 +319,8 @@ class UnrealFileAssetRequestResponse : public CesiumAsync::IAssetRequest, virtual std::string contentType() const override { return std::string(); } - virtual gsl::span data() const override { - return gsl::span( + virtual std::span data() const override { + return std::span( reinterpret_cast(this->_data.GetData()), size_t(this->_data.Num())); } diff --git a/Source/CesiumRuntime/Public/CesiumCommon.h b/Source/CesiumRuntime/Public/CesiumCommon.h index 633570315..17901acb2 100644 --- a/Source/CesiumRuntime/Public/CesiumCommon.h +++ b/Source/CesiumRuntime/Public/CesiumCommon.h @@ -4,6 +4,8 @@ #include "Runtime/Launch/Resources/Version.h" +#define ENGINE_VERSION_5_5_OR_HIGHER \ + (ENGINE_MAJOR_VERSION > 5 || ENGINE_MINOR_VERSION >= 5) #define ENGINE_VERSION_5_4_OR_HIGHER \ (ENGINE_MAJOR_VERSION > 5 || ENGINE_MINOR_VERSION >= 4) #define ENGINE_VERSION_5_3_OR_HIGHER \ diff --git a/Source/CesiumRuntime/Public/UnrealAssetAccessor.h b/Source/CesiumRuntime/Public/UnrealAssetAccessor.h index 0a76c3fe6..01095bcf9 100644 --- a/Source/CesiumRuntime/Public/UnrealAssetAccessor.h +++ b/Source/CesiumRuntime/Public/UnrealAssetAccessor.h @@ -26,7 +26,7 @@ class CESIUMRUNTIME_API UnrealAssetAccessor const std::string& verb, const std::string& url, const std::vector& headers, - const gsl::span& contentPayload) override; + const std::span& contentPayload) override; virtual void tick() noexcept override; diff --git a/extern/cesium-native b/extern/cesium-native index 970ab2414..2035dda59 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 970ab241464c90fd1009dd4521cd77ea1d69b22d +Subproject commit 2035dda592521d63952ea83cc33ee84a61e3fa68 diff --git a/extern/vcpkg-overlays/abseil/portfile.cmake b/extern/vcpkg-overlays/abseil/portfile.cmake new file mode 100644 index 000000000..83f393dce --- /dev/null +++ b/extern/vcpkg-overlays/abseil/portfile.cmake @@ -0,0 +1,72 @@ +if(NOT VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO abseil/abseil-cpp + REF "20240722.0" + SHA512 bd2cca8f007f2eee66f51c95a979371622b850ceb2ce3608d00ba826f7c494a1da0fba3c1427728f2c173fe50d59b701da35c2c9fdad2752a5a49746b1c8ef31 + HEAD_REF master +) + +# With ABSL_PROPAGATE_CXX_STD=ON abseil automatically detect if it is being +# compiled with C++14 or C++17, and modifies the installed `absl/base/options.h` +# header accordingly. This works even if CMAKE_CXX_STANDARD is not set. Abseil +# uses the compiler default behavior to update `absl/base/options.h` as needed. +set(ABSL_USE_CXX17_OPTION "") +if("cxx17" IN_LIST FEATURES) + set(ABSL_USE_CXX17_OPTION "-DCMAKE_CXX_STANDARD=17") +endif() + +set(ABSL_STATIC_RUNTIME_OPTION "") +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_CRT_LINKAGE STREQUAL "static") + set(ABSL_STATIC_RUNTIME_OPTION "-DABSL_MSVC_STATIC_RUNTIME=ON") +endif() + +# Don't let Abseil clobber our CMAKE_MSVC_RUNTIME_LIBRARY choice. +vcpkg_replace_string("${SOURCE_PATH}/CMakeLists.txt" "set(CMAKE_MSVC_RUNTIME_LIBRARY \"MultiThreaded$<$:Debug>DLL\")" "#set(CMAKE_MSVC_RUNTIME_LIBRARY \"MultiThreaded$<$:Debug>DLL\")") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + DISABLE_PARALLEL_CONFIGURE + OPTIONS + -DABSL_PROPAGATE_CXX_STD=OFF + -DCMAKE_CXX_STANDARD=14 + ${ABSL_USE_CXX17_OPTION} + ${ABSL_STATIC_RUNTIME_OPTION} +) + +# Don't let our customized version of Abseil pose as the real thing. +vcpkg_replace_string("${SOURCE_PATH}/absl/base/options.h" "ABSL_OPTION_INLINE_NAMESPACE_NAME lts_20240722" "ABSL_OPTION_INLINE_NAMESPACE_NAME lts_20240722_cesium_for_unreal") +vcpkg_replace_string("${SOURCE_PATH}/absl/base/options.h" "ABSL_OPTION_USE_STD_ANY 2" "ABSL_OPTION_USE_STD_ANY 0") +vcpkg_replace_string("${SOURCE_PATH}/absl/base/options.h" "ABSL_OPTION_USE_STD_OPTIONAL 2" "ABSL_OPTION_USE_STD_OPTIONAL 0") +vcpkg_replace_string("${SOURCE_PATH}/absl/base/options.h" "ABSL_OPTION_USE_STD_STRING_VIEW 2" "ABSL_OPTION_USE_STD_STRING_VIEW 0") +vcpkg_replace_string("${SOURCE_PATH}/absl/base/options.h" "ABSL_OPTION_USE_STD_VARIANT 2" "ABSL_OPTION_USE_STD_VARIANT 0") +vcpkg_replace_string("${SOURCE_PATH}/absl/base/options.h" "ABSL_OPTION_USE_STD_ORDERING 2" "ABSL_OPTION_USE_STD_ORDERING 0") +vcpkg_replace_string("${SOURCE_PATH}/absl/base/config.h" "#define ABSL_LTS_RELEASE_VERSION 20240722" "//#define ABSL_LTS_RELEASE_VERSION 20240722") +vcpkg_replace_string("${SOURCE_PATH}/absl/base/config.h" "#define ABSL_LTS_RELEASE_PATCH_LEVEL 0" "//#define ABSL_LTS_RELEASE_PATCH_LEVEL 0") + +# Apply this patch to fix C++20 build with Android NDK r25 +# https://github.com/abseil/abseil-cpp/pull/1728 +vcpkg_replace_string("${SOURCE_PATH}/absl/time/time.h" "__cpp_impl_three_way_comparison" "__cpp_lib_three_way_comparison") +vcpkg_replace_string("${SOURCE_PATH}/absl/strings/cord.h" "__cpp_impl_three_way_comparison" "__cpp_lib_three_way_comparison") + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(PACKAGE_NAME absl CONFIG_PATH lib/cmake/absl) +vcpkg_fixup_pkgconfig() + +vcpkg_copy_pdbs() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/include/absl/copts" + "${CURRENT_PACKAGES_DIR}/include/absl/strings/testdata" + "${CURRENT_PACKAGES_DIR}/include/absl/time/internal/cctz/testdata" +) + +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/absl/base/config.h" "defined(ABSL_CONSUME_DLL)" "1") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/absl/base/internal/thread_identity.h" "defined(ABSL_CONSUME_DLL)" "1") +endif() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/extern/vcpkg-overlays/abseil/vcpkg.json b/extern/vcpkg-overlays/abseil/vcpkg.json new file mode 100644 index 000000000..93c750579 --- /dev/null +++ b/extern/vcpkg-overlays/abseil/vcpkg.json @@ -0,0 +1,26 @@ +{ + "name": "abseil", + "version": "20240722.0-cesium-for-unreal", + "description": [ + "Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google's own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives.", + "In some cases, Abseil provides pieces missing from the C++ standard; in others, Abseil provides alternatives to the standard for special needs we've found through usage in the Google code base. We denote those cases clearly within the library code we provide you.", + "Abseil is not meant to be a competitor to the standard library; we've just found that many of these utilities serve a purpose within our code base, and we now want to provide those resources to the C++ community as a whole." + ], + "homepage": "https://github.com/abseil/abseil-cpp", + "license": "Apache-2.0", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "cxx17": { + "description": "Enable compiler C++17." + } + } +} diff --git a/extern/vcpkg-overlays/stb/FindStb.cmake b/extern/vcpkg-overlays/stb/FindStb.cmake new file mode 100644 index 000000000..4ffa8b1ff --- /dev/null +++ b/extern/vcpkg-overlays/stb/FindStb.cmake @@ -0,0 +1,29 @@ +# Distributed under the OSI-approved BSD 3-Clause License. + +#.rst: +# FindStb +# ------------ +# +# Find the Stb include headers. +# +# Result Variables +# ^^^^^^^^^^^^^^^^ +# +# This module defines the following variables: +# +# ``Stb_FOUND`` +# True if Stb library found +# +# ``Stb_INCLUDE_DIR`` +# Location of Stb headers +# + +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) +include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake) + +if(NOT Stb_INCLUDE_DIR) + find_path(Stb_INCLUDE_DIR NAMES stb_image.h PATHS ${Stb_DIR} PATH_SUFFIXES include) +endif() + +find_package_handle_standard_args(Stb DEFAULT_MSG Stb_INCLUDE_DIR) +mark_as_advanced(Stb_INCLUDE_DIR) diff --git a/extern/vcpkg-overlays/stb/portfile.cmake b/extern/vcpkg-overlays/stb/portfile.cmake new file mode 100644 index 000000000..5f3935029 --- /dev/null +++ b/extern/vcpkg-overlays/stb/portfile.cmake @@ -0,0 +1,19 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO nothings/stb + REF f75e8d1cad7d90d72ef7a4661f1b994ef78b4e31 # committed on 2024-07-29 + SHA512 4a733aefb816a366c999663e3d482144616721b26c321ee5dd0dce611a34050b6aef97d46bd2c4f8a9631d83b097491a7ce88607fd9493d880aaa94567a68cce + HEAD_REF master +) + +file(GLOB HEADER_FILES "${SOURCE_PATH}/*.h" "${SOURCE_PATH}/stb_vorbis.c") +file(COPY ${HEADER_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/include") + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/FindStb.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") + +# Even when told to create static symbols, STB creates two symbols globally, which breaks packaging in UE 5.4. Fix that. +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/stb_image_resize2.h" "STBIR__SIMDI_CONST(stbir__s" "STBIRDEF STBIR__SIMDI_CONST(stbir__s") diff --git a/extern/vcpkg-overlays/stb/usage b/extern/vcpkg-overlays/stb/usage new file mode 100644 index 000000000..ac75766bf --- /dev/null +++ b/extern/vcpkg-overlays/stb/usage @@ -0,0 +1,4 @@ +The package stb provides CMake targets: + + find_package(Stb REQUIRED) + target_include_directories(main PRIVATE ${Stb_INCLUDE_DIR}) \ No newline at end of file diff --git a/extern/vcpkg-overlays/stb/vcpkg-cmake-wrapper.cmake b/extern/vcpkg-overlays/stb/vcpkg-cmake-wrapper.cmake new file mode 100644 index 000000000..e787d29f0 --- /dev/null +++ b/extern/vcpkg-overlays/stb/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,6 @@ +set(STB_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +_find_package(${ARGS}) + +set(CMAKE_MODULE_PATH ${STB_PREV_MODULE_PATH}) diff --git a/extern/vcpkg-overlays/stb/vcpkg.json b/extern/vcpkg-overlays/stb/vcpkg.json new file mode 100644 index 000000000..07b7d65b1 --- /dev/null +++ b/extern/vcpkg-overlays/stb/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "stb", + "version-date": "2024-07-29", + "port-version": 1, + "description": "public domain header-only libraries", + "homepage": "https://github.com/nothings/stb", + "license": "MIT OR CC-PDDC" +} diff --git a/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake b/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake index 90455d171..47c6df42b 100644 --- a/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake @@ -30,5 +30,17 @@ list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_C_FLAGS_DEBUG:STRING=/MD /Z7 # When building official binaries on CI, use a very specific MSVC toolset version (which must be installed). # When building locally, use the default. if(DEFINED ENV{CI}) + # Toolset version should be 14.38 on UE 5.5+, 14.34 on prior versions. set(VCPKG_PLATFORM_TOOLSET_VERSION "14.34") + + set(UNREAL_ENGINE_BUILD_VERSION_FILENAME "$ENV{UNREAL_ENGINE_ROOT}/Engine/Build/Build.version") + if(EXISTS "${UNREAL_ENGINE_BUILD_VERSION_FILENAME}") + file(READ "${UNREAL_ENGINE_BUILD_VERSION_FILENAME}" UNREAL_ENGINE_BUILD_VERSION) + string(JSON UNREAL_MAJOR_VERSION GET "${UNREAL_ENGINE_BUILD_VERSION}" "MajorVersion") + string(JSON UNREAL_MINOR_VERSION GET "${UNREAL_ENGINE_BUILD_VERSION}" "MinorVersion") + if("${UNREAL_MAJOR_VERSION}" GREATER "5" OR "${UNREAL_MINOR_VERSION}" GREATER_EQUAL "5") + # This is UE 5.5+, so use MSVC 14.38. + set(VCPKG_PLATFORM_TOOLSET_VERSION "14.38") + endif() + endif() endif()