Commit Graph

1179 Commits

Author SHA1 Message Date
danny couture
9deed45ff0 [ZenLoader]
- Simplify partial loading logic which is now only applied during flush if required
  - During partial load, only remove the exact RequestID being flushed so that other requestid can be flushed independently
  - Add missing timeout handling for postloads
  - Add missing support to run linkerload thread-safe postloads on async loading thread
  - Add unittest to make sure timeout is respected for postloads
  - Add unittest to make sure behavior of IsReadyForAsyncPostLoad is respected until a flush occurs
  - Add unittest for syncloads coming from thread-safe postloads and validate partial loading behavior
  - Make unittest run in editor only as they rely on saving package before reloading them
  - Refactor unittest for better reuse

#rb Francis.Hurteau

[CL 28799225 by danny couture in ue5-main branch]
2023-10-16 11:26:11 -04:00
KristofMorva
a75f380b2a Fix warning "Failed to find object 'Object None.None'" when deserializing FObjectAndNameAsStringProxyArchive.
Should also speed up loading a buffer with a lot of NULL objects considerably (see PR #6875).

#jira UE-92396
#PR 6875
#rb robert.millar

#ushell-cherrypick of 28497640 by kristof.morva1

[CL 28502883 by KristofMorva in ue5-main branch]
2023-10-05 12:09:52 -04:00
danny couture
fa346f675c [ZenLoader] Make static analyzer happy
#rb Francis.Hurteau

[CL 28463907 by danny couture in ue5-main branch]
2023-10-04 13:29:23 -04:00
graeme thornton
4547c6ceef Downgrading a warning to an error to unblock development while a proper fix is investigated
#rnx
[FYI] danny.couture

[CL 28433079 by graeme thornton in ue5-main branch]
2023-10-03 17:16:40 -04:00
danny couture
d40076e978 [ZenLoader]
- Add partial flush support from loading thread
 - Fix the ConvertFromType allowing to load the softobjectptr during its conversion to hardref even when called from ALT and zenloader is active
 - Add unittest to exercise softobjectptr to hardref conversion in ConvertFromType
 - Move asserts preventing flush from loading thread directly into legacy loader
 - Added a few veryverbose logs that were missing for linker load
 - Fix partial loading being applied to sync calls coming from a postload, preventing the object to be fully postloaded before finishing the sync load

#rb Francis.Hurteau

[CL 28373045 by danny couture in ue5-main branch]
2023-10-02 07:51:24 -04:00
andriy tylychko
d938d346bd fixed crash in AsyncFileHandle with unimplemented EnsureCompletion()
#jira UE-195894
#rb danny.couture, francis.hurteau

[CL 28313586 by andriy tylychko in ue5-main branch]
2023-09-28 07:09:26 -04:00
danny couture
fd1c551986 [ZenLoader]
- Further improve the partial load logic by avoiding some operations where possible
 - Also add some very verbose logging that can help identifying load ordering issues

#rnx
#rb Francis.Hurteau

[CL 28312996 by danny couture in ue5-main branch]
2023-09-28 06:41:49 -04:00
danny couture
68be86ed63 [ZenLoader] Fix export bundle being picked up recursively during a flush caused by a synchronous load invoked while running a previous export bundle of the same package
#rnx
#rb Francis.Hurteau

[CL 28274954 by danny couture in ue5-main branch]
2023-09-27 11:16:23 -04:00
danny couture
98cf4f14e5 [ZenLoader] Fix recursive loading behavior in zenloader by following more closely how legacy loading works
- Add a new partial loading mode where flushing the requestID will exit after serialization is done (after exportdone but before postload)
  - Automatically opt-in partial loading when an explicit load is called recursively from another load (treated as an import)
  - During recursive loading, attach postload of the recursive load to the caller's postload
  - Add loading unit tests to validate the new behavior for zenloader
  - Add a way to detect which loader is currently active to run unit tests on zenloader only

#rnx
#jira UE-190649
#rb Francis.Hurteau

[CL 28227792 by danny couture in ue5-main branch]
2023-09-26 10:26:04 -04:00
bob tellez
c00095c628 [Backout] - CL28184258
[FYI] danny.couture
Original CL Desc
-----------------------------------------------------------------
[ZenLoader] Fix recursive loading behavior in zenloader by following more closely how legacy loading works
  - Add a new partial loading mode where flushing the requestID will exit after serialization is done (after exportdone but before postload)
  - Automatically opt-in partial loading when an explicit load is called recursively from another load (treated as an import)
  - During recursive loading, attach postload of the recursive load to the caller's postload
  - Add loading unit tests to validate the new behavior for zenloader
  - Add a way to detect which loader is currently active to run unit tests on zenloader only

#rnx
#jira UE-190649
#rb Francis.Hurteau

[CL 28214800 by bob tellez in ue5-main branch]
2023-09-25 22:04:05 -04:00
danny couture
f54ea28898 [ZenLoader] Fix recursive loading behavior in zenloader by following more closely how legacy loading works
- Add a new partial loading mode where flushing the requestID will exit after serialization is done (after exportdone but before postload)
  - Automatically opt-in partial loading when an explicit load is called recursively from another load (treated as an import)
  - During recursive loading, attach postload of the recursive load to the caller's postload
  - Add loading unit tests to validate the new behavior for zenloader
  - Add a way to detect which loader is currently active to run unit tests on zenloader only

#rnx
#jira UE-190649
#rb Francis.Hurteau

[CL 28184263 by danny couture in ue5-main branch]
2023-09-25 08:06:46 -04:00
richard malo
701043238b FAsyncPackage and FAsyncLoadingThread2 CallCompletionCallbacks now properly sets GPlayInEditorID with associated package request PIEInstanceID using FPlayInEditorLoadingScope.
#rb danny.couture, francis.hurteau

[CL 27993285 by richard malo in ue5-main branch]
2023-09-19 09:25:34 -04:00
danny couture
9128d06649 Remove sleep from zenloader flushrequest
- Improves performance by waking up GT as soon as the async loading thread needs something processed on it
  - Improves performance by only entering the sleeping part when the GT is actually idle instead of all the time
  - Reduce power consumption and contention between GT/ALT by favoring longer sleep instead of spinning on platform not supporting sub milliseconds sleeps

#jira UE-90979
#rb PJ.Kack

[CL 27954710 by danny couture in ue5-main branch]
2023-09-18 08:19:45 -04:00
ionut matasaru
5c572b8810 LoadTimeTrace: Fixed TRACE_LOADTIME_ASYNC_PACKAGE_LINKER_ASSOCIATION macro not using correctly the Linker parameter.
#rb trivial

[CL 27951196 by ionut matasaru in ue5-main branch]
2023-09-18 01:58:28 -04:00
josh adams
aeb5cb1347 - Restoring a backout after fixing the issue that causes the backout
[Backout] - CL27745134
[FYI] stan.hormell
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL27731288 - CIS / Build Errors
[FYI] Josh.Adams
Original CL Desc
-----------------------------------------------------------------
- Deprecated GetSectionPrivate and FindOrAddSection, and accessors in FConfigFile that could return a non-const FConfigSection (this is so we can track modifications to config values)
- Added AddToSection, RemoveKeyFromSection, etc to replace directly accessing a FConfigSection
- Fixed up Epic code for the deprecations (at least the majority, some projects that aren't built by Horde presubmit may have some that we will address going forward)
#jira UE-194955
#rb david.harvey and various others

[CL 27923017 by josh adams in ue5-main branch]
2023-09-15 13:39:02 -04:00
jurre debaare
aae72407f2 Standalone builds always use raw transforms
#jira UE-193896
#fix remove GIsEditor==true limitation for FCoreUObjectDelegates::OnEndLoadPackage broadcasting
#rb Matt.Peters

[CL 27911905 by jurre debaare in ue5-main branch]
2023-09-15 08:04:24 -04:00
matt peters
a77af3f0e8 ZenStore structures: expose structures to interpret zenstore headers for use in -diffonly cooks.
PackageStoreOptimizer: Expose a static version of FindScriptObject and functions for calculating PublicExportHash.
FNameMap: Add a foreach iterator to provide a list of all data in the struct.
ZenPackageHeader: Move from private to internal, add a constructor that returns an error string rather than fatally asserting.
#rb Per.Larsson
#rnx

[CL 27855318 by matt peters in ue5-main branch]
2023-09-13 18:11:20 -04:00
stan hormell
37bad2d07b [Backout] - CL27731288 - CIS / Build Errors
[FYI] Josh.Adams
Original CL Desc
-----------------------------------------------------------------
- Deprecated GetSectionPrivate and FindOrAddSection, and accessors in FConfigFile that could return a non-const FConfigSection (this is so we can track modifications to config values)
- Added AddToSection, RemoveKeyFromSection, etc to replace directly accessing a FConfigSection
- Fixed up Epic code for the deprecations (at least the majority, some projects that aren't built by Horde presubmit may have some that we will address going forward)
#jira UE-194955
#rb david.harvey and various others

[CL 27745141 by stan hormell in ue5-main branch]
2023-09-10 22:58:21 -04:00
josh adams
a8a9a0b759 - Deprecated GetSectionPrivate and FindOrAddSection, and accessors in FConfigFile that could return a non-const FConfigSection (this is so we can track modifications to config values)
- Added AddToSection, RemoveKeyFromSection, etc to replace directly accessing a FConfigSection
- Fixed up Epic code for the deprecations (at least the majority, some projects that aren't built by Horde presubmit may have some that we will address going forward)
#jira UE-194955
#rb david.harvey and various others

[CL 27731364 by josh adams in ue5-main branch]
2023-09-08 17:58:55 -04:00
Matt Peters
e69f086889 CookOnTheFly2: Remove duplicate warnings for missing packages requested multiple times, and remove warnings for editor-only packages that are found due to unsolicited loads on the cooker but were not requested by the client. Add packagename to warnings about missing packages.
#jira UE-184879
#rnx
#rb Dan.Englebrecht

[CL 27593637 by Matt Peters in ue5-main branch]
2023-09-05 08:41:53 -04:00
louisphilippe seguin
36c722f3c4 Fix wrong printf parameters in checkf & ensuremsgf found in engine code
#rb Fabian.Giesen, Kirill.Zorin
#rnx

[CL 27519547 by louisphilippe seguin in ue5-main branch]
2023-08-31 08:56:30 -04:00
tomasz obrebski
9e09fa9069 Zen header alignment
#jira UE-179443
#rb pj.kack

[CL 27440335 by tomasz obrebski in ue5-main branch]
2023-08-29 07:38:16 -04:00
per larsson
600eac785a IAS - allow reading from file cache when HTTP streaming is disabled
#rb Paul.Chipchase
#rnx

## Background
The on demand I/O backend doesn't store complete/hole I/O chunks in the local file cache, only the parts that has been requested by the game. There are currently
two ways for querying the I/O backend(s) whether a specific chunk exists or not. The primary one used by the texture streaming system is DoesChunkExist(ChunkId). This
method is called via FBulkData::DoesExist(). In order to be able to fufill this query for partially cached I/O chunks, two additional methods has been
added to the I/O dispatcher API. Currently private, only accessible by FBulkData.
 - DoesChunkExist(ChunkId, OffsetAndLength)
 - GetSizeForChunk(ChunkId, OffsetAndLength)

The method GetSizeForChunk is only ever used by the IAsyncFileHandle wrapper for bulk data and is a tricky compromise. The file handle
represents the hole chunk/file where the bulk data instance resides, i.e. .ubulk, .uptnl etc. Calling get file size on this file handle should return
the size for the entire chunk/file. It is technically possible to read outside of the bulk data range and this would result in the read request
coming back as failed, since the resolve function in the I/O backend wouldn't be found. The file handle wrapper for bulk data is currently only used
by virtual textures and should be deprecated in the long run.

[CL 27337787 by per larsson in ue5-main branch]
2023-08-24 07:52:54 -04:00
matt peters
012a4022ab BulkDataRegistry: Disable in commandlets other than the cook commandlet. Those commandlets do not need to query its api, and they do not tick it so if it is enabled it grows memory forever without releasing it.
#rb Zousar.Shaker
#rnx

[CL 27309648 by matt peters in ue5-main branch]
2023-08-23 12:24:05 -04:00
Matt Peters
7747519417 Cooker: DiffOnly: fix mismatched alloc/malloc calls on the previousbytes read from disk. They were being allocated with FMemory::Malloc but freed with delete. This mismatch is detected by ASAN and can cause crashes.
#rb Zousar.Shaker
#rnx

[CL 27250322 by Matt Peters in ue5-main branch]
2023-08-21 15:35:02 -04:00