Commit Graph

354 Commits

Author SHA1 Message Date
PJ Kack
b0bc254d82 AsyncLoading 1&2: Refactor initial load to remove zen loader dependency on script object blob in order to support editor loading.
NotifyRegistrationEvent:
Remove all NRP_Started events since they add no value.
Move the NRP_Finished event for type NRT_Class from InitializePrivateStaticClass (Class.cpp) to UObjectLoadAllCompiledInDefaultProperties (UObjectBase.cpp) since this is where the outer registration function for the class is actually executed.
Add a new NRT_NoExportObject event in ConstructUPackage for top level noexport objects like UScriptStruct, UDelegateFunction and USparseDelegateFunction that are just part of the package and has no registration info.

AsyncLoader:
Move EDLBootNotificationManager from AsyncPackageLoader to AsyncLoading.
Add FEarlyRegistrationEventsRecorder to replay early events that occur before the loader is created.

AsyncLoading:
Ignore the new NRT_NoExportObject event.
Allow for objects to skip the NRP_Added and NRP_Started phases.

AsyncLoading2:
Remove LazyInitializeFromLoadPackage and the reading and parsing of the ScriptObjects binary blob.
Remove FindScriptImportObjectFromIndex/GFindExistingScriptImport that was dependent on the ScriptObject blob, instead all script objects are added to the global import store directly from the notification system callbacks.
Change GetUnresolvedCDOs logic to check for imported classes with missing or not-yet-initialized CDOs.
Add FAsyncPackageDesc2::ReferencerRequestId to let each package track its most recent load package request referencer.
Change ProcessPendingCDOs logic to avoid recursive reentrancy and to process the most relevant CDOs first, based on the new ReferencerRequestId.

Tests:
Lyra: Editor, Runtime EDL and Zen loader on Win64 and Console
ShooterGame: Editor, Runtime EDL and Zen loader on Win64 and Console
AncientGame: Editor, Runtime EDL and Zen loader on Win64
Other: Editor, CookedEditor, Runtime EDL and Zen loader on Win64 (client and server)

#jira none
#rb carlmagnus.nordin
#robomerge EngineMerge
#rnx
#preflight 62a84ba7cf54a658eeffc200

[CL 20643384 by PJ Kack in ue5-main branch]
2022-06-14 05:37:32 -04:00
paul chipchase
d802d4d4b2 EditorBulkdata now longer stores a EPackageSegment member since it is always set to EPackageSegment::Header
#rb Per.Larsson
#rnx
#preflight 629f530958032863438a0b30

- Storing the segment type as a member made the code would imply to the reader that it could be changed, even though in all paths it was being set to  EPackageSegment::Header. Removing the member and just hard coding the segment use should make the code easier to follow.
- Editor bulkdata always stores it's payload in the package trailer, which for now counts as the package header.
- The only deviation for this is the experimental feature that allows us to store the payloads in a sidecar file. This code path is not currently supported, but has been updated to use hardcoded EPackageSegment::PayloadSidecar.
- Given that PackageSegment was always set to EPackageSegment::Header we can easily remove any assert of if statement checking for that.

[CL 20553326 by paul chipchase in ue5-main branch]
2022-06-08 04:15:48 -04:00
Devin Doucette
c154ee9fbc DerivedData: Fixed the namespace of GetTypeHash
#jira UE-155447
#preflight 6298d94f5143e4aacd839eb9
#preflight 6298d9bf0360a10c349c2bf1
#rb none
#rnx

[CL 20471890 by Devin Doucette in ue5-main branch]
2022-06-02 13:14:45 -04:00
Per Larsson
a97300da1f Bulk Data - remove checking the global GEventDrivenLoader and add support for loading from optional packages
#rb CarlMagnus.Nordin
#jira none
#preflight 62986a87a07cbdb4285b3699

