Files
UnrealEngineUWP/Engine/Source/Developer/DerivedDataCache/Private/FileSystemCacheStore.cpp

2660 lines
83 KiB
C++
Raw Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
#include "Algo/Accumulate.h"
#include "Algo/AllOf.h"
#include "Algo/Compare.h"
#include "Algo/StableSort.h"
#include "Algo/Transform.h"
#include "Async/Async.h"
#include "Async/TaskGraphInterfaces.h"
#include "Containers/StaticBitArray.h"
#include "DerivedDataBackendCorruptionWrapper.h"
#include "DerivedDataBackendInterface.h"
#include "DerivedDataCacheInterface.h"
#include "DerivedDataCacheMaintainer.h"
#include "DerivedDataCachePrivate.h"
#include "DerivedDataCacheRecord.h"
#include "DerivedDataCacheUsageStats.h"
#include "DerivedDataChunk.h"
#include "DerivedDataValue.h"
#include "Experimental/Async/LazyEvent.h"
#include "Features/IModularFeatures.h"
#include "HAL/Event.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "HAL/FileManager.h"
#include "HAL/Thread.h"
#include "Hash/xxhash.h"
#include "HashingArchiveProxy.h"
#include "Math/NumericLimits.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "Misc/CommandLine.h"
#include "Misc/ConfigCacheIni.h"
#include "Misc/CoreMisc.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "Misc/FileHelper.h"
#include "Misc/Guid.h"
#include "Misc/MessageDialog.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "Misc/Paths.h"
#include "Misc/PathViews.h"
#include "Misc/ScopeExit.h"
Copying //UE4/Dev-Editor to //UE4/Dev-Main (Source: //UE4/Dev-Editor @ 3739701) #lockdown Nick.Penwarden #rb none ============================ MAJOR FEATURES & CHANGES ============================ Change 3358367 by tim.gautier Submitting resaved QAGame assets - Materials, Material Instances, Material Functions and Parameters Change 3624848 by Jamie.Dale Added a composite font for the editor (and Slate core) This is defined in FLegacySlateFontInfoCache::GetDefaultFont and uses our default Roboto fonts (and the culture specific fallback fonts), and is now used as the default font for Slate and the editor. This change removes all the manual TTF/OTF file references from the various Slate styles, as well as updating 200+ hard-coded font references to use the new default font. This fixes various rendering issues with fonts in the editor when using different languages, and clears a big barrier for removing the legacy localized fallback font support. Change 3654993 by Jamie.Dale 'Native' (now called 'FNativeFuncPtr') is now a function pointer that takes a UObject* context, rather than a UObject member function pointer This avoids ambiguity when binding a native function pointer to a type that doesn't match the context pointer, as you could end up getting a function called with an incorrect 'this' pointer Breaking changes: - Native has been renamed to FNativeFuncPtr. - The signature of a native function has changed (use the DECLARE_FUNCTION and DEFINE_FUNCTION macro pair). - Use P_THIS if you were previously using the 'this' pointer in your native function. Change 3699591 by Jamie.Dale Added support for displaying and editing numbers in a culture correct way Numeric input boxes in Slate will now display and accept numbers using the culture correct decimal separators. This is enabled by default, and can be disabled by setting "ShouldUseLocalizedNumericInput" to "False" in XEditorSettings.ini (for the editor), or XGameUserSettings.ini (for a game). #jira UE-4028 Change 3719568 by Jamie.Dale Allow platforms to override the default ICU timezone calculation Change 3622366 by Bradut.Palas #jira UE-46677 Don't allow OnLevelRemovedFromWorld to reset the transaction buffer if we're in PIE mode. Also, remove one undo barrier in case the event was triggered in PIE mode or else we block the user from undoing previous actions. Change 3622378 by Bradut.Palas #jira UE-46590 we have a general bug with detecting the size of the last column, but the clamping prevents it from appearing with the other resize modes. The Content Browser is the only one to use fixed width. The bug is that the size of the last element is incorrectly reported, after we drag back and forth. Fixed by not reading the size real time, but reading it from the SlotInfo structure that is created earlier, which holds the correct value. Change 3622552 by Jamie.Dale Added support for per-culture sub-fonts within a composite font This allows you to do things like create a Japanese specific Han sub-font to override the Han characters used in a CJK font (previously you needed to create a localized font asset to achieve this). Change 3623170 by Jamie.Dale Fixing warning Change 3624846 by Jamie.Dale Composite font cache optimizations - Converted a typically small sized map to a sorted array + binary search. - Converted the already sorted range array to use binary search. - Contiguous ranges using the same typeface are now merged in the cache. Change 3625576 by Cody.Albert We now only set the widget tree to transient instead of passing the flag through StaticDuplicateObject. This was causing instanced subobjects to be flagged with RF_DuplicateTransient, preventing them from properly being duplicated when an array of instanced subobjects was modified. #jira UE-47971 Change 3626057 by Matt.Kuhlenschmidt Expose EUmgSequencePlayMode to blueprints #jira UE-49255 Change 3626556 by Matt.Kuhlenschmidt Fix window size and position adjustment not accounting for primary monitor not being a high DPI monitor when a secondary monitor is. Causes flickering and incorrect window positioning. #jira UE-48922, UE-48957 Change 3627692 by Matt.Kuhlenschmidt PR #3977: Source control submenu menu customization (Contributed by Kryofenix) Change 3628600 by Arciel.Rekman Added AutoCheckout to FAssetRenameManager for commandlet usage. Change 3630561 by Richard.Hinckley Deprecating the version of UFunctionalTestingManager::RunAllFunctionalTests that feature an unused bool parameter, replacing with a new version without that parameter. Change 3630656 by Richard.Hinckley Compile fix. Change 3630964 by Arciel.Rekman Fix CrashReporterClient headless build. Change 3631050 by Matt.Kuhlenschmidt Back out revision 9 from //UE4/Dev-Editor/Engine/Source/Runtime/Slate/Private/Widgets/Layout/SSplitter.cpp Causes major problems with resizing splitters in editor Change 3631140 by Arciel.Rekman OpenAL: update Linux version to 1.18.1 (UETOOL-1253) - Also remove a hack for RPATH and make it use a generic RPATH mechanism. - Bulk of the change from Cengiz.Terzibas #jira UETOOL-1253 Change 3632924 by Jamie.Dale Added support for a catch-all fallback font within composite fonts This allows you to provide broad "font of last resort" behavior on a per-composite font basis, in a way that can also work with different font styles. Change 3633055 by Jamie.Dale Fixed some refresh issues in the font editor Change 3633062 by Jamie.Dale Fixed localization commands being reported as unknown Change 3633906 by Nick.Darnell UMG - You can now store refrences to widgets in the same UserWidget. If you need to create links between widgets this is valuable. Will likely introduce new ways to utilize this in the future, for now just getting it working. Change 3634070 by Arciel.Rekman Display actually used values of material overrides. Change 3634254 by Arciel.Rekman Fix ResavePackages working poorly with projects on other drives (UE-49465). #jira UE-49465 Change 3635985 by Matt.Kuhlenschmidt Fixed typo in function name used by maps PR #3975: Add tooltip to Arrays in Editor (Contributed by projectgheist) Change 3636012 by Matt.Kuhlenschmidt PR #3982: Unhide mouse cursor after using Ansel (Contributed by projectgheist) Change 3636706 by Lauren.Ridge Epic Friday: Save parameters to child or sibling instance functionality Change 3638706 by Jamie.Dale Added an improved Japanese font to the editor This is only used when displaying Japanese text when the editor is set to Japanese, and uses a font with Japanese-style unified Han characters (our default fallback font uses Chinese-style unified Han characters). #jira UE-33268 Change 3639438 by Arciel.Rekman Linux: Repaired ARM server build (UE-49635). - Made Steam* plugins compile. - Disabled OpenEXR as the libs aren't compiled (need to be done separately). (Edigrating CL 3639429 from Release-4.17 to Dev-Editor) Change 3640625 by Matt.Kuhlenschmidt PR #4012: FSlateApplication::ProcessReply use &Reply (Contributed by projectgheist) Change 3640626 by Matt.Kuhlenschmidt PR #4011: Remove space from filename (Contributed by projectgheist) Change 3640697 by Matt.Kuhlenschmidt PR #4010: PNG alpha fix (Contributed by mmdanggg2) Change 3641137 by Jamie.Dale Fixed an issue where a culture specific sub-font could produce incorrect measurements during a culture switch It would fallback to the last resort font for a frame or two while the font cache flushed. This has it update the ranges immediately. Change 3641351 by Jamie.Dale Fixing incorrect weights on the Japanese sub-font Change 3641356 by Jamie.Dale Fixing inconsistent font sizes between CoreStyle and EditorStyle Change 3641710 by Jamie.Dale Fixed pure-virtual function call on UMulticastDelegateProperty Change 3641941 by Lauren.Ridge Adding a Parameter Details tab to the Material Editor so users can change default parameter details Change 3644141 by Jamie.Dale Added an improved Korean font to the editor This is only used when displaying Korean text when the editor is set to Korean Change 3644213 by Arciel.Rekman Fix the side effects of a fix for UE-49465. - Default materials were apparently not being found while building DDC (e.g. making an installed build), now they are and we should not reset loaders on them lest we trigger HasDefaultMaterialsPostLoaded() assert later. #jira UE-49465 Change 3644777 by Jamie.Dale Reverting Korean editor font back to NanumGothic as NanumBarunGothic looked too squished Change 3644879 by tim.gautier QAGame: Optimized assets for Procedural Foliage testing - Added camera bookmarks to Stations in QA-Foliage - Renamed QA-FoliageTypeInst assets to ProcFoliage_Shape - Fixed up redirectors Change 3645109 by Matt.Kuhlenschmidt PR #3990: Git plugin: fix status of renamed, removed, missing, untracked assets (Contributed by SRombauts) Change 3645114 by Matt.Kuhlenschmidt PR #3991: Git Plugin: Fix RunDumpToFile() leaking Process handles (Contributed by SRombauts) Change 3645116 by Matt.Kuhlenschmidt PR #3996: Git Plugin: run an "UpdateStatus" at "Connect" time to populate the Source Control cache (Contributed by SRombauts) Change 3645118 by Matt.Kuhlenschmidt PR #4005: Git Plugin: Expand the size of the Button "Initialize project with Git" (Contributed by SRombauts) Change 3645876 by Arciel.Rekman Linux: fix submenus of context menu not working (UE-47639). - Change by icculus (Ryan Gordon). - QA-ClickHUD seems to be not affected by this change (it is already broken alas). #jira UE-47639 Change 3648088 by Jamie.Dale Fixed some case-sensitivity issues with FText format argument names/pins These were originally case-sensitive, but that was lost somewhere along the way. This change restores their original behavior. #jira UE-47122 Change 3648097 by Jamie.Dale Moved common macOS/iOS localization implementation into FApplePlatformMisc #jira UE-49940 Change 3650858 by Arciel.Rekman UBT: improve CodeLite project generator (UE-49400). - PR #3987 submitted by yaakuro (Cengiz Terzibas). #jira UE-49400 Change 3651231 by Arciel.Rekman Linux: default to SM5 for Vulkan. - Change by Timothee.Bessett. Change 3653627 by Matt.Kuhlenschmidt PR #4020: Source Control Submit Files now interprets Escape key as if the user clicked cancel (Contributed by SRombauts) Change 3653628 by Matt.Kuhlenschmidt PR #4022: Add New C++ Class dialog remember previously selected module. (Contributed by Koderz) Change 3653984 by Jamie.Dale Fixed some redundant string construction Change 3658528 by Joe.Graf UE-45141 - Added CMAKE_CXX_COMPILER and CMAKE_C_COMPILER settings to the generated CMake files Change 3658594 by Jamie.Dale Zipping in UAT now always uses UTF-8 encoding to prevent Unicode issues #jira UE-27263 Change 3659643 by Michael.Trepka Added a call to FCoreDelegates::ApplicationWillTerminateDelegate.Broadcast(); in Mac RequestExit() to match Windows behavior #jira UETOOL-1238 Change 3661908 by Matt.Kuhlenschmidt USD asset importing improvements Change 3664100 by Matt.Kuhlenschmidt Fix static analysis Change 3664107 by Matt.Kuhlenschmidt PR #4051: UE-49448: FPropertyChangedEvent to include TopLevelObjects (Contributed by projectgheist) Change 3664125 by Matt.Kuhlenschmidt PR #4036: Add missing GRAPHEDITOR_API (Contributed by projectgheist) Change 3664340 by Jamie.Dale PR #3648: Prevent GatherTextFromSource from failing the commandlet (Contributed by projectgheist) Change 3664403 by Jamie.Dale PR #3769: Fixes UE-46973 - Drag and Dropping Folders with Names (Contributed by LordNed) Change 3664539 by Jamie.Dale PR #3280: Added EditableText functionality (Contributed by projectgheist) Change 3665433 by Alexis.Matte When we finish importing morph target we must re-initialise the render resources since we now use GPU morph target. #jira UE-50231 Change 3666747 by Cody.Albert Change 3669280 by Jamie.Dale PR #4060: UE-50455: Verify folder is newly created before removing from tree (Contributed by projectgheist) Change 3669718 by Jamie.Dale PR #4061: Clear Content Browser folder search box on escape key (Contributed by projectgheist) Change 3670838 by Alexis.Matte Fix crash when deleting a skeletal mesh LOD and the mouse is over the "reimport" button. #jira UE-50387 Change 3671559 by Matt.Kuhlenschmidt Update SimpleUI automation test ground truth #jira UE-50325 Change 3671587 by Alexis.Matte Fix fbx importer scale not always apply. A cache array was not reset when opening a fbx file. #jira UE-50147 Change 3671730 by Jamie.Dale Added PostInitInstance to UClass to allow class types to perform construction time initialization of their instances Change 3672104 by Michael.Dupuis #jira UE-50427: Update the volume visibility list of the editor viewport when changing the procedural foliage settings Change 3674906 by Alexis.Matte Make sure the export LOD option is taken in consideration when exporting a level or the current level selection #jira UE-50248 Change 3674942 by Matt.Kuhlenschmidt Fix static analysis Change 3675401 by Alexis.Matte -fix export animation, do not truncate the last frame anymore -fix the import animation, there was a display issue in the progress bar. Also a floorToInt sometime truncate the last valid frame. We also have a better way to calculate the time increment we use to sample the fbx curves. #jira UE-48231 Change 3675990 by Alexis.Matte Remove morph target when doing a re-import, so morph will be remove if they do not exist anymore in the fbx. This is to avoid driving random vertex with old morph target. #jira UE-50391 Change 3676169 by Alexis.Matte When we re-import with dialog the option, "Override Full Name" was set to false and save with the option dialog. We now not set it to false, since it was not use during re-import. Change 3676396 by Alexis.Matte Make all LOD 0 name consistent in staticmesh editor #jira UE-49461 Change 3677730 by Cody.Albert Enable locking of Persistent Level in Levels tab #jira UE-50686 Change 3677838 by Jamie.Dale Replaced broken version of Roboto Light Change 3679619 by Alexis.Matte Integrate GitHub pr #4029 to fix import fbx chunk material assignation. #jira UE-50001 Change 3680093 by Alexis.Matte Fix the skeletal mesh so the vertex color is part of the vertex equality like with the static mesh. Change 3680931 by Arciel.Rekman SlateDialogs: show image icon for *.tga (UE-25106). - Also reworked the logic somewhat. #jira UE-25106 Change 3681966 by Yannick.Lange MaterialEditor post-process preview. #jira UE-45307 Change 3682407 by Lauren.Ridge Fixes for material editor compile errors Change 3682628 by Lauren.Ridge Content browser filters for Material Layers, Blends, and their instances Change 3682725 by Lauren.Ridge Adding filter assets and instance assets to Material Layers and Material Layer Blends. Turning Material Layering on by default Change 3682921 by Lauren.Ridge Fix for instance layers not initializing fully Change 3682954 by Lauren.Ridge Creating Material Layer Test Assets Change 3683582 by Alexis.Matte Fix static analysis build Change 3683614 by Matt.Kuhlenschmidt PR #4062: Git Plugin: Fix UE-44637: Deleting an asset is unsuccessful if the asset is marked for add (Contributed by SRombauts) Change 3684130 by Lauren.Ridge Allow visible parameter retrieval to correctly recurse through internally called functions. Previous check was intended to prevent function previews from leaving their graph through unhooked inputs, but unintentionally blocked all function inputs. Change 3686289 by Arciel.Rekman Remove the pessimization (UE-23791). Change 3686455 by Lauren.Ridge Fixes for adding/removing a layer parameter from the parent not updating the child Change 3686829 by Jamie.Dale No longer include trailing whitespace in the justification calculation for soft-wrapped lines #jira UE-50266 Change 3686970 by Lauren.Ridge Making material parameter preview work for functions as well Change 3687077 by Jamie.Dale Fixed crash using FActorDetails with the struct details panel Change 3687152 by Jamie.Dale Fixed the row structure tag not appearing in the Content Browser for Data Table assets The CDO is used to filter these tags, and the CDO was omiting that tag which caused it to be filtered for all Data Tables. #jira UE-48691 Change 3687174 by Lauren.Ridge Fix for material layer sub-parameters showing up in the default material parameters panel Change 3688100 by Lauren.Ridge Fixing static analysis error Change 3688317 by Jamie.Dale Fixed crash using the widget reflector in a cooked game Editor-style isn't available in cooked games. Core-style should be used instead for the widget reflector. Change 3689054 by Jamie.Dale Reference Viewer can now show/copy references lists for nodes with multiple objects, or multiple selected nodes #jira UE-45751 Change 3689513 by Jamie.Dale Fixed justification bug with RTL text caused by CL# 3686829 Also implemented the same alignment fix for visually left-aligned RTL text. #jira UE-50266 Change 3690231 by Lauren.Ridge Added Material Layers Parameters Preview (all editing disabled) panel to the Material Editor Change 3690234 by Lauren.Ridge Adding Material Layers Function Parameter to Static Parameter Compare Change 3690750 by Chris.Bunner Potential nullptr crash. Change 3690751 by Chris.Bunner Fixed logic on overridden vector parameter retrieval for material instances checking a function owned parameter. Change 3691010 by Jamie.Dale Fixed some clipping issues that could occur with right-aligned text FTextBlockLayout::OnPaint was passing an unscaled offset to SetVisibleRegion, and it also wasn't correctly adjusting the offset for RTL text with left-alignment (which becomes a visual right-alignment) #jira UE-46760 Change 3691091 by Jamie.Dale Renamed FTextBlockLayout to FSlateTextBlockLayout to reflect that it's a Slate specific type Change 3691134 by Alexis.Matte Make sure we instance also the collision mesh when exporting a level to fbx file. #jira UE-51066 Change 3691157 by Lauren.Ridge Fix for reset to default not refreshing sub-parameters Change 3691192 by Jamie.Dale Fixed Content Browser selection resetting when changing certain view settings #jira UE-49611 Change 3691204 by Alexis.Matte Remove fbx export file version 2010 compatibility. The 2018 fbx sdk refuse to export earlier then 2011. #jira UE-51023 Change 3692335 by Lauren.Ridge Setting displayed asset to equal filter asset if no instance has been selected Change 3692479 by Jamie.Dale Fixed whitespace Change 3692508 by Alexis.Matte Make sure we warn the user that there is nothing to export when exporting to fbx using "export selected" or "export All" from the file menu. We also prevent the export dialog to show #jira UE-50973 Change 3692639 by Jamie.Dale Translation Editor now shows stale translations as "Untranslated" Change 3692743 by Lauren.Ridge Smaller blend icons, added icon size override to FObjectEntryBox Change 3692830 by Alexis.Matte Fix linux build Change 3692894 by Lauren.Ridge Tooltip on "Parent" in material layers Change 3693141 by Jamie.Dale Removed dead code FastDecimalFormat made this redundant Change 3693580 by Jamie.Dale Added AlwaysSign number formatting option #jira UE-10310 Change 3693784 by Jamie.Dale Fixed assert extracting the number formatting rules for Arabic It uses a character outside the BMP for its plus and minus sign, so we need these to be a string to handle that. #jira UE-10310 Change 3694428 by Arciel.Rekman Linux: make directory watch request a warning so they don't block cooking. - See https://answers.unrealengine.com/questions/715206/cook-error-on-linux.html Change 3694458 by Matt.Kuhlenschmidt Made duplicate keybinding warning non-fatal Change 3694496 by Alexis.Matte fix static analysis build Change 3694515 by Jamie.Dale Added support for culture correct parsing of decimal numbers #jira UE-4028 Change 3694621 by Jamie.Dale Added a variant of FastDecimalFormat::StringToNumber that takes a string length This can be useful if you want to convert a number from within a non-null terminated string #jira UE-4028 Change 3694958 by Jamie.Dale Added a parsed length output to FastDecimalFormat::StringToNumber to allow permissive parsing You can test this rather than the result if you want to attempt to parse a number from a string that may have other data after it. This also fixes the sign-suffix causing the parsing to fail. #jira UE-4028 Change 3695083 by Alexis.Matte Optimisation of the morph target import - We now compute only the normal for the shape the tangent are not necessary - The async tasks are create when there is some available cpu thread to avoid filling the memory - When we re-import the morph target are deleted in bulk avoiding to initialize the morph map for every morphs targets #jira UE-50945 Change 3695122 by Jamie.Dale GetCultureAgnosticFormattingRules no longer returns a copy Change 3695835 by Arciel.Rekman TestPAL: greatly expanded malloc test. Change 3695918 by Arciel.Rekman TestPAL: Added thread priority test. Change 3696589 by Arciel.Rekman TestPAL: tweak thread priorities test (better readability). Change 3697345 by Alexis.Matte Fix reorder of material when importing a LOD with new material #jira UE-51135 Change 3699590 by Jamie.Dale Updated SGraphPinNum to use a numeric editor #jira UE-4028 Change 3699698 by Matt.Kuhlenschmidt Fix crash opening the level viewport context menu if the actor-component selection is out of sync #jira UE-48444 Change 3700158 by Arciel.Rekman Enable packaging for Android Vulkan on Linux (UETOOL-1232). - Change by Cengiz Terzibas Change 3700224 by Arciel.Rekman TestPAL: fixed a memory leak. Change 3700775 by Cody.Albert Don't need to initialize EnvironmentCubeMap twice. Change 3700866 by Michael.Trepka PR #3223: Remove unnecessary reallocation. (Contributed by foollbar) #jira UE-41643 Change 3701132 by Michael.Trepka Copy of CL 3671538 Fixed issues with editor's game mode in high DPI on Mac. #jira UE-49947, UE-51063 Change 3701421 by Michael.Trepka Fixed a crash in FScreenShotManager caused by an attempt to access a deleted FString in async lambda expression Change 3701495 by Alexis.Matte Fix fbx importer "import normals" option when mix with "mikkt" tangent build it was recomputing the normals instead of importing them. #jira UE-UE-51359 Change 3702982 by Jamie.Dale Cleaned up some localization setting names These now have consistent names and avoid double negatives. This also fixes needing to restart the editor when changing the "ShouldUseLocalizedPropertyNames" setting. Change 3703517 by Arciel.Rekman TestPAL: improved thread test. - Changed the counter to a normal variable to reduce possible contentions (threads used to share the counter in an early prototype, hence the usage of an atomic). Change 3704378 by Michael.Trepka Disable Zoom button on Mac if project requests a resizeable window without it. #jira UE-51335 Change 3706316 by Jamie.Dale Fixed the asset search suggestions list closing if you clicked on its scrollbar #jira UE-28885 Change 3706855 by Alexis.Matte Support importing animation that has some keys with negative time #jira UE-51305 Change 3709634 by Matt.Kuhlenschmidt PR #4146: Null access check on ForceLOD in FViewport::HighResScreenshot (Contributed by projectgheist) Change 3711085 by Michael.Trepka Reenabled UBT makefiles on Mac Change 3713049 by Josh.Engebretson The ConfigPropertyEditor now generates a unique runtime UClass. It uses the outer name on the property instead of a unique ID as a unique id would generate a new UClass every time (and these are RF_Standalone). I also removed some static qualifiers for Section and Property names which were incorrect. #jira UE-51319 Change 3713144 by Lauren.Ridge Fixing automated test error #jira UE-50982 Change 3713395 by Alexis.Matte Fix auto import mountpoint #jira UE-51524 Change 3713881 by Michael.Trepka Added -buildscw to Mac Build.sh script to build ShaderCompileWorker in addition to the requested target. Xcode passes it to the script when building non-program targets. #jira UE-31093 Change 3714197 by Michael.Trepka Send IMM key down event to the main window instead of Cocoa key window, as that's what the Slate's active window is. This solves problems with IMM not working in context menu text edit fields. #jira UE-47915 Change 3714911 by Joe.Graf Merge of cmake changes from Dev-Rendering Change 3715973 by Michael.Trepka Disable OS close button on Windows if project settings request that #jira UE-45522 Change 3716390 by Lauren.Ridge The color picker summoned when double-clicking vector3 nodes now has its intended "do not refresh until OK is clicked" behavior. #jira UE-50916 Change 3716529 by Josh.Engebretson Content Browser: Clamp "Assets to Load at Once Before Warning" so it cannot be set below 1 #jira UE-51341 Change 3716885 by Josh.Engebretson Tracking transactions such as a duplication operation can modify a selection which differs from the initial one. Added package state tracking to restore unmodified state when necessary. #jira UE-48572 Change 3716929 by Josh.Engebretson Unshelved from pending changelist '3364093': PR #3420: Exe's icons and properties (Contributed by projectgheist) Change 3716937 by Josh.Engebretson Unshelved from pending changelist '3647428': PR #4026: Fixed memory leaks for pipe writes and added data pipe writes (Contributed by Hemofektik) Change 3717002 by Josh.Engebretson Fix FileReference/string conversion Change 3717355 by Joe.Graf Fixed CMake file generation on Windows including Engine/Source/ThirdParty source Change 3718256 by Arciel.Rekman TestPAL: slight mod to the malloc test. - Touch the allocated memory to check actual resident usage. Change 3718290 by Arciel.Rekman BAFO: place descriptor after the allocation to save some VIRT memory. - We're relying on passing correct "Size" argument to Free() anyway, and this modification makes use of that extra information to save on memory for the descriptor. Change 3718508 by Michael.Trepka Fixed vsnprintf on platforms that use our custom implementation in StandardPlatformString.cpp to ignore length modifier for certain types (floating point, pointer) #jira UE-46148 Change 3718855 by Lauren.Ridge Adding content browser favorite folders. Add or remove folders from the favorite list in the folder's right-click context menu, and hide or show the favorites list in the Content Browser options. Change 3718932 by Cody.Albert Update ActorSequence plugin loading phase to PreDefault #jira UE-51612 Change 3719378 by tim.gautier QAGame: Renamed multiTxt_Justification > UMG_TextJustification. Added additional Text Widgets for testing Change 3719413 by Lauren.Ridge Resubmit of content browser favorites Change 3719803 by Yannick.Lange VREditor: Fix crash with null GEditor #jira UE-50103 Change 3721127 by tim.gautier QAGame: Fixed up a ton of redirectors within /Content and /Content/Materials - Added M_ParamDefaults and MF_ParamDefaults - Moved legacy MeshPaint materials into /Content/Materials/MeshPaint - Renamed ColorPulse assets from MatFunction_ > MF_, moved into /Content/Materials/Functions Change 3721255 by Alexis.Matte Replace skeletal mesh import option "keep overlapping vertex" by 3 float thresholds allowing the user to control the welding thresholds. #jira UE-51363 Change 3721594 by Lauren.Ridge Material Blends now have plane mesh previews in their icons. Change 3722072 by tim.gautier QAGame: Updated MF_ParamDefaults - using red channel as roughness Updated M_ParamDefaults - tweaked Scalar values Change 3722180 by Michael.Trepka Updated Xcode project generator to sort projects in the navigator by name (within folders) and also sort the list of schemes so that their order matches the order of projects in the navigator. #jira UE-25941 Change 3722220 by Michael.Trepka Fixed a problem with Xcode project generator not handling quoted preprocessor definitions correctly #jira UE-40246 Change 3722806 by Lauren.Ridge Fixing non-editor compiles Change 3722914 by Alexis.Matte Fbx importer: Add new attribute type(eSkeleton) for staticmesh socket import. #jira UE-51665 Change 3723446 by Michael.Trepka Copy of CL 3688862 from 4.18 + one more fix for a deadlock related to window resizing when using IME Don't do anything in Mac window's windowWillResize: if we're simply chaning the z order of windows. This way we avoid a rare dead lock when hiding the window. #jira UE-48257 Change 3723505 by Matt.Kuhlenschmidt Fix duplicate actors being created for USD primitives that specify a custom actor class Change 3723555 by Matt.Kuhlenschmidt Fix crash loading the gameplayabilities module #jira UE-51693 Change 3723557 by Matt.Kuhlenschmidt Fixed tooltip on viewport dpi scaling option Change 3723870 by Lauren.Ridge Fixing incorrect reset to default visibility, adding clear behavior to fields Change 3723917 by Arciel.Rekman Linux: fix compilation with glibc 2.26+ (UE-51699). - Fixes compilation on Ubuntu 17.10 among others. (Merging 3723489 from //UE4/Release-4.18/... to //UE4/Dev-Editor/...) Change 3723918 by Arciel.Rekman Linux: do not test for popcnt presence unnecessarily (UE-51677). (Merging 3723904 from //UE4/Release-4.18/... to //UE4/Dev-Editor/...) Change 3724229 by Arciel.Rekman Fix FOutputDeviceStdOutput to use printf() on Unix platforms. Change 3724261 by Arciel.Rekman TestPAL: fix thread priority test (zero the counter). Change 3724978 by Arciel.Rekman Linux: fix priority calculation. - Rlimit values are always positive, so this was completely broken when the RLIMIT_NICE is non-0. Change 3725382 by Matt.Kuhlenschmidt Guard against crashes and add more logging when actor creation fails. Looks like it could be manual garbage collections triggered before conversion is complete so those have been removed #jira UE-47464 Change 3725559 by Matt.Kuhlenschmidt Added a setting to enable/disable high dpi support in editor. This currently only functions in Windows. Moved some files around for better consistency Change 3725640 by Arciel.Rekman Fix Linux thread/process priorities. - Should also speed up SCW on Linux by deprioritizing them less. Change 3726101 by Matt.Kuhlenschmidt Fix logic bug in USD child "kind" type resolving Change 3726244 by Joe.Graf Added an option to generate a minimal set of targets for cmake files Added shader and config files to cmake file generation for searching within IDEs Change 3726506 by Arciel.Rekman Fix compile issue after DPI change. Change 3726549 by Matt.Kuhlenschmidt Remove unnecessary indirection to cached widgets in the hit test grid Change 3726660 by Arciel.Rekman Enable DPI switch on Linux. Change 3726763 by Arciel.Rekman Fix mismatching "noperspective" qualifier (UE-50807). - Pull request #4080 by TTimo. Change 3727080 by Michael.Trepka Added support for editor's EnableHighDPIAwareness setting on Mac Change 3727658 by Matt.Kuhlenschmidt Fix shutdown crash if level editor is still referenced after the object system has been gc'd #jira UE-51630 Change 3728270 by Matt.Kuhlenschmidt Remove propertyeditor dependency from editorstyle Change 3728291 by Arciel.Rekman Linux: fix for a crash on a headless system (UE-51714). - Preliminary change before merging to 4.18. Change 3728293 by Arciel.Rekman Linux: remove unneeded dependency on CEF. - Old workaround should no longer be needed, while this dependency makes UE4 depend on a ton of external libs. Change 3728524 by Michael.Trepka Copy of CL 3725570 Removed Enable Fullscreen option from editor's Window menu on Mac. Windowed fullscreen mode is currently unavailable on Mac in editor mode as supporting it properly would require it to work with multiple spaces and split screen, which we currently don't handle (requested in UE-27240) #jira UE-51709 Change 3728875 by Michael.Trepka Fixed compile error in Mac SlateOpenGLContext.cpp Change 3728880 by Matt.Kuhlenschmidt Guard against invalid worlds in thumbnail renderers Change 3728924 by Michael.Trepka Don't defer MacApplication->CloseWindow() call. This should fix a rare problem with deferred call executing during Slate's PrepassWindowAndChildren call. #jira UE-51711 Change 3729288 by Joe.Graf Added the .idea/misc.xml file generation to speed up CLion indexing Change 3729935 by Michael.Dupuis #jira UE-51722: Hide from UI invalid enum values Change 3730234 by Matt.Kuhlenschmidt Fix "Game Gets Mouse Control" setting no longer functioning and instead the mouse was always captured. #jira UE-51801 Change 3730349 by Michael.Dupuis #jira UE-51324: Clear the UI selection when rebuilding the palette, as we destroyed all items and recreate them, so selection is on invalid item Change 3730438 by Lauren.Ridge Cleaning up material layering UI functions Change 3730723 by Jamie.Dale Fixed FastDecimalFormat::StringToNumber incorrectly reporting that number-like sequences that lacked digits had been parsed as numbers #jira UE-51799 Change 3731008 by Lauren.Ridge Changing Layers and Blends from proxy assets to real assets Change 3731026 by Arciel.Rekman libelf: make elf_end() visible (UE-51843). - This repairs compilation for a case when CUDA is being used. - Also added some missing files for ARM 32-bit. Change 3731081 by Lauren.Ridge New material layer test assets Change 3731186 by Josh.Engebretson Adding camera speed scalar setting and Toolbar UI to increase range on camera speed presets #jira UE-50104 Change 3731188 by Mike.Erwin Improve responsiveness of Open Asset dialog. On large projects, there's a noticeable delay when opening and searching/filtering assets. Stopwatch measurements on my machine (seconds for ~122,000 assets): before with this CL ctrl-P 1.4 0.45 search 1.8 0.55 CollectionManagerModule was the main culprit for search/filter slowness. Open Asset delay was due to filtering out plugin content. We were doing a lot of redundant work for what is essentially a read-only operation. Change 3731682 by Arciel.Rekman UnrealEd: Allow unattended commandlets to rename/save packages. Change 3732305 by Michael.Dupuis #jira UE-48434 : Only register if the foliage type still has a valid mesh Change 3732361 by Matt.Kuhlenschmidt Fix two settings objects being created in the transient package with the same name #jira UE-51891 Change 3732895 by Josh.Engebretson https://jira.it.epicgames.net/browse/UE-51706 If a shared DDC is not being used, present a notification to the licensee with a link on how to setup a shared DDC. Adds DDC notification events for check/put and query for whether a shared DDC is in use. #jira UE-51706 Change 3733025 by Arciel.Rekman UBT: make sure new clang versions are invoked. Change 3733311 by Mike.Erwin Fix Linux compile warning from CL 3731188 It didn't like mixing && and || without parentheses. Reworked logic to do one test at a time, put cheaper tests first to avoid calls to more expensive IsPluginFolder. Change 3733658 by Josh.Engebretson Add a missing #undef LOCTEXT_NAMESPACE Change 3734003 by Arciel.Rekman Fix Windows attempting to use printf %ls and crashing at that (UE-51934). Change 3734039 by Michael.Trepka Fixed a couple of merge issues in Mac ApplicationCore Change 3734052 by Michael.Trepka One more Mac ApplicationCore fix Change 3734244 by Lauren.Ridge Fix for accessing Slate window on render thread Change 3734950 by Josh.Engebretson Fixing clang warning Change 3734978 by Jamie.Dale Relaxed enum property importing to allow valid numeric values to be imported too This was previously made more strict which caused a regression in Data Table importing #jira UE-51848 Change 3734999 by Arciel.Rekman Linux: add LTO support and more. - Adds ability to use link-time opitimization (reusing current target property bAllowLTCG). - Supports using llvm-ar and lld instead of ar/ranlib and ld. - More build information printed (and in a better organized way). - Native scripts updated to install packages with the appropriate tools on supported systems - AutoSDKs updated to require a new toolchain (already checked in). - Required disabling OpenAL due to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219089 Change 3735268 by Matt.Kuhlenschmidt Added support for canvas based DPI scaling. -Scene canvas is by default not scaled as this could severely impact any game using a canvas based UI -The debug canvas for stats is always dpi scaled in editor and pie. -Eliminated text scaling workaround now that the entire canvas is properly scaled -Enabled canvas scaling in cascade UI Change 3735329 by Matt.Kuhlenschmidt Fix potential crash if an asset editor has an object deleted out from under it #jira UE-51941 Change 3735502 by Arciel.Rekman Fix compile issue (bShouldUpdateScreenPercentage). Change 3735878 by Jamie.Dale Updated FString::SanitizeFloat to allow you to specify the min number of fractional digits to have in the resultant string This defaults to 1 as that was the old behavior of FString::SanitizeFloat, but can also be set to 0 to prevent adding .0 to whole numbers. Change 3735881 by Jamie.Dale JsonValue no longer stringifies whole numbers as floats Change 3735884 by Jamie.Dale Only allow enums to import integral values Change 3735912 by Josh.Engebretson Improving cook process error/warning handling including asset warning/error content browser links and manual dismiss for cook error notifications #jira UE-48131 Change 3736280 by Matt.Kuhlenschmidt Fix 0 dpi scale for canvases #jira UE-51995 Change 3736298 by Matt.Kuhlenschmidt Force focus of game viewports in vr mode Change 3736374 by Jamie.Dale Fixed some places where input chords were being used without testing that they had a valid key set #jira UE-51799 Change 3738543 by Matt.Kuhlenschmidt Better fix for edit condition crashes #jira UE-51886 Change 3738603 by Lauren.Ridge Copy over of drag and drop non-array onto array fix Change 3739701 by Chris.Babcock Fix crashlytics merge error #jira UE-52064 #ue4 #android [CL 3739980 by Matt Kuhlenschmidt in Main branch]
2017-11-06 18:22:01 -05:00
#include "Misc/ScopeLock.h"
#include "Misc/StringBuilder.h"
#include "ProfilingDebugging/CookStats.h"
#include "ProfilingDebugging/CountersTrace.h"
#include "ProfilingDebugging/CpuProfilerTrace.h"
#include "Serialization/CompactBinary.h"
#include "Serialization/CompactBinaryPackage.h"
#include "Serialization/CompactBinaryValidation.h"
#include "Serialization/CompactBinaryWriter.h"
#include "Templates/Greater.h"
Copying //UE4/Orion-Staging to //UE4/Main (Origin //Orion/Dev-General @ 2870388) #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2870336 on 2016/02/17 by Marc.Audy Continued splitting up Orion Build * Restructure from platform based MakeBuild steps in to a PS4, Server, and Windows Client MakeBuild * Cook server data only once for both Windows and Linux (windows reuses Linux server data) * Split compilation of Win64 Client and Server such that MakeBuild_Server only builds Server and MakeBuild_WindowsClient only builds Client #jira UEB-580 #rb Ben.Marsh #tests Preflight and generated Windows Client and Server work to play game Change 2870026 on 2016/02/17 by Wes.Hunt Don't allow array shrinking when removing the corruption wrapper trailer. #rb none Updating CIS Counter Change 2869725 on 2016/02/17 by Dmitry.Rekman More analytics and QoS stats added for 0.19. #rb none #tests Ran Windows client and Linux server on compatible content. Change 2869705 on 2016/02/16 by Ryan.Gerleve Fix replicated properties and call RepNotifies of startup actors when scrubbing in replays. This is the engine support for fixing OR-6817, towers not respawning when rewinding replays. #rb john.pollard #tests golden path, replays, ps4 nomcp Change 2869644 on 2016/02/16 by Jason.Bestimt #ORION_DEV - Merge MAIN (0.18) at CL# 2869635 #Tests:none #RB:none Change 2869586 on 2016/02/16 by Marcus.Wassmer Fix texturestreaming RHI flushes. #rb none #test goldenpath #codereview Gil.Gribb Change 2869279 on 2016/02/16 by Lukasz.Furman fixed minion hit reaction directions #orion OR-13953 #rb Mieszko.Zielinski #tests PIE: hit minions with various abilities from different angles, checked velocity of death particles when killed by abilities and towers #codereview Dan.Youhon Change 2869277 on 2016/02/16 by Wes.Hunt During cook, when a package is not ready to save, actually early out of the saving code. Saves somewhere in the 130s to 200s range for cooks. #rb daniel.lamb #tests local windows cooks, preflight PS4 cooks Change 2869132 on 2016/02/16 by Mieszko.Zielinski Added a function to AISenseConfig allowing native-code MaxAge configuration #UE4 #rb Lukasz.Furman #test none required Change 2868981 on 2016/02/16 by Wes.Hunt remove -LogCookStats cmdline check, always log cook stats. -SendCookAnalytics flag is still used. This was requested by NickP. #rb none #tests local windows cooks Change 2868975 on 2016/02/16 by Wes.Hunt Don't submit DDC usage stats for zero-sized events. #rb none #tests local windows cook Change 2868956 on 2016/02/16 by Jason.Bestimt #ORION_DEV - Merge MAIN (0.18) at CL# 2868926 #RB:none #Tests:none Change 2868889 on 2016/02/16 by Max.Chen Sequencer: Only allow transport control binding when editing level editor sequencers. #rb none #tests none Change 2868663 on 2016/02/16 by David.Ratti downgrade warning to display #rb none #tests compile Change 2868624 on 2016/02/16 by Marcus.Wassmer Re-Enable Defrag validation for devgeneral #rb none #test none Change 2868493 on 2016/02/16 by Benn.Gallagher Added a few more stats to morph target updates to try and narrow down hitches #rb Bruce.Nesbit #tests pie, -game Win64 Change 2868445 on 2016/02/16 by Dmitry.Rekman Linux: report crashes due to stack overflow (OR-14519). - Reserve memory for alternative stack for signal handlers. Adds about 128KB memory per thread. - Force process spawning to use vfork() when no pipes are needed. - Ignore all signals except explicitly handled. - Prevent signals from being raised while another one is handled. - Added "debug threadrecurse" and "debug threadstackoverflow" to test that. [CL 2873763 by Andrew Grant in Main branch]
2016-02-19 12:03:17 -05:00
#define MAX_BACKEND_KEY_LENGTH (120)
#define MAX_BACKEND_NUMBERED_SUBFOLDER_LENGTH (9)
#if PLATFORM_LINUX // PATH_MAX on Linux is 4096 (getconf PATH_MAX /, also see limits.h), so this value can be larger (note that it is still arbitrary).
// This should not affect sharing the cache between platforms as the absolute paths will be different anyway.
#define MAX_CACHE_DIR_LEN (3119)
#else
#define MAX_CACHE_DIR_LEN (119)
#endif // PLATFORM_LINUX
#define MAX_CACHE_EXTENTION_LEN (4)
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
namespace UE::DerivedData
{
TRACE_DECLARE_INT_COUNTER(FileSystemDDC_Exist, TEXT("FileSystemDDC Exist"));
TRACE_DECLARE_INT_COUNTER(FileSystemDDC_ExistHit, TEXT("FileSystemDDC Exist Hit"));
TRACE_DECLARE_INT_COUNTER(FileSystemDDC_Get, TEXT("FileSystemDDC Get"));
TRACE_DECLARE_INT_COUNTER(FileSystemDDC_GetHit, TEXT("FileSystemDDC Get Hit"));
TRACE_DECLARE_INT_COUNTER(FileSystemDDC_Put, TEXT("FileSystemDDC Put"));
TRACE_DECLARE_INT_COUNTER(FileSystemDDC_PutHit, TEXT("FileSystemDDC Put Hit"));
TRACE_DECLARE_INT_COUNTER(FileSystemDDC_BytesRead, TEXT("FileSystemDDC Bytes Read"));
TRACE_DECLARE_INT_COUNTER(FileSystemDDC_BytesWritten, TEXT("FileSystemDDC Bytes Written"));
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static const TCHAR* GBucketsDirectoryName = TEXT("Buckets");
static const TCHAR* GContentDirectoryName = TEXT("Content");
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
void BuildPathForLegacyCache(const TCHAR* const CacheKey, FStringBuilderBase& Path)
{
TStringBuilder<256> Key;
Key << CacheKey;
for (TCHAR& Char : MakeArrayView(Key))
{
Char = FChar::ToUpper(Char);
}
checkf(Algo::AllOf(MakeArrayView(Key),
[](TCHAR C) { return FChar::IsAlnum(C) || FChar::IsUnderscore(C) || C == TEXT('$'); }),
TEXT("Invalid characters in cache key %s"), CacheKey);
const uint32 Hash = FCrc::StrCrc_DEPRECATED(Key.Len(), Key.GetData());
Path.Appendf(TEXT("%1d/%1d/%1d/%s.udd"), (Hash / 100) % 10, (Hash / 10) % 10, Hash % 10, *Key);
}
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
void BuildPathForCachePackage(const FCacheKey& CacheKey, FStringBuilderBase& Path)
{
const FIoHash::ByteArray& Bytes = CacheKey.Hash.GetBytes();
Path.Appendf(TEXT("%s/%hs/%02x/%02x/"), GBucketsDirectoryName, CacheKey.Bucket.ToCString(), Bytes[0], Bytes[1]);
UE::String::BytesToHexLower(MakeArrayView(Bytes).RightChop(2), Path);
Path << TEXTVIEW(".udd");
}
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
void BuildPathForCacheContent(const FIoHash& RawHash, FStringBuilderBase& Path)
{
const FIoHash::ByteArray& Bytes = RawHash.GetBytes();
Path.Appendf(TEXT("%s/%02x/%02x/"), GContentDirectoryName, Bytes[0], Bytes[1]);
UE::String::BytesToHexLower(MakeArrayView(Bytes).RightChop(2), Path);
Path << TEXTVIEW(".udd");
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static uint64 RandFromGuid()
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
{
const FGuid Guid = FGuid::NewGuid();
return FXxHash64::HashBuffer(&Guid, sizeof(FGuid)).Hash;
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
}
/** A LCG in which the modulus is a power of two where the exponent is the bit width of T. */
template <typename T, T Modulus = 0>
class TLinearCongruentialGenerator
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
{
static_assert(!TIsSigned<T>::Value);
static_assert((Modulus & (Modulus - 1)) == 0, "Modulus must be a power of two.");
public:
constexpr inline TLinearCongruentialGenerator(T InMultiplier, T InIncrement)
: Multiplier(InMultiplier)
, Increment(InIncrement)
{
}
constexpr inline T GetNext(T& Value)
{
Value = (Value * Multiplier + Increment) & (Modulus - 1);
return Value;
}
private:
const T Multiplier;
const T Increment;
};
class FRandomStream
{
public:
inline explicit FRandomStream(const uint32 Seed)
: Random(1103515245, 12345) // From ANSI C
, Value(Seed)
{
}
/** Returns a random value in [Min, Max). */
inline uint32 GetRandRange(const uint32 Min, const uint32 Max)
{
return Min + uint32((uint64(Max - Min) * Random.GetNext(Value)) >> 32);
}
private:
TLinearCongruentialGenerator<uint32> Random;
uint32 Value;
};
template <uint32 Modulus, uint32 Count = Modulus>
class TRandomOrder
{
static_assert((Modulus & (Modulus - 1)) == 0 && Modulus > 16, "Modulus must be a power of two greater than 16.");
static_assert(Count > 0 && Count <= Modulus, "Count must be in the range (0, Modulus].");
public:
inline explicit TRandomOrder(FRandomStream& Stream)
: Random(Stream.GetRandRange(0, Modulus / 16) * 8 + 5, 12345)
, First(Stream.GetRandRange(0, Count))
, Value(First)
{
}
inline uint32 GetFirst() const
{
return First;
}
inline uint32 GetNext()
{
if constexpr (Count < Modulus)
{
for (;;)
{
if (const uint32 Next = Random.GetNext(Value); Next < Count)
{
return Next;
}
}
}
return Random.GetNext(Value);
}
private:
TLinearCongruentialGenerator<uint32, Modulus> Random;
uint32 First;
uint32 Value;
};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
struct FFileSystemCacheStoreMaintainerParams
{
/** Files older than this will be deleted. */
FTimespan MaxFileAge = FTimespan::FromDays(15.0);
/** Limits the number of files scanned in one second. */
uint32 MaxFileScanRate = MAX_uint32;
/** Limits the number of directories scanned in each cache bucket or content root. */
uint32 MaxDirectoryScanCount = MAX_uint32;
/** Minimum duration between the start of consecutive scans. Use MaxValue to scan only once. */
FTimespan ScanFrequency = FTimespan::FromHours(1.0);
/** Time to wait after initialization before maintenance begins. */
FTimespan TimeToWaitAfterInit = FTimespan::FromMinutes(1.0);
};
class FFileSystemCacheStoreMaintainer final : public ICacheStoreMaintainer
{
public:
FFileSystemCacheStoreMaintainer(const FFileSystemCacheStoreMaintainerParams& Params, FStringView CachePath);
~FFileSystemCacheStoreMaintainer();
bool IsIdle() const final { return bIdle; }
void WaitForIdle() const { IdleEvent.Wait(); }
void BoostPriority() final;
private:
void Tick();
void Loop();
void Scan();
void CreateContentRoot();
void CreateBucketRoots();
void ScanHashRoot(uint32 RootIndex);
TStaticBitArray<256> ScanHashDirectory(FStringBuilderBase& BasePath);
TStaticBitArray<10> ScanLegacyDirectory(FStringBuilderBase& BasePath);
void CreateLegacyRoot();
void ScanLegacyRoot();
void ResetRoots();
void ProcessFile(const TCHAR* Path, const FFileStatData& Stat);
private:
struct FRoot;
struct FLegacyRoot;
FFileSystemCacheStoreMaintainerParams Params;
/** Path to the root of the cache store. */
FString CachePath;
/** True when there is no active maintenance scan. */
bool bIdle = false;
/** True when maintenance is expected to exit as soon as possible. */
bool bExit = false;
/** True when maintenance is expected to exit at the end of the scan. */
bool bExitAfterScan = false;
/** Ignore the file scan rate for one maintenance scan. */
bool bIgnoreFileScanRate = false;
uint32 ProcessCount = 0;
uint32 DeleteCount = 0;
uint64 DeleteSize = 0;
double BatchStartTime = 0.0;
IFileManager& FileManager = IFileManager::Get();
mutable FLazyEvent IdleEvent;
FEventRef WaitEvent;
FThread Thread;
TArray<TUniquePtr<FRoot>> Roots;
TUniquePtr<FLegacyRoot> LegacyRoot;
FRandomStream Random{uint32(RandFromGuid())};
static constexpr double MaxScanFrequencyDays = 365.0;
};
struct FFileSystemCacheStoreMaintainer::FRoot
{
inline FRoot(const FStringView RootPath, FRandomStream& Stream)
: Order(Stream)
{
Path.Append(RootPath);
}
TStringBuilder<256> Path;
TRandomOrder<256 * 256> Order;
TStaticBitArray<256> ScannedLevel0;
TStaticBitArray<256> ExistsLevel0;
TStaticBitArray<256> ExistsLevel1[256];
uint32 DirectoryScanCount = 0;
bool bScannedRoot = false;
};
struct FFileSystemCacheStoreMaintainer::FLegacyRoot
{
inline explicit FLegacyRoot(FRandomStream& Stream)
: Order(Stream)
{
}
TRandomOrder<1024, 1000> Order;
TStaticBitArray<10> ScannedLevel0;
TStaticBitArray<10> ScannedLevel1[10];
TStaticBitArray<10> ExistsLevel0;
TStaticBitArray<10> ExistsLevel1[10];
TStaticBitArray<10> ExistsLevel2[10][10];
uint32 DirectoryScanCount = 0;
};
FFileSystemCacheStoreMaintainer::FFileSystemCacheStoreMaintainer(
const FFileSystemCacheStoreMaintainerParams& InParams,
const FStringView InCachePath)
: Params(InParams)
, CachePath(InCachePath)
, bExitAfterScan(Params.ScanFrequency.GetTotalDays() > MaxScanFrequencyDays)
, IdleEvent(EEventMode::ManualReset)
, WaitEvent(EEventMode::AutoReset)
, Thread(
TEXT("FileSystemCacheStoreMaintainer"),
[this] { Loop(); },
[this] { Tick(); },
/*StackSize*/ 32 * 1024,
TPri_BelowNormal)
{
IModularFeatures::Get().RegisterModularFeature(FeatureName, this);
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
}
FFileSystemCacheStoreMaintainer::~FFileSystemCacheStoreMaintainer()
{
bExit = true;
IModularFeatures::Get().UnregisterModularFeature(FeatureName, this);
WaitEvent->Trigger();
Thread.Join();
}
void FFileSystemCacheStoreMaintainer::BoostPriority()
{
bIgnoreFileScanRate = true;
WaitEvent->Trigger();
}
void FFileSystemCacheStoreMaintainer::Tick()
{
// Scan once and exit if the priority has been boosted.
if (bIgnoreFileScanRate)
{
bExitAfterScan = true;
Loop();
}
bIdle = true;
IdleEvent.Trigger();
}
void FFileSystemCacheStoreMaintainer::Loop()
{
WaitEvent->Wait(Params.TimeToWaitAfterInit, /*bIgnoreThreadIdleStats*/ true);
while (!bExit)
{
const FDateTime ScanStart = FDateTime::Now();
DeleteCount = 0;
DeleteSize = 0;
IdleEvent.Reset();
bIdle = false;
Scan();
bIdle = true;
IdleEvent.Trigger();
bIgnoreFileScanRate = false;
const FDateTime ScanEnd = FDateTime::Now();
UE_LOG(LogDerivedDataCache, Log,
TEXT("%s: Maintenance finished in %s and deleted %u file(s) with total size %" UINT64_FMT " MiB."),
*CachePath, *(ScanEnd - ScanStart).ToString(), DeleteCount, DeleteSize / 1024 / 1024);
if (bExit || bExitAfterScan)
{
break;
}
const FDateTime ScanTime = ScanStart + Params.ScanFrequency;
UE_CLOG(ScanEnd < ScanTime, LogDerivedDataCache, Verbose,
TEXT("%s: Maintenance is paused until the next scan at %s."), *CachePath, *ScanTime.ToString());
for (FDateTime Now = ScanEnd; !bExit && Now < ScanTime; Now = FDateTime::Now())
{
WaitEvent->Wait(ScanTime - Now, /*bIgnoreThreadIdleStats*/ true);
}
}
bIdle = true;
IdleEvent.Trigger();
}
void FFileSystemCacheStoreMaintainer::Scan()
{
CreateContentRoot();
CreateBucketRoots();
CreateLegacyRoot();
while (!bExit)
{
const uint32 RootCount = uint32(Roots.Num());
const uint32 TotalRootCount = uint32(RootCount + LegacyRoot.IsValid());
if (TotalRootCount == 0)
{
break;
}
if (const uint32 RootIndex = Random.GetRandRange(0, TotalRootCount); RootIndex < RootCount)
{
ScanHashRoot(RootIndex);
}
else
{
ScanLegacyRoot();
}
}
ResetRoots();
}
void FFileSystemCacheStoreMaintainer::CreateContentRoot()
{
TStringBuilder<256> ContentPath;
FPathViews::Append(ContentPath, CachePath, GContentDirectoryName);
if (FileManager.DirectoryExists(*ContentPath))
{
Roots.Add(MakeUnique<FRoot>(ContentPath, Random));
}
}
void FFileSystemCacheStoreMaintainer::CreateBucketRoots()
{
TStringBuilder<256> BucketsPath;
FPathViews::Append(BucketsPath, CachePath, GBucketsDirectoryName);
FileManager.IterateDirectoryStat(*BucketsPath, [this](const TCHAR* Path, const FFileStatData& Stat) -> bool
{
if (Stat.bIsDirectory)
{
Roots.Add(MakeUnique<FRoot>(Path, Random));
}
return !bExit;
});
}
void FFileSystemCacheStoreMaintainer::ScanHashRoot(const uint32 RootIndex)
{
FRoot& Root = *Roots[int32(RootIndex)];
const uint32 DirectoryIndex = Root.Order.GetNext();
const uint32 IndexLevel0 = DirectoryIndex / 256;
const uint32 IndexLevel1 = DirectoryIndex % 256;
bool bScanned = false;
ON_SCOPE_EXIT
{
if ((DirectoryIndex == Root.Order.GetFirst()) ||
(bScanned && ++Root.DirectoryScanCount >= Params.MaxDirectoryScanCount))
{
UE_LOG(LogDerivedDataCache, VeryVerbose,
TEXT("%s: Maintenance finished scanning %s."), *CachePath, *Root.Path);
Roots.RemoveAt(int32(RootIndex));
}
};
if (!Root.bScannedRoot)
{
Root.ExistsLevel0 = ScanHashDirectory(Root.Path);
Root.bScannedRoot = true;
}
if (!Root.ExistsLevel0[IndexLevel0])
{
return;
}
if (!Root.ScannedLevel0[IndexLevel0])
{
TStringBuilder<256> Path;
Path.Appendf(TEXT("%s/%02x"), *Root.Path, IndexLevel0);
Root.ExistsLevel1[IndexLevel0] = ScanHashDirectory(Path);
Root.ScannedLevel0[IndexLevel0] = true;
}
if (!Root.ExistsLevel1[IndexLevel0][IndexLevel1])
{
return;
}
TStringBuilder<256> Path;
Path.Appendf(TEXT("%s/%02x/%02x"), *Root.Path, IndexLevel0, IndexLevel1);
FileManager.IterateDirectoryStat(*Path, [this](const TCHAR* const Path, const FFileStatData& Stat) -> bool
{
ProcessFile(Path, Stat);
return !bExit;
});
bScanned = true;
}
TStaticBitArray<256> FFileSystemCacheStoreMaintainer::ScanHashDirectory(FStringBuilderBase& BasePath)
{
TStaticBitArray<256> Exists;
FileManager.IterateDirectoryStat(*BasePath, [this, &Exists](const TCHAR* Path, const FFileStatData& Stat) -> bool
{
FStringView View = FPathViews::GetCleanFilename(Path);
if (Stat.bIsDirectory && View.Len() == 2 && Algo::AllOf(View, FChar::IsHexDigit))
{
uint8 Byte;
if (String::HexToBytes(View, &Byte) == 1)
{
Exists[Byte] = true;
}
}
return !bExit;
});
return Exists;
}
TStaticBitArray<10> FFileSystemCacheStoreMaintainer::ScanLegacyDirectory(FStringBuilderBase& BasePath)
{
TStaticBitArray<10> Exists;
FileManager.IterateDirectoryStat(*BasePath, [this, &Exists](const TCHAR* Path, const FFileStatData& Stat) -> bool
{
FStringView View = FPathViews::GetCleanFilename(Path);
if (Stat.bIsDirectory && View.Len() == 1 && Algo::AllOf(View, FChar::IsDigit))
{
Exists[FChar::ConvertCharDigitToInt(View[0])] = true;
}
return !bExit;
});
return Exists;
}
void FFileSystemCacheStoreMaintainer::CreateLegacyRoot()
{
TStringBuilder<256> Path;
FPathViews::Append(Path, CachePath);
TStaticBitArray<10> Exists = ScanLegacyDirectory(Path);
if (Exists.FindFirstSetBit() != INDEX_NONE)
{
LegacyRoot = MakeUnique<FLegacyRoot>(Random);
LegacyRoot->ExistsLevel0 = Exists;
}
}
void FFileSystemCacheStoreMaintainer::ScanLegacyRoot()
{
FLegacyRoot& Root = *LegacyRoot;
const uint32 DirectoryIndex = Root.Order.GetNext();
const int32 IndexLevel0 = int32(DirectoryIndex / 100) % 10;
const int32 IndexLevel1 = int32(DirectoryIndex / 10) % 10;
const int32 IndexLevel2 = int32(DirectoryIndex / 1) % 10;
bool bScanned = false;
ON_SCOPE_EXIT
{
if ((DirectoryIndex == Root.Order.GetFirst()) ||
(bScanned && ++Root.DirectoryScanCount >= Params.MaxDirectoryScanCount))
{
LegacyRoot.Reset();
}
};
if (!Root.ExistsLevel0[IndexLevel0])
{
return;
}
if (!Root.ScannedLevel0[IndexLevel0])
{
TStringBuilder<256> Path;
FPathViews::Append(Path, CachePath, IndexLevel0);
Root.ExistsLevel1[IndexLevel0] = ScanLegacyDirectory(Path);
Root.ScannedLevel0[IndexLevel0] = true;
}
if (!Root.ExistsLevel1[IndexLevel0][IndexLevel1])
{
return;
}
if (!Root.ScannedLevel1[IndexLevel0][IndexLevel1])
{
TStringBuilder<256> Path;
FPathViews::Append(Path, CachePath, IndexLevel0, IndexLevel1);
Root.ExistsLevel2[IndexLevel0][IndexLevel1] = ScanLegacyDirectory(Path);
Root.ScannedLevel1[IndexLevel0][IndexLevel1] = true;
}
if (!Root.ExistsLevel2[IndexLevel0][IndexLevel1][IndexLevel2])
{
return;
}
TStringBuilder<256> Path;
FPathViews::Append(Path, CachePath, IndexLevel0, IndexLevel1, IndexLevel2);
FileManager.IterateDirectoryStat(*Path, [this](const TCHAR* const Path, const FFileStatData& Stat) -> bool
{
ProcessFile(Path, Stat);
return !bExit;
});
bScanned = true;
}
void FFileSystemCacheStoreMaintainer::ResetRoots()
{
Roots.Empty();
LegacyRoot.Reset();
}
void FFileSystemCacheStoreMaintainer::ProcessFile(const TCHAR* const Path, const FFileStatData& Stat)
{
if (Stat.bIsDirectory)
{
return;
}
const FDateTime Now = FDateTime::UtcNow();
if (Stat.ModificationTime + Params.MaxFileAge < Now && Stat.AccessTime + Params.MaxFileAge < Now)
{
++DeleteCount;
DeleteSize += Stat.FileSize > 0 ? uint64(Stat.FileSize) : 0;
if (FileManager.Delete(Path, /*bRequireExists*/ false, /*bEvenReadOnly*/ false, /*bQuiet*/ true))
{
UE_LOG(LogDerivedDataCache, VeryVerbose,
TEXT("%s: Maintenance deleted file %s that was last modified at %s."),
*CachePath, Path, *Stat.ModificationTime.ToIso8601());
}
else
{
UE_LOG(LogDerivedDataCache, Verbose,
TEXT("%s: Maintenance failed to delete file %s that was last modified at %s."),
*CachePath, Path, *Stat.ModificationTime.ToIso8601());
}
}
if (!bExit && !bIgnoreFileScanRate && Params.MaxFileScanRate && ++ProcessCount % Params.MaxFileScanRate == 0)
{
const double BatchEndTime = FPlatformTime::Seconds();
if (const double BatchWaitTime = 1.0 - (BatchEndTime - BatchStartTime); BatchWaitTime > 0.0)
{
WaitEvent->Wait(FTimespan::FromSeconds(BatchWaitTime), /*bIgnoreThreadIdleStats*/ true);
BatchStartTime = FPlatformTime::Seconds();
}
else
{
BatchStartTime = BatchEndTime;
}
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class FAccessLogWriter
{
public:
FAccessLogWriter(const TCHAR* FileName, const FString& CachePath);
void Append(const TCHAR* CacheKey, FStringView Path);
void Append(const FIoHash& RawHash, FStringView Path);
void Append(const FCacheKey& CacheKey, FStringView Path);
private:
void AppendPath(FStringView Path);
TUniquePtr<FArchive> Archive;
FString BasePath;
FCriticalSection CriticalSection;
TSet<FString> CacheKeys;
TSet<FIoHash> ContentKeys;
TSet<FCacheKey> RecordKeys;
};
FAccessLogWriter::FAccessLogWriter(const TCHAR* const FileName, const FString& CachePath)
: Archive(IFileManager::Get().CreateFileWriter(FileName, FILEWRITE_AllowRead))
, BasePath(CachePath / TEXT(""))
{
}
void FAccessLogWriter::Append(const TCHAR* const CacheKey, const FStringView Path)
{
FScopeLock Lock(&CriticalSection);
bool bIsAlreadyInSet = false;
CacheKeys.FindOrAdd(FString(CacheKey), &bIsAlreadyInSet);
if (!bIsAlreadyInSet)
{
AppendPath(Path);
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
}
}
void FAccessLogWriter::Append(const FIoHash& RawHash, const FStringView Path)
{
FScopeLock Lock(&CriticalSection);
bool bIsAlreadyInSet = false;
ContentKeys.FindOrAdd(RawHash, &bIsAlreadyInSet);
if (!bIsAlreadyInSet)
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
{
AppendPath(Path);
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
}
}
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
void FAccessLogWriter::Append(const FCacheKey& CacheKey, const FStringView Path)
{
FScopeLock Lock(&CriticalSection);
bool bIsAlreadyInSet = false;
RecordKeys.FindOrAdd(CacheKey, &bIsAlreadyInSet);
if (!bIsAlreadyInSet)
{
AppendPath(Path);
}
}
void FAccessLogWriter::AppendPath(const FStringView Path)
{
if (Path.StartsWith(BasePath))
{
const FTCHARToUTF8 PathUtf8(Path.RightChop(BasePath.Len()));
Archive->Serialize(const_cast<ANSICHAR*>(PathUtf8.Get()), PathUtf8.Length());
Archive->Serialize(const_cast<ANSICHAR*>(LINE_TERMINATOR_ANSI), sizeof(LINE_TERMINATOR_ANSI) - 1);
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class FFileSystemCacheStore final : public FDerivedDataBackendInterface
{
public:
FFileSystemCacheStore(const TCHAR* CachePath, const TCHAR* Params, const TCHAR* AccessLogPath);
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
inline bool IsUsable() const { return !bDisabled; }
bool RunSpeedTest(
double InSkipTestsIfSeeksExceedMS,
double& OutSeekTimeMS,
double& OutReadSpeedMBs,
double& OutWriteSpeedMBs) const;
// FDerivedDataBackendInterface Interface
FString GetName() const final { return CachePath; }
bool IsWritable() const final { return !bReadOnly && !bDisabled; }
ESpeedClass GetSpeedClass() const final { return SpeedClass; }
bool CachedDataProbablyExists(const TCHAR* CacheKey) final;
bool GetCachedData(const TCHAR* CacheKey, TArray<uint8>& Data) final;
EPutStatus PutCachedData(const TCHAR* CacheKey, TConstArrayView<uint8> Data, bool bPutEvenIfExists) final;
void RemoveCachedData(const TCHAR* CacheKey, bool bTransient) final;
TSharedRef<FDerivedDataCacheStatsNode> GatherUsageStats() const final;
TBitArray<> TryToPrefetch(TConstArrayView<FString> CacheKeys) final;
bool WouldCache(const TCHAR* CacheKey, TConstArrayView<uint8> InData) final;
bool ApplyDebugOptions(FBackendDebugOptions& InOptions) final;
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
EBackendLegacyMode GetLegacyMode() const final { return LegacyMode; }
// ICacheStore Interface
void Put(
TConstArrayView<FCachePutRequest> Requests,
IRequestOwner& Owner,
FOnCachePutComplete&& OnComplete) final;
void Get(
TConstArrayView<FCacheGetRequest> Requests,
IRequestOwner& Owner,
FOnCacheGetComplete&& OnComplete) final;
void PutValue(
TConstArrayView<FCachePutValueRequest> Requests,
IRequestOwner& Owner,
FOnCachePutValueComplete&& OnComplete) final;
void GetValue(
TConstArrayView<FCacheGetValueRequest> Requests,
IRequestOwner& Owner,
FOnCacheGetValueComplete&& OnComplete) final;
void GetChunks(
TConstArrayView<FCacheGetChunkRequest> Requests,
IRequestOwner& Owner,
FOnCacheGetChunkComplete&& OnComplete) final;
private:
[[nodiscard]] bool PutCacheRecord(FStringView Name, const FCacheRecord& Record, const FCacheRecordPolicy& Policy, uint64& OutWriteSize);
[[nodiscard]] FOptionalCacheRecord GetCacheRecordOnly(
FStringView Name,
DDC: Reworked ICacheStore to allow partial records, filtering of payloads, and loading parts of payloads - ICacheStore::Put() has updated documentation to reflect the requirements of partial records. - ICacheStore::Get() now takes a FCacheRecordPolicy, which is implicitly constructible from ECachePolicy, and allows setting the policy by payload. - ICacheStore::GetPayload() is replaced by ICacheStore::GetChunks(), which allows loading parts of payloads. - ICacheStore::CancelAll() is moved to ICache::CancelAll() because the cache can track requests at the top level and cancel them without exposing cancellation on individual cache stores. - ECachePolicy::SkipLocalCopy has been removed because it is difficult to reason about. - ECachePolicy::SkipData flags now have a documented meaning for put requests, to hint that record existence implies payload existence. - The filesystem and memory cache stores have been updated to support partial records, filtering of payloads, and loading parts of payloads. - Requesting part of a payload will decompress the entire payload for now, until compressed buffers expose a way to decompress only part. - Fixed a bug in FTexturePlatformData::AreDerivedMipsAvailable() that caused it to return false for structured cache keys. #rb Zousar.Shaker #rnx #preflight 615e03241ed62f0001b95454 #ROBOMERGE-OWNER: Devin.Doucette #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 17748550 in //UE5/Release-5.0/... via CL 17748555 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v879-17706426) #ROBOMERGE-CONFLICT from-shelf #ROBOMERGE[STARSHIP]: UE5-Main [CL 17748602 by Devin Doucette in ue5-release-engine-test branch]
2021-10-07 09:11:32 -04:00
const FCacheKey& Key,
const FCacheRecordPolicy& Policy);
[[nodiscard]] FOptionalCacheRecord GetCacheRecord(
FStringView Name,
DDC: Reworked ICacheStore to allow partial records, filtering of payloads, and loading parts of payloads - ICacheStore::Put() has updated documentation to reflect the requirements of partial records. - ICacheStore::Get() now takes a FCacheRecordPolicy, which is implicitly constructible from ECachePolicy, and allows setting the policy by payload. - ICacheStore::GetPayload() is replaced by ICacheStore::GetChunks(), which allows loading parts of payloads. - ICacheStore::CancelAll() is moved to ICache::CancelAll() because the cache can track requests at the top level and cancel them without exposing cancellation on individual cache stores. - ECachePolicy::SkipLocalCopy has been removed because it is difficult to reason about. - ECachePolicy::SkipData flags now have a documented meaning for put requests, to hint that record existence implies payload existence. - The filesystem and memory cache stores have been updated to support partial records, filtering of payloads, and loading parts of payloads. - Requesting part of a payload will decompress the entire payload for now, until compressed buffers expose a way to decompress only part. - Fixed a bug in FTexturePlatformData::AreDerivedMipsAvailable() that caused it to return false for structured cache keys. #rb Zousar.Shaker #rnx #preflight 615e03241ed62f0001b95454 #ROBOMERGE-OWNER: Devin.Doucette #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 17748550 in //UE5/Release-5.0/... via CL 17748555 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v879-17706426) #ROBOMERGE-CONFLICT from-shelf #ROBOMERGE[STARSHIP]: UE5-Main [CL 17748602 by Devin Doucette in ue5-release-engine-test branch]
2021-10-07 09:11:32 -04:00
const FCacheKey& Key,
const FCacheRecordPolicy& Policy,
EStatus& OutStatus);
[[nodiscard]] bool PutCacheValue(FStringView Name, const FCacheKey& Key, const FValue& Value, ECachePolicy Policy, uint64& OutWriteSize);
[[nodiscard]] bool GetCacheValueOnly(FStringView Name, const FCacheKey& Key, ECachePolicy Policy, FValue& OutValue);
[[nodiscard]] bool GetCacheValue(FStringView Name, const FCacheKey& Key, ECachePolicy Policy, FValue& OutValue);
[[nodiscard]] bool PutCacheContent(FStringView Name, const FCompressedBuffer& Content, uint64& OutWriteSize) const;
[[nodiscard]] bool GetCacheContentExists(const FCacheKey& Key, const FIoHash& RawHash) const;
[[nodiscard]] bool GetCacheContent(
FStringView Name,
const FCacheKey& Key,
const FValueId& Id,
const FValue& Value,
ECachePolicy Policy,
FValue& OutValue) const;
void GetCacheContent(
FStringView Name,
const FCacheKey& Key,
const FValueId& Id,
const FValue& Value,
ECachePolicy Policy,
FCompressedBufferReader& Reader,
TUniquePtr<FArchive>& OutArchive) const;
void BuildCachePackagePath(const FCacheKey& CacheKey, FStringBuilderBase& Path) const;
void BuildCacheContentPath(const FIoHash& RawHash, FStringBuilderBase& Path) const;
[[nodiscard]] bool SaveFileWithHash(FStringBuilderBase& Path, FStringView DebugName, TFunctionRef<void (FArchive&)> WriteFunction, bool bReplaceExisting = false) const;
[[nodiscard]] bool LoadFileWithHash(FStringBuilderBase& Path, FStringView DebugName, TFunctionRef<void (FArchive&)> ReadFunction) const;
[[nodiscard]] bool SaveFile(FStringBuilderBase& Path, FStringView DebugName, TFunctionRef<void (FArchive&)> WriteFunction, bool bReplaceExisting = false) const;
[[nodiscard]] bool LoadFile(FStringBuilderBase& Path, FStringView DebugName, TFunctionRef<void (FArchive&)> ReadFunction) const;
[[nodiscard]] TUniquePtr<FArchive> OpenFile(FStringBuilderBase& Path, FStringView DebugName) const;
[[nodiscard]] bool FileExists(FStringBuilderBase& Path) const;
private:
void BuildCacheLegacyPath(const TCHAR* const CacheKey, FStringBuilderBase& Path) const
{
Path << CachePath << TEXT('/');
BuildPathForLegacyCache(CacheKey, Path);
}
/** Base path we are storing the cache files in. */
FString CachePath;
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
/** How to access the legacy cache. */
EBackendLegacyMode LegacyMode = EBackendLegacyMode::ValueWithLegacyFallback;
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
/** Class of this cache */
ESpeedClass SpeedClass;
/** If true, we failed to write to this directory and it did not contain anything so we should not be used. */
bool bDisabled;
/** If true, do not attempt to write to this cache. */
bool bReadOnly;
/** If true, CachedDataProbablyExists will update the file timestamps. */
bool bTouch;
/** If true, allow transient data to be removed from the cache. */
bool bPurgeTransient;
/** Age of file when it should be deleted from DDC cache. */
double DaysToDeleteUnusedFiles;
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
/** Maximum total size of compressed data stored within a record package with multiple attachments. */
uint64 MaxRecordSizeKB = 256;
/** Maximum total size of compressed data stored within a value package, or a record package with one attachment. */
uint64 MaxValueSizeKB = 1024;
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
/** Object used for synchronization via a scoped lock. */
Copying //UE4/Dev-Editor to //UE4/Dev-Main (Source: //UE4/Dev-Editor @ 3739701) #lockdown Nick.Penwarden #rb none ============================ MAJOR FEATURES & CHANGES ============================ Change 3358367 by tim.gautier Submitting resaved QAGame assets - Materials, Material Instances, Material Functions and Parameters Change 3624848 by Jamie.Dale Added a composite font for the editor (and Slate core) This is defined in FLegacySlateFontInfoCache::GetDefaultFont and uses our default Roboto fonts (and the culture specific fallback fonts), and is now used as the default font for Slate and the editor. This change removes all the manual TTF/OTF file references from the various Slate styles, as well as updating 200+ hard-coded font references to use the new default font. This fixes various rendering issues with fonts in the editor when using different languages, and clears a big barrier for removing the legacy localized fallback font support. Change 3654993 by Jamie.Dale 'Native' (now called 'FNativeFuncPtr') is now a function pointer that takes a UObject* context, rather than a UObject member function pointer This avoids ambiguity when binding a native function pointer to a type that doesn't match the context pointer, as you could end up getting a function called with an incorrect 'this' pointer Breaking changes: - Native has been renamed to FNativeFuncPtr. - The signature of a native function has changed (use the DECLARE_FUNCTION and DEFINE_FUNCTION macro pair). - Use P_THIS if you were previously using the 'this' pointer in your native function. Change 3699591 by Jamie.Dale Added support for displaying and editing numbers in a culture correct way Numeric input boxes in Slate will now display and accept numbers using the culture correct decimal separators. This is enabled by default, and can be disabled by setting "ShouldUseLocalizedNumericInput" to "False" in XEditorSettings.ini (for the editor), or XGameUserSettings.ini (for a game). #jira UE-4028 Change 3719568 by Jamie.Dale Allow platforms to override the default ICU timezone calculation Change 3622366 by Bradut.Palas #jira UE-46677 Don't allow OnLevelRemovedFromWorld to reset the transaction buffer if we're in PIE mode. Also, remove one undo barrier in case the event was triggered in PIE mode or else we block the user from undoing previous actions. Change 3622378 by Bradut.Palas #jira UE-46590 we have a general bug with detecting the size of the last column, but the clamping prevents it from appearing with the other resize modes. The Content Browser is the only one to use fixed width. The bug is that the size of the last element is incorrectly reported, after we drag back and forth. Fixed by not reading the size real time, but reading it from the SlotInfo structure that is created earlier, which holds the correct value. Change 3622552 by Jamie.Dale Added support for per-culture sub-fonts within a composite font This allows you to do things like create a Japanese specific Han sub-font to override the Han characters used in a CJK font (previously you needed to create a localized font asset to achieve this). Change 3623170 by Jamie.Dale Fixing warning Change 3624846 by Jamie.Dale Composite font cache optimizations - Converted a typically small sized map to a sorted array + binary search. - Converted the already sorted range array to use binary search. - Contiguous ranges using the same typeface are now merged in the cache. Change 3625576 by Cody.Albert We now only set the widget tree to transient instead of passing the flag through StaticDuplicateObject. This was causing instanced subobjects to be flagged with RF_DuplicateTransient, preventing them from properly being duplicated when an array of instanced subobjects was modified. #jira UE-47971 Change 3626057 by Matt.Kuhlenschmidt Expose EUmgSequencePlayMode to blueprints #jira UE-49255 Change 3626556 by Matt.Kuhlenschmidt Fix window size and position adjustment not accounting for primary monitor not being a high DPI monitor when a secondary monitor is. Causes flickering and incorrect window positioning. #jira UE-48922, UE-48957 Change 3627692 by Matt.Kuhlenschmidt PR #3977: Source control submenu menu customization (Contributed by Kryofenix) Change 3628600 by Arciel.Rekman Added AutoCheckout to FAssetRenameManager for commandlet usage. Change 3630561 by Richard.Hinckley Deprecating the version of UFunctionalTestingManager::RunAllFunctionalTests that feature an unused bool parameter, replacing with a new version without that parameter. Change 3630656 by Richard.Hinckley Compile fix. Change 3630964 by Arciel.Rekman Fix CrashReporterClient headless build. Change 3631050 by Matt.Kuhlenschmidt Back out revision 9 from //UE4/Dev-Editor/Engine/Source/Runtime/Slate/Private/Widgets/Layout/SSplitter.cpp Causes major problems with resizing splitters in editor Change 3631140 by Arciel.Rekman OpenAL: update Linux version to 1.18.1 (UETOOL-1253) - Also remove a hack for RPATH and make it use a generic RPATH mechanism. - Bulk of the change from Cengiz.Terzibas #jira UETOOL-1253 Change 3632924 by Jamie.Dale Added support for a catch-all fallback font within composite fonts This allows you to provide broad "font of last resort" behavior on a per-composite font basis, in a way that can also work with different font styles. Change 3633055 by Jamie.Dale Fixed some refresh issues in the font editor Change 3633062 by Jamie.Dale Fixed localization commands being reported as unknown Change 3633906 by Nick.Darnell UMG - You can now store refrences to widgets in the same UserWidget. If you need to create links between widgets this is valuable. Will likely introduce new ways to utilize this in the future, for now just getting it working. Change 3634070 by Arciel.Rekman Display actually used values of material overrides. Change 3634254 by Arciel.Rekman Fix ResavePackages working poorly with projects on other drives (UE-49465). #jira UE-49465 Change 3635985 by Matt.Kuhlenschmidt Fixed typo in function name used by maps PR #3975: Add tooltip to Arrays in Editor (Contributed by projectgheist) Change 3636012 by Matt.Kuhlenschmidt PR #3982: Unhide mouse cursor after using Ansel (Contributed by projectgheist) Change 3636706 by Lauren.Ridge Epic Friday: Save parameters to child or sibling instance functionality Change 3638706 by Jamie.Dale Added an improved Japanese font to the editor This is only used when displaying Japanese text when the editor is set to Japanese, and uses a font with Japanese-style unified Han characters (our default fallback font uses Chinese-style unified Han characters). #jira UE-33268 Change 3639438 by Arciel.Rekman Linux: Repaired ARM server build (UE-49635). - Made Steam* plugins compile. - Disabled OpenEXR as the libs aren't compiled (need to be done separately). (Edigrating CL 3639429 from Release-4.17 to Dev-Editor) Change 3640625 by Matt.Kuhlenschmidt PR #4012: FSlateApplication::ProcessReply use &Reply (Contributed by projectgheist) Change 3640626 by Matt.Kuhlenschmidt PR #4011: Remove space from filename (Contributed by projectgheist) Change 3640697 by Matt.Kuhlenschmidt PR #4010: PNG alpha fix (Contributed by mmdanggg2) Change 3641137 by Jamie.Dale Fixed an issue where a culture specific sub-font could produce incorrect measurements during a culture switch It would fallback to the last resort font for a frame or two while the font cache flushed. This has it update the ranges immediately. Change 3641351 by Jamie.Dale Fixing incorrect weights on the Japanese sub-font Change 3641356 by Jamie.Dale Fixing inconsistent font sizes between CoreStyle and EditorStyle Change 3641710 by Jamie.Dale Fixed pure-virtual function call on UMulticastDelegateProperty Change 3641941 by Lauren.Ridge Adding a Parameter Details tab to the Material Editor so users can change default parameter details Change 3644141 by Jamie.Dale Added an improved Korean font to the editor This is only used when displaying Korean text when the editor is set to Korean Change 3644213 by Arciel.Rekman Fix the side effects of a fix for UE-49465. - Default materials were apparently not being found while building DDC (e.g. making an installed build), now they are and we should not reset loaders on them lest we trigger HasDefaultMaterialsPostLoaded() assert later. #jira UE-49465 Change 3644777 by Jamie.Dale Reverting Korean editor font back to NanumGothic as NanumBarunGothic looked too squished Change 3644879 by tim.gautier QAGame: Optimized assets for Procedural Foliage testing - Added camera bookmarks to Stations in QA-Foliage - Renamed QA-FoliageTypeInst assets to ProcFoliage_Shape - Fixed up redirectors Change 3645109 by Matt.Kuhlenschmidt PR #3990: Git plugin: fix status of renamed, removed, missing, untracked assets (Contributed by SRombauts) Change 3645114 by Matt.Kuhlenschmidt PR #3991: Git Plugin: Fix RunDumpToFile() leaking Process handles (Contributed by SRombauts) Change 3645116 by Matt.Kuhlenschmidt PR #3996: Git Plugin: run an "UpdateStatus" at "Connect" time to populate the Source Control cache (Contributed by SRombauts) Change 3645118 by Matt.Kuhlenschmidt PR #4005: Git Plugin: Expand the size of the Button "Initialize project with Git" (Contributed by SRombauts) Change 3645876 by Arciel.Rekman Linux: fix submenus of context menu not working (UE-47639). - Change by icculus (Ryan Gordon). - QA-ClickHUD seems to be not affected by this change (it is already broken alas). #jira UE-47639 Change 3648088 by Jamie.Dale Fixed some case-sensitivity issues with FText format argument names/pins These were originally case-sensitive, but that was lost somewhere along the way. This change restores their original behavior. #jira UE-47122 Change 3648097 by Jamie.Dale Moved common macOS/iOS localization implementation into FApplePlatformMisc #jira UE-49940 Change 3650858 by Arciel.Rekman UBT: improve CodeLite project generator (UE-49400). - PR #3987 submitted by yaakuro (Cengiz Terzibas). #jira UE-49400 Change 3651231 by Arciel.Rekman Linux: default to SM5 for Vulkan. - Change by Timothee.Bessett. Change 3653627 by Matt.Kuhlenschmidt PR #4020: Source Control Submit Files now interprets Escape key as if the user clicked cancel (Contributed by SRombauts) Change 3653628 by Matt.Kuhlenschmidt PR #4022: Add New C++ Class dialog remember previously selected module. (Contributed by Koderz) Change 3653984 by Jamie.Dale Fixed some redundant string construction Change 3658528 by Joe.Graf UE-45141 - Added CMAKE_CXX_COMPILER and CMAKE_C_COMPILER settings to the generated CMake files Change 3658594 by Jamie.Dale Zipping in UAT now always uses UTF-8 encoding to prevent Unicode issues #jira UE-27263 Change 3659643 by Michael.Trepka Added a call to FCoreDelegates::ApplicationWillTerminateDelegate.Broadcast(); in Mac RequestExit() to match Windows behavior #jira UETOOL-1238 Change 3661908 by Matt.Kuhlenschmidt USD asset importing improvements Change 3664100 by Matt.Kuhlenschmidt Fix static analysis Change 3664107 by Matt.Kuhlenschmidt PR #4051: UE-49448: FPropertyChangedEvent to include TopLevelObjects (Contributed by projectgheist) Change 3664125 by Matt.Kuhlenschmidt PR #4036: Add missing GRAPHEDITOR_API (Contributed by projectgheist) Change 3664340 by Jamie.Dale PR #3648: Prevent GatherTextFromSource from failing the commandlet (Contributed by projectgheist) Change 3664403 by Jamie.Dale PR #3769: Fixes UE-46973 - Drag and Dropping Folders with Names (Contributed by LordNed) Change 3664539 by Jamie.Dale PR #3280: Added EditableText functionality (Contributed by projectgheist) Change 3665433 by Alexis.Matte When we finish importing morph target we must re-initialise the render resources since we now use GPU morph target. #jira UE-50231 Change 3666747 by Cody.Albert Change 3669280 by Jamie.Dale PR #4060: UE-50455: Verify folder is newly created before removing from tree (Contributed by projectgheist) Change 3669718 by Jamie.Dale PR #4061: Clear Content Browser folder search box on escape key (Contributed by projectgheist) Change 3670838 by Alexis.Matte Fix crash when deleting a skeletal mesh LOD and the mouse is over the "reimport" button. #jira UE-50387 Change 3671559 by Matt.Kuhlenschmidt Update SimpleUI automation test ground truth #jira UE-50325 Change 3671587 by Alexis.Matte Fix fbx importer scale not always apply. A cache array was not reset when opening a fbx file. #jira UE-50147 Change 3671730 by Jamie.Dale Added PostInitInstance to UClass to allow class types to perform construction time initialization of their instances Change 3672104 by Michael.Dupuis #jira UE-50427: Update the volume visibility list of the editor viewport when changing the procedural foliage settings Change 3674906 by Alexis.Matte Make sure the export LOD option is taken in consideration when exporting a level or the current level selection #jira UE-50248 Change 3674942 by Matt.Kuhlenschmidt Fix static analysis Change 3675401 by Alexis.Matte -fix export animation, do not truncate the last frame anymore -fix the import animation, there was a display issue in the progress bar. Also a floorToInt sometime truncate the last valid frame. We also have a better way to calculate the time increment we use to sample the fbx curves. #jira UE-48231 Change 3675990 by Alexis.Matte Remove morph target when doing a re-import, so morph will be remove if they do not exist anymore in the fbx. This is to avoid driving random vertex with old morph target. #jira UE-50391 Change 3676169 by Alexis.Matte When we re-import with dialog the option, "Override Full Name" was set to false and save with the option dialog. We now not set it to false, since it was not use during re-import. Change 3676396 by Alexis.Matte Make all LOD 0 name consistent in staticmesh editor #jira UE-49461 Change 3677730 by Cody.Albert Enable locking of Persistent Level in Levels tab #jira UE-50686 Change 3677838 by Jamie.Dale Replaced broken version of Roboto Light Change 3679619 by Alexis.Matte Integrate GitHub pr #4029 to fix import fbx chunk material assignation. #jira UE-50001 Change 3680093 by Alexis.Matte Fix the skeletal mesh so the vertex color is part of the vertex equality like with the static mesh. Change 3680931 by Arciel.Rekman SlateDialogs: show image icon for *.tga (UE-25106). - Also reworked the logic somewhat. #jira UE-25106 Change 3681966 by Yannick.Lange MaterialEditor post-process preview. #jira UE-45307 Change 3682407 by Lauren.Ridge Fixes for material editor compile errors Change 3682628 by Lauren.Ridge Content browser filters for Material Layers, Blends, and their instances Change 3682725 by Lauren.Ridge Adding filter assets and instance assets to Material Layers and Material Layer Blends. Turning Material Layering on by default Change 3682921 by Lauren.Ridge Fix for instance layers not initializing fully Change 3682954 by Lauren.Ridge Creating Material Layer Test Assets Change 3683582 by Alexis.Matte Fix static analysis build Change 3683614 by Matt.Kuhlenschmidt PR #4062: Git Plugin: Fix UE-44637: Deleting an asset is unsuccessful if the asset is marked for add (Contributed by SRombauts) Change 3684130 by Lauren.Ridge Allow visible parameter retrieval to correctly recurse through internally called functions. Previous check was intended to prevent function previews from leaving their graph through unhooked inputs, but unintentionally blocked all function inputs. Change 3686289 by Arciel.Rekman Remove the pessimization (UE-23791). Change 3686455 by Lauren.Ridge Fixes for adding/removing a layer parameter from the parent not updating the child Change 3686829 by Jamie.Dale No longer include trailing whitespace in the justification calculation for soft-wrapped lines #jira UE-50266 Change 3686970 by Lauren.Ridge Making material parameter preview work for functions as well Change 3687077 by Jamie.Dale Fixed crash using FActorDetails with the struct details panel Change 3687152 by Jamie.Dale Fixed the row structure tag not appearing in the Content Browser for Data Table assets The CDO is used to filter these tags, and the CDO was omiting that tag which caused it to be filtered for all Data Tables. #jira UE-48691 Change 3687174 by Lauren.Ridge Fix for material layer sub-parameters showing up in the default material parameters panel Change 3688100 by Lauren.Ridge Fixing static analysis error Change 3688317 by Jamie.Dale Fixed crash using the widget reflector in a cooked game Editor-style isn't available in cooked games. Core-style should be used instead for the widget reflector. Change 3689054 by Jamie.Dale Reference Viewer can now show/copy references lists for nodes with multiple objects, or multiple selected nodes #jira UE-45751 Change 3689513 by Jamie.Dale Fixed justification bug with RTL text caused by CL# 3686829 Also implemented the same alignment fix for visually left-aligned RTL text. #jira UE-50266 Change 3690231 by Lauren.Ridge Added Material Layers Parameters Preview (all editing disabled) panel to the Material Editor Change 3690234 by Lauren.Ridge Adding Material Layers Function Parameter to Static Parameter Compare Change 3690750 by Chris.Bunner Potential nullptr crash. Change 3690751 by Chris.Bunner Fixed logic on overridden vector parameter retrieval for material instances checking a function owned parameter. Change 3691010 by Jamie.Dale Fixed some clipping issues that could occur with right-aligned text FTextBlockLayout::OnPaint was passing an unscaled offset to SetVisibleRegion, and it also wasn't correctly adjusting the offset for RTL text with left-alignment (which becomes a visual right-alignment) #jira UE-46760 Change 3691091 by Jamie.Dale Renamed FTextBlockLayout to FSlateTextBlockLayout to reflect that it's a Slate specific type Change 3691134 by Alexis.Matte Make sure we instance also the collision mesh when exporting a level to fbx file. #jira UE-51066 Change 3691157 by Lauren.Ridge Fix for reset to default not refreshing sub-parameters Change 3691192 by Jamie.Dale Fixed Content Browser selection resetting when changing certain view settings #jira UE-49611 Change 3691204 by Alexis.Matte Remove fbx export file version 2010 compatibility. The 2018 fbx sdk refuse to export earlier then 2011. #jira UE-51023 Change 3692335 by Lauren.Ridge Setting displayed asset to equal filter asset if no instance has been selected Change 3692479 by Jamie.Dale Fixed whitespace Change 3692508 by Alexis.Matte Make sure we warn the user that there is nothing to export when exporting to fbx using "export selected" or "export All" from the file menu. We also prevent the export dialog to show #jira UE-50973 Change 3692639 by Jamie.Dale Translation Editor now shows stale translations as "Untranslated" Change 3692743 by Lauren.Ridge Smaller blend icons, added icon size override to FObjectEntryBox Change 3692830 by Alexis.Matte Fix linux build Change 3692894 by Lauren.Ridge Tooltip on "Parent" in material layers Change 3693141 by Jamie.Dale Removed dead code FastDecimalFormat made this redundant Change 3693580 by Jamie.Dale Added AlwaysSign number formatting option #jira UE-10310 Change 3693784 by Jamie.Dale Fixed assert extracting the number formatting rules for Arabic It uses a character outside the BMP for its plus and minus sign, so we need these to be a string to handle that. #jira UE-10310 Change 3694428 by Arciel.Rekman Linux: make directory watch request a warning so they don't block cooking. - See https://answers.unrealengine.com/questions/715206/cook-error-on-linux.html Change 3694458 by Matt.Kuhlenschmidt Made duplicate keybinding warning non-fatal Change 3694496 by Alexis.Matte fix static analysis build Change 3694515 by Jamie.Dale Added support for culture correct parsing of decimal numbers #jira UE-4028 Change 3694621 by Jamie.Dale Added a variant of FastDecimalFormat::StringToNumber that takes a string length This can be useful if you want to convert a number from within a non-null terminated string #jira UE-4028 Change 3694958 by Jamie.Dale Added a parsed length output to FastDecimalFormat::StringToNumber to allow permissive parsing You can test this rather than the result if you want to attempt to parse a number from a string that may have other data after it. This also fixes the sign-suffix causing the parsing to fail. #jira UE-4028 Change 3695083 by Alexis.Matte Optimisation of the morph target import - We now compute only the normal for the shape the tangent are not necessary - The async tasks are create when there is some available cpu thread to avoid filling the memory - When we re-import the morph target are deleted in bulk avoiding to initialize the morph map for every morphs targets #jira UE-50945 Change 3695122 by Jamie.Dale GetCultureAgnosticFormattingRules no longer returns a copy Change 3695835 by Arciel.Rekman TestPAL: greatly expanded malloc test. Change 3695918 by Arciel.Rekman TestPAL: Added thread priority test. Change 3696589 by Arciel.Rekman TestPAL: tweak thread priorities test (better readability). Change 3697345 by Alexis.Matte Fix reorder of material when importing a LOD with new material #jira UE-51135 Change 3699590 by Jamie.Dale Updated SGraphPinNum to use a numeric editor #jira UE-4028 Change 3699698 by Matt.Kuhlenschmidt Fix crash opening the level viewport context menu if the actor-component selection is out of sync #jira UE-48444 Change 3700158 by Arciel.Rekman Enable packaging for Android Vulkan on Linux (UETOOL-1232). - Change by Cengiz Terzibas Change 3700224 by Arciel.Rekman TestPAL: fixed a memory leak. Change 3700775 by Cody.Albert Don't need to initialize EnvironmentCubeMap twice. Change 3700866 by Michael.Trepka PR #3223: Remove unnecessary reallocation. (Contributed by foollbar) #jira UE-41643 Change 3701132 by Michael.Trepka Copy of CL 3671538 Fixed issues with editor's game mode in high DPI on Mac. #jira UE-49947, UE-51063 Change 3701421 by Michael.Trepka Fixed a crash in FScreenShotManager caused by an attempt to access a deleted FString in async lambda expression Change 3701495 by Alexis.Matte Fix fbx importer "import normals" option when mix with "mikkt" tangent build it was recomputing the normals instead of importing them. #jira UE-UE-51359 Change 3702982 by Jamie.Dale Cleaned up some localization setting names These now have consistent names and avoid double negatives. This also fixes needing to restart the editor when changing the "ShouldUseLocalizedPropertyNames" setting. Change 3703517 by Arciel.Rekman TestPAL: improved thread test. - Changed the counter to a normal variable to reduce possible contentions (threads used to share the counter in an early prototype, hence the usage of an atomic). Change 3704378 by Michael.Trepka Disable Zoom button on Mac if project requests a resizeable window without it. #jira UE-51335 Change 3706316 by Jamie.Dale Fixed the asset search suggestions list closing if you clicked on its scrollbar #jira UE-28885 Change 3706855 by Alexis.Matte Support importing animation that has some keys with negative time #jira UE-51305 Change 3709634 by Matt.Kuhlenschmidt PR #4146: Null access check on ForceLOD in FViewport::HighResScreenshot (Contributed by projectgheist) Change 3711085 by Michael.Trepka Reenabled UBT makefiles on Mac Change 3713049 by Josh.Engebretson The ConfigPropertyEditor now generates a unique runtime UClass. It uses the outer name on the property instead of a unique ID as a unique id would generate a new UClass every time (and these are RF_Standalone). I also removed some static qualifiers for Section and Property names which were incorrect. #jira UE-51319 Change 3713144 by Lauren.Ridge Fixing automated test error #jira UE-50982 Change 3713395 by Alexis.Matte Fix auto import mountpoint #jira UE-51524 Change 3713881 by Michael.Trepka Added -buildscw to Mac Build.sh script to build ShaderCompileWorker in addition to the requested target. Xcode passes it to the script when building non-program targets. #jira UE-31093 Change 3714197 by Michael.Trepka Send IMM key down event to the main window instead of Cocoa key window, as that's what the Slate's active window is. This solves problems with IMM not working in context menu text edit fields. #jira UE-47915 Change 3714911 by Joe.Graf Merge of cmake changes from Dev-Rendering Change 3715973 by Michael.Trepka Disable OS close button on Windows if project settings request that #jira UE-45522 Change 3716390 by Lauren.Ridge The color picker summoned when double-clicking vector3 nodes now has its intended "do not refresh until OK is clicked" behavior. #jira UE-50916 Change 3716529 by Josh.Engebretson Content Browser: Clamp "Assets to Load at Once Before Warning" so it cannot be set below 1 #jira UE-51341 Change 3716885 by Josh.Engebretson Tracking transactions such as a duplication operation can modify a selection which differs from the initial one. Added package state tracking to restore unmodified state when necessary. #jira UE-48572 Change 3716929 by Josh.Engebretson Unshelved from pending changelist '3364093': PR #3420: Exe's icons and properties (Contributed by projectgheist) Change 3716937 by Josh.Engebretson Unshelved from pending changelist '3647428': PR #4026: Fixed memory leaks for pipe writes and added data pipe writes (Contributed by Hemofektik) Change 3717002 by Josh.Engebretson Fix FileReference/string conversion Change 3717355 by Joe.Graf Fixed CMake file generation on Windows including Engine/Source/ThirdParty source Change 3718256 by Arciel.Rekman TestPAL: slight mod to the malloc test. - Touch the allocated memory to check actual resident usage. Change 3718290 by Arciel.Rekman BAFO: place descriptor after the allocation to save some VIRT memory. - We're relying on passing correct "Size" argument to Free() anyway, and this modification makes use of that extra information to save on memory for the descriptor. Change 3718508 by Michael.Trepka Fixed vsnprintf on platforms that use our custom implementation in StandardPlatformString.cpp to ignore length modifier for certain types (floating point, pointer) #jira UE-46148 Change 3718855 by Lauren.Ridge Adding content browser favorite folders. Add or remove folders from the favorite list in the folder's right-click context menu, and hide or show the favorites list in the Content Browser options. Change 3718932 by Cody.Albert Update ActorSequence plugin loading phase to PreDefault #jira UE-51612 Change 3719378 by tim.gautier QAGame: Renamed multiTxt_Justification > UMG_TextJustification. Added additional Text Widgets for testing Change 3719413 by Lauren.Ridge Resubmit of content browser favorites Change 3719803 by Yannick.Lange VREditor: Fix crash with null GEditor #jira UE-50103 Change 3721127 by tim.gautier QAGame: Fixed up a ton of redirectors within /Content and /Content/Materials - Added M_ParamDefaults and MF_ParamDefaults - Moved legacy MeshPaint materials into /Content/Materials/MeshPaint - Renamed ColorPulse assets from MatFunction_ > MF_, moved into /Content/Materials/Functions Change 3721255 by Alexis.Matte Replace skeletal mesh import option "keep overlapping vertex" by 3 float thresholds allowing the user to control the welding thresholds. #jira UE-51363 Change 3721594 by Lauren.Ridge Material Blends now have plane mesh previews in their icons. Change 3722072 by tim.gautier QAGame: Updated MF_ParamDefaults - using red channel as roughness Updated M_ParamDefaults - tweaked Scalar values Change 3722180 by Michael.Trepka Updated Xcode project generator to sort projects in the navigator by name (within folders) and also sort the list of schemes so that their order matches the order of projects in the navigator. #jira UE-25941 Change 3722220 by Michael.Trepka Fixed a problem with Xcode project generator not handling quoted preprocessor definitions correctly #jira UE-40246 Change 3722806 by Lauren.Ridge Fixing non-editor compiles Change 3722914 by Alexis.Matte Fbx importer: Add new attribute type(eSkeleton) for staticmesh socket import. #jira UE-51665 Change 3723446 by Michael.Trepka Copy of CL 3688862 from 4.18 + one more fix for a deadlock related to window resizing when using IME Don't do anything in Mac window's windowWillResize: if we're simply chaning the z order of windows. This way we avoid a rare dead lock when hiding the window. #jira UE-48257 Change 3723505 by Matt.Kuhlenschmidt Fix duplicate actors being created for USD primitives that specify a custom actor class Change 3723555 by Matt.Kuhlenschmidt Fix crash loading the gameplayabilities module #jira UE-51693 Change 3723557 by Matt.Kuhlenschmidt Fixed tooltip on viewport dpi scaling option Change 3723870 by Lauren.Ridge Fixing incorrect reset to default visibility, adding clear behavior to fields Change 3723917 by Arciel.Rekman Linux: fix compilation with glibc 2.26+ (UE-51699). - Fixes compilation on Ubuntu 17.10 among others. (Merging 3723489 from //UE4/Release-4.18/... to //UE4/Dev-Editor/...) Change 3723918 by Arciel.Rekman Linux: do not test for popcnt presence unnecessarily (UE-51677). (Merging 3723904 from //UE4/Release-4.18/... to //UE4/Dev-Editor/...) Change 3724229 by Arciel.Rekman Fix FOutputDeviceStdOutput to use printf() on Unix platforms. Change 3724261 by Arciel.Rekman TestPAL: fix thread priority test (zero the counter). Change 3724978 by Arciel.Rekman Linux: fix priority calculation. - Rlimit values are always positive, so this was completely broken when the RLIMIT_NICE is non-0. Change 3725382 by Matt.Kuhlenschmidt Guard against crashes and add more logging when actor creation fails. Looks like it could be manual garbage collections triggered before conversion is complete so those have been removed #jira UE-47464 Change 3725559 by Matt.Kuhlenschmidt Added a setting to enable/disable high dpi support in editor. This currently only functions in Windows. Moved some files around for better consistency Change 3725640 by Arciel.Rekman Fix Linux thread/process priorities. - Should also speed up SCW on Linux by deprioritizing them less. Change 3726101 by Matt.Kuhlenschmidt Fix logic bug in USD child "kind" type resolving Change 3726244 by Joe.Graf Added an option to generate a minimal set of targets for cmake files Added shader and config files to cmake file generation for searching within IDEs Change 3726506 by Arciel.Rekman Fix compile issue after DPI change. Change 3726549 by Matt.Kuhlenschmidt Remove unnecessary indirection to cached widgets in the hit test grid Change 3726660 by Arciel.Rekman Enable DPI switch on Linux. Change 3726763 by Arciel.Rekman Fix mismatching "noperspective" qualifier (UE-50807). - Pull request #4080 by TTimo. Change 3727080 by Michael.Trepka Added support for editor's EnableHighDPIAwareness setting on Mac Change 3727658 by Matt.Kuhlenschmidt Fix shutdown crash if level editor is still referenced after the object system has been gc'd #jira UE-51630 Change 3728270 by Matt.Kuhlenschmidt Remove propertyeditor dependency from editorstyle Change 3728291 by Arciel.Rekman Linux: fix for a crash on a headless system (UE-51714). - Preliminary change before merging to 4.18. Change 3728293 by Arciel.Rekman Linux: remove unneeded dependency on CEF. - Old workaround should no longer be needed, while this dependency makes UE4 depend on a ton of external libs. Change 3728524 by Michael.Trepka Copy of CL 3725570 Removed Enable Fullscreen option from editor's Window menu on Mac. Windowed fullscreen mode is currently unavailable on Mac in editor mode as supporting it properly would require it to work with multiple spaces and split screen, which we currently don't handle (requested in UE-27240) #jira UE-51709 Change 3728875 by Michael.Trepka Fixed compile error in Mac SlateOpenGLContext.cpp Change 3728880 by Matt.Kuhlenschmidt Guard against invalid worlds in thumbnail renderers Change 3728924 by Michael.Trepka Don't defer MacApplication->CloseWindow() call. This should fix a rare problem with deferred call executing during Slate's PrepassWindowAndChildren call. #jira UE-51711 Change 3729288 by Joe.Graf Added the .idea/misc.xml file generation to speed up CLion indexing Change 3729935 by Michael.Dupuis #jira UE-51722: Hide from UI invalid enum values Change 3730234 by Matt.Kuhlenschmidt Fix "Game Gets Mouse Control" setting no longer functioning and instead the mouse was always captured. #jira UE-51801 Change 3730349 by Michael.Dupuis #jira UE-51324: Clear the UI selection when rebuilding the palette, as we destroyed all items and recreate them, so selection is on invalid item Change 3730438 by Lauren.Ridge Cleaning up material layering UI functions Change 3730723 by Jamie.Dale Fixed FastDecimalFormat::StringToNumber incorrectly reporting that number-like sequences that lacked digits had been parsed as numbers #jira UE-51799 Change 3731008 by Lauren.Ridge Changing Layers and Blends from proxy assets to real assets Change 3731026 by Arciel.Rekman libelf: make elf_end() visible (UE-51843). - This repairs compilation for a case when CUDA is being used. - Also added some missing files for ARM 32-bit. Change 3731081 by Lauren.Ridge New material layer test assets Change 3731186 by Josh.Engebretson Adding camera speed scalar setting and Toolbar UI to increase range on camera speed presets #jira UE-50104 Change 3731188 by Mike.Erwin Improve responsiveness of Open Asset dialog. On large projects, there's a noticeable delay when opening and searching/filtering assets. Stopwatch measurements on my machine (seconds for ~122,000 assets): before with this CL ctrl-P 1.4 0.45 search 1.8 0.55 CollectionManagerModule was the main culprit for search/filter slowness. Open Asset delay was due to filtering out plugin content. We were doing a lot of redundant work for what is essentially a read-only operation. Change 3731682 by Arciel.Rekman UnrealEd: Allow unattended commandlets to rename/save packages. Change 3732305 by Michael.Dupuis #jira UE-48434 : Only register if the foliage type still has a valid mesh Change 3732361 by Matt.Kuhlenschmidt Fix two settings objects being created in the transient package with the same name #jira UE-51891 Change 3732895 by Josh.Engebretson https://jira.it.epicgames.net/browse/UE-51706 If a shared DDC is not being used, present a notification to the licensee with a link on how to setup a shared DDC. Adds DDC notification events for check/put and query for whether a shared DDC is in use. #jira UE-51706 Change 3733025 by Arciel.Rekman UBT: make sure new clang versions are invoked. Change 3733311 by Mike.Erwin Fix Linux compile warning from CL 3731188 It didn't like mixing && and || without parentheses. Reworked logic to do one test at a time, put cheaper tests first to avoid calls to more expensive IsPluginFolder. Change 3733658 by Josh.Engebretson Add a missing #undef LOCTEXT_NAMESPACE Change 3734003 by Arciel.Rekman Fix Windows attempting to use printf %ls and crashing at that (UE-51934). Change 3734039 by Michael.Trepka Fixed a couple of merge issues in Mac ApplicationCore Change 3734052 by Michael.Trepka One more Mac ApplicationCore fix Change 3734244 by Lauren.Ridge Fix for accessing Slate window on render thread Change 3734950 by Josh.Engebretson Fixing clang warning Change 3734978 by Jamie.Dale Relaxed enum property importing to allow valid numeric values to be imported too This was previously made more strict which caused a regression in Data Table importing #jira UE-51848 Change 3734999 by Arciel.Rekman Linux: add LTO support and more. - Adds ability to use link-time opitimization (reusing current target property bAllowLTCG). - Supports using llvm-ar and lld instead of ar/ranlib and ld. - More build information printed (and in a better organized way). - Native scripts updated to install packages with the appropriate tools on supported systems - AutoSDKs updated to require a new toolchain (already checked in). - Required disabling OpenAL due to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219089 Change 3735268 by Matt.Kuhlenschmidt Added support for canvas based DPI scaling. -Scene canvas is by default not scaled as this could severely impact any game using a canvas based UI -The debug canvas for stats is always dpi scaled in editor and pie. -Eliminated text scaling workaround now that the entire canvas is properly scaled -Enabled canvas scaling in cascade UI Change 3735329 by Matt.Kuhlenschmidt Fix potential crash if an asset editor has an object deleted out from under it #jira UE-51941 Change 3735502 by Arciel.Rekman Fix compile issue (bShouldUpdateScreenPercentage). Change 3735878 by Jamie.Dale Updated FString::SanitizeFloat to allow you to specify the min number of fractional digits to have in the resultant string This defaults to 1 as that was the old behavior of FString::SanitizeFloat, but can also be set to 0 to prevent adding .0 to whole numbers. Change 3735881 by Jamie.Dale JsonValue no longer stringifies whole numbers as floats Change 3735884 by Jamie.Dale Only allow enums to import integral values Change 3735912 by Josh.Engebretson Improving cook process error/warning handling including asset warning/error content browser links and manual dismiss for cook error notifications #jira UE-48131 Change 3736280 by Matt.Kuhlenschmidt Fix 0 dpi scale for canvases #jira UE-51995 Change 3736298 by Matt.Kuhlenschmidt Force focus of game viewports in vr mode Change 3736374 by Jamie.Dale Fixed some places where input chords were being used without testing that they had a valid key set #jira UE-51799 Change 3738543 by Matt.Kuhlenschmidt Better fix for edit condition crashes #jira UE-51886 Change 3738603 by Lauren.Ridge Copy over of drag and drop non-array onto array fix Change 3739701 by Chris.Babcock Fix crashlytics merge error #jira UE-52064 #ue4 #android [CL 3739980 by Matt Kuhlenschmidt in Main branch]
2017-11-06 18:22:01 -05:00
FCriticalSection SynchronizationObject;
// DDCNotification metrics
/** Map of cache keys to miss times for generating timing deltas. */
Copying //UE4/Dev-Editor to //UE4/Dev-Main (Source: //UE4/Dev-Editor @ 3739701) #lockdown Nick.Penwarden #rb none ============================ MAJOR FEATURES & CHANGES ============================ Change 3358367 by tim.gautier Submitting resaved QAGame assets - Materials, Material Instances, Material Functions and Parameters Change 3624848 by Jamie.Dale Added a composite font for the editor (and Slate core) This is defined in FLegacySlateFontInfoCache::GetDefaultFont and uses our default Roboto fonts (and the culture specific fallback fonts), and is now used as the default font for Slate and the editor. This change removes all the manual TTF/OTF file references from the various Slate styles, as well as updating 200+ hard-coded font references to use the new default font. This fixes various rendering issues with fonts in the editor when using different languages, and clears a big barrier for removing the legacy localized fallback font support. Change 3654993 by Jamie.Dale 'Native' (now called 'FNativeFuncPtr') is now a function pointer that takes a UObject* context, rather than a UObject member function pointer This avoids ambiguity when binding a native function pointer to a type that doesn't match the context pointer, as you could end up getting a function called with an incorrect 'this' pointer Breaking changes: - Native has been renamed to FNativeFuncPtr. - The signature of a native function has changed (use the DECLARE_FUNCTION and DEFINE_FUNCTION macro pair). - Use P_THIS if you were previously using the 'this' pointer in your native function. Change 3699591 by Jamie.Dale Added support for displaying and editing numbers in a culture correct way Numeric input boxes in Slate will now display and accept numbers using the culture correct decimal separators. This is enabled by default, and can be disabled by setting "ShouldUseLocalizedNumericInput" to "False" in XEditorSettings.ini (for the editor), or XGameUserSettings.ini (for a game). #jira UE-4028 Change 3719568 by Jamie.Dale Allow platforms to override the default ICU timezone calculation Change 3622366 by Bradut.Palas #jira UE-46677 Don't allow OnLevelRemovedFromWorld to reset the transaction buffer if we're in PIE mode. Also, remove one undo barrier in case the event was triggered in PIE mode or else we block the user from undoing previous actions. Change 3622378 by Bradut.Palas #jira UE-46590 we have a general bug with detecting the size of the last column, but the clamping prevents it from appearing with the other resize modes. The Content Browser is the only one to use fixed width. The bug is that the size of the last element is incorrectly reported, after we drag back and forth. Fixed by not reading the size real time, but reading it from the SlotInfo structure that is created earlier, which holds the correct value. Change 3622552 by Jamie.Dale Added support for per-culture sub-fonts within a composite font This allows you to do things like create a Japanese specific Han sub-font to override the Han characters used in a CJK font (previously you needed to create a localized font asset to achieve this). Change 3623170 by Jamie.Dale Fixing warning Change 3624846 by Jamie.Dale Composite font cache optimizations - Converted a typically small sized map to a sorted array + binary search. - Converted the already sorted range array to use binary search. - Contiguous ranges using the same typeface are now merged in the cache. Change 3625576 by Cody.Albert We now only set the widget tree to transient instead of passing the flag through StaticDuplicateObject. This was causing instanced subobjects to be flagged with RF_DuplicateTransient, preventing them from properly being duplicated when an array of instanced subobjects was modified. #jira UE-47971 Change 3626057 by Matt.Kuhlenschmidt Expose EUmgSequencePlayMode to blueprints #jira UE-49255 Change 3626556 by Matt.Kuhlenschmidt Fix window size and position adjustment not accounting for primary monitor not being a high DPI monitor when a secondary monitor is. Causes flickering and incorrect window positioning. #jira UE-48922, UE-48957 Change 3627692 by Matt.Kuhlenschmidt PR #3977: Source control submenu menu customization (Contributed by Kryofenix) Change 3628600 by Arciel.Rekman Added AutoCheckout to FAssetRenameManager for commandlet usage. Change 3630561 by Richard.Hinckley Deprecating the version of UFunctionalTestingManager::RunAllFunctionalTests that feature an unused bool parameter, replacing with a new version without that parameter. Change 3630656 by Richard.Hinckley Compile fix. Change 3630964 by Arciel.Rekman Fix CrashReporterClient headless build. Change 3631050 by Matt.Kuhlenschmidt Back out revision 9 from //UE4/Dev-Editor/Engine/Source/Runtime/Slate/Private/Widgets/Layout/SSplitter.cpp Causes major problems with resizing splitters in editor Change 3631140 by Arciel.Rekman OpenAL: update Linux version to 1.18.1 (UETOOL-1253) - Also remove a hack for RPATH and make it use a generic RPATH mechanism. - Bulk of the change from Cengiz.Terzibas #jira UETOOL-1253 Change 3632924 by Jamie.Dale Added support for a catch-all fallback font within composite fonts This allows you to provide broad "font of last resort" behavior on a per-composite font basis, in a way that can also work with different font styles. Change 3633055 by Jamie.Dale Fixed some refresh issues in the font editor Change 3633062 by Jamie.Dale Fixed localization commands being reported as unknown Change 3633906 by Nick.Darnell UMG - You can now store refrences to widgets in the same UserWidget. If you need to create links between widgets this is valuable. Will likely introduce new ways to utilize this in the future, for now just getting it working. Change 3634070 by Arciel.Rekman Display actually used values of material overrides. Change 3634254 by Arciel.Rekman Fix ResavePackages working poorly with projects on other drives (UE-49465). #jira UE-49465 Change 3635985 by Matt.Kuhlenschmidt Fixed typo in function name used by maps PR #3975: Add tooltip to Arrays in Editor (Contributed by projectgheist) Change 3636012 by Matt.Kuhlenschmidt PR #3982: Unhide mouse cursor after using Ansel (Contributed by projectgheist) Change 3636706 by Lauren.Ridge Epic Friday: Save parameters to child or sibling instance functionality Change 3638706 by Jamie.Dale Added an improved Japanese font to the editor This is only used when displaying Japanese text when the editor is set to Japanese, and uses a font with Japanese-style unified Han characters (our default fallback font uses Chinese-style unified Han characters). #jira UE-33268 Change 3639438 by Arciel.Rekman Linux: Repaired ARM server build (UE-49635). - Made Steam* plugins compile. - Disabled OpenEXR as the libs aren't compiled (need to be done separately). (Edigrating CL 3639429 from Release-4.17 to Dev-Editor) Change 3640625 by Matt.Kuhlenschmidt PR #4012: FSlateApplication::ProcessReply use &Reply (Contributed by projectgheist) Change 3640626 by Matt.Kuhlenschmidt PR #4011: Remove space from filename (Contributed by projectgheist) Change 3640697 by Matt.Kuhlenschmidt PR #4010: PNG alpha fix (Contributed by mmdanggg2) Change 3641137 by Jamie.Dale Fixed an issue where a culture specific sub-font could produce incorrect measurements during a culture switch It would fallback to the last resort font for a frame or two while the font cache flushed. This has it update the ranges immediately. Change 3641351 by Jamie.Dale Fixing incorrect weights on the Japanese sub-font Change 3641356 by Jamie.Dale Fixing inconsistent font sizes between CoreStyle and EditorStyle Change 3641710 by Jamie.Dale Fixed pure-virtual function call on UMulticastDelegateProperty Change 3641941 by Lauren.Ridge Adding a Parameter Details tab to the Material Editor so users can change default parameter details Change 3644141 by Jamie.Dale Added an improved Korean font to the editor This is only used when displaying Korean text when the editor is set to Korean Change 3644213 by Arciel.Rekman Fix the side effects of a fix for UE-49465. - Default materials were apparently not being found while building DDC (e.g. making an installed build), now they are and we should not reset loaders on them lest we trigger HasDefaultMaterialsPostLoaded() assert later. #jira UE-49465 Change 3644777 by Jamie.Dale Reverting Korean editor font back to NanumGothic as NanumBarunGothic looked too squished Change 3644879 by tim.gautier QAGame: Optimized assets for Procedural Foliage testing - Added camera bookmarks to Stations in QA-Foliage - Renamed QA-FoliageTypeInst assets to ProcFoliage_Shape - Fixed up redirectors Change 3645109 by Matt.Kuhlenschmidt PR #3990: Git plugin: fix status of renamed, removed, missing, untracked assets (Contributed by SRombauts) Change 3645114 by Matt.Kuhlenschmidt PR #3991: Git Plugin: Fix RunDumpToFile() leaking Process handles (Contributed by SRombauts) Change 3645116 by Matt.Kuhlenschmidt PR #3996: Git Plugin: run an "UpdateStatus" at "Connect" time to populate the Source Control cache (Contributed by SRombauts) Change 3645118 by Matt.Kuhlenschmidt PR #4005: Git Plugin: Expand the size of the Button "Initialize project with Git" (Contributed by SRombauts) Change 3645876 by Arciel.Rekman Linux: fix submenus of context menu not working (UE-47639). - Change by icculus (Ryan Gordon). - QA-ClickHUD seems to be not affected by this change (it is already broken alas). #jira UE-47639 Change 3648088 by Jamie.Dale Fixed some case-sensitivity issues with FText format argument names/pins These were originally case-sensitive, but that was lost somewhere along the way. This change restores their original behavior. #jira UE-47122 Change 3648097 by Jamie.Dale Moved common macOS/iOS localization implementation into FApplePlatformMisc #jira UE-49940 Change 3650858 by Arciel.Rekman UBT: improve CodeLite project generator (UE-49400). - PR #3987 submitted by yaakuro (Cengiz Terzibas). #jira UE-49400 Change 3651231 by Arciel.Rekman Linux: default to SM5 for Vulkan. - Change by Timothee.Bessett. Change 3653627 by Matt.Kuhlenschmidt PR #4020: Source Control Submit Files now interprets Escape key as if the user clicked cancel (Contributed by SRombauts) Change 3653628 by Matt.Kuhlenschmidt PR #4022: Add New C++ Class dialog remember previously selected module. (Contributed by Koderz) Change 3653984 by Jamie.Dale Fixed some redundant string construction Change 3658528 by Joe.Graf UE-45141 - Added CMAKE_CXX_COMPILER and CMAKE_C_COMPILER settings to the generated CMake files Change 3658594 by Jamie.Dale Zipping in UAT now always uses UTF-8 encoding to prevent Unicode issues #jira UE-27263 Change 3659643 by Michael.Trepka Added a call to FCoreDelegates::ApplicationWillTerminateDelegate.Broadcast(); in Mac RequestExit() to match Windows behavior #jira UETOOL-1238 Change 3661908 by Matt.Kuhlenschmidt USD asset importing improvements Change 3664100 by Matt.Kuhlenschmidt Fix static analysis Change 3664107 by Matt.Kuhlenschmidt PR #4051: UE-49448: FPropertyChangedEvent to include TopLevelObjects (Contributed by projectgheist) Change 3664125 by Matt.Kuhlenschmidt PR #4036: Add missing GRAPHEDITOR_API (Contributed by projectgheist) Change 3664340 by Jamie.Dale PR #3648: Prevent GatherTextFromSource from failing the commandlet (Contributed by projectgheist) Change 3664403 by Jamie.Dale PR #3769: Fixes UE-46973 - Drag and Dropping Folders with Names (Contributed by LordNed) Change 3664539 by Jamie.Dale PR #3280: Added EditableText functionality (Contributed by projectgheist) Change 3665433 by Alexis.Matte When we finish importing morph target we must re-initialise the render resources since we now use GPU morph target. #jira UE-50231 Change 3666747 by Cody.Albert Change 3669280 by Jamie.Dale PR #4060: UE-50455: Verify folder is newly created before removing from tree (Contributed by projectgheist) Change 3669718 by Jamie.Dale PR #4061: Clear Content Browser folder search box on escape key (Contributed by projectgheist) Change 3670838 by Alexis.Matte Fix crash when deleting a skeletal mesh LOD and the mouse is over the "reimport" button. #jira UE-50387 Change 3671559 by Matt.Kuhlenschmidt Update SimpleUI automation test ground truth #jira UE-50325 Change 3671587 by Alexis.Matte Fix fbx importer scale not always apply. A cache array was not reset when opening a fbx file. #jira UE-50147 Change 3671730 by Jamie.Dale Added PostInitInstance to UClass to allow class types to perform construction time initialization of their instances Change 3672104 by Michael.Dupuis #jira UE-50427: Update the volume visibility list of the editor viewport when changing the procedural foliage settings Change 3674906 by Alexis.Matte Make sure the export LOD option is taken in consideration when exporting a level or the current level selection #jira UE-50248 Change 3674942 by Matt.Kuhlenschmidt Fix static analysis Change 3675401 by Alexis.Matte -fix export animation, do not truncate the last frame anymore -fix the import animation, there was a display issue in the progress bar. Also a floorToInt sometime truncate the last valid frame. We also have a better way to calculate the time increment we use to sample the fbx curves. #jira UE-48231 Change 3675990 by Alexis.Matte Remove morph target when doing a re-import, so morph will be remove if they do not exist anymore in the fbx. This is to avoid driving random vertex with old morph target. #jira UE-50391 Change 3676169 by Alexis.Matte When we re-import with dialog the option, "Override Full Name" was set to false and save with the option dialog. We now not set it to false, since it was not use during re-import. Change 3676396 by Alexis.Matte Make all LOD 0 name consistent in staticmesh editor #jira UE-49461 Change 3677730 by Cody.Albert Enable locking of Persistent Level in Levels tab #jira UE-50686 Change 3677838 by Jamie.Dale Replaced broken version of Roboto Light Change 3679619 by Alexis.Matte Integrate GitHub pr #4029 to fix import fbx chunk material assignation. #jira UE-50001 Change 3680093 by Alexis.Matte Fix the skeletal mesh so the vertex color is part of the vertex equality like with the static mesh. Change 3680931 by Arciel.Rekman SlateDialogs: show image icon for *.tga (UE-25106). - Also reworked the logic somewhat. #jira UE-25106 Change 3681966 by Yannick.Lange MaterialEditor post-process preview. #jira UE-45307 Change 3682407 by Lauren.Ridge Fixes for material editor compile errors Change 3682628 by Lauren.Ridge Content browser filters for Material Layers, Blends, and their instances Change 3682725 by Lauren.Ridge Adding filter assets and instance assets to Material Layers and Material Layer Blends. Turning Material Layering on by default Change 3682921 by Lauren.Ridge Fix for instance layers not initializing fully Change 3682954 by Lauren.Ridge Creating Material Layer Test Assets Change 3683582 by Alexis.Matte Fix static analysis build Change 3683614 by Matt.Kuhlenschmidt PR #4062: Git Plugin: Fix UE-44637: Deleting an asset is unsuccessful if the asset is marked for add (Contributed by SRombauts) Change 3684130 by Lauren.Ridge Allow visible parameter retrieval to correctly recurse through internally called functions. Previous check was intended to prevent function previews from leaving their graph through unhooked inputs, but unintentionally blocked all function inputs. Change 3686289 by Arciel.Rekman Remove the pessimization (UE-23791). Change 3686455 by Lauren.Ridge Fixes for adding/removing a layer parameter from the parent not updating the child Change 3686829 by Jamie.Dale No longer include trailing whitespace in the justification calculation for soft-wrapped lines #jira UE-50266 Change 3686970 by Lauren.Ridge Making material parameter preview work for functions as well Change 3687077 by Jamie.Dale Fixed crash using FActorDetails with the struct details panel Change 3687152 by Jamie.Dale Fixed the row structure tag not appearing in the Content Browser for Data Table assets The CDO is used to filter these tags, and the CDO was omiting that tag which caused it to be filtered for all Data Tables. #jira UE-48691 Change 3687174 by Lauren.Ridge Fix for material layer sub-parameters showing up in the default material parameters panel Change 3688100 by Lauren.Ridge Fixing static analysis error Change 3688317 by Jamie.Dale Fixed crash using the widget reflector in a cooked game Editor-style isn't available in cooked games. Core-style should be used instead for the widget reflector. Change 3689054 by Jamie.Dale Reference Viewer can now show/copy references lists for nodes with multiple objects, or multiple selected nodes #jira UE-45751 Change 3689513 by Jamie.Dale Fixed justification bug with RTL text caused by CL# 3686829 Also implemented the same alignment fix for visually left-aligned RTL text. #jira UE-50266 Change 3690231 by Lauren.Ridge Added Material Layers Parameters Preview (all editing disabled) panel to the Material Editor Change 3690234 by Lauren.Ridge Adding Material Layers Function Parameter to Static Parameter Compare Change 3690750 by Chris.Bunner Potential nullptr crash. Change 3690751 by Chris.Bunner Fixed logic on overridden vector parameter retrieval for material instances checking a function owned parameter. Change 3691010 by Jamie.Dale Fixed some clipping issues that could occur with right-aligned text FTextBlockLayout::OnPaint was passing an unscaled offset to SetVisibleRegion, and it also wasn't correctly adjusting the offset for RTL text with left-alignment (which becomes a visual right-alignment) #jira UE-46760 Change 3691091 by Jamie.Dale Renamed FTextBlockLayout to FSlateTextBlockLayout to reflect that it's a Slate specific type Change 3691134 by Alexis.Matte Make sure we instance also the collision mesh when exporting a level to fbx file. #jira UE-51066 Change 3691157 by Lauren.Ridge Fix for reset to default not refreshing sub-parameters Change 3691192 by Jamie.Dale Fixed Content Browser selection resetting when changing certain view settings #jira UE-49611 Change 3691204 by Alexis.Matte Remove fbx export file version 2010 compatibility. The 2018 fbx sdk refuse to export earlier then 2011. #jira UE-51023 Change 3692335 by Lauren.Ridge Setting displayed asset to equal filter asset if no instance has been selected Change 3692479 by Jamie.Dale Fixed whitespace Change 3692508 by Alexis.Matte Make sure we warn the user that there is nothing to export when exporting to fbx using "export selected" or "export All" from the file menu. We also prevent the export dialog to show #jira UE-50973 Change 3692639 by Jamie.Dale Translation Editor now shows stale translations as "Untranslated" Change 3692743 by Lauren.Ridge Smaller blend icons, added icon size override to FObjectEntryBox Change 3692830 by Alexis.Matte Fix linux build Change 3692894 by Lauren.Ridge Tooltip on "Parent" in material layers Change 3693141 by Jamie.Dale Removed dead code FastDecimalFormat made this redundant Change 3693580 by Jamie.Dale Added AlwaysSign number formatting option #jira UE-10310 Change 3693784 by Jamie.Dale Fixed assert extracting the number formatting rules for Arabic It uses a character outside the BMP for its plus and minus sign, so we need these to be a string to handle that. #jira UE-10310 Change 3694428 by Arciel.Rekman Linux: make directory watch request a warning so they don't block cooking. - See https://answers.unrealengine.com/questions/715206/cook-error-on-linux.html Change 3694458 by Matt.Kuhlenschmidt Made duplicate keybinding warning non-fatal Change 3694496 by Alexis.Matte fix static analysis build Change 3694515 by Jamie.Dale Added support for culture correct parsing of decimal numbers #jira UE-4028 Change 3694621 by Jamie.Dale Added a variant of FastDecimalFormat::StringToNumber that takes a string length This can be useful if you want to convert a number from within a non-null terminated string #jira UE-4028 Change 3694958 by Jamie.Dale Added a parsed length output to FastDecimalFormat::StringToNumber to allow permissive parsing You can test this rather than the result if you want to attempt to parse a number from a string that may have other data after it. This also fixes the sign-suffix causing the parsing to fail. #jira UE-4028 Change 3695083 by Alexis.Matte Optimisation of the morph target import - We now compute only the normal for the shape the tangent are not necessary - The async tasks are create when there is some available cpu thread to avoid filling the memory - When we re-import the morph target are deleted in bulk avoiding to initialize the morph map for every morphs targets #jira UE-50945 Change 3695122 by Jamie.Dale GetCultureAgnosticFormattingRules no longer returns a copy Change 3695835 by Arciel.Rekman TestPAL: greatly expanded malloc test. Change 3695918 by Arciel.Rekman TestPAL: Added thread priority test. Change 3696589 by Arciel.Rekman TestPAL: tweak thread priorities test (better readability). Change 3697345 by Alexis.Matte Fix reorder of material when importing a LOD with new material #jira UE-51135 Change 3699590 by Jamie.Dale Updated SGraphPinNum to use a numeric editor #jira UE-4028 Change 3699698 by Matt.Kuhlenschmidt Fix crash opening the level viewport context menu if the actor-component selection is out of sync #jira UE-48444 Change 3700158 by Arciel.Rekman Enable packaging for Android Vulkan on Linux (UETOOL-1232). - Change by Cengiz Terzibas Change 3700224 by Arciel.Rekman TestPAL: fixed a memory leak. Change 3700775 by Cody.Albert Don't need to initialize EnvironmentCubeMap twice. Change 3700866 by Michael.Trepka PR #3223: Remove unnecessary reallocation. (Contributed by foollbar) #jira UE-41643 Change 3701132 by Michael.Trepka Copy of CL 3671538 Fixed issues with editor's game mode in high DPI on Mac. #jira UE-49947, UE-51063 Change 3701421 by Michael.Trepka Fixed a crash in FScreenShotManager caused by an attempt to access a deleted FString in async lambda expression Change 3701495 by Alexis.Matte Fix fbx importer "import normals" option when mix with "mikkt" tangent build it was recomputing the normals instead of importing them. #jira UE-UE-51359 Change 3702982 by Jamie.Dale Cleaned up some localization setting names These now have consistent names and avoid double negatives. This also fixes needing to restart the editor when changing the "ShouldUseLocalizedPropertyNames" setting. Change 3703517 by Arciel.Rekman TestPAL: improved thread test. - Changed the counter to a normal variable to reduce possible contentions (threads used to share the counter in an early prototype, hence the usage of an atomic). Change 3704378 by Michael.Trepka Disable Zoom button on Mac if project requests a resizeable window without it. #jira UE-51335 Change 3706316 by Jamie.Dale Fixed the asset search suggestions list closing if you clicked on its scrollbar #jira UE-28885 Change 3706855 by Alexis.Matte Support importing animation that has some keys with negative time #jira UE-51305 Change 3709634 by Matt.Kuhlenschmidt PR #4146: Null access check on ForceLOD in FViewport::HighResScreenshot (Contributed by projectgheist) Change 3711085 by Michael.Trepka Reenabled UBT makefiles on Mac Change 3713049 by Josh.Engebretson The ConfigPropertyEditor now generates a unique runtime UClass. It uses the outer name on the property instead of a unique ID as a unique id would generate a new UClass every time (and these are RF_Standalone). I also removed some static qualifiers for Section and Property names which were incorrect. #jira UE-51319 Change 3713144 by Lauren.Ridge Fixing automated test error #jira UE-50982 Change 3713395 by Alexis.Matte Fix auto import mountpoint #jira UE-51524 Change 3713881 by Michael.Trepka Added -buildscw to Mac Build.sh script to build ShaderCompileWorker in addition to the requested target. Xcode passes it to the script when building non-program targets. #jira UE-31093 Change 3714197 by Michael.Trepka Send IMM key down event to the main window instead of Cocoa key window, as that's what the Slate's active window is. This solves problems with IMM not working in context menu text edit fields. #jira UE-47915 Change 3714911 by Joe.Graf Merge of cmake changes from Dev-Rendering Change 3715973 by Michael.Trepka Disable OS close button on Windows if project settings request that #jira UE-45522 Change 3716390 by Lauren.Ridge The color picker summoned when double-clicking vector3 nodes now has its intended "do not refresh until OK is clicked" behavior. #jira UE-50916 Change 3716529 by Josh.Engebretson Content Browser: Clamp "Assets to Load at Once Before Warning" so it cannot be set below 1 #jira UE-51341 Change 3716885 by Josh.Engebretson Tracking transactions such as a duplication operation can modify a selection which differs from the initial one. Added package state tracking to restore unmodified state when necessary. #jira UE-48572 Change 3716929 by Josh.Engebretson Unshelved from pending changelist '3364093': PR #3420: Exe's icons and properties (Contributed by projectgheist) Change 3716937 by Josh.Engebretson Unshelved from pending changelist '3647428': PR #4026: Fixed memory leaks for pipe writes and added data pipe writes (Contributed by Hemofektik) Change 3717002 by Josh.Engebretson Fix FileReference/string conversion Change 3717355 by Joe.Graf Fixed CMake file generation on Windows including Engine/Source/ThirdParty source Change 3718256 by Arciel.Rekman TestPAL: slight mod to the malloc test. - Touch the allocated memory to check actual resident usage. Change 3718290 by Arciel.Rekman BAFO: place descriptor after the allocation to save some VIRT memory. - We're relying on passing correct "Size" argument to Free() anyway, and this modification makes use of that extra information to save on memory for the descriptor. Change 3718508 by Michael.Trepka Fixed vsnprintf on platforms that use our custom implementation in StandardPlatformString.cpp to ignore length modifier for certain types (floating point, pointer) #jira UE-46148 Change 3718855 by Lauren.Ridge Adding content browser favorite folders. Add or remove folders from the favorite list in the folder's right-click context menu, and hide or show the favorites list in the Content Browser options. Change 3718932 by Cody.Albert Update ActorSequence plugin loading phase to PreDefault #jira UE-51612 Change 3719378 by tim.gautier QAGame: Renamed multiTxt_Justification > UMG_TextJustification. Added additional Text Widgets for testing Change 3719413 by Lauren.Ridge Resubmit of content browser favorites Change 3719803 by Yannick.Lange VREditor: Fix crash with null GEditor #jira UE-50103 Change 3721127 by tim.gautier QAGame: Fixed up a ton of redirectors within /Content and /Content/Materials - Added M_ParamDefaults and MF_ParamDefaults - Moved legacy MeshPaint materials into /Content/Materials/MeshPaint - Renamed ColorPulse assets from MatFunction_ > MF_, moved into /Content/Materials/Functions Change 3721255 by Alexis.Matte Replace skeletal mesh import option "keep overlapping vertex" by 3 float thresholds allowing the user to control the welding thresholds. #jira UE-51363 Change 3721594 by Lauren.Ridge Material Blends now have plane mesh previews in their icons. Change 3722072 by tim.gautier QAGame: Updated MF_ParamDefaults - using red channel as roughness Updated M_ParamDefaults - tweaked Scalar values Change 3722180 by Michael.Trepka Updated Xcode project generator to sort projects in the navigator by name (within folders) and also sort the list of schemes so that their order matches the order of projects in the navigator. #jira UE-25941 Change 3722220 by Michael.Trepka Fixed a problem with Xcode project generator not handling quoted preprocessor definitions correctly #jira UE-40246 Change 3722806 by Lauren.Ridge Fixing non-editor compiles Change 3722914 by Alexis.Matte Fbx importer: Add new attribute type(eSkeleton) for staticmesh socket import. #jira UE-51665 Change 3723446 by Michael.Trepka Copy of CL 3688862 from 4.18 + one more fix for a deadlock related to window resizing when using IME Don't do anything in Mac window's windowWillResize: if we're simply chaning the z order of windows. This way we avoid a rare dead lock when hiding the window. #jira UE-48257 Change 3723505 by Matt.Kuhlenschmidt Fix duplicate actors being created for USD primitives that specify a custom actor class Change 3723555 by Matt.Kuhlenschmidt Fix crash loading the gameplayabilities module #jira UE-51693 Change 3723557 by Matt.Kuhlenschmidt Fixed tooltip on viewport dpi scaling option Change 3723870 by Lauren.Ridge Fixing incorrect reset to default visibility, adding clear behavior to fields Change 3723917 by Arciel.Rekman Linux: fix compilation with glibc 2.26+ (UE-51699). - Fixes compilation on Ubuntu 17.10 among others. (Merging 3723489 from //UE4/Release-4.18/... to //UE4/Dev-Editor/...) Change 3723918 by Arciel.Rekman Linux: do not test for popcnt presence unnecessarily (UE-51677). (Merging 3723904 from //UE4/Release-4.18/... to //UE4/Dev-Editor/...) Change 3724229 by Arciel.Rekman Fix FOutputDeviceStdOutput to use printf() on Unix platforms. Change 3724261 by Arciel.Rekman TestPAL: fix thread priority test (zero the counter). Change 3724978 by Arciel.Rekman Linux: fix priority calculation. - Rlimit values are always positive, so this was completely broken when the RLIMIT_NICE is non-0. Change 3725382 by Matt.Kuhlenschmidt Guard against crashes and add more logging when actor creation fails. Looks like it could be manual garbage collections triggered before conversion is complete so those have been removed #jira UE-47464 Change 3725559 by Matt.Kuhlenschmidt Added a setting to enable/disable high dpi support in editor. This currently only functions in Windows. Moved some files around for better consistency Change 3725640 by Arciel.Rekman Fix Linux thread/process priorities. - Should also speed up SCW on Linux by deprioritizing them less. Change 3726101 by Matt.Kuhlenschmidt Fix logic bug in USD child "kind" type resolving Change 3726244 by Joe.Graf Added an option to generate a minimal set of targets for cmake files Added shader and config files to cmake file generation for searching within IDEs Change 3726506 by Arciel.Rekman Fix compile issue after DPI change. Change 3726549 by Matt.Kuhlenschmidt Remove unnecessary indirection to cached widgets in the hit test grid Change 3726660 by Arciel.Rekman Enable DPI switch on Linux. Change 3726763 by Arciel.Rekman Fix mismatching "noperspective" qualifier (UE-50807). - Pull request #4080 by TTimo. Change 3727080 by Michael.Trepka Added support for editor's EnableHighDPIAwareness setting on Mac Change 3727658 by Matt.Kuhlenschmidt Fix shutdown crash if level editor is still referenced after the object system has been gc'd #jira UE-51630 Change 3728270 by Matt.Kuhlenschmidt Remove propertyeditor dependency from editorstyle Change 3728291 by Arciel.Rekman Linux: fix for a crash on a headless system (UE-51714). - Preliminary change before merging to 4.18. Change 3728293 by Arciel.Rekman Linux: remove unneeded dependency on CEF. - Old workaround should no longer be needed, while this dependency makes UE4 depend on a ton of external libs. Change 3728524 by Michael.Trepka Copy of CL 3725570 Removed Enable Fullscreen option from editor's Window menu on Mac. Windowed fullscreen mode is currently unavailable on Mac in editor mode as supporting it properly would require it to work with multiple spaces and split screen, which we currently don't handle (requested in UE-27240) #jira UE-51709 Change 3728875 by Michael.Trepka Fixed compile error in Mac SlateOpenGLContext.cpp Change 3728880 by Matt.Kuhlenschmidt Guard against invalid worlds in thumbnail renderers Change 3728924 by Michael.Trepka Don't defer MacApplication->CloseWindow() call. This should fix a rare problem with deferred call executing during Slate's PrepassWindowAndChildren call. #jira UE-51711 Change 3729288 by Joe.Graf Added the .idea/misc.xml file generation to speed up CLion indexing Change 3729935 by Michael.Dupuis #jira UE-51722: Hide from UI invalid enum values Change 3730234 by Matt.Kuhlenschmidt Fix "Game Gets Mouse Control" setting no longer functioning and instead the mouse was always captured. #jira UE-51801 Change 3730349 by Michael.Dupuis #jira UE-51324: Clear the UI selection when rebuilding the palette, as we destroyed all items and recreate them, so selection is on invalid item Change 3730438 by Lauren.Ridge Cleaning up material layering UI functions Change 3730723 by Jamie.Dale Fixed FastDecimalFormat::StringToNumber incorrectly reporting that number-like sequences that lacked digits had been parsed as numbers #jira UE-51799 Change 3731008 by Lauren.Ridge Changing Layers and Blends from proxy assets to real assets Change 3731026 by Arciel.Rekman libelf: make elf_end() visible (UE-51843). - This repairs compilation for a case when CUDA is being used. - Also added some missing files for ARM 32-bit. Change 3731081 by Lauren.Ridge New material layer test assets Change 3731186 by Josh.Engebretson Adding camera speed scalar setting and Toolbar UI to increase range on camera speed presets #jira UE-50104 Change 3731188 by Mike.Erwin Improve responsiveness of Open Asset dialog. On large projects, there's a noticeable delay when opening and searching/filtering assets. Stopwatch measurements on my machine (seconds for ~122,000 assets): before with this CL ctrl-P 1.4 0.45 search 1.8 0.55 CollectionManagerModule was the main culprit for search/filter slowness. Open Asset delay was due to filtering out plugin content. We were doing a lot of redundant work for what is essentially a read-only operation. Change 3731682 by Arciel.Rekman UnrealEd: Allow unattended commandlets to rename/save packages. Change 3732305 by Michael.Dupuis #jira UE-48434 : Only register if the foliage type still has a valid mesh Change 3732361 by Matt.Kuhlenschmidt Fix two settings objects being created in the transient package with the same name #jira UE-51891 Change 3732895 by Josh.Engebretson https://jira.it.epicgames.net/browse/UE-51706 If a shared DDC is not being used, present a notification to the licensee with a link on how to setup a shared DDC. Adds DDC notification events for check/put and query for whether a shared DDC is in use. #jira UE-51706 Change 3733025 by Arciel.Rekman UBT: make sure new clang versions are invoked. Change 3733311 by Mike.Erwin Fix Linux compile warning from CL 3731188 It didn't like mixing && and || without parentheses. Reworked logic to do one test at a time, put cheaper tests first to avoid calls to more expensive IsPluginFolder. Change 3733658 by Josh.Engebretson Add a missing #undef LOCTEXT_NAMESPACE Change 3734003 by Arciel.Rekman Fix Windows attempting to use printf %ls and crashing at that (UE-51934). Change 3734039 by Michael.Trepka Fixed a couple of merge issues in Mac ApplicationCore Change 3734052 by Michael.Trepka One more Mac ApplicationCore fix Change 3734244 by Lauren.Ridge Fix for accessing Slate window on render thread Change 3734950 by Josh.Engebretson Fixing clang warning Change 3734978 by Jamie.Dale Relaxed enum property importing to allow valid numeric values to be imported too This was previously made more strict which caused a regression in Data Table importing #jira UE-51848 Change 3734999 by Arciel.Rekman Linux: add LTO support and more. - Adds ability to use link-time opitimization (reusing current target property bAllowLTCG). - Supports using llvm-ar and lld instead of ar/ranlib and ld. - More build information printed (and in a better organized way). - Native scripts updated to install packages with the appropriate tools on supported systems - AutoSDKs updated to require a new toolchain (already checked in). - Required disabling OpenAL due to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219089 Change 3735268 by Matt.Kuhlenschmidt Added support for canvas based DPI scaling. -Scene canvas is by default not scaled as this could severely impact any game using a canvas based UI -The debug canvas for stats is always dpi scaled in editor and pie. -Eliminated text scaling workaround now that the entire canvas is properly scaled -Enabled canvas scaling in cascade UI Change 3735329 by Matt.Kuhlenschmidt Fix potential crash if an asset editor has an object deleted out from under it #jira UE-51941 Change 3735502 by Arciel.Rekman Fix compile issue (bShouldUpdateScreenPercentage). Change 3735878 by Jamie.Dale Updated FString::SanitizeFloat to allow you to specify the min number of fractional digits to have in the resultant string This defaults to 1 as that was the old behavior of FString::SanitizeFloat, but can also be set to 0 to prevent adding .0 to whole numbers. Change 3735881 by Jamie.Dale JsonValue no longer stringifies whole numbers as floats Change 3735884 by Jamie.Dale Only allow enums to import integral values Change 3735912 by Josh.Engebretson Improving cook process error/warning handling including asset warning/error content browser links and manual dismiss for cook error notifications #jira UE-48131 Change 3736280 by Matt.Kuhlenschmidt Fix 0 dpi scale for canvases #jira UE-51995 Change 3736298 by Matt.Kuhlenschmidt Force focus of game viewports in vr mode Change 3736374 by Jamie.Dale Fixed some places where input chords were being used without testing that they had a valid key set #jira UE-51799 Change 3738543 by Matt.Kuhlenschmidt Better fix for edit condition crashes #jira UE-51886 Change 3738603 by Lauren.Ridge Copy over of drag and drop non-array onto array fix Change 3739701 by Chris.Babcock Fix crashlytics merge error #jira UE-52064 #ue4 #android [CL 3739980 by Matt Kuhlenschmidt in Main branch]
2017-11-06 18:22:01 -05:00
TMap<FString, double> DDCNotificationCacheTimes;
/** The total estimated build time accumulated from cache miss/put deltas. */
Copying //UE4/Dev-Editor to //UE4/Dev-Main (Source: //UE4/Dev-Editor @ 3739701) #lockdown Nick.Penwarden #rb none ============================ MAJOR FEATURES & CHANGES ============================ Change 3358367 by tim.gautier Submitting resaved QAGame assets - Materials, Material Instances, Material Functions and Parameters Change 3624848 by Jamie.Dale Added a composite font for the editor (and Slate core) This is defined in FLegacySlateFontInfoCache::GetDefaultFont and uses our default Roboto fonts (and the culture specific fallback fonts), and is now used as the default font for Slate and the editor. This change removes all the manual TTF/OTF file references from the various Slate styles, as well as updating 200+ hard-coded font references to use the new default font. This fixes various rendering issues with fonts in the editor when using different languages, and clears a big barrier for removing the legacy localized fallback font support. Change 3654993 by Jamie.Dale 'Native' (now called 'FNativeFuncPtr') is now a function pointer that takes a UObject* context, rather than a UObject member function pointer This avoids ambiguity when binding a native function pointer to a type that doesn't match the context pointer, as you could end up getting a function called with an incorrect 'this' pointer Breaking changes: - Native has been renamed to FNativeFuncPtr. - The signature of a native function has changed (use the DECLARE_FUNCTION and DEFINE_FUNCTION macro pair). - Use P_THIS if you were previously using the 'this' pointer in your native function. Change 3699591 by Jamie.Dale Added support for displaying and editing numbers in a culture correct way Numeric input boxes in Slate will now display and accept numbers using the culture correct decimal separators. This is enabled by default, and can be disabled by setting "ShouldUseLocalizedNumericInput" to "False" in XEditorSettings.ini (for the editor), or XGameUserSettings.ini (for a game). #jira UE-4028 Change 3719568 by Jamie.Dale Allow platforms to override the default ICU timezone calculation Change 3622366 by Bradut.Palas #jira UE-46677 Don't allow OnLevelRemovedFromWorld to reset the transaction buffer if we're in PIE mode. Also, remove one undo barrier in case the event was triggered in PIE mode or else we block the user from undoing previous actions. Change 3622378 by Bradut.Palas #jira UE-46590 we have a general bug with detecting the size of the last column, but the clamping prevents it from appearing with the other resize modes. The Content Browser is the only one to use fixed width. The bug is that the size of the last element is incorrectly reported, after we drag back and forth. Fixed by not reading the size real time, but reading it from the SlotInfo structure that is created earlier, which holds the correct value. Change 3622552 by Jamie.Dale Added support for per-culture sub-fonts within a composite font This allows you to do things like create a Japanese specific Han sub-font to override the Han characters used in a CJK font (previously you needed to create a localized font asset to achieve this). Change 3623170 by Jamie.Dale Fixing warning Change 3624846 by Jamie.Dale Composite font cache optimizations - Converted a typically small sized map to a sorted array + binary search. - Converted the already sorted range array to use binary search. - Contiguous ranges using the same typeface are now merged in the cache. Change 3625576 by Cody.Albert We now only set the widget tree to transient instead of passing the flag through StaticDuplicateObject. This was causing instanced subobjects to be flagged with RF_DuplicateTransient, preventing them from properly being duplicated when an array of instanced subobjects was modified. #jira UE-47971 Change 3626057 by Matt.Kuhlenschmidt Expose EUmgSequencePlayMode to blueprints #jira UE-49255 Change 3626556 by Matt.Kuhlenschmidt Fix window size and position adjustment not accounting for primary monitor not being a high DPI monitor when a secondary monitor is. Causes flickering and incorrect window positioning. #jira UE-48922, UE-48957 Change 3627692 by Matt.Kuhlenschmidt PR #3977: Source control submenu menu customization (Contributed by Kryofenix) Change 3628600 by Arciel.Rekman Added AutoCheckout to FAssetRenameManager for commandlet usage. Change 3630561 by Richard.Hinckley Deprecating the version of UFunctionalTestingManager::RunAllFunctionalTests that feature an unused bool parameter, replacing with a new version without that parameter. Change 3630656 by Richard.Hinckley Compile fix. Change 3630964 by Arciel.Rekman Fix CrashReporterClient headless build. Change 3631050 by Matt.Kuhlenschmidt Back out revision 9 from //UE4/Dev-Editor/Engine/Source/Runtime/Slate/Private/Widgets/Layout/SSplitter.cpp Causes major problems with resizing splitters in editor Change 3631140 by Arciel.Rekman OpenAL: update Linux version to 1.18.1 (UETOOL-1253) - Also remove a hack for RPATH and make it use a generic RPATH mechanism. - Bulk of the change from Cengiz.Terzibas #jira UETOOL-1253 Change 3632924 by Jamie.Dale Added support for a catch-all fallback font within composite fonts This allows you to provide broad "font of last resort" behavior on a per-composite font basis, in a way that can also work with different font styles. Change 3633055 by Jamie.Dale Fixed some refresh issues in the font editor Change 3633062 by Jamie.Dale Fixed localization commands being reported as unknown Change 3633906 by Nick.Darnell UMG - You can now store refrences to widgets in the same UserWidget. If you need to create links between widgets this is valuable. Will likely introduce new ways to utilize this in the future, for now just getting it working. Change 3634070 by Arciel.Rekman Display actually used values of material overrides. Change 3634254 by Arciel.Rekman Fix ResavePackages working poorly with projects on other drives (UE-49465). #jira UE-49465 Change 3635985 by Matt.Kuhlenschmidt Fixed typo in function name used by maps PR #3975: Add tooltip to Arrays in Editor (Contributed by projectgheist) Change 3636012 by Matt.Kuhlenschmidt PR #3982: Unhide mouse cursor after using Ansel (Contributed by projectgheist) Change 3636706 by Lauren.Ridge Epic Friday: Save parameters to child or sibling instance functionality Change 3638706 by Jamie.Dale Added an improved Japanese font to the editor This is only used when displaying Japanese text when the editor is set to Japanese, and uses a font with Japanese-style unified Han characters (our default fallback font uses Chinese-style unified Han characters). #jira UE-33268 Change 3639438 by Arciel.Rekman Linux: Repaired ARM server build (UE-49635). - Made Steam* plugins compile. - Disabled OpenEXR as the libs aren't compiled (need to be done separately). (Edigrating CL 3639429 from Release-4.17 to Dev-Editor) Change 3640625 by Matt.Kuhlenschmidt PR #4012: FSlateApplication::ProcessReply use &Reply (Contributed by projectgheist) Change 3640626 by Matt.Kuhlenschmidt PR #4011: Remove space from filename (Contributed by projectgheist) Change 3640697 by Matt.Kuhlenschmidt PR #4010: PNG alpha fix (Contributed by mmdanggg2) Change 3641137 by Jamie.Dale Fixed an issue where a culture specific sub-font could produce incorrect measurements during a culture switch It would fallback to the last resort font for a frame or two while the font cache flushed. This has it update the ranges immediately. Change 3641351 by Jamie.Dale Fixing incorrect weights on the Japanese sub-font Change 3641356 by Jamie.Dale Fixing inconsistent font sizes between CoreStyle and EditorStyle Change 3641710 by Jamie.Dale Fixed pure-virtual function call on UMulticastDelegateProperty Change 3641941 by Lauren.Ridge Adding a Parameter Details tab to the Material Editor so users can change default parameter details Change 3644141 by Jamie.Dale Added an improved Korean font to the editor This is only used when displaying Korean text when the editor is set to Korean Change 3644213 by Arciel.Rekman Fix the side effects of a fix for UE-49465. - Default materials were apparently not being found while building DDC (e.g. making an installed build), now they are and we should not reset loaders on them lest we trigger HasDefaultMaterialsPostLoaded() assert later. #jira UE-49465 Change 3644777 by Jamie.Dale Reverting Korean editor font back to NanumGothic as NanumBarunGothic looked too squished Change 3644879 by tim.gautier QAGame: Optimized assets for Procedural Foliage testing - Added camera bookmarks to Stations in QA-Foliage - Renamed QA-FoliageTypeInst assets to ProcFoliage_Shape - Fixed up redirectors Change 3645109 by Matt.Kuhlenschmidt PR #3990: Git plugin: fix status of renamed, removed, missing, untracked assets (Contributed by SRombauts) Change 3645114 by Matt.Kuhlenschmidt PR #3991: Git Plugin: Fix RunDumpToFile() leaking Process handles (Contributed by SRombauts) Change 3645116 by Matt.Kuhlenschmidt PR #3996: Git Plugin: run an "UpdateStatus" at "Connect" time to populate the Source Control cache (Contributed by SRombauts) Change 3645118 by Matt.Kuhlenschmidt PR #4005: Git Plugin: Expand the size of the Button "Initialize project with Git" (Contributed by SRombauts) Change 3645876 by Arciel.Rekman Linux: fix submenus of context menu not working (UE-47639). - Change by icculus (Ryan Gordon). - QA-ClickHUD seems to be not affected by this change (it is already broken alas). #jira UE-47639 Change 3648088 by Jamie.Dale Fixed some case-sensitivity issues with FText format argument names/pins These were originally case-sensitive, but that was lost somewhere along the way. This change restores their original behavior. #jira UE-47122 Change 3648097 by Jamie.Dale Moved common macOS/iOS localization implementation into FApplePlatformMisc #jira UE-49940 Change 3650858 by Arciel.Rekman UBT: improve CodeLite project generator (UE-49400). - PR #3987 submitted by yaakuro (Cengiz Terzibas). #jira UE-49400 Change 3651231 by Arciel.Rekman Linux: default to SM5 for Vulkan. - Change by Timothee.Bessett. Change 3653627 by Matt.Kuhlenschmidt PR #4020: Source Control Submit Files now interprets Escape key as if the user clicked cancel (Contributed by SRombauts) Change 3653628 by Matt.Kuhlenschmidt PR #4022: Add New C++ Class dialog remember previously selected module. (Contributed by Koderz) Change 3653984 by Jamie.Dale Fixed some redundant string construction Change 3658528 by Joe.Graf UE-45141 - Added CMAKE_CXX_COMPILER and CMAKE_C_COMPILER settings to the generated CMake files Change 3658594 by Jamie.Dale Zipping in UAT now always uses UTF-8 encoding to prevent Unicode issues #jira UE-27263 Change 3659643 by Michael.Trepka Added a call to FCoreDelegates::ApplicationWillTerminateDelegate.Broadcast(); in Mac RequestExit() to match Windows behavior #jira UETOOL-1238 Change 3661908 by Matt.Kuhlenschmidt USD asset importing improvements Change 3664100 by Matt.Kuhlenschmidt Fix static analysis Change 3664107 by Matt.Kuhlenschmidt PR #4051: UE-49448: FPropertyChangedEvent to include TopLevelObjects (Contributed by projectgheist) Change 3664125 by Matt.Kuhlenschmidt PR #4036: Add missing GRAPHEDITOR_API (Contributed by projectgheist) Change 3664340 by Jamie.Dale PR #3648: Prevent GatherTextFromSource from failing the commandlet (Contributed by projectgheist) Change 3664403 by Jamie.Dale PR #3769: Fixes UE-46973 - Drag and Dropping Folders with Names (Contributed by LordNed) Change 3664539 by Jamie.Dale PR #3280: Added EditableText functionality (Contributed by projectgheist) Change 3665433 by Alexis.Matte When we finish importing morph target we must re-initialise the render resources since we now use GPU morph target. #jira UE-50231 Change 3666747 by Cody.Albert Change 3669280 by Jamie.Dale PR #4060: UE-50455: Verify folder is newly created before removing from tree (Contributed by projectgheist) Change 3669718 by Jamie.Dale PR #4061: Clear Content Browser folder search box on escape key (Contributed by projectgheist) Change 3670838 by Alexis.Matte Fix crash when deleting a skeletal mesh LOD and the mouse is over the "reimport" button. #jira UE-50387 Change 3671559 by Matt.Kuhlenschmidt Update SimpleUI automation test ground truth #jira UE-50325 Change 3671587 by Alexis.Matte Fix fbx importer scale not always apply. A cache array was not reset when opening a fbx file. #jira UE-50147 Change 3671730 by Jamie.Dale Added PostInitInstance to UClass to allow class types to perform construction time initialization of their instances Change 3672104 by Michael.Dupuis #jira UE-50427: Update the volume visibility list of the editor viewport when changing the procedural foliage settings Change 3674906 by Alexis.Matte Make sure the export LOD option is taken in consideration when exporting a level or the current level selection #jira UE-50248 Change 3674942 by Matt.Kuhlenschmidt Fix static analysis Change 3675401 by Alexis.Matte -fix export animation, do not truncate the last frame anymore -fix the import animation, there was a display issue in the progress bar. Also a floorToInt sometime truncate the last valid frame. We also have a better way to calculate the time increment we use to sample the fbx curves. #jira UE-48231 Change 3675990 by Alexis.Matte Remove morph target when doing a re-import, so morph will be remove if they do not exist anymore in the fbx. This is to avoid driving random vertex with old morph target. #jira UE-50391 Change 3676169 by Alexis.Matte When we re-import with dialog the option, "Override Full Name" was set to false and save with the option dialog. We now not set it to false, since it was not use during re-import. Change 3676396 by Alexis.Matte Make all LOD 0 name consistent in staticmesh editor #jira UE-49461 Change 3677730 by Cody.Albert Enable locking of Persistent Level in Levels tab #jira UE-50686 Change 3677838 by Jamie.Dale Replaced broken version of Roboto Light Change 3679619 by Alexis.Matte Integrate GitHub pr #4029 to fix import fbx chunk material assignation. #jira UE-50001 Change 3680093 by Alexis.Matte Fix the skeletal mesh so the vertex color is part of the vertex equality like with the static mesh. Change 3680931 by Arciel.Rekman SlateDialogs: show image icon for *.tga (UE-25106). - Also reworked the logic somewhat. #jira UE-25106 Change 3681966 by Yannick.Lange MaterialEditor post-process preview. #jira UE-45307 Change 3682407 by Lauren.Ridge Fixes for material editor compile errors Change 3682628 by Lauren.Ridge Content browser filters for Material Layers, Blends, and their instances Change 3682725 by Lauren.Ridge Adding filter assets and instance assets to Material Layers and Material Layer Blends. Turning Material Layering on by default Change 3682921 by Lauren.Ridge Fix for instance layers not initializing fully Change 3682954 by Lauren.Ridge Creating Material Layer Test Assets Change 3683582 by Alexis.Matte Fix static analysis build Change 3683614 by Matt.Kuhlenschmidt PR #4062: Git Plugin: Fix UE-44637: Deleting an asset is unsuccessful if the asset is marked for add (Contributed by SRombauts) Change 3684130 by Lauren.Ridge Allow visible parameter retrieval to correctly recurse through internally called functions. Previous check was intended to prevent function previews from leaving their graph through unhooked inputs, but unintentionally blocked all function inputs. Change 3686289 by Arciel.Rekman Remove the pessimization (UE-23791). Change 3686455 by Lauren.Ridge Fixes for adding/removing a layer parameter from the parent not updating the child Change 3686829 by Jamie.Dale No longer include trailing whitespace in the justification calculation for soft-wrapped lines #jira UE-50266 Change 3686970 by Lauren.Ridge Making material parameter preview work for functions as well Change 3687077 by Jamie.Dale Fixed crash using FActorDetails with the struct details panel Change 3687152 by Jamie.Dale Fixed the row structure tag not appearing in the Content Browser for Data Table assets The CDO is used to filter these tags, and the CDO was omiting that tag which caused it to be filtered for all Data Tables. #jira UE-48691 Change 3687174 by Lauren.Ridge Fix for material layer sub-parameters showing up in the default material parameters panel Change 3688100 by Lauren.Ridge Fixing static analysis error Change 3688317 by Jamie.Dale Fixed crash using the widget reflector in a cooked game Editor-style isn't available in cooked games. Core-style should be used instead for the widget reflector. Change 3689054 by Jamie.Dale Reference Viewer can now show/copy references lists for nodes with multiple objects, or multiple selected nodes #jira UE-45751 Change 3689513 by Jamie.Dale Fixed justification bug with RTL text caused by CL# 3686829 Also implemented the same alignment fix for visually left-aligned RTL text. #jira UE-50266 Change 3690231 by Lauren.Ridge Added Material Layers Parameters Preview (all editing disabled) panel to the Material Editor Change 3690234 by Lauren.Ridge Adding Material Layers Function Parameter to Static Parameter Compare Change 3690750 by Chris.Bunner Potential nullptr crash. Change 3690751 by Chris.Bunner Fixed logic on overridden vector parameter retrieval for material instances checking a function owned parameter. Change 3691010 by Jamie.Dale Fixed some clipping issues that could occur with right-aligned text FTextBlockLayout::OnPaint was passing an unscaled offset to SetVisibleRegion, and it also wasn't correctly adjusting the offset for RTL text with left-alignment (which becomes a visual right-alignment) #jira UE-46760 Change 3691091 by Jamie.Dale Renamed FTextBlockLayout to FSlateTextBlockLayout to reflect that it's a Slate specific type Change 3691134 by Alexis.Matte Make sure we instance also the collision mesh when exporting a level to fbx file. #jira UE-51066 Change 3691157 by Lauren.Ridge Fix for reset to default not refreshing sub-parameters Change 3691192 by Jamie.Dale Fixed Content Browser selection resetting when changing certain view settings #jira UE-49611 Change 3691204 by Alexis.Matte Remove fbx export file version 2010 compatibility. The 2018 fbx sdk refuse to export earlier then 2011. #jira UE-51023 Change 3692335 by Lauren.Ridge Setting displayed asset to equal filter asset if no instance has been selected Change 3692479 by Jamie.Dale Fixed whitespace Change 3692508 by Alexis.Matte Make sure we warn the user that there is nothing to export when exporting to fbx using "export selected" or "export All" from the file menu. We also prevent the export dialog to show #jira UE-50973 Change 3692639 by Jamie.Dale Translation Editor now shows stale translations as "Untranslated" Change 3692743 by Lauren.Ridge Smaller blend icons, added icon size override to FObjectEntryBox Change 3692830 by Alexis.Matte Fix linux build Change 3692894 by Lauren.Ridge Tooltip on "Parent" in material layers Change 3693141 by Jamie.Dale Removed dead code FastDecimalFormat made this redundant Change 3693580 by Jamie.Dale Added AlwaysSign number formatting option #jira UE-10310 Change 3693784 by Jamie.Dale Fixed assert extracting the number formatting rules for Arabic It uses a character outside the BMP for its plus and minus sign, so we need these to be a string to handle that. #jira UE-10310 Change 3694428 by Arciel.Rekman Linux: make directory watch request a warning so they don't block cooking. - See https://answers.unrealengine.com/questions/715206/cook-error-on-linux.html Change 3694458 by Matt.Kuhlenschmidt Made duplicate keybinding warning non-fatal Change 3694496 by Alexis.Matte fix static analysis build Change 3694515 by Jamie.Dale Added support for culture correct parsing of decimal numbers #jira UE-4028 Change 3694621 by Jamie.Dale Added a variant of FastDecimalFormat::StringToNumber that takes a string length This can be useful if you want to convert a number from within a non-null terminated string #jira UE-4028 Change 3694958 by Jamie.Dale Added a parsed length output to FastDecimalFormat::StringToNumber to allow permissive parsing You can test this rather than the result if you want to attempt to parse a number from a string that may have other data after it. This also fixes the sign-suffix causing the parsing to fail. #jira UE-4028 Change 3695083 by Alexis.Matte Optimisation of the morph target import - We now compute only the normal for the shape the tangent are not necessary - The async tasks are create when there is some available cpu thread to avoid filling the memory - When we re-import the morph target are deleted in bulk avoiding to initialize the morph map for every morphs targets #jira UE-50945 Change 3695122 by Jamie.Dale GetCultureAgnosticFormattingRules no longer returns a copy Change 3695835 by Arciel.Rekman TestPAL: greatly expanded malloc test. Change 3695918 by Arciel.Rekman TestPAL: Added thread priority test. Change 3696589 by Arciel.Rekman TestPAL: tweak thread priorities test (better readability). Change 3697345 by Alexis.Matte Fix reorder of material when importing a LOD with new material #jira UE-51135 Change 3699590 by Jamie.Dale Updated SGraphPinNum to use a numeric editor #jira UE-4028 Change 3699698 by Matt.Kuhlenschmidt Fix crash opening the level viewport context menu if the actor-component selection is out of sync #jira UE-48444 Change 3700158 by Arciel.Rekman Enable packaging for Android Vulkan on Linux (UETOOL-1232). - Change by Cengiz Terzibas Change 3700224 by Arciel.Rekman TestPAL: fixed a memory leak. Change 3700775 by Cody.Albert Don't need to initialize EnvironmentCubeMap twice. Change 3700866 by Michael.Trepka PR #3223: Remove unnecessary reallocation. (Contributed by foollbar) #jira UE-41643 Change 3701132 by Michael.Trepka Copy of CL 3671538 Fixed issues with editor's game mode in high DPI on Mac. #jira UE-49947, UE-51063 Change 3701421 by Michael.Trepka Fixed a crash in FScreenShotManager caused by an attempt to access a deleted FString in async lambda expression Change 3701495 by Alexis.Matte Fix fbx importer "import normals" option when mix with "mikkt" tangent build it was recomputing the normals instead of importing them. #jira UE-UE-51359 Change 3702982 by Jamie.Dale Cleaned up some localization setting names These now have consistent names and avoid double negatives. This also fixes needing to restart the editor when changing the "ShouldUseLocalizedPropertyNames" setting. Change 3703517 by Arciel.Rekman TestPAL: improved thread test. - Changed the counter to a normal variable to reduce possible contentions (threads used to share the counter in an early prototype, hence the usage of an atomic). Change 3704378 by Michael.Trepka Disable Zoom button on Mac if project requests a resizeable window without it. #jira UE-51335 Change 3706316 by Jamie.Dale Fixed the asset search suggestions list closing if you clicked on its scrollbar #jira UE-28885 Change 3706855 by Alexis.Matte Support importing animation that has some keys with negative time #jira UE-51305 Change 3709634 by Matt.Kuhlenschmidt PR #4146: Null access check on ForceLOD in FViewport::HighResScreenshot (Contributed by projectgheist) Change 3711085 by Michael.Trepka Reenabled UBT makefiles on Mac Change 3713049 by Josh.Engebretson The ConfigPropertyEditor now generates a unique runtime UClass. It uses the outer name on the property instead of a unique ID as a unique id would generate a new UClass every time (and these are RF_Standalone). I also removed some static qualifiers for Section and Property names which were incorrect. #jira UE-51319 Change 3713144 by Lauren.Ridge Fixing automated test error #jira UE-50982 Change 3713395 by Alexis.Matte Fix auto import mountpoint #jira UE-51524 Change 3713881 by Michael.Trepka Added -buildscw to Mac Build.sh script to build ShaderCompileWorker in addition to the requested target. Xcode passes it to the script when building non-program targets. #jira UE-31093 Change 3714197 by Michael.Trepka Send IMM key down event to the main window instead of Cocoa key window, as that's what the Slate's active window is. This solves problems with IMM not working in context menu text edit fields. #jira UE-47915 Change 3714911 by Joe.Graf Merge of cmake changes from Dev-Rendering Change 3715973 by Michael.Trepka Disable OS close button on Windows if project settings request that #jira UE-45522 Change 3716390 by Lauren.Ridge The color picker summoned when double-clicking vector3 nodes now has its intended "do not refresh until OK is clicked" behavior. #jira UE-50916 Change 3716529 by Josh.Engebretson Content Browser: Clamp "Assets to Load at Once Before Warning" so it cannot be set below 1 #jira UE-51341 Change 3716885 by Josh.Engebretson Tracking transactions such as a duplication operation can modify a selection which differs from the initial one. Added package state tracking to restore unmodified state when necessary. #jira UE-48572 Change 3716929 by Josh.Engebretson Unshelved from pending changelist '3364093': PR #3420: Exe's icons and properties (Contributed by projectgheist) Change 3716937 by Josh.Engebretson Unshelved from pending changelist '3647428': PR #4026: Fixed memory leaks for pipe writes and added data pipe writes (Contributed by Hemofektik) Change 3717002 by Josh.Engebretson Fix FileReference/string conversion Change 3717355 by Joe.Graf Fixed CMake file generation on Windows including Engine/Source/ThirdParty source Change 3718256 by Arciel.Rekman TestPAL: slight mod to the malloc test. - Touch the allocated memory to check actual resident usage. Change 3718290 by Arciel.Rekman BAFO: place descriptor after the allocation to save some VIRT memory. - We're relying on passing correct "Size" argument to Free() anyway, and this modification makes use of that extra information to save on memory for the descriptor. Change 3718508 by Michael.Trepka Fixed vsnprintf on platforms that use our custom implementation in StandardPlatformString.cpp to ignore length modifier for certain types (floating point, pointer) #jira UE-46148 Change 3718855 by Lauren.Ridge Adding content browser favorite folders. Add or remove folders from the favorite list in the folder's right-click context menu, and hide or show the favorites list in the Content Browser options. Change 3718932 by Cody.Albert Update ActorSequence plugin loading phase to PreDefault #jira UE-51612 Change 3719378 by tim.gautier QAGame: Renamed multiTxt_Justification > UMG_TextJustification. Added additional Text Widgets for testing Change 3719413 by Lauren.Ridge Resubmit of content browser favorites Change 3719803 by Yannick.Lange VREditor: Fix crash with null GEditor #jira UE-50103 Change 3721127 by tim.gautier QAGame: Fixed up a ton of redirectors within /Content and /Content/Materials - Added M_ParamDefaults and MF_ParamDefaults - Moved legacy MeshPaint materials into /Content/Materials/MeshPaint - Renamed ColorPulse assets from MatFunction_ > MF_, moved into /Content/Materials/Functions Change 3721255 by Alexis.Matte Replace skeletal mesh import option "keep overlapping vertex" by 3 float thresholds allowing the user to control the welding thresholds. #jira UE-51363 Change 3721594 by Lauren.Ridge Material Blends now have plane mesh previews in their icons. Change 3722072 by tim.gautier QAGame: Updated MF_ParamDefaults - using red channel as roughness Updated M_ParamDefaults - tweaked Scalar values Change 3722180 by Michael.Trepka Updated Xcode project generator to sort projects in the navigator by name (within folders) and also sort the list of schemes so that their order matches the order of projects in the navigator. #jira UE-25941 Change 3722220 by Michael.Trepka Fixed a problem with Xcode project generator not handling quoted preprocessor definitions correctly #jira UE-40246 Change 3722806 by Lauren.Ridge Fixing non-editor compiles Change 3722914 by Alexis.Matte Fbx importer: Add new attribute type(eSkeleton) for staticmesh socket import. #jira UE-51665 Change 3723446 by Michael.Trepka Copy of CL 3688862 from 4.18 + one more fix for a deadlock related to window resizing when using IME Don't do anything in Mac window's windowWillResize: if we're simply chaning the z order of windows. This way we avoid a rare dead lock when hiding the window. #jira UE-48257 Change 3723505 by Matt.Kuhlenschmidt Fix duplicate actors being created for USD primitives that specify a custom actor class Change 3723555 by Matt.Kuhlenschmidt Fix crash loading the gameplayabilities module #jira UE-51693 Change 3723557 by Matt.Kuhlenschmidt Fixed tooltip on viewport dpi scaling option Change 3723870 by Lauren.Ridge Fixing incorrect reset to default visibility, adding clear behavior to fields Change 3723917 by Arciel.Rekman Linux: fix compilation with glibc 2.26+ (UE-51699). - Fixes compilation on Ubuntu 17.10 among others. (Merging 3723489 from //UE4/Release-4.18/... to //UE4/Dev-Editor/...) Change 3723918 by Arciel.Rekman Linux: do not test for popcnt presence unnecessarily (UE-51677). (Merging 3723904 from //UE4/Release-4.18/... to //UE4/Dev-Editor/...) Change 3724229 by Arciel.Rekman Fix FOutputDeviceStdOutput to use printf() on Unix platforms. Change 3724261 by Arciel.Rekman TestPAL: fix thread priority test (zero the counter). Change 3724978 by Arciel.Rekman Linux: fix priority calculation. - Rlimit values are always positive, so this was completely broken when the RLIMIT_NICE is non-0. Change 3725382 by Matt.Kuhlenschmidt Guard against crashes and add more logging when actor creation fails. Looks like it could be manual garbage collections triggered before conversion is complete so those have been removed #jira UE-47464 Change 3725559 by Matt.Kuhlenschmidt Added a setting to enable/disable high dpi support in editor. This currently only functions in Windows. Moved some files around for better consistency Change 3725640 by Arciel.Rekman Fix Linux thread/process priorities. - Should also speed up SCW on Linux by deprioritizing them less. Change 3726101 by Matt.Kuhlenschmidt Fix logic bug in USD child "kind" type resolving Change 3726244 by Joe.Graf Added an option to generate a minimal set of targets for cmake files Added shader and config files to cmake file generation for searching within IDEs Change 3726506 by Arciel.Rekman Fix compile issue after DPI change. Change 3726549 by Matt.Kuhlenschmidt Remove unnecessary indirection to cached widgets in the hit test grid Change 3726660 by Arciel.Rekman Enable DPI switch on Linux. Change 3726763 by Arciel.Rekman Fix mismatching "noperspective" qualifier (UE-50807). - Pull request #4080 by TTimo. Change 3727080 by Michael.Trepka Added support for editor's EnableHighDPIAwareness setting on Mac Change 3727658 by Matt.Kuhlenschmidt Fix shutdown crash if level editor is still referenced after the object system has been gc'd #jira UE-51630 Change 3728270 by Matt.Kuhlenschmidt Remove propertyeditor dependency from editorstyle Change 3728291 by Arciel.Rekman Linux: fix for a crash on a headless system (UE-51714). - Preliminary change before merging to 4.18. Change 3728293 by Arciel.Rekman Linux: remove unneeded dependency on CEF. - Old workaround should no longer be needed, while this dependency makes UE4 depend on a ton of external libs. Change 3728524 by Michael.Trepka Copy of CL 3725570 Removed Enable Fullscreen option from editor's Window menu on Mac. Windowed fullscreen mode is currently unavailable on Mac in editor mode as supporting it properly would require it to work with multiple spaces and split screen, which we currently don't handle (requested in UE-27240) #jira UE-51709 Change 3728875 by Michael.Trepka Fixed compile error in Mac SlateOpenGLContext.cpp Change 3728880 by Matt.Kuhlenschmidt Guard against invalid worlds in thumbnail renderers Change 3728924 by Michael.Trepka Don't defer MacApplication->CloseWindow() call. This should fix a rare problem with deferred call executing during Slate's PrepassWindowAndChildren call. #jira UE-51711 Change 3729288 by Joe.Graf Added the .idea/misc.xml file generation to speed up CLion indexing Change 3729935 by Michael.Dupuis #jira UE-51722: Hide from UI invalid enum values Change 3730234 by Matt.Kuhlenschmidt Fix "Game Gets Mouse Control" setting no longer functioning and instead the mouse was always captured. #jira UE-51801 Change 3730349 by Michael.Dupuis #jira UE-51324: Clear the UI selection when rebuilding the palette, as we destroyed all items and recreate them, so selection is on invalid item Change 3730438 by Lauren.Ridge Cleaning up material layering UI functions Change 3730723 by Jamie.Dale Fixed FastDecimalFormat::StringToNumber incorrectly reporting that number-like sequences that lacked digits had been parsed as numbers #jira UE-51799 Change 3731008 by Lauren.Ridge Changing Layers and Blends from proxy assets to real assets Change 3731026 by Arciel.Rekman libelf: make elf_end() visible (UE-51843). - This repairs compilation for a case when CUDA is being used. - Also added some missing files for ARM 32-bit. Change 3731081 by Lauren.Ridge New material layer test assets Change 3731186 by Josh.Engebretson Adding camera speed scalar setting and Toolbar UI to increase range on camera speed presets #jira UE-50104 Change 3731188 by Mike.Erwin Improve responsiveness of Open Asset dialog. On large projects, there's a noticeable delay when opening and searching/filtering assets. Stopwatch measurements on my machine (seconds for ~122,000 assets): before with this CL ctrl-P 1.4 0.45 search 1.8 0.55 CollectionManagerModule was the main culprit for search/filter slowness. Open Asset delay was due to filtering out plugin content. We were doing a lot of redundant work for what is essentially a read-only operation. Change 3731682 by Arciel.Rekman UnrealEd: Allow unattended commandlets to rename/save packages. Change 3732305 by Michael.Dupuis #jira UE-48434 : Only register if the foliage type still has a valid mesh Change 3732361 by Matt.Kuhlenschmidt Fix two settings objects being created in the transient package with the same name #jira UE-51891 Change 3732895 by Josh.Engebretson https://jira.it.epicgames.net/browse/UE-51706 If a shared DDC is not being used, present a notification to the licensee with a link on how to setup a shared DDC. Adds DDC notification events for check/put and query for whether a shared DDC is in use. #jira UE-51706 Change 3733025 by Arciel.Rekman UBT: make sure new clang versions are invoked. Change 3733311 by Mike.Erwin Fix Linux compile warning from CL 3731188 It didn't like mixing && and || without parentheses. Reworked logic to do one test at a time, put cheaper tests first to avoid calls to more expensive IsPluginFolder. Change 3733658 by Josh.Engebretson Add a missing #undef LOCTEXT_NAMESPACE Change 3734003 by Arciel.Rekman Fix Windows attempting to use printf %ls and crashing at that (UE-51934). Change 3734039 by Michael.Trepka Fixed a couple of merge issues in Mac ApplicationCore Change 3734052 by Michael.Trepka One more Mac ApplicationCore fix Change 3734244 by Lauren.Ridge Fix for accessing Slate window on render thread Change 3734950 by Josh.Engebretson Fixing clang warning Change 3734978 by Jamie.Dale Relaxed enum property importing to allow valid numeric values to be imported too This was previously made more strict which caused a regression in Data Table importing #jira UE-51848 Change 3734999 by Arciel.Rekman Linux: add LTO support and more. - Adds ability to use link-time opitimization (reusing current target property bAllowLTCG). - Supports using llvm-ar and lld instead of ar/ranlib and ld. - More build information printed (and in a better organized way). - Native scripts updated to install packages with the appropriate tools on supported systems - AutoSDKs updated to require a new toolchain (already checked in). - Required disabling OpenAL due to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219089 Change 3735268 by Matt.Kuhlenschmidt Added support for canvas based DPI scaling. -Scene canvas is by default not scaled as this could severely impact any game using a canvas based UI -The debug canvas for stats is always dpi scaled in editor and pie. -Eliminated text scaling workaround now that the entire canvas is properly scaled -Enabled canvas scaling in cascade UI Change 3735329 by Matt.Kuhlenschmidt Fix potential crash if an asset editor has an object deleted out from under it #jira UE-51941 Change 3735502 by Arciel.Rekman Fix compile issue (bShouldUpdateScreenPercentage). Change 3735878 by Jamie.Dale Updated FString::SanitizeFloat to allow you to specify the min number of fractional digits to have in the resultant string This defaults to 1 as that was the old behavior of FString::SanitizeFloat, but can also be set to 0 to prevent adding .0 to whole numbers. Change 3735881 by Jamie.Dale JsonValue no longer stringifies whole numbers as floats Change 3735884 by Jamie.Dale Only allow enums to import integral values Change 3735912 by Josh.Engebretson Improving cook process error/warning handling including asset warning/error content browser links and manual dismiss for cook error notifications #jira UE-48131 Change 3736280 by Matt.Kuhlenschmidt Fix 0 dpi scale for canvases #jira UE-51995 Change 3736298 by Matt.Kuhlenschmidt Force focus of game viewports in vr mode Change 3736374 by Jamie.Dale Fixed some places where input chords were being used without testing that they had a valid key set #jira UE-51799 Change 3738543 by Matt.Kuhlenschmidt Better fix for edit condition crashes #jira UE-51886 Change 3738603 by Lauren.Ridge Copy over of drag and drop non-array onto array fix Change 3739701 by Chris.Babcock Fix crashlytics merge error #jira UE-52064 #ue4 #android [CL 3739980 by Matt Kuhlenschmidt in Main branch]
2017-11-06 18:22:01 -05:00
double TotalEstimatedBuildTime;
/** Access log to write to */
TUniquePtr<FAccessLogWriter> AccessLogWriter;
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
/** Debug Options */
FBackendDebugOptions DebugOptions;
FDerivedDataCacheUsageStats UsageStats;
TUniquePtr<FFileSystemCacheStoreMaintainer> Maintainer;
};
FFileSystemCacheStore::FFileSystemCacheStore(
const TCHAR* const InCachePath,
const TCHAR* const InParams,
const TCHAR* const InAccessLogPath)
: CachePath(InCachePath)
, SpeedClass(ESpeedClass::Unknown)
, bDisabled(false)
, bReadOnly(false)
, bTouch(false)
, bPurgeTransient(false)
, DaysToDeleteUnusedFiles(15.0)
, TotalEstimatedBuildTime(0)
{
// If we find a platform that has more stringent limits, this needs to be rethought.
checkf(MAX_BACKEND_KEY_LENGTH + MAX_CACHE_DIR_LEN + MAX_BACKEND_NUMBERED_SUBFOLDER_LENGTH + MAX_CACHE_EXTENTION_LEN < FPlatformMisc::GetMaxPathLength(),
TEXT("Not enough room left for cache keys in max path."));
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
check(CachePath.Len());
FPaths::NormalizeFilename(CachePath);
// Params that override our instance defaults
FParse::Bool(InParams, TEXT("ReadOnly="), bReadOnly);
FParse::Bool(InParams, TEXT("Touch="), bTouch);
FParse::Bool(InParams, TEXT("PurgeTransient="), bPurgeTransient);
FParse::Value(InParams, TEXT("UnusedFileAge="), DaysToDeleteUnusedFiles);
FParse::Value(InParams, TEXT("MaxRecordSizeKB="), MaxRecordSizeKB);
FParse::Value(InParams, TEXT("MaxValueSizeKB="), MaxValueSizeKB);
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
if (FString LegacyModeString; FParse::Value(InParams, TEXT("LegacyMode="), LegacyModeString))
{
if (!TryLexFromString(LegacyMode, LegacyModeString))
{
UE_LOG(LogDerivedDataCache, Warning, TEXT("%s: Ignoring unrecognized legacy mode '%s'"), *CachePath, *LegacyModeString);
}
}
// Flush the cache if requested.
bool bFlush = false;
if (!bReadOnly && FParse::Bool(InParams, TEXT("Flush="), bFlush) && bFlush)
{
TRACE_CPUPROFILER_EVENT_SCOPE(FileSystemDDC_Flush);
IFileManager::Get().DeleteDirectory(*(CachePath / TEXT("")), /*bRequireExists*/ false, /*bTree*/ true);
}
Optimizations for DDC access on remote / slow drives. If a filesystem node is not available not prompt the user and optionally retry incase they need to mount a drive or start VPN Fiilesystem nodes now perform a speed test using a selection of 'DDC sized' files to determine a classification (local, fast, ok, slow). Add a new 'ConsiderSlowAt' property to the 'Filesystem' DDC node type. If latency to the node is >= this value then the node will be marked as slow which disables touch'ing and reduces file stats Interface Changes - Add the concept of a speed class to nodes - Add GetName to nodes for better debugging / logging - WouldCache query that allows caches to opt of of consideration early and avoid async tasks being created. - Create a new 'FileBackedDerivedDataBackend' class that's the for the memory/boot backend and future classes - TryToPrefetch interface functions for future use Behavior Changes - Moved parameter parsing into FileSysteDerivedDataBackend as things were getting out of hand - FileSystemDerivedDataBackend now performs a speed test using 'DDC sized' files in separate directories and applies a classification - Slow locations turn off touching of data on read - Slow locations always return true for CachedDataProbablyExists. It's faster just to try to read and fail - If the shared DDC is not available the user is prompted incase they need to mount it. [at]ben.marsh [at]josh.engebretson #rb swarm #tests lots of PIE runs with / without this option #ROBOMERGE-SOURCE: CL 12387516 via CL 12387517 via CL 12396622 #ROBOMERGE-BOT: (v671-12333473) [CL 12396757 by andrew grant in Release-Engine-Staging branch]
2020-03-24 19:12:36 -04:00
// check latency and speed. Read values should always be valid
double ReadSpeedMBs = 0.0;
double WriteSpeedMBs = 0.0;
double SeekTimeMS = 0.0;
/* Speeds faster than this are considered local*/
const float ConsiderFastAtMS = 10;
/* Speeds faster than this are ok. Everything else is slow. This value can be overridden in the ini file */
float ConsiderSlowAtMS = 50;
FParse::Value(InParams, TEXT("ConsiderSlowAt="), ConsiderSlowAtMS);
// can skip the speed test so everything acts as local (e.g. 4.25 and earlier behavior).
bool SkipSpeedTest = !WITH_EDITOR || FParse::Param(FCommandLine::Get(), TEXT("DDCSkipSpeedTest"));
if (SkipSpeedTest)
{
ReadSpeedMBs = 999;
WriteSpeedMBs = 999;
SeekTimeMS = 0;
UE_LOG(LogDerivedDataCache, Log, TEXT("Skipping speed test to %s. Assuming local performance"), *CachePath);
}
if (!SkipSpeedTest && !RunSpeedTest(ConsiderSlowAtMS * 2, SeekTimeMS, ReadSpeedMBs, WriteSpeedMBs))
{
bDisabled = true;
UE_LOG(LogDerivedDataCache, Warning, TEXT("No read or write access to %s"), *CachePath);
}
else
{
bool bReadTestPassed = ReadSpeedMBs > 0.0;
bool bWriteTestPassed = WriteSpeedMBs > 0.0;
// if we failed writes mark this as read only
bReadOnly = bReadOnly || !bWriteTestPassed;
// classify and report on these times
if (SeekTimeMS < 1)
{
SpeedClass = ESpeedClass::Local;
}
else if (SeekTimeMS <= ConsiderFastAtMS)
{
SpeedClass = ESpeedClass::Fast;
}
else if (SeekTimeMS >= ConsiderSlowAtMS)
{
SpeedClass = ESpeedClass::Slow;
}
else
{
SpeedClass = ESpeedClass::Ok;
}
UE_LOG(LogDerivedDataCache, Display,
TEXT("Performance to %s: Latency=%.02fms. RandomReadSpeed=%.02fMBs, RandomWriteSpeed=%.02fMBs. ")
TEXT("Assigned SpeedClass '%s'"),
*CachePath, SeekTimeMS, ReadSpeedMBs, WriteSpeedMBs, LexToString(SpeedClass));
if (SpeedClass <= FDerivedDataBackendInterface::ESpeedClass::Slow && !bReadOnly)
{
if (GIsBuildMachine)
{
UE_LOG(LogDerivedDataCache, Display, TEXT("Access to %s appears to be slow. ")
TEXT("'Touch' will be disabled and queries/writes will be limited."), *CachePath);
}
else
{
UE_LOG(LogDerivedDataCache, Warning, TEXT("Access to %s appears to be slow. ")
TEXT("'Touch' will be disabled and queries/writes will be limited."), *CachePath);
}
bTouch = false;
//bReadOnly = true;
}
if (!bReadOnly)
{
if (FString(FCommandLine::Get()).Contains(TEXT("Run=DerivedDataCache")))
{
bTouch = true; // we always touch files when running the DDC commandlet
}
// The command line (-ddctouch) enables touch on all filesystem backends if specified.
bTouch = bTouch || FParse::Param(FCommandLine::Get(), TEXT("DDCTOUCH"));
if (bTouch)
{
UE_LOG(LogDerivedDataCache, Display, TEXT("Files in %s will be touched."), *CachePath);
}
bool bClean = false;
bool bDeleteUnused = true;
FParse::Bool(InParams, TEXT("Clean="), bClean);
FParse::Bool(InParams, TEXT("DeleteUnused="), bDeleteUnused);
bDeleteUnused = bDeleteUnused && !FParse::Param(FCommandLine::Get(), TEXT("NODDCCLEANUP"));
if (bClean || bDeleteUnused)
{
FFileSystemCacheStoreMaintainerParams MaintainerParams;
MaintainerParams.MaxFileAge = FTimespan::FromDays(DaysToDeleteUnusedFiles);
if (bDeleteUnused)
{
if (!FParse::Value(InParams, TEXT("MaxFileChecksPerSec="), MaintainerParams.MaxFileScanRate))
{
int32 MaxFileScanRate;
if (GConfig->GetInt(TEXT("DDCCleanup"), TEXT("MaxFileChecksPerSec"), MaxFileScanRate, GEngineIni))
{
MaintainerParams.MaxFileScanRate = uint32(MaxFileScanRate);
}
}
FParse::Value(InParams, TEXT("FoldersToClean="), MaintainerParams.MaxDirectoryScanCount);
}
else
{
MaintainerParams.ScanFrequency = FTimespan::MaxValue();
}
double TimeToWaitAfterInit;
if (bClean)
{
MaintainerParams.TimeToWaitAfterInit = FTimespan::Zero();
}
else if (GConfig->GetDouble(TEXT("DDCCleanup"), TEXT("TimeToWaitAfterInit"), TimeToWaitAfterInit, GEngineIni))
{
MaintainerParams.TimeToWaitAfterInit = FTimespan::FromSeconds(TimeToWaitAfterInit);
}
Maintainer = MakeUnique<FFileSystemCacheStoreMaintainer>(MaintainerParams, CachePath);
if (bClean)
{
Maintainer->BoostPriority();
Maintainer->WaitForIdle();
}
}
}
if (IsUsable() && InAccessLogPath != nullptr && *InAccessLogPath != 0)
{
AccessLogWriter.Reset(new FAccessLogWriter(InAccessLogPath, CachePath));
}
}
}
bool FFileSystemCacheStore::RunSpeedTest(
const double InSkipTestsIfSeeksExceedMS,
double& OutSeekTimeMS,
double& OutReadSpeedMBs,
double& OutWriteSpeedMBs) const
{
SCOPED_BOOT_TIMING("RunSpeedTest");
// files of increasing size. Most DDC data falls within this range so we don't want to skew by reading
// large amounts of data. Ultimately we care most about latency anyway.
const int FileSizes[] = { 4, 8, 16, 64, 128, 256 };
const int NumTestFolders = 2; //(0-9)
const int FileSizeCount = UE_ARRAY_COUNT(FileSizes);
bool bWriteTestPassed = true;
bool bReadTestPassed = true;
bool bTestDataExists = true;
double TotalSeekTime = 0;
double TotalReadTime = 0;
double TotalWriteTime = 0;
int TotalDataRead = 0;
int TotalDataWritten = 0;
const FString AbsoluteCachePath = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*CachePath);
if (AbsoluteCachePath.Len() > MAX_CACHE_DIR_LEN)
{
const FText ErrorMessage = FText::Format(NSLOCTEXT("DerivedDataCache", "PathTooLong", "Cache path {0} is longer than {1} characters... please adjust [DerivedDataBackendGraph] paths to be shorter (this leaves more room for cache keys)."),
FText::FromString(AbsoluteCachePath), FText::AsNumber(MAX_CACHE_DIR_LEN));
FMessageDialog::Open(EAppMsgType::Ok, ErrorMessage);
UE_LOG(LogDerivedDataCache, Fatal, TEXT("%s"), *ErrorMessage.ToString());
}
TArray<FString> Paths;
TArray<FString> MissingFiles;
MissingFiles.Reserve(NumTestFolders * FileSizeCount);
const FString TestDataPath = FPaths::Combine(CachePath, TEXT("TestData"));
// create an upfront map of paths to data size in bytes
// create the paths we'll use. <path>/0/TestData.dat, <path>/1/TestData.dat etc. If those files don't exist we'll
// create them which will likely give an invalid result when measuring them now but not in the future...
TMap<FString, int> TestFileEntries;
for (int iSize = 0; iSize < FileSizeCount; iSize++)
{
// make sure we dont stat/read/write to consecuting files in folders
for (int iFolder = 0; iFolder < NumTestFolders; iFolder++)
{
int FileSizeKB = FileSizes[iSize];
FString Path = FPaths::Combine(CachePath, TEXT("TestData"), *FString::FromInt(iFolder),
*FString::Printf(TEXT("TestData_%dkb.dat"), FileSizeKB));
TestFileEntries.Add(Path, FileSizeKB * 1024);
}
}
// measure latency by checking for the presence of all these files. We'll also track which don't exist..
const double StatStartTime = FPlatformTime::Seconds();
for (auto& KV : TestFileEntries)
{
FFileStatData StatData = IFileManager::Get().GetStatData(*KV.Key);
if (!StatData.bIsValid || StatData.FileSize != KV.Value)
{
MissingFiles.Add(KV.Key);
}
}
// save total stat time
TotalSeekTime = (FPlatformTime::Seconds() - StatStartTime);
// calculate seek time here
OutSeekTimeMS = (TotalSeekTime / TestFileEntries.Num()) * 1000;
UE_LOG(LogDerivedDataCache, Verbose, TEXT("Stat tests to %s took %.02f seconds"), *CachePath, TotalSeekTime);
// if seek times are very slow do a single read/write test just to confirm access
/*if (OutSeekTimeMS >= InSkipTestsIfSeeksExceedMS)
{
UE_LOG(LogDerivedDataCache, Warning,
TEXT("Limiting read/write speed tests due to seek times of %.02f exceeding %.02fms. ")
TEXT("Values will be inaccurate."), OutSeekTimeMS, InSkipTestsIfSeeksExceedMS);
FString Path = TestFileEntries.begin()->Key;
int Size = TestFileEntries.begin()->Value;
TestFileEntries.Reset();
TestFileEntries.Add(Path, Size);
}*/
// create any files that were missing
if (!bReadOnly)
{
TArray<uint8> Data;
for (auto& File : MissingFiles)
{
const int DesiredSize = TestFileEntries[File];
Data.SetNumUninitialized(DesiredSize);
if (!FFileHelper::SaveArrayToFile(Data, *File, &IFileManager::Get(), FILEWRITE_Silent))
{
// Handle the case where something else may have created the path at the same time.
// This is less about multiple users and more about things like SCW's / UnrealPak
// that can spin up multiple instances at once.
if (!IFileManager::Get().FileExists(*File))
{
uint32 ErrorCode = FPlatformMisc::GetLastError();
TCHAR ErrorBuffer[1024];
FPlatformMisc::GetSystemErrorMessage(ErrorBuffer, 1024, ErrorCode);
UE_LOG(LogDerivedDataCache, Warning,
TEXT("Fail to create %s, derived data cache to this directory will be read only. ")
TEXT("WriteError: %u (%s)"), *File, ErrorCode, ErrorBuffer);
bTestDataExists = false;
bWriteTestPassed = false;
break;
}
}
}
}
// now read all sizes from random folders
{
const int ArraySize = UE_ARRAY_COUNT(FileSizes);
TArray<uint8> TempData;
TempData.Empty(FileSizes[ArraySize - 1] * 1024);
const double ReadStartTime = FPlatformTime::Seconds();
for (auto& KV : TestFileEntries)
{
const int FileSize = KV.Value;
const FString& FilePath = KV.Key;
if (!FFileHelper::LoadFileToArray(TempData, *FilePath, FILEREAD_Silent))
{
uint32 ErrorCode = FPlatformMisc::GetLastError();
TCHAR ErrorBuffer[1024];
FPlatformMisc::GetSystemErrorMessage(ErrorBuffer, 1024, ErrorCode);
UE_LOG(LogDerivedDataCache, Warning,
TEXT("Fail to read from %s, derived data cache will be disabled. ReadError: %u (%s)"),
*FilePath, ErrorCode, ErrorBuffer);
bReadTestPassed = false;
break;
}
TotalDataRead += TempData.Num();
}
TotalReadTime = FPlatformTime::Seconds() - ReadStartTime;
UE_LOG(LogDerivedDataCache, Verbose, TEXT("Read tests %s on %s and took %.02f seconds"),
bReadTestPassed ? TEXT("passed") : TEXT("failed"), *CachePath, TotalReadTime);
}
// do write tests if or read tests passed and our seeks were below the cut-off
if (bReadTestPassed && !bReadOnly)
{
// do write tests but use a unique folder that is cleaned up afterwards
FString CustomPath = FPaths::Combine(CachePath, TEXT("TestData"), *FGuid::NewGuid().ToString());
const int ArraySize = UE_ARRAY_COUNT(FileSizes);
TArray<uint8> TempData;
TempData.Empty(FileSizes[ArraySize - 1] * 1024);
const double WriteStartTime = FPlatformTime::Seconds();
for (auto& KV : TestFileEntries)
{
const int FileSize = KV.Value;
FString FilePath = KV.Key;
TempData.SetNumUninitialized(FileSize);
FilePath = FilePath.Replace(*CachePath, *CustomPath);
if (!FFileHelper::SaveArrayToFile(TempData, *FilePath, &IFileManager::Get(), FILEWRITE_Silent))
{
uint32 ErrorCode = FPlatformMisc::GetLastError();
TCHAR ErrorBuffer[1024];
FPlatformMisc::GetSystemErrorMessage(ErrorBuffer, 1024, ErrorCode);
UE_LOG(LogDerivedDataCache, Warning,
TEXT("Fail to write to %s, derived data cache will be disabled. ReadError: %u (%s)"),
*FilePath, ErrorCode, ErrorBuffer);
bWriteTestPassed = false;
break;
}
TotalDataWritten += TempData.Num();
}
TotalWriteTime = FPlatformTime::Seconds() - WriteStartTime;
UE_LOG(LogDerivedDataCache, Verbose, TEXT("write tests %s on %s and took %.02f seconds"),
bWriteTestPassed ? TEXT("passed") : TEXT("failed"), *CachePath, TotalReadTime)
// remove the custom path but do it async as this can be slow on remote drives
AsyncTask(ENamedThreads::AnyThread, [CustomPath]() {
IFileManager::Get().DeleteDirectory(*CustomPath, false, true);
});
// check latency and speed. Read values should always be valid
const double ReadSpeedMBs = (bReadTestPassed ? (TotalDataRead / TotalReadTime) : 0) / (1024 * 1024);
const double WriteSpeedMBs = (bWriteTestPassed ? (TotalDataWritten / TotalWriteTime) : 0) / (1024 * 1024);
const double SeekTimeMS = (TotalSeekTime / TestFileEntries.Num()) * 1000;
}
const double TotalTestTime = FPlatformTime::Seconds() - StatStartTime;
UE_LOG(LogDerivedDataCache, Log, TEXT("Speed tests for %s took %.02f seconds"), *CachePath, TotalTestTime);
// check latency and speed. Read values should always be valid
OutReadSpeedMBs = (bReadTestPassed ? (TotalDataRead / TotalReadTime) : 0) / (1024 * 1024);
OutWriteSpeedMBs = (bWriteTestPassed ? (TotalDataWritten / TotalWriteTime) : 0) / (1024 * 1024);
return bWriteTestPassed || bReadTestPassed;
}
bool FFileSystemCacheStore::CachedDataProbablyExists(const TCHAR* const CacheKey)
{
TRACE_CPUPROFILER_EVENT_SCOPE(FileSystemDDC_Exist);
TRACE_COUNTER_INCREMENT(FileSystemDDC_Exist);
COOK_STAT(auto Timer = UsageStats.TimeProbablyExists());
if (!IsUsable())
{
UE_LOG(LogDerivedDataCache, VeryVerbose,
TEXT("%s: Skipped exists check of %s because this cache store is not available"), *CachePath, CacheKey);
return false;
}
if (DebugOptions.ShouldSimulateGetMiss(CacheKey))
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Simulated miss for exists check of %s"), *CachePath, CacheKey);
return false;
}
TStringBuilder<256> LegacyPath;
BuildCacheLegacyPath(CacheKey, LegacyPath);
const bool bExists = FileExists(LegacyPath);
if (bExists)
{
if (AccessLogWriter)
{
AccessLogWriter->Append(CacheKey, LegacyPath);
}
TRACE_COUNTER_INCREMENT(FileSystemDDC_ExistHit);
COOK_STAT(Timer.AddHit(0));
}
// If not using a shared cache, record a (probable) miss
else if (!GetDerivedDataCacheRef().GetUsingSharedDDC())
{
// store a cache miss
FScopeLock ScopeLock(&SynchronizationObject);
if (!DDCNotificationCacheTimes.Contains(CacheKey))
{
DDCNotificationCacheTimes.Add(CacheKey, FPlatformTime::Seconds());
}
}
UE_LOG(LogDerivedDataCache, Verbose,
TEXT("%s: CachedDataProbablyExists=%d for %s"), *CachePath, int32(bExists), CacheKey);
return bExists;
}
bool FFileSystemCacheStore::GetCachedData(const TCHAR* const CacheKey, TArray<uint8>& Data)
{
TRACE_CPUPROFILER_EVENT_SCOPE(FileSystemDDC_Get);
TRACE_COUNTER_INCREMENT(FileSystemDDC_Get);
COOK_STAT(auto Timer = UsageStats.TimeGet());
const double StartTime = FPlatformTime::Seconds();
if (!IsUsable())
{
UE_LOG(LogDerivedDataCache, VeryVerbose,
TEXT("%s: Skipped get of %s because this cache store is not available"), *CachePath, CacheKey);
return false;
}
if (DebugOptions.ShouldSimulateGetMiss(CacheKey))
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Simulated miss for get of %s"), *CachePath, CacheKey);
return false;
}
const auto ReadData = [this, CacheKey, &Data](FArchive& Ar)
{
const int64 Size = Ar.TotalSize();
if (Size > MAX_int32)
{
Ar.SetError();
return;
}
Data.Reset(int32(Size));
Data.AddUninitialized(int32(Size));
Ar.Serialize(Data.GetData(), Size);
if (!FCorruptionWrapper::ReadTrailer(Data, *CachePath, CacheKey))
{
Ar.SetError();
}
};
TStringBuilder<256> LegacyPath;
BuildCacheLegacyPath(CacheKey, LegacyPath);
if (LoadFile(LegacyPath, CacheKey, ReadData))
{
if (AccessLogWriter)
{
AccessLogWriter->Append(CacheKey, LegacyPath);
}
const double ReadDuration = FPlatformTime::Seconds() - StartTime;
const double ReadSpeed = ReadDuration > 0.001 ? (Data.Num() / ReadDuration) / (1024.0 * 1024.0) : 0.0;
UE_LOG(LogDerivedDataCache, Verbose,
TEXT("%s: Cache hit on %s (%d bytes, %.02f secs, %.2fMB/s)"),
*CachePath, CacheKey, Data.Num(), ReadDuration, ReadSpeed);
TRACE_COUNTER_INCREMENT(FileSystemDDC_GetHit);
TRACE_COUNTER_ADD(FileSystemDDC_BytesRead, int64(Data.Num()));
COOK_STAT(Timer.AddHit(Data.Num()));
return true;
}
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Cache miss on %s"), *CachePath, CacheKey);
Data.Empty();
// If not using a shared cache, record a miss
if (!GetDerivedDataCacheRef().GetUsingSharedDDC())
{
// store a cache miss
FScopeLock ScopeLock(&SynchronizationObject);
if (!DDCNotificationCacheTimes.Contains(CacheKey))
{
DDCNotificationCacheTimes.Add(CacheKey, FPlatformTime::Seconds());
}
}
return false;
}
bool FFileSystemCacheStore::WouldCache(const TCHAR* const CacheKey, const TConstArrayView<uint8> InData)
{
return IsWritable() && !CachedDataProbablyExists(CacheKey);
}
FFileSystemCacheStore::EPutStatus FFileSystemCacheStore::PutCachedData(
const TCHAR* const CacheKey,
const TConstArrayView<uint8> Data,
const bool bPutEvenIfExists)
{
TRACE_CPUPROFILER_EVENT_SCOPE(FileSystemDDC_Put);
TRACE_COUNTER_INCREMENT(FileSystemDDC_Put);
COOK_STAT(auto Timer = UsageStats.TimePut());
checkf(Data.Num(), TEXT("%s: Failed to put %s due to empty data"), *CachePath, CacheKey);
if (!IsUsable())
{
UE_LOG(LogDerivedDataCache, VeryVerbose,
TEXT("%s: Skipped put of %s because this cache store is not available"), *CachePath, CacheKey);
return EPutStatus::NotCached;
}
if (!IsWritable())
{
UE_LOG(LogDerivedDataCache, VeryVerbose,
TEXT("%s: Skipped put of %s because this cache store is read-only"), *CachePath, CacheKey);
return EPutStatus::NotCached;
}
if (DebugOptions.ShouldSimulatePutMiss(CacheKey))
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Simulated miss for put of %s"), *CachePath, CacheKey);
return EPutStatus::NotCached;
}
TStringBuilder<256> LegacyPath;
BuildCacheLegacyPath(CacheKey, LegacyPath);
if (AccessLogWriter)
{
AccessLogWriter->Append(CacheKey, LegacyPath);
}
EPutStatus Status = EPutStatus::NotCached;
if (bPutEvenIfExists || !FileExists(LegacyPath))
{
const auto WriteData = [this, CacheKey, &Data](FArchive& Ar)
{
Ar.Serialize(const_cast<uint8*>(Data.GetData()), Data.Num());
FCorruptionWrapper::WriteTrailer(Ar, Data, *CachePath, CacheKey);
};
if (SaveFile(LegacyPath, CacheKey, WriteData))
{
UE_LOG(LogDerivedDataCache, Verbose,
TEXT("%s: Successful cache put of %s to %s"), *CachePath, CacheKey, *LegacyPath);
TRACE_COUNTER_INCREMENT(FileSystemDDC_PutHit);
TRACE_COUNTER_ADD(FileSystemDDC_BytesWritten, int64(Data.Num()));
COOK_STAT(Timer.AddHit(Data.Num()));
Status = EPutStatus::Cached;
}
}
else
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Skipping put of %s to existing file"), *CachePath, CacheKey);
Status = EPutStatus::Cached;
}
// If not using a shared cache, update estimated build time
if (!GetDerivedDataCacheRef().GetUsingSharedDDC())
{
FScopeLock ScopeLock(&SynchronizationObject);
if (DDCNotificationCacheTimes.Contains(CacheKey))
{
// There isn't any way to get exact build times in the DDC code as custom asset processing and async are factors.
// So, estimate the asset build time based on the delta between the cache miss and the put
TotalEstimatedBuildTime += (FPlatformTime::Seconds() - DDCNotificationCacheTimes[CacheKey]);
DDCNotificationCacheTimes.Remove(CacheKey);
// If more than 20 seconds has been spent building assets, send out a notification
if (TotalEstimatedBuildTime > 20.0f)
{
// Send out a DDC put notification if we have any subscribers
FDerivedDataCacheInterface::FOnDDCNotification& DDCNotificationEvent =
GetDerivedDataCacheRef().GetDDCNotificationEvent();
if (DDCNotificationEvent.IsBound())
{
TotalEstimatedBuildTime = 0.0f;
DECLARE_CYCLE_STAT(TEXT("FSimpleDelegateGraphTask.PutCachedData"),
STAT_FSimpleDelegateGraphTask_DDCNotification, STATGROUP_TaskGraphTasks);
FSimpleDelegateGraphTask::CreateAndDispatchWhenReady(
FSimpleDelegateGraphTask::FDelegate::CreateLambda([DDCNotificationEvent]() {
DDCNotificationEvent.Broadcast(FDerivedDataCacheInterface::SharedDDCPerformanceNotification);
}),
GET_STATID(STAT_FSimpleDelegateGraphTask_DDCNotification),
nullptr,
ENamedThreads::GameThread);
}
}
}
}
return Status;
}
void FFileSystemCacheStore::RemoveCachedData(const TCHAR* const CacheKey, const bool bTransient)
{
check(IsUsable());
if (IsWritable() && (!bTransient || bPurgeTransient))
{
TStringBuilder<256> LegacyPath;
BuildCacheLegacyPath(CacheKey, LegacyPath);
if (bTransient)
{
UE_LOG(LogDerivedDataCache, Verbose,
TEXT("%s: Deleting cached data for %s from %s"), *CachePath, CacheKey, *LegacyPath);
}
IFileManager::Get().Delete(*LegacyPath, /*bRequireExists*/ false, /*bEvenReadOnly*/ false, /*bQuiet*/ true);
}
}
TSharedRef<FDerivedDataCacheStatsNode> FFileSystemCacheStore::GatherUsageStats() const
{
TSharedRef<FDerivedDataCacheStatsNode> Usage =
MakeShared<FDerivedDataCacheStatsNode>(TEXT("File System"), *CachePath, SpeedClass == ESpeedClass::Local);
Usage->Stats.Add(TEXT(""), UsageStats);
return Usage;
}
TBitArray<> FFileSystemCacheStore::TryToPrefetch(const TConstArrayView<FString> CacheKeys)
{
return CachedDataProbablyExistsBatch(CacheKeys);
}
bool FFileSystemCacheStore::ApplyDebugOptions(FBackendDebugOptions& InOptions)
{
DebugOptions = InOptions;
return true;
}
void FFileSystemCacheStore::Put(
const TConstArrayView<FCachePutRequest> Requests,
IRequestOwner& Owner,
FOnCachePutComplete&& OnComplete)
{
for (const FCachePutRequest& Request : Requests)
{
bool bOk;
{
const FCacheRecord& Record = Request.Record;
TRACE_CPUPROFILER_EVENT_SCOPE(FileSystemDDC_Put);
TRACE_COUNTER_INCREMENT(FileSystemDDC_Put);
COOK_STAT(auto Timer = UsageStats.TimePut());
uint64 WriteSize = 0;
bOk = PutCacheRecord(Request.Name, Record, Request.Policy, WriteSize);
if (bOk)
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Cache put complete for %s from '%s'"),
*CachePath, *WriteToString<96>(Record.GetKey()), *Request.Name);
TRACE_COUNTER_INCREMENT(FileSystemDDC_PutHit);
TRACE_COUNTER_ADD(FileSystemDDC_BytesWritten, WriteSize);
if (WriteSize)
{
COOK_STAT(Timer.AddHit(WriteSize));
}
}
}
OnComplete(Request.MakeResponse(bOk ? EStatus::Ok : EStatus::Error));
}
}
void FFileSystemCacheStore::Get(
const TConstArrayView<FCacheGetRequest> Requests,
IRequestOwner& Owner,
FOnCacheGetComplete&& OnComplete)
{
for (const FCacheGetRequest& Request : Requests)
{
EStatus Status = EStatus::Error;
FOptionalCacheRecord Record;
{
TRACE_CPUPROFILER_EVENT_SCOPE(FileSystemDDC_Get);
TRACE_COUNTER_INCREMENT(FileSystemDDC_Get);
COOK_STAT(auto Timer = UsageStats.TimeGet());
if ((Record = GetCacheRecord(Request.Name, Request.Key, Request.Policy, Status)))
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Cache hit for %s from '%s'"),
*CachePath, *WriteToString<96>(Request.Key), *Request.Name);
TRACE_COUNTER_INCREMENT(FileSystemDDC_GetHit);
TRACE_COUNTER_ADD(FileSystemDDC_BytesRead, Private::GetCacheRecordCompressedSize(Record.Get()));
COOK_STAT(Timer.AddHit(Private::GetCacheRecordCompressedSize(Record.Get())));
}
else
{
Record = FCacheRecordBuilder(Request.Key).Build();
}
}
OnComplete({Request.Name, MoveTemp(Record).Get(), Request.UserData, Status});
}
}
void FFileSystemCacheStore::PutValue(
const TConstArrayView<FCachePutValueRequest> Requests,
IRequestOwner& Owner,
FOnCachePutValueComplete&& OnComplete)
{
for (const FCachePutValueRequest& Request : Requests)
{
bool bOk;
{
TRACE_CPUPROFILER_EVENT_SCOPE(FileSystemDDC_PutValue);
TRACE_COUNTER_INCREMENT(FileSystemDDC_Put);
COOK_STAT(auto Timer = UsageStats.TimePut());
uint64 WriteSize = 0;
bOk = PutCacheValue(Request.Name, Request.Key, Request.Value, Request.Policy, WriteSize);
if (bOk)
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Cache put complete for %s from '%s'"),
*CachePath, *WriteToString<96>(Request.Key), *Request.Name);
TRACE_COUNTER_INCREMENT(FileSystemDDC_PutHit);
TRACE_COUNTER_ADD(FileSystemDDC_BytesWritten, WriteSize);
if (WriteSize)
{
COOK_STAT(Timer.AddHit(WriteSize));
}
}
}
OnComplete(Request.MakeResponse(bOk ? EStatus::Ok : EStatus::Error));
}
}
void FFileSystemCacheStore::GetValue(
const TConstArrayView<FCacheGetValueRequest> Requests,
IRequestOwner& Owner,
FOnCacheGetValueComplete&& OnComplete)
{
for (const FCacheGetValueRequest& Request : Requests)
{
bool bOk;
FValue Value;
{
TRACE_CPUPROFILER_EVENT_SCOPE(FileSystemDDC_GetValue);
TRACE_COUNTER_INCREMENT(FileSystemDDC_Get);
COOK_STAT(auto Timer = UsageStats.TimeGet());
bOk = GetCacheValue(Request.Name, Request.Key, Request.Policy, Value);
if (bOk)
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Cache hit for %s from '%s'"),
*CachePath, *WriteToString<96>(Request.Key), *Request.Name);
TRACE_COUNTER_INCREMENT(FileSystemDDC_GetHit);
TRACE_COUNTER_ADD(FileSystemDDC_BytesRead, Value.GetData().GetCompressedSize());
COOK_STAT(Timer.AddHit(Value.GetData().GetCompressedSize()));
}
}
OnComplete({Request.Name, Request.Key, Value, Request.UserData, bOk ? EStatus::Ok : EStatus::Error});
}
}
void FFileSystemCacheStore::GetChunks(
const TConstArrayView<FCacheGetChunkRequest> Requests,
IRequestOwner& Owner,
FOnCacheGetChunkComplete&& OnComplete)
{
TArray<FCacheGetChunkRequest, TInlineAllocator<16>> SortedRequests(Requests);
SortedRequests.StableSort(TChunkLess());
bool bHasValue = false;
FValue Value;
FValueId ValueId;
FCacheKey ValueKey;
TUniquePtr<FArchive> ValueAr;
FCompressedBufferReader ValueReader;
FOptionalCacheRecord Record;
for (const FCacheGetChunkRequest& Request : SortedRequests)
{
EStatus Status = EStatus::Error;
FSharedBuffer Buffer;
uint64 RawSize = 0;
{
TRACE_CPUPROFILER_EVENT_SCOPE(FileSystemDDC_GetChunks);
TRACE_COUNTER_INCREMENT(FileSystemDDC_Get);
const bool bExistsOnly = EnumHasAnyFlags(Request.Policy, ECachePolicy::SkipData);
COOK_STAT(auto Timer = bExistsOnly ? UsageStats.TimeProbablyExists() : UsageStats.TimeGet());
if (!(bHasValue && ValueKey == Request.Key && ValueId == Request.Id) || ValueReader.HasSource() < !bExistsOnly)
{
ValueReader.ResetSource();
ValueAr.Reset();
ValueKey = {};
ValueId.Reset();
Value.Reset();
bHasValue = false;
if (Request.Id.IsValid())
{
if (!(Record && Record.Get().GetKey() == Request.Key))
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
{
FCacheRecordPolicyBuilder PolicyBuilder(ECachePolicy::None);
PolicyBuilder.AddValuePolicy(Request.Id, Request.Policy);
Record.Reset();
Record = GetCacheRecordOnly(Request.Name, Request.Key, PolicyBuilder.Build());
}
if (Record)
{
if (const FValueWithId& ValueWithId = Record.Get().GetValue(Request.Id))
{
bHasValue = true;
Value = ValueWithId;
ValueId = Request.Id;
ValueKey = Request.Key;
GetCacheContent(Request.Name, Request.Key, ValueId, Value, Request.Policy, ValueReader, ValueAr);
}
}
}
else
{
ValueKey = Request.Key;
bHasValue = GetCacheValueOnly(Request.Name, Request.Key, Request.Policy, Value);
if (bHasValue)
{
GetCacheContent(Request.Name, Request.Key, Request.Id, Value, Request.Policy, ValueReader, ValueAr);
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
}
}
}
if (bHasValue)
{
const uint64 RawOffset = FMath::Min(Value.GetRawSize(), Request.RawOffset);
RawSize = FMath::Min(Value.GetRawSize() - RawOffset, Request.RawSize);
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Cache hit for %s from '%s'"),
*CachePath, *WriteToString<96>(Request.Key, '/', Request.Id), *Request.Name);
TRACE_COUNTER_INCREMENT(FileSystemDDC_GetHit);
TRACE_COUNTER_ADD(FileSystemDDC_BytesRead, !bExistsOnly ? RawSize : 0);
COOK_STAT(Timer.AddHit(!bExistsOnly ? RawSize : 0));
if (!bExistsOnly)
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
{
Buffer = ValueReader.Decompress(RawOffset, RawSize);
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
}
Status = bExistsOnly || Buffer.GetSize() == RawSize ? EStatus::Ok : EStatus::Error;
}
}
OnComplete({Request.Name, Request.Key, Request.Id, Request.RawOffset,
RawSize, Value.GetRawHash(), MoveTemp(Buffer), Request.UserData, Status});
}
}
bool FFileSystemCacheStore::PutCacheRecord(
const FStringView Name,
const FCacheRecord& Record,
const FCacheRecordPolicy& Policy,
uint64& OutWriteSize)
{
if (!IsWritable())
{
UE_LOG(LogDerivedDataCache, VeryVerbose,
TEXT("%s: Skipped put of %s from '%.*s' because this cache store is read-only"),
*CachePath, *WriteToString<96>(Record.GetKey()), Name.Len(), Name.GetData());
return false;
}
const FCacheKey& Key = Record.GetKey();
const ECachePolicy RecordPolicy = Policy.GetRecordPolicy();
// Skip the request if storing to the cache is disabled.
const ECachePolicy StoreFlag = SpeedClass == ESpeedClass::Local ? ECachePolicy::StoreLocal : ECachePolicy::StoreRemote;
if (!EnumHasAnyFlags(RecordPolicy, StoreFlag))
{
UE_LOG(LogDerivedDataCache, VeryVerbose, TEXT("%s: Skipped put of %s from '%.*s' due to cache policy"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
if (DebugOptions.ShouldSimulatePutMiss(Key))
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Simulated miss for put of %s from '%.*s'"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
TStringBuilder<256> Path;
BuildCachePackagePath(Key, Path);
// Check if there is an existing record package.
FCbPackage ExistingPackage;
const ECachePolicy QueryFlag = SpeedClass == ESpeedClass::Local ? ECachePolicy::QueryLocal : ECachePolicy::QueryRemote;
bool bReplaceExisting = !EnumHasAnyFlags(RecordPolicy, QueryFlag);
bool bSavePackage = bReplaceExisting;
if (const bool bLoadPackage = !bReplaceExisting || !Algo::AllOf(Record.GetValues(), &FValue::HasData))
{
// Load the existing package to take its attachments into account.
// Save the new package if there is no existing package or it fails to load.
bSavePackage |= !LoadFileWithHash(Path, Name, [&ExistingPackage](FArchive& Ar) { ExistingPackage.TryLoad(Ar); });
if (!bSavePackage)
{
// Save the new package if the existing package is invalid.
const FOptionalCacheRecord ExistingRecord = FCacheRecord::Load(ExistingPackage);
bSavePackage |= !ExistingRecord;
const auto MakeValueTuple = [](const FValueWithId& Value) -> TTuple<FValueId, FIoHash>
{
return MakeTuple(Value.GetId(), Value.GetRawHash());
};
if (ExistingRecord && !Algo::CompareBy(ExistingRecord.Get().GetValues(), Record.GetValues(), MakeValueTuple))
{
// Content differs between the existing record and the new record.
UE_LOG(LogDerivedDataCache, Display, TEXT("%s: Cache put found non-deterministic record for %s from '%.*s'"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
const auto HasValueContent = [this, Name, &Key](const FValueWithId& Value) -> bool
{
if (!Value.HasData() && !GetCacheContentExists(Key, Value.GetRawHash()))
{
UE_LOG(LogDerivedDataCache, Log,
TEXT("%s: Cache put of non-deterministic record will overwrite existing record due to ")
TEXT("missing value %s with hash %s for %s from '%.*s'"),
*CachePath, *WriteToString<16>(Value.GetId()), *WriteToString<48>(Value.GetRawHash()),
*WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
return true;
};
// Save the new package because the existing package differs and is missing content.
bSavePackage |= !Algo::AllOf(ExistingRecord.Get().GetValues(), HasValueContent);
}
bReplaceExisting |= bSavePackage;
}
}
// Serialize the record to a package and remove attachments that will be stored externally.
FCbPackage Package = Record.Save();
TArray<FCompressedBuffer, TInlineAllocator<8>> ExternalContent;
if (ExistingPackage && !bSavePackage)
{
// Mirror the existing internal/external attachment storage.
TArray<FCompressedBuffer, TInlineAllocator<8>> AllContent;
Algo::Transform(Package.GetAttachments(), AllContent, &FCbAttachment::AsCompressedBinary);
for (FCompressedBuffer& Content : AllContent)
{
const FIoHash RawHash = Content.GetRawHash();
if (!ExistingPackage.FindAttachment(RawHash))
{
Package.RemoveAttachment(RawHash);
ExternalContent.Add(MoveTemp(Content));
}
}
}
else
{
// Attempt to copy missing attachments from the existing package.
if (ExistingPackage)
{
for (const FValue& Value : Record.GetValues())
{
if (!Value.HasData())
{
if (const FCbAttachment* Attachment = ExistingPackage.FindAttachment(Value.GetRawHash()))
{
Package.AddAttachment(*Attachment);
}
}
}
}
// Remove the largest attachments from the package until it fits within the size limits.
TArray<FCompressedBuffer, TInlineAllocator<8>> AllContent;
Algo::Transform(Package.GetAttachments(), AllContent, &FCbAttachment::AsCompressedBinary);
uint64 TotalSize = Algo::TransformAccumulate(AllContent, &FCompressedBuffer::GetCompressedSize, uint64(0));
const uint64 MaxSize = (Record.GetValues().Num() == 1 ? MaxValueSizeKB : MaxRecordSizeKB) * 1024;
if (TotalSize > MaxSize)
{
Algo::StableSortBy(AllContent, &FCompressedBuffer::GetCompressedSize, TGreater<>());
for (FCompressedBuffer& Content : AllContent)
{
const uint64 CompressedSize = Content.GetCompressedSize();
Package.RemoveAttachment(Content.GetRawHash());
ExternalContent.Add(MoveTemp(Content));
TotalSize -= CompressedSize;
if (TotalSize <= MaxSize)
{
break;
}
}
}
}
// Save the external content to storage.
for (FCompressedBuffer& Content : ExternalContent)
{
uint64 WriteSize = 0;
if (!PutCacheContent(Name, Content, OutWriteSize))
{
return false;
}
OutWriteSize += WriteSize;
}
// Save the record package to storage.
const auto WritePackage = [&Package, &OutWriteSize](FArchive& Ar)
{
Package.Save(Ar);
OutWriteSize += uint64(Ar.TotalSize());
};
if (bSavePackage && !SaveFileWithHash(Path, Name, WritePackage, bReplaceExisting))
{
return false;
}
if (AccessLogWriter)
{
AccessLogWriter->Append(Key, Path);
}
return true;
}
FOptionalCacheRecord FFileSystemCacheStore::GetCacheRecordOnly(
const FStringView Name,
const FCacheKey& Key,
const FCacheRecordPolicy& Policy)
{
if (!IsUsable())
{
UE_LOG(LogDerivedDataCache, VeryVerbose,
TEXT("%s: Skipped get of %s from '%.*s' because this cache store is not available"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return FOptionalCacheRecord();
}
// Skip the request if querying the cache is disabled.
const ECachePolicy QueryFlag = SpeedClass == ESpeedClass::Local ? ECachePolicy::QueryLocal : ECachePolicy::QueryRemote;
if (!EnumHasAnyFlags(Policy.GetRecordPolicy(), QueryFlag))
{
UE_LOG(LogDerivedDataCache, VeryVerbose, TEXT("%s: Skipped get of %s from '%.*s' due to cache policy"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return FOptionalCacheRecord();
}
if (DebugOptions.ShouldSimulateGetMiss(Key))
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Simulated miss for get of %s from '%.*s'"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return FOptionalCacheRecord();
}
TStringBuilder<256> Path;
BuildCachePackagePath(Key, Path);
bool bDeletePackage = true;
ON_SCOPE_EXIT
{
if (bDeletePackage && !bReadOnly)
{
IFileManager::Get().Delete(*Path, /*bRequireExists*/ false, /*bEvenReadOnly*/ false, /*bQuiet*/ true);
}
};
FOptionalCacheRecord Record;
{
FCbPackage Package;
if (!LoadFileWithHash(Path, Name, [&Package](FArchive& Ar) { Package.TryLoad(Ar); }))
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Cache miss with missing package for %s from '%.*s'"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return Record;
}
if (ValidateCompactBinary(Package, ECbValidateMode::Default | ECbValidateMode::Package) != ECbValidateError::None)
{
UE_LOG(LogDerivedDataCache, Display, TEXT("%s: Cache miss with invalid package for %s from '%.*s'"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return Record;
}
Record = FCacheRecord::Load(Package);
if (Record.IsNull())
{
UE_LOG(LogDerivedDataCache, Display, TEXT("%s: Cache miss with record load failure for %s from '%.*s'"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return Record;
}
}
if (AccessLogWriter)
{
AccessLogWriter->Append(Key, Path);
}
bDeletePackage = false;
return Record;
}
FOptionalCacheRecord FFileSystemCacheStore::GetCacheRecord(
const FStringView Name,
const FCacheKey& Key,
const FCacheRecordPolicy& Policy,
EStatus& OutStatus)
{
FOptionalCacheRecord Record = GetCacheRecordOnly(Name, Key, Policy);
if (Record.IsNull())
{
OutStatus = EStatus::Error;
return Record;
}
OutStatus = EStatus::Ok;
FCacheRecordBuilder RecordBuilder(Key);
const ECachePolicy RecordPolicy = Policy.GetRecordPolicy();
if (!EnumHasAnyFlags(RecordPolicy, ECachePolicy::SkipMeta))
{
RecordBuilder.SetMeta(FCbObject(Record.Get().GetMeta()));
}
for (const FValueWithId& Value : Record.Get().GetValues())
{
const FValueId& Id = Value.GetId();
const ECachePolicy ValuePolicy = Policy.GetValuePolicy(Id);
FValue Content;
if (GetCacheContent(Name, Key, Id, Value, ValuePolicy, Content))
{
RecordBuilder.AddValue(Id, MoveTemp(Content));
}
else if (EnumHasAnyFlags(RecordPolicy, ECachePolicy::PartialRecord))
{
OutStatus = EStatus::Error;
RecordBuilder.AddValue(Value);
}
else
{
OutStatus = EStatus::Error;
return FOptionalCacheRecord();
}
}
return RecordBuilder.Build();
}
bool FFileSystemCacheStore::PutCacheValue(
const FStringView Name,
const FCacheKey& Key,
const FValue& Value,
const ECachePolicy Policy,
uint64& OutWriteSize)
{
if (!IsWritable())
{
UE_LOG(LogDerivedDataCache, VeryVerbose,
TEXT("%s: Skipped put of %s from '%.*s' because this cache store is read-only"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
// Skip the request if storing to the cache is disabled.
const ECachePolicy StoreFlag = SpeedClass == ESpeedClass::Local ? ECachePolicy::StoreLocal : ECachePolicy::StoreRemote;
if (!EnumHasAnyFlags(Policy, StoreFlag))
{
UE_LOG(LogDerivedDataCache, VeryVerbose, TEXT("%s: Skipped put of %s from '%.*s' due to cache policy"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
if (DebugOptions.ShouldSimulatePutMiss(Key))
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Simulated miss for put of %s from '%.*s'"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
// Check if there is an existing value package.
FCbPackage ExistingPackage;
TStringBuilder<256> Path;
BuildCachePackagePath(Key, Path);
const ECachePolicy QueryFlag = SpeedClass == ESpeedClass::Local ? ECachePolicy::QueryLocal : ECachePolicy::QueryRemote;
bool bReplaceExisting = !EnumHasAnyFlags(Policy, QueryFlag);
bool bSavePackage = bReplaceExisting;
if (const bool bLoadPackage = !bReplaceExisting || !Value.HasData())
{
// Load the existing package to take its attachments into account.
// Save the new package if there is no existing package or it fails to load.
bSavePackage |= !LoadFileWithHash(Path, Name, [&ExistingPackage](FArchive& Ar) { ExistingPackage.TryLoad(Ar); });
if (!bSavePackage)
{
const FCbObjectView Object = ExistingPackage.GetObject();
const FIoHash RawHash = Object["RawHash"].AsHash();
const uint64 RawSize = Object["RawSize"].AsUInt64(MAX_uint64);
if (RawHash.IsZero() || RawSize == MAX_uint64)
{
// Save the new package because the existing package is invalid.
UE_LOG(LogDerivedDataCache, Display, TEXT("%s: Cache put found invalid existing value for %s from '%.*s'"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
bSavePackage = true;
}
else if (!(RawHash == Value.GetRawHash() && RawSize == Value.GetRawSize()))
{
// Content differs between the existing value and the new value.
UE_LOG(LogDerivedDataCache, Display, TEXT("%s: Cache put found non-deterministic value "
"with new hash %s and existing hash %s for %s from '%.*s'"),
*CachePath, *WriteToString<48>(Value.GetRawHash()), *WriteToString<48>(RawHash),
*WriteToString<96>(Key), Name.Len(), Name.GetData());
if (!ExistingPackage.FindAttachment(RawHash) && !GetCacheContentExists(Key, RawHash))
{
// Save the new package because the existing package differs and is missing content.
UE_LOG(LogDerivedDataCache, Log,
TEXT("%s: Cache put of non-deterministic value will overwrite existing value due to "
"missing value with hash %s for %s from '%.*s'"),
*CachePath, *WriteToString<48>(RawHash), *WriteToString<96>(Key), Name.Len(), Name.GetData());
bSavePackage = true;
}
}
bReplaceExisting |= bSavePackage;
}
}
// Save the value to a package and save the data to external content depending on its size.
FCbPackage Package;
TArray<FCompressedBuffer, TInlineAllocator<1>> ExternalContent;
if (ExistingPackage && !bSavePackage)
{
if (Value.HasData() && !ExistingPackage.FindAttachment(Value.GetRawHash()))
{
ExternalContent.Add(Value.GetData());
}
}
else
{
FCbWriter Writer;
Writer.BeginObject();
Writer.AddBinaryAttachment("RawHash", Value.GetRawHash());
Writer.AddInteger("RawSize", Value.GetRawSize());
Writer.EndObject();
Package.SetObject(Writer.Save().AsObject());
if (!Value.HasData())
{
// Verify that the content exists in storage.
if (!GetCacheContentExists(Key, Value.GetRawHash()))
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Failed due to missing data for put of %s from '%.*s'"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
}
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
else if (Value.GetData().GetCompressedSize() <= MaxValueSizeKB * 1024)
{
// Store the content in the package.
Package.AddAttachment(FCbAttachment(Value.GetData()));
}
else
{
ExternalContent.Add(Value.GetData());
}
}
// Save the external content to storage.
for (FCompressedBuffer& Content : ExternalContent)
{
uint64 WriteSize = 0;
if (!PutCacheContent(Name, Content, OutWriteSize))
{
return false;
}
OutWriteSize += WriteSize;
}
// Save the value package to storage.
const auto WritePackage = [&Package, &OutWriteSize](FArchive& Ar)
{
Package.Save(Ar);
OutWriteSize += uint64(Ar.TotalSize());
};
if (bSavePackage && !SaveFileWithHash(Path, Name, WritePackage, bReplaceExisting))
{
return false;
}
if (AccessLogWriter)
{
AccessLogWriter->Append(Key, Path);
}
return true;
}
bool FFileSystemCacheStore::GetCacheValueOnly(
const FStringView Name,
const FCacheKey& Key,
const ECachePolicy Policy,
FValue& OutValue)
{
if (!IsUsable())
{
UE_LOG(LogDerivedDataCache, VeryVerbose,
TEXT("%s: Skipped get of %s from '%.*s' because this cache store is not available"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
// Skip the request if querying the cache is disabled.
const ECachePolicy QueryFlag = SpeedClass == ESpeedClass::Local ? ECachePolicy::QueryLocal : ECachePolicy::QueryRemote;
if (!EnumHasAnyFlags(Policy, QueryFlag))
{
UE_LOG(LogDerivedDataCache, VeryVerbose, TEXT("%s: Skipped get of %s from '%.*s' due to cache policy"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
if (DebugOptions.ShouldSimulateGetMiss(Key))
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Simulated miss for get of %s from '%.*s'"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
TStringBuilder<256> Path;
BuildCachePackagePath(Key, Path);
bool bDeletePackage = true;
ON_SCOPE_EXIT
{
if (bDeletePackage && !bReadOnly)
{
IFileManager::Get().Delete(*Path, /*bRequireExists*/ false, /*bEvenReadOnly*/ false, /*bQuiet*/ true);
}
};
FCbPackage Package;
if (!LoadFileWithHash(Path, Name, [&Package](FArchive& Ar) { Package.TryLoad(Ar); }))
{
UE_LOG(LogDerivedDataCache, Verbose, TEXT("%s: Cache miss with missing package for %s from '%.*s'"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
if (ValidateCompactBinary(Package, ECbValidateMode::Default | ECbValidateMode::Package) != ECbValidateError::None)
{
UE_LOG(LogDerivedDataCache, Display, TEXT("%s: Cache miss with invalid package for %s from '%.*s'"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
const FCbObjectView Object = Package.GetObject();
const FIoHash RawHash = Object["RawHash"].AsHash();
const uint64 RawSize = Object["RawSize"].AsUInt64(MAX_uint64);
if (RawHash.IsZero() || RawSize == MAX_uint64)
{
UE_LOG(LogDerivedDataCache, Display, TEXT("%s: Cache miss with invalid value for %s from '%.*s'"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
if (const FCbAttachment* const Attachment = Package.FindAttachment(RawHash))
{
const FCompressedBuffer& Data = Attachment->AsCompressedBinary();
if (Data.GetRawHash() != RawHash || Data.GetRawSize() != RawSize)
{
UE_LOG(LogDerivedDataCache, Display,
TEXT("%s: Cache miss with invalid value attachment for %s from '%.*s'"),
*CachePath, *WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
OutValue = FValue(Data);
}
else
{
OutValue = FValue(RawHash, RawSize);
}
if (AccessLogWriter)
{
AccessLogWriter->Append(Key, Path);
}
bDeletePackage = false;
return true;
}
bool FFileSystemCacheStore::GetCacheValue(
const FStringView Name,
const FCacheKey& Key,
const ECachePolicy Policy,
FValue& OutValue)
{
return GetCacheValueOnly(Name, Key, Policy, OutValue) && GetCacheContent(Name, Key, {}, OutValue, Policy, OutValue);
}
bool FFileSystemCacheStore::PutCacheContent(
const FStringView Name,
const FCompressedBuffer& Content,
uint64& OutWriteSize) const
{
const FIoHash& RawHash = Content.GetRawHash();
TStringBuilder<256> Path;
BuildCacheContentPath(RawHash, Path);
const auto WriteContent = [&](FArchive& Ar) { Content.Save(Ar); OutWriteSize += uint64(Ar.TotalSize()); };
if (!FileExists(Path) && !SaveFileWithHash(Path, Name, WriteContent))
{
return false;
}
if (AccessLogWriter)
{
AccessLogWriter->Append(RawHash, Path);
}
return true;
}
bool FFileSystemCacheStore::GetCacheContentExists(const FCacheKey& Key, const FIoHash& RawHash) const
{
TStringBuilder<256> Path;
BuildCacheContentPath(RawHash, Path);
return FileExists(Path);
}
bool FFileSystemCacheStore::GetCacheContent(
const FStringView Name,
const FCacheKey& Key,
const FValueId& Id,
const FValue& Value,
const ECachePolicy Policy,
FValue& OutValue) const
{
if (!EnumHasAnyFlags(Policy, ECachePolicy::Query))
{
OutValue = Value.RemoveData();
return true;
}
if (Value.HasData())
{
OutValue = EnumHasAnyFlags(Policy, ECachePolicy::SkipData) ? Value.RemoveData() : Value;
return true;
}
const FIoHash& RawHash = Value.GetRawHash();
TStringBuilder<256> Path;
BuildCacheContentPath(RawHash, Path);
if (EnumHasAnyFlags(Policy, ECachePolicy::SkipData))
{
if (FileExists(Path))
{
if (AccessLogWriter)
{
AccessLogWriter->Append(RawHash, Path);
}
OutValue = Value;
return true;
}
}
else
{
FCompressedBuffer CompressedBuffer;
if (LoadFileWithHash(Path, Name, [&CompressedBuffer](FArchive& Ar) { CompressedBuffer = FCompressedBuffer::Load(Ar); }))
{
if (CompressedBuffer.GetRawHash() == RawHash)
{
if (AccessLogWriter)
{
AccessLogWriter->Append(RawHash, Path);
}
OutValue = FValue(MoveTemp(CompressedBuffer));
return true;
}
UE_LOG(LogDerivedDataCache, Display,
TEXT("%s: Cache miss with corrupted value %s with hash %s for %s from '%.*s'"),
*CachePath, *WriteToString<16>(Id), *WriteToString<48>(RawHash),
*WriteToString<96>(Key), Name.Len(), Name.GetData());
return false;
}
}
UE_LOG(LogDerivedDataCache, Verbose,
TEXT("%s: Cache miss with missing value %s with hash %s for %s from '%.*s'"),
*CachePath, *WriteToString<16>(Id), *WriteToString<48>(RawHash), *WriteToString<96>(Key),
Name.Len(), Name.GetData());
return false;
}
void FFileSystemCacheStore::GetCacheContent(
const FStringView Name,
const FCacheKey& Key,
const FValueId& Id,
const FValue& Value,
const ECachePolicy Policy,
FCompressedBufferReader& Reader,
TUniquePtr<FArchive>& OutArchive) const
{
if (!EnumHasAnyFlags(Policy, ECachePolicy::Query))
{
return;
}
if (Value.HasData())
{
if (!EnumHasAnyFlags(Policy, ECachePolicy::SkipData))
{
Reader.SetSource(Value.GetData());
}
OutArchive.Reset();
return;
}
const FIoHash& RawHash = Value.GetRawHash();
TStringBuilder<256> Path;
BuildCacheContentPath(RawHash, Path);
if (EnumHasAllFlags(Policy, ECachePolicy::SkipData))
{
if (FileExists(Path))
{
if (AccessLogWriter)
{
AccessLogWriter->Append(RawHash, Path);
}
return;
}
}
else
{
OutArchive = OpenFile(Path, Name);
if (OutArchive)
{
Reader.SetSource(*OutArchive);
if (Reader.GetRawHash() == RawHash)
{
if (AccessLogWriter)
{
AccessLogWriter->Append(RawHash, Path);
}
return;
}
UE_LOG(LogDerivedDataCache, Display,
TEXT("%s: Cache miss with corrupted value %s with hash %s for %s from '%.*s'"),
*CachePath, *WriteToString<16>(Id), *WriteToString<48>(RawHash),
*WriteToString<96>(Key), Name.Len(), Name.GetData());
Reader.ResetSource();
OutArchive.Reset();
return;
}
}
UE_LOG(LogDerivedDataCache, Verbose,
TEXT("%s: Cache miss with missing value %s with hash %s for %s from '%.*s'"),
*CachePath, *WriteToString<16>(Id), *WriteToString<48>(RawHash), *WriteToString<96>(Key),
Name.Len(), Name.GetData());
}
void FFileSystemCacheStore::BuildCachePackagePath(const FCacheKey& CacheKey, FStringBuilderBase& Path) const
{
Path << CachePath << TEXT('/');
BuildPathForCachePackage(CacheKey, Path);
}
void FFileSystemCacheStore::BuildCacheContentPath(const FIoHash& RawHash, FStringBuilderBase& Path) const
{
Path << CachePath << TEXT('/');
BuildPathForCacheContent(RawHash, Path);
}
bool FFileSystemCacheStore::SaveFileWithHash(
FStringBuilderBase& Path,
const FStringView DebugName,
const TFunctionRef<void (FArchive&)> WriteFunction,
const bool bReplaceExisting) const
{
return SaveFile(Path, DebugName, [&WriteFunction](FArchive& Ar)
{
THashingArchiveProxy<FBlake3> HashAr(Ar);
WriteFunction(HashAr);
FBlake3Hash Hash = HashAr.GetHash();
Ar << Hash;
}, bReplaceExisting);
}
bool FFileSystemCacheStore::LoadFileWithHash(
FStringBuilderBase& Path,
const FStringView DebugName,
const TFunctionRef<void (FArchive& Ar)> ReadFunction) const
{
return LoadFile(Path, DebugName, [this, &Path, &DebugName, &ReadFunction](FArchive& Ar)
{
THashingArchiveProxy<FBlake3> HashAr(Ar);
ReadFunction(HashAr);
const FBlake3Hash Hash = HashAr.GetHash();
FBlake3Hash SavedHash;
Ar << SavedHash;
if (Hash != SavedHash && !Ar.IsError())
{
Ar.SetError();
UE_LOG(LogDerivedDataCache, Display,
TEXT("%s: File %s from '%.*s' is corrupted and has hash %s when %s is expected."),
*CachePath, *Path, DebugName.Len(), DebugName.GetData(),
*WriteToString<80>(Hash), *WriteToString<80>(SavedHash));
}
});
}
bool FFileSystemCacheStore::SaveFile(
FStringBuilderBase& Path,
const FStringView DebugName,
const TFunctionRef<void (FArchive&)> WriteFunction,
const bool bReplaceExisting) const
{
const double StartTime = FPlatformTime::Seconds();
TStringBuilder<256> TempPath;
TempPath << FPathViews::GetPath(Path) << TEXT("/Temp.") << FGuid::NewGuid();
ON_SCOPE_EXIT
{
IFileManager::Get().Delete(*TempPath, /*bRequireExists*/ false, /*bEvenReadOnly*/ false, /*bQuiet*/ true);
};
int64 WriteSize = 0;
bool bError = false;
if (TUniquePtr<FArchive> Ar{IFileManager::Get().CreateFileWriter(*TempPath, FILEWRITE_Silent)})
{
WriteFunction(*Ar);
WriteSize = Ar->Tell();
bError = !Ar->Close();
}
if (bError || WriteSize == 0)
{
UE_LOG(LogDerivedDataCache, Warning,
TEXT("%s: Failed to write to temp file %s when saving %s from '%.*s'. Error 0x%08x"),
*CachePath, *TempPath, *Path, DebugName.Len(), DebugName.GetData(), FPlatformMisc::GetLastError());
return false;
}
if (IFileManager::Get().FileSize(*TempPath) != WriteSize)
{
UE_LOG(LogDerivedDataCache, Warning,
TEXT("%s: Failed to write to temp file %s when saving %s from '%.*s'. ")
TEXT("File is %" INT64_FMT " bytes when %" INT64_FMT " bytes are expected."),
*CachePath, *TempPath, *Path, DebugName.Len(), DebugName.GetData(),
IFileManager::Get().FileSize(*TempPath), WriteSize);
return false;
}
if (!IFileManager::Get().Move(*Path, *TempPath,
bReplaceExisting, /*bEvenIfReadOnly*/ false, /*bAttributes*/ false, /*bDoNotRetryOrError*/ true))
{
UE_LOG(LogDerivedDataCache, Log,
TEXT("%s: Move collision when writing file %s from '%.*s'."),
*CachePath, *Path, DebugName.Len(), DebugName.GetData());
}
const double WriteDuration = FPlatformTime::Seconds() - StartTime;
const double WriteSpeed = WriteDuration > 0.001 ? (WriteSize / WriteDuration) / (1024.0 * 1024.0) : 0.0;
UE_LOG(LogDerivedDataCache, VeryVerbose,
TEXT("%s: Saved %s from '%.*s' (%" INT64_FMT " bytes, %.02f secs, %.2f MiB/s)"),
*CachePath, *Path, DebugName.Len(), DebugName.GetData(), WriteSize, WriteDuration, WriteSpeed);
return true;
}
bool FFileSystemCacheStore::LoadFile(
FStringBuilderBase& Path,
const FStringView DebugName,
const TFunctionRef<void (FArchive& Ar)> ReadFunction) const
{
check(IsUsable());
const double StartTime = FPlatformTime::Seconds();
int64 ReadSize = 0;
bool bError = false;
if (TUniquePtr<FArchive> Ar = OpenFile(Path, DebugName))
{
ReadFunction(*Ar);
ReadSize = Ar->Tell();
bError = !Ar->Close();
if (bError)
{
UE_LOG(LogDerivedDataCache, Display,
TEXT("%s: Failed to load file %s from '%.*s'."),
*CachePath, *Path, DebugName.Len(), DebugName.GetData());
}
}
const double ReadDuration = FPlatformTime::Seconds() - StartTime;
const double ReadSpeed = ReadDuration > 0.001 ? (ReadSize / ReadDuration) / (1024.0 * 1024.0) : 0.0;
if (!GIsBuildMachine && ReadDuration > 5.0)
{
// Slower than 0.5 MiB/s?
UE_CLOG(ReadSpeed < 0.5, LogDerivedDataCache, Warning,
TEXT("%s: Loading %s from '%.*s' is very slow (%.2f MiB/s); consider disabling this cache backend"),
*CachePath, *Path, DebugName.Len(), DebugName.GetData(), ReadSpeed);
}
UE_LOG(LogDerivedDataCache, VeryVerbose,
TEXT("%s: Loaded %s from '%.*s' (%" INT64_FMT " bytes, %.02f secs, %.2f MiB/s)"),
*CachePath, *Path, DebugName.Len(), DebugName.GetData(), ReadSize, ReadDuration, ReadSpeed);
if (bError && !bReadOnly)
{
IFileManager::Get().Delete(*Path, /*bRequireExists*/ false, /*bEvenReadOnly*/ false, /*bQuiet*/ true);
}
return !bError && ReadSize > 0;
}
TUniquePtr<FArchive> FFileSystemCacheStore::OpenFile(FStringBuilderBase& Path, const FStringView DebugName) const
{
// Check for existence before reading because it may update the modification time and avoid the
// file being deleted by a cache cleanup thread or process.
if (!FileExists(Path))
{
return nullptr;
}
return TUniquePtr<FArchive>(IFileManager::Get().CreateFileReader(*Path, FILEREAD_Silent));
}
bool FFileSystemCacheStore::FileExists(FStringBuilderBase& Path) const
{
const FDateTime TimeStamp = IFileManager::Get().GetTimeStamp(*Path);
if (TimeStamp == FDateTime::MinValue())
{
return false;
}
if (bTouch || (!bReadOnly && (FDateTime::UtcNow() - TimeStamp).GetTotalDays() > (DaysToDeleteUnusedFiles / 4)))
{
IFileManager::Get().SetTimeStamp(*Path, FDateTime::UtcNow());
}
return true;
}
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
ILegacyCacheStore* CreateFileSystemCacheStore(
const TCHAR* CachePath,
const TCHAR* Params,
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
const TCHAR* AccessLogPath,
ECacheStoreFlags& OutFlags)
{
TUniquePtr<FFileSystemCacheStore> Store(new FFileSystemCacheStore(CachePath, Params, AccessLogPath));
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
if (Store->IsUsable())
{
ECacheStoreFlags Flags = ECacheStoreFlags::Query;
Flags |= Store->IsWritable() ? ECacheStoreFlags::Store : ECacheStoreFlags::None;
Flags |= Store->GetSpeedClass() == EBackendSpeedClass::Local ? ECacheStoreFlags::Local : ECacheStoreFlags::Remote;
OutFlags = Flags;
return Store.Release();
}
return nullptr;
}
DDC: Enabled compression of legacy cache data - FileSystem, Http, Pak, S3 use the ValueWithLegacyFallback mode by default, which cause them to fall back to searching for uncompressed data if compressed data is not found. - FileSystem has been fixed to store up to 1 MiB of compressed data inline with the value package rather than separately in content-addressable storage. - Pak has been optimized to have GetChunks only load the required region of the requested value, rather than the whole value. - Pak has been changed to stop storing data inline in the record package, since it will end up in the same file anyway when stored separately. - Pak will upgrade the compressor and compression level when a compressed pak file is requested. Default cache compression uses Oodle Mermaid VeryFast and will upgrade to Oodle Kraken Optimal2. - Zen does not have compression enabled by default, pending deployment of a new version that stores compressed values to Horde Storage. - Added a missing request barrier when saving uncompressed data as compressed. Example reduction in file system cache size when cooking for Windows: - CitySample dropped from 66.5 GiB to 21.8 GiB. - Lyra dropped from 2.54 GiB to 672 MiB. - ShooterGame dropped from 1.21 GiB to 380 MiB. Example reduction in compressed pak file cache size when cooking for Windows: - CitySample dropped from 22.3 GiB to 18.5 GiB. - Lyra dropped from 691 MiB to 543 MiB. - ShooterGame dropped from 387 MiB to 313 MiB. #jira UE-134381 #preflight 620a703f583261b0a658e043, 620a6fb2803d9066e6805310, 620a733117632e948459b6af #lockdown Aurel.Cordonnier #rb Zousar.Shaker #ROBOMERGE-AUTHOR: devin.doucette #ROBOMERGE-SOURCE: CL 18983671 in //UE5/Release-5.0/... via CL 18983890 via CL 18984096 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589) [CL 18984126 by devin doucette in ue5-main branch]
2022-02-14 14:43:39 -05:00
} // UE::DerivedData