From 90dde220b6420112d97049e754792f8f7ae28211 Mon Sep 17 00:00:00 2001 From: donghaiwang Date: Sun, 21 Dec 2025 21:41:04 +0800 Subject: [PATCH] [carla] Fix build issues with VS22. --- .../LiveLink/Private/LiveLinkClient.cpp | 3 ++- .../UnitTests/Engine/PackedVectorTest.cpp | 5 +++-- .../Private/PeakPicker.cpp | 3 ++- .../Private/ExportMaterialProxy.h | 6 +++--- .../Private/MaterialUtilities.cpp | 4 ++-- .../MaterialEditor/Private/MaterialEditor.h | 4 ++-- .../Private/Lightmass/LightmassRender.cpp | 4 ++-- .../UnrealEd/Private/PreviewMaterial.cpp | 4 ++-- .../Voronoi/Private/Voronoi/Voronoi.cpp | 7 ++++--- .../RenderCore/Private/RenderGraphPrivate.cpp | 20 +++++++++++++------ 10 files changed, 36 insertions(+), 24 deletions(-) diff --git a/Engine/Plugins/Animation/LiveLink/Source/LiveLink/Private/LiveLinkClient.cpp b/Engine/Plugins/Animation/LiveLink/Source/LiveLink/Private/LiveLinkClient.cpp index ac9ef4b7a..c240be8dc 100644 --- a/Engine/Plugins/Animation/LiveLink/Source/LiveLink/Private/LiveLinkClient.cpp +++ b/Engine/Plugins/Animation/LiveLink/Source/LiveLink/Private/LiveLinkClient.cpp @@ -40,6 +40,7 @@ #include "VirtualSubjects/LiveLinkBlueprintVirtualSubject.h" #endif +#include /** * Declare stats to see what takes up time in LiveLink @@ -1667,7 +1668,7 @@ void FLiveLinkClient_Base_DEPRECATED::PushSubjectData(FGuid InSourceGuid, FName } for (int32 i = MaxNumberOfProperties; i < NumberOfPropertyNames; ++i) { - NewData.PropertyValues[i] = INFINITY; + NewData.PropertyValues[i] = std::numeric_limits::infinity(); } PushSubjectFrameData_AnyThread(SubjectKey, MoveTemp(AnimationStruct)); } diff --git a/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Private/UnitTests/Engine/PackedVectorTest.cpp b/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Private/UnitTests/Engine/PackedVectorTest.cpp index cb8814f30..69b32d689 100644 --- a/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Private/UnitTests/Engine/PackedVectorTest.cpp +++ b/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Private/UnitTests/Engine/PackedVectorTest.cpp @@ -4,6 +4,7 @@ #include "Engine/NetSerialization.h" #include "UnitTestEnvironment.h" #include +#include namespace PackedVectorTest { @@ -54,7 +55,7 @@ bool UPackedVectorTest::ExecuteUnitTest() -180817.42f, 47.11f, -FMath::Exp2(25.0f), // overflow - INFINITY, // non-finite + std::numeric_limits::infinity(), // non-finite }; static const float Quantize100_Values[] = @@ -63,7 +64,7 @@ bool UPackedVectorTest::ExecuteUnitTest() +180720.42f, -19751216.0f, FMath::Exp2(31.0f), - -INFINITY, + -std::numeric_limits::infinity(), }; struct TestCase diff --git a/Engine/Plugins/Runtime/AudioSynesthesia/Source/AudioSynesthesiaCore/Private/PeakPicker.cpp b/Engine/Plugins/Runtime/AudioSynesthesia/Source/AudioSynesthesiaCore/Private/PeakPicker.cpp index 1be0fd179..411b2eaaf 100644 --- a/Engine/Plugins/Runtime/AudioSynesthesia/Source/AudioSynesthesiaCore/Private/PeakPicker.cpp +++ b/Engine/Plugins/Runtime/AudioSynesthesia/Source/AudioSynesthesiaCore/Private/PeakPicker.cpp @@ -3,6 +3,7 @@ #include "PeakPicker.h" #include "CoreMinimal.h" #include "DSP/FloatArrayMath.h" +#include namespace Audio { @@ -15,7 +16,7 @@ namespace Audio Settings.NumPreMean = FMath::Max(1, Settings.NumPreMean); Settings.NumPostMean = FMath::Max(1, Settings.NumPostMean); Settings.NumWait = FMath::Max(1, Settings.NumWait); - Settings.MeanDelta = FMath::Clamp(Settings.MeanDelta, 1e-6f, INFINITY); + Settings.MeanDelta = FMath::Clamp(Settings.MeanDelta, 1e-6f, std::numeric_limits::infinity()); } void FPeakPicker::PickPeaks(TArrayView InData, TArray& OutPeakIndices) diff --git a/Engine/Source/Developer/MaterialBaking/Private/ExportMaterialProxy.h b/Engine/Source/Developer/MaterialBaking/Private/ExportMaterialProxy.h index b100fb493..a497ae45e 100644 --- a/Engine/Source/Developer/MaterialBaking/Private/ExportMaterialProxy.h +++ b/Engine/Source/Developer/MaterialBaking/Private/ExportMaterialProxy.h @@ -321,7 +321,7 @@ class FExportMaterialProxy : public FMaterial, public FMaterialRenderProxy //////////////// // FMaterialRenderProxy interface. - virtual const FMaterial& GetMaterialWithFallback(ERHIFeatureLevel::Type FeatureLevel, const FMaterialRenderProxy*& OutFallbackMaterialRenderProxy) const override + virtual const FMaterial& GetMaterialWithFallback(ERHIFeatureLevel::Type InFeatureLevel, const FMaterialRenderProxy*& OutFallbackMaterialRenderProxy) const override { if(GetRenderingThreadShaderMap()) { @@ -330,7 +330,7 @@ class FExportMaterialProxy : public FMaterial, public FMaterialRenderProxy else { OutFallbackMaterialRenderProxy = UMaterial::GetDefaultMaterial(MD_Surface)->GetRenderProxy(); - return OutFallbackMaterialRenderProxy->GetMaterialWithFallback(FeatureLevel, OutFallbackMaterialRenderProxy); + return OutFallbackMaterialRenderProxy->GetMaterialWithFallback(InFeatureLevel, OutFallbackMaterialRenderProxy); } } @@ -627,4 +627,4 @@ class FExportMaterialProxy : public FMaterial, public FMaterialRenderProxy EMaterialProperty PropertyToCompile; FGuid Id; bool bSynchronousCompilation; -}; \ No newline at end of file +}; diff --git a/Engine/Source/Developer/MaterialUtilities/Private/MaterialUtilities.cpp b/Engine/Source/Developer/MaterialUtilities/Private/MaterialUtilities.cpp index 3afad04b8..c6a2a32c6 100644 --- a/Engine/Source/Developer/MaterialUtilities/Private/MaterialUtilities.cpp +++ b/Engine/Source/Developer/MaterialUtilities/Private/MaterialUtilities.cpp @@ -490,7 +490,7 @@ class FExportMaterialProxy : public FMaterial, public FMaterialRenderProxy //////////////// // FMaterialRenderProxy interface. - virtual const FMaterial& GetMaterialWithFallback(ERHIFeatureLevel::Type FeatureLevel, const FMaterialRenderProxy*& OutFallbackMaterialRenderProxy) const override + virtual const FMaterial& GetMaterialWithFallback(ERHIFeatureLevel::Type InFeatureLevel, const FMaterialRenderProxy*& OutFallbackMaterialRenderProxy) const override { if(GetRenderingThreadShaderMap()) { @@ -499,7 +499,7 @@ class FExportMaterialProxy : public FMaterial, public FMaterialRenderProxy else { OutFallbackMaterialRenderProxy = UMaterial::GetDefaultMaterial(MD_Surface)->GetRenderProxy(); - return OutFallbackMaterialRenderProxy->GetMaterialWithFallback(FeatureLevel, OutFallbackMaterialRenderProxy); + return OutFallbackMaterialRenderProxy->GetMaterialWithFallback(InFeatureLevel, OutFallbackMaterialRenderProxy); } } diff --git a/Engine/Source/Editor/MaterialEditor/Private/MaterialEditor.h b/Engine/Source/Editor/MaterialEditor/Private/MaterialEditor.h index 1f0d11c03..6db7556f7 100644 --- a/Engine/Source/Editor/MaterialEditor/Private/MaterialEditor.h +++ b/Engine/Source/Editor/MaterialEditor/Private/MaterialEditor.h @@ -102,7 +102,7 @@ class FMatExpressionPreview : public FMaterial, public FMaterialRenderProxy //////////////// // FMaterialRenderProxy interface. - virtual const FMaterial& GetMaterialWithFallback(ERHIFeatureLevel::Type FeatureLevel, const FMaterialRenderProxy*& OutFallbackMaterialRenderProxy) const override + virtual const FMaterial& GetMaterialWithFallback(ERHIFeatureLevel::Type InFeatureLevel, const FMaterialRenderProxy*& OutFallbackMaterialRenderProxy) const override { if(GetRenderingThreadShaderMap()) { @@ -111,7 +111,7 @@ class FMatExpressionPreview : public FMaterial, public FMaterialRenderProxy else { OutFallbackMaterialRenderProxy = UMaterial::GetDefaultMaterial(MD_Surface)->GetRenderProxy(); - return OutFallbackMaterialRenderProxy->GetMaterialWithFallback(FeatureLevel, OutFallbackMaterialRenderProxy); + return OutFallbackMaterialRenderProxy->GetMaterialWithFallback(InFeatureLevel, OutFallbackMaterialRenderProxy); } } diff --git a/Engine/Source/Editor/UnrealEd/Private/Lightmass/LightmassRender.cpp b/Engine/Source/Editor/UnrealEd/Private/Lightmass/LightmassRender.cpp index d46bf610f..3af24c5a0 100644 --- a/Engine/Source/Editor/UnrealEd/Private/Lightmass/LightmassRender.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/Lightmass/LightmassRender.cpp @@ -316,7 +316,7 @@ class FLightmassMaterialProxy : public FMaterial, public FMaterialRenderProxy //////////////// // FMaterialRenderProxy interface. - virtual const FMaterial& GetMaterialWithFallback(ERHIFeatureLevel::Type FeatureLevel, const FMaterialRenderProxy*& OutFallbackMaterialRenderProxy) const override + virtual const FMaterial& GetMaterialWithFallback(ERHIFeatureLevel::Type InFeatureLevel, const FMaterialRenderProxy*& OutFallbackMaterialRenderProxy) const override { if(GetRenderingThreadShaderMap()) { @@ -325,7 +325,7 @@ class FLightmassMaterialProxy : public FMaterial, public FMaterialRenderProxy else { OutFallbackMaterialRenderProxy = UMaterial::GetDefaultMaterial(MD_Surface)->GetRenderProxy(); - return OutFallbackMaterialRenderProxy->GetMaterialWithFallback(FeatureLevel, OutFallbackMaterialRenderProxy); + return OutFallbackMaterialRenderProxy->GetMaterialWithFallback(InFeatureLevel, OutFallbackMaterialRenderProxy); } } diff --git a/Engine/Source/Editor/UnrealEd/Private/PreviewMaterial.cpp b/Engine/Source/Editor/UnrealEd/Private/PreviewMaterial.cpp index 1eab0a8af..781492820 100644 --- a/Engine/Source/Editor/UnrealEd/Private/PreviewMaterial.cpp +++ b/Engine/Source/Editor/UnrealEd/Private/PreviewMaterial.cpp @@ -229,7 +229,7 @@ class FPreviewMaterial : public FMaterialResource, public FMaterialRenderProxy virtual bool IsPersistent() const { return false; } // FMaterialRenderProxy interface - virtual const FMaterial& GetMaterialWithFallback(ERHIFeatureLevel::Type FeatureLevel, const FMaterialRenderProxy*& OutFallbackMaterialRenderProxy) const override + virtual const FMaterial& GetMaterialWithFallback(ERHIFeatureLevel::Type InFeatureLevel, const FMaterialRenderProxy*& OutFallbackMaterialRenderProxy) const override { if(GetRenderingThreadShaderMap()) { @@ -238,7 +238,7 @@ class FPreviewMaterial : public FMaterialResource, public FMaterialRenderProxy else { OutFallbackMaterialRenderProxy = UMaterial::GetDefaultMaterial(MD_Surface)->GetRenderProxy(); - return OutFallbackMaterialRenderProxy->GetMaterialWithFallback(FeatureLevel, OutFallbackMaterialRenderProxy); + return OutFallbackMaterialRenderProxy->GetMaterialWithFallback(InFeatureLevel, OutFallbackMaterialRenderProxy); } } diff --git a/Engine/Source/Runtime/Experimental/Voronoi/Private/Voronoi/Voronoi.cpp b/Engine/Source/Runtime/Experimental/Voronoi/Private/Voronoi/Voronoi.cpp index 923d144da..fbd732307 100644 --- a/Engine/Source/Runtime/Experimental/Voronoi/Private/Voronoi/Voronoi.cpp +++ b/Engine/Source/Runtime/Experimental/Voronoi/Private/Voronoi/Voronoi.cpp @@ -1,11 +1,12 @@ // Copyright Epic Games, Inc. All Rights Reserved. #include "Voronoi/Voronoi.h" - THIRD_PARTY_INCLUDES_START #include "voro++/voro++.hh" THIRD_PARTY_INCLUDES_END +#include + namespace { // initialize AABB, ignoring NaNs @@ -80,7 +81,7 @@ namespace { // If points are too far apart, voro++ will ask for unbounded memory to build its grid over space // TODO: Figure out reasonable bounds / behavior for this case - ensure(BoundingBoxSize.GetMax() < HUGE_VALF); + ensure(BoundingBoxSize.GetMax() < std::numeric_limits::max()); int NumSites = Sites.Num(); @@ -273,4 +274,4 @@ int32 FVoronoiDiagram::FindCell(const FVector& Pos) // Voronoi.ComputeAllCells(AllCells); //} -const float FVoronoiDiagram::DefaultBoundingBoxSlack = .1f; \ No newline at end of file +const float FVoronoiDiagram::DefaultBoundingBoxSlack = .1f; diff --git a/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp b/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp index 16ccf1b2d..76e085007 100644 --- a/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp +++ b/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp @@ -1,6 +1,8 @@ // Copyright Epic Games, Inc. All Rights Reserved. #include "RenderGraphPrivate.h" +#include +#include #if RDG_ENABLE_DEBUG @@ -170,19 +172,25 @@ bool IsDebugAllowedForResource(const TCHAR* ResourceName) FLinearColor GetClobberColor() { - switch (GRDGClobberResources) + float x; + switch ((int32_t)GRDGClobberResources) { case 1: - return FLinearColor(1000, 1000, 1000, 1000); + x = 1000.0F; + break; case 2: - return FLinearColor(NAN, NAN, NAN, NAN); + x = std::numeric_limits::quiet_NaN(); + break; case 3: - return FLinearColor(INFINITY, INFINITY, INFINITY, INFINITY); + x = std::numeric_limits::infinity(); + break; case 4: - return FLinearColor(0, 0, 0, 0); + x = 0.0F; + break; default: return FLinearColor::Black; } + return FLinearColor(x, x, x, x); } uint32 GetClobberBufferValue() @@ -395,4 +403,4 @@ void InitRenderGraph() CVarRDGDebugResourceFilter->Set(*ResourceFilter); } #endif -} \ No newline at end of file +}