[CL 20469669 by Per Larsson in ue5-main branch]
2022-06-02 10:53:10 -04:00
Per Larsson
1a72e611cf Bulk data - fix bug when loading bulk data referenced from the original .uasset file
- added additional check that the bulk data is not loading from a referenced .uasset file when using the attached archive
- reverted back to set default Offset value to INDEX_NONE
- removed setting SizeOnDisk when transacting

#rb Paul.Chipchase
#jira UE-155428
#preflight 629759c4e809e387be1a8fc3

[CL 20451384 by Per Larsson in ue5-main branch]
2022-06-01 08:52:47 -04:00
Devin Doucette
87340081ea DerivedData: Added a new API in place of the use of IoDispatcher
#preflight 62961234e62c873b96c939d5
#rb Zousar.Shaker

[CL 20445536 by Devin Doucette in ue5-main branch]
2022-05-31 22:01:40 -04:00
Per Larsson
88f2de0b83 Removed disable optimization pragma and unused header
#rb none
#jira none
#preflight 629094a9f6668c14a3c758a1

[CL 20391200 by Per Larsson in ue5-main branch]
2022-05-27 05:24:20 -04:00
Per Larsson
c30e677d1b Merge BulkData 1&2
#rb Paul.Chipchase, PJ.Kack, CarlMagnus.Nordin
#jira none
#preflight 629085d14f63120d8e170977

###
This change attempts to merge the editor and the runtime version of bulk data, i.e. bulk data one and two.
The major difference between the two is the fact that the editor version supported element vice
serialization via inheritance. This has been complelety removed in the runtime version. In order
to mitigate this divergance a non-virtual base class has been extracted that forms the base
for the untyped and typed versions of bulk data.
The untyped version is only used in editor and will be deprecated. However this is a breaking change,
previously it was possible to inherit from FByteBulkData in editor builds.
Other differences between the two includes:
* IsBulkDataLoaded - returns true for bulk data 1 if an allocation has been made even if the size is zero
* StartStreaming - was removed in bulk data 2 and has been removed
* FlushAsyncLoading - bulk data 2 was busy waiting, now an event is used

All I/O related functionality has been extracted into BulkDataStreaming.cpp and is using
a  FBulkDataChunkId that is either a package path or a package ID.This could potentially
be extended to contain a cache key in development builds to support loading from DDC, i.e derived
data references.

[CL 20391050 by Per Larsson in ue5-main branch]
2022-05-27 04:31:58 -04:00
David Harvey
2a8d225bba fix for bulkdata template link errors in modular builds.
#jira UE-150227
#rnx
#preflight 62681f2fdd35c0d6cab45853
#rb Matt.Peters

[CL 19936402 by David Harvey in ue5-main branch]
2022-04-27 05:18:35 -04:00
Matt Peters
e6687c56ac BulkDataRegistry: Fix EditorBuildInputResolver to set Status to Error in the cases where a registered BulkData is found but it cannot find its payload.
Remove bValid from FMetaData and FData return structs; it is redundant with the RawHash/Buffer data already present in those structs.
#preflight 62680b42430b9997ebe0a46d
#rb Devin.Doucette
#rnx

[CL 19923039 by Matt Peters in ue5-main branch]
2022-04-26 12:47:22 -04:00
Matt Peters
657ada7efa BulkDataRegistry: Fix code that can create duplicate BulkData identifiers. When loading a duplicate from an existing package, give a warning and update the BulkData during Serialize. Add resaveondemand=bulkdataduplicates argument in resave packages to resave these existing packages.
#rb Zousar.Shaker, Paul.Chipchase
#rnx
#preflight 62616e8f6119a1a496a8fe90

[CL 19850627 by Matt Peters in ue5-main branch]
2022-04-21 12:03:36 -04:00
Francis Hurteau
3da268ce6d Modified FlushTree to FlushRequest and being a simple wrapper around a package loading request
Automatically propagate explicit package load request association to a package dependencies which allow flush request to process only related packages while skipping others
This should also allow FlushAsyncLoading to be re-entrant down the line
Suppress the transaction system while ticking async loading in the main thread
Added an editor config to enabled the async loading thread. Currently non functional

#rb CarlMagnus.Nordin
#preflight 623e0081a67e4e1ab70598d7

[CL 19626072 by Francis Hurteau in ue5-main branch]
2022-04-05 11:29:57 -04:00
johan torp
5c2624134d Optimize AssetTools AdvancedCopyPackages and add batch versions of ForceReplaceReferences and ConsolidateObjects
331s -> 0.28s to consolidate objects when cloning a small shooting range map

#rb Robert.Manuszewski,Chris.Gagnon,Francis.Hurteau,Jamie.Dale,JeanLuc.Corenthin,Phillip.Kavan

#ROBOMERGE-AUTHOR: johan.torp
#ROBOMERGE-SOURCE: CL 19507095 via CL 19507103 via CL 19507108 via CL 19507110
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19514683 by johan torp in ue5-main branch]
2022-03-25 12:41:16 -04:00
Steve Robb
897dd170ab Replacement of DEPRECATED_MACRO with UE_DEPRECATED_MACRO.
#rb devin.doucette
#jira none
#preflight 623b225a7b69b01ec16118a7

[CL 19480377 by Steve Robb in ue5-main branch]
2022-03-23 12:07:25 -04:00
Devin Doucette
ddff894d31 DerivedData: Added the framework for serializing derived data references to cooked packages
#preflight 6234fe538a298a014fc20227
#rb Matt.Peters
#rnx

[CL 19442331 by Devin Doucette in ue5-main branch]
2022-03-18 18:39:18 -04:00
steve robb
0e1e8c13fb Removal of unused CopyFormatted*() and *_TextOnly() functions.
#rb graeme.thornton
#preflight 6229fae77341dd1ecf70f0a0

#ROBOMERGE-OWNER: marc.audy
#ROBOMERGE-AUTHOR: steve.robb
#ROBOMERGE-SOURCE: CL 19335163 via CL 19339363 via CL 19345711 via CL 19350978 via CL 19351029
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19351730 by steve robb in ue5-main branch]
2022-03-11 04:01:36 -05:00
robert millar
5811293e2a Add TargetRules.bFNameOutlineNumber as an option to reduce the size of FName by 4 bytes by storing the number in the name table.
Adds a define UE_FNAME_OUTLINE_NUMBER.
Removes of FName, FMinimalName from memory image support. Adds of FMemoryImageName.
Removal of FMinimalName operator<<, all fields made private, size made variable.
All fields of FScriptName made private.
Added console commands for dumping numbered/unnumbered names and stats.

#rb johan.torp

#ROBOMERGE-OWNER: robert.millar
#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 19058026 via CL 19058611 via CL 19058656 via CL 19061727 via CL 19061740 via CL 19064047
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v918-19018356)

[CL 19066701 by robert millar in ue5-main branch]
2022-02-21 02:35:48 -05:00
robert manuszewski
c36e03d5e3 do clause support
#rb Andrew.Scheidecker
#preflight 620f3a108863746a104d6c36

#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 19047989 via CL 19048186 via CL 19048197 via CL 19048203 via CL 19049414
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v918-19018356)

[CL 19065767 by robert manuszewski in ue5-main branch]
2022-02-21 00:33:13 -05:00
Matt Peters
7645a7dd38 OnEndLoadPackage: Change the arguments to a context object to avoid future need to change the function prototype. Add RecursiveDepth and bSynchronous arguments so that callers can take action only on the top-level EndLoadPackage if necessary.
BulkDataRegistry: Wait until the top-level EndLoadPackage, and wait until after OnEnginePostInit, before deleting bulkdatasize records. Deleting them sooner can make them be deleted before they're used by the EditorDomain if the EditorDomain's TrySavePackage triggers package loading and a recursive OnEndLoadPackage.
#rb Zousar.Shaker
#rnx
#preflight 620f00e7e8554a6f64f74d5a

[CL 19046732 by Matt Peters in ue5-main branch]
2022-02-17 22:02:59 -05:00
Matt Peters
6dcd01dd70 EditorBulkData: Add an Owner argument for UpdatePayload, and supply it from FTextureSource, so we can know ahead of the save which package an in-memory bulk data will be saved under.
#rb Paul.Chipchase
#rnx
#preflight 620efcb4c602491fb81538f8

[CL 19046506 by Matt Peters in ue5-main branch]
2022-02-17 21:12:20 -05:00
geoff evans
1fc76c15d9 Defensive Crash Fix for when ReplaceWith UStruct pointer is null
#rnx
#rb tbd
#jira UE-142833
#preflight 620e855ae8554a6f64e734e1

[CL 19038296 by geoff evans in ue5-main branch]
2022-02-17 13:48:49 -05:00
jeanfrancois dube
0d527b196f Added support for override package in package text serialization:
- Text format now includes import and export tables instead of discovering import while serializating exports. This is required to have enough information about objects with an override package that have their Outer in another package.
- UObject Json formatters now export import/export indices instead of relying on the objects full paths, which index into the exported import/export tables.
- Merged code to serialize UObject* and FObjectPtr in Json formatters to avoid code duplication.

#rb francis.hurteau, steve.robb
#preflight 61fd34030a43b689e1750d28
#rnx

#ROBOMERGE-AUTHOR: jeanfrancois.dube
#ROBOMERGE-SOURCE: CL 18978952 via CL 18980785 via CL 18981531 via CL 18981661 via CL 18992713 via CL 18993052
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18997360 by jeanfrancois dube in ue5-main branch]
2022-02-15 11:35:28 -05:00
paul chipchase
05d81ee7f3 EditorBulkData and the virtualization system now use FIoHash directly and FPayloadId is removed
#rb Per.Larsson, Devin.Doucette
#jira UE-133497
#rnx
#preflight 61f835491c5ac5523462810a

- A lot of files have been touched but most of this is changing FPayload::IsValid to !FIoHash::IsZero, the main changes are in EditorBulkData/EditorBulkDataTests
- The only difference between FPayloadId and FIoHash is that the former considered the hash of an invalid or empty buffer to be 'invalid' too where as FIoHash would return a valid hash
-- To keep behaviour the same, we only hash payloads in EditorBulkData using a utility method ::HashBuffer which will not hash empty or invalid payloads and return a default FIoHash instead.
-- Unit tests have been extended to prove that the behaviour has not changed.

#ROBOMERGE-AUTHOR: paul.chipchase
#ROBOMERGE-SOURCE: CL 18806362 in //UE5/Release-5.0/... via CL 18808527 via CL 18821790
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18822154 by paul chipchase in ue5-main branch]
2022-02-02 02:21:24 -05:00
phillip kavan
340513789d Ensure that the FArchiveReplaceObjectAndStructPropertyRef ctor invokes the default serialization path with the right vtable.
#jira MH-3535, MH-4936
#rb Robert.Manuszewski
#preflight 61f43da2241aeec8655ac928

#ROBOMERGE-AUTHOR: phillip.kavan
#ROBOMERGE-SOURCE: CL 18777281 in //UE5/Release-5.0/... via CL 18778405 via CL 18778932
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18778969 by phillip kavan in ue5-main branch]
2022-01-28 16:45:51 -05:00
carlmagnus nordin
a201cd8e12 Fixed up uses of FIoDispatcher::IsInitialized() so that they work correctly also when there's a mix of cooked packages in iostore and uncooked packages on disk
FIoDispatcher::IsInitialized() will now return true if it exists (which is almost always)
Renamed FArchive::IsUsingEventDrivenLoader() to IsLoadingFromCookedPackage and based it on the PKG_Cooked flag
#rnx
#rb pj.kack
#preflight 61f3ab6f74510448a6740570

#ROBOMERGE-AUTHOR: carlmagnus.nordin
#ROBOMERGE-SOURCE: CL 18769198 in //UE5/Release-5.0/... via CL 18769204 via CL 18769272
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18769277 by carlmagnus nordin in ue5-main branch]
2022-01-28 04:29:58 -05:00