Commit Graph

441 Commits

Author SHA1 Message Date
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
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
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
paul chipchase
6e8473a9dd Delete the deprecated header BulkData2.h as it has not been in use for several releases.
#rb Per.Larsson
#rnx

[CL 26841133 by paul chipchase in ue5-main branch]
2023-08-04 04:03:08 -04:00
paul chipchase
fb7da6ad42 Improve the documentation for EBulkDataFlags to help people understand how to use them.
#rb Per.Larsson
#rnx

[CL 26840243 by paul chipchase in ue5-main branch]
2023-08-04 02:56:11 -04:00
neil henning
43a5d99013 Backout CL 26567699 because its causing an Android clang ICE.
[CL 26572214 by neil henning in ue5-main branch]
2023-07-25 10:05:36 -04:00
danny couture
8d027a4e3c Implement more granular progress tracking of async package loading in zenloader
- Allows callees of LoadPackageAsync to be notified when serialization is done so they can schedule the next load right from the async loading thread without having to pay for a round-trip to the game-thread
  - Add UnattendedAsyncLoading test as a sample of how this feature can be used
  - Add thread-safety tests for LoadPackageAsync
  - Can be exercised using a cooked client build with the following command-line
        -ExecCmds="Automation RunTest System.Engine.Loading.UnattendedAsyncLoadingTest+System.Engine.Loading.ThreadSafeAsyncLoadingTest;Quit"

#jira UE-188744
#rb Francis.Hurteau

[CL 26569151 by danny couture in ue5-main branch]
2023-07-25 07:36:40 -04:00
neil henning
55d6b8bfbb Add back the gnu::alloc_align change to explain to clang the alignment of allocated pointers.
#rb Devin.Doucette

[CL 26567709 by neil henning in ue5-main branch]
2023-07-25 03:45:51 -04:00
matt peters
d0e927d0f0 Cooker: DiffWriterArchive: Fix a bug after refactor with FArchiveStackTraceIgnoreScope no longer being respected. Change DiffWriterArchive to report all messages to a message callback rather than logging them directly. Future users of DiffWriterArchive will store the messages rather than logging them.
#rb Zousar.Shaker
#rnx

[CL 26324673 by matt peters in ue5-main branch]
2023-06-29 15:40:21 -04:00
matt peters
3c2682f374 FArchiveStackTrace: Deprecate the public interface and move it into a private helper class of DiffPackageWriter.
#rb Zousar.Shaker
#rnx

[CL 26269033 by matt peters in ue5-main branch]
2023-06-27 16:13:59 -04:00
robert millar
94b709b249 Propagate set of request ids for FlushAsyncLoading into inner loops.
#rb francis.hurteau,danny.couture,pj.kack

[CL 26106812 by robert millar in ue5-main branch]
2023-06-19 17:47:11 -04:00
ben zeigler
77666d67e5 CoreUObject deprecation cleanup pass to remove functions and classes deprecated before 5.0
This change does not remove things like PackageGuid that are still used in some cases
#rb matt.peters

[CL 26096036 by ben zeigler in ue5-main branch]
2023-06-19 13:29:53 -04:00
henrik karlsson
e7a889441d [Core]
* Moved dllexport from type to methods/staticvar. This improves compile times, memory and performance in dll builds

#rb

[CL 26081848 by henrik karlsson in ue5-main branch]
2023-06-17 15:59:58 -04:00
henrik karlsson
c90d3cb093 [CoreUObject]
* Moved dll export from types to methods/staticvar

#rb none

[CL 25910241 by henrik karlsson in ue5-main branch]
2023-06-10 01:58:50 -04:00
joe pribele
9728870797 changed PackageHarvester and SavePackage to use TObjectPtr for future work on Lazy Load
https://p4-swarm.epicgames.net/reviews/25856160

#rb Francis.Hurteau

[CL 25877925 by joe pribele in ue5-main branch]
2023-06-08 14:33:34 -04:00
henrik karlsson
f027bfa856 [Core]
* Fixed compile errors when compiling .h files in isolation

#rb none

[CL 25865668 by henrik karlsson in ue5-main branch]
2023-06-08 02:30:27 -04:00
zousar shaker
b0d5721dde Initial implementation of DiffOnly mode for ZenServer as Cooked Output Store. Lacking detailed header diffing, but stubbed in for future addition. When using ZenServer as Cooked Output Store the packages use the ZenPackageSummary header format instead of the PackageFileSummary header format. This is how data is stored in ZenServer and the format it is when fetched. Data produced in process is transformed into this format ahead of diffing.
The code for parsing a view of the ZenPackageSummary has been extracted from AsyncLoading2.cpp into a private h/cpp and is possible to use from the header diffing code when printing out detailed diffs, but is not used yet.

#rb matt.peters
#rb pj.kack
#jira UE-175237

[CL 25549055 by zousar shaker in ue5-main branch]
2023-05-19 14:43:02 -04:00
paul chipchase
4335d78604 Deprecate four FBulkData flags that no longer serve any useful purposes: BULKDATA_Unused, BULKDATA_ForceStreamPayload, BULKDATA_SerializeCompressedBitWindow and BULKDATA_BadDataVersion
#rb Per.Larsson
#jira none
#preflight 64674758c571db717b037aaf

- BULKDATA_ForceStreamPayload and BULKDATA_SerializeCompressedBitWindow have not done anything for sometime.
- BULKDATA_BadDataVersion was a bug added some years ago which could've caused DDC pollution. Since then the DDC keys for the problematic assets have been changed several times and there should no longer be any danger.
- BULKDATA_Unused technically works but is unused and there does not seem to be any demand for it. This flag will probably remain deprecated for longer than the others to check for any valid external feedback.

[CL 25541994 by paul chipchase in ue5-main branch]
2023-05-19 06:27:58 -04:00
paul chipchase
b7eae46d3a Make FEditorBulkData thread safe.
#rb Danny.Couture, Devin.Doucette, Per.Larsson
#jira UE-140944
#preflight 645e2c76b71b8186aaca29db


*** FLinkerLoad
- Attaching/detaching both FBulkData and FEditorBulkdata to a FLinkerLoad should now be thread safe.
- Note that this does NOT fix the long standing issue when a FPackage is GCed before some of the UObjects (assets) inside of that package, which causes any remaining bulkdata to be detached (and unable to load off disk) without forcing payloads into memory. This will be addressed as its own work item.
-- FEditorBulkData can still attempt to load its payload from a package after detachment as a fall back measure that is preferable to a crash.

*** FEditorBulkData
- Forced to use FRecursiveMutex at the moment some methods that need locking make calls into the bulkdata registry which can make calls back to the calling bulkdata object ending up with recursive locking, at least for now.
- This might look like a lot of locks being introduced, but FEditorBulkData methods are called relatively infrequently., in a test project with a semi large amount of data (~16GB) cooking from a cold DDC benchmarked at roughly the same wall time before/after these changes.
- Added a comment block to the header describing the thread safety expectations of the class.
- Made the class final as we really don't want to deal with inherited bulkdata types as we did with the old system.
- Since FLinkerLoad attachment/detachment is now thread safe we can detach from any pre-existing AttachedAr when running the assignment operator and attach to the AttachedAr of the provided bulkdata. This means copied/assigned bulkdata do not need to force their payloads into memory.
- Cleaned up some comments in the header.

[CL 25485916 by paul chipchase in ue5-main branch]
2023-05-16 02:28:26 -04:00
robert millar
a8278fe991 Optimize PIE soft object path fixups.
- FSoftObjectPath properties report as containing weak object references for serializers.
- Mark PIE ID fixup archive as ArIsObjectReferenceCollector.

#rb francis.hurteau

[CL 25415885 by robert millar in ue5-main branch]
2023-05-10 16:30:59 -04:00
chris tchou
1eab09f9c7 Landscape Texture Mip Storage Provider, give us an option to customize how Landscape Texture data is stored.
Currently, Landscape will only apply the new storage provider to it's heightmaps at cook time, when it sees that the landscape has been flagged to use the new compressed storage path (enabled under Landscape -> Advanced), and only for Windows platforms (to be expanded as we test other platforms).

The compressed storage path option on the landscape is hidden by default, and can be made visible via CVAR ("landscape.ShowCompressHeightMapsOption")

Makes use of a new All Mip Provider interface to Texture2Ds, that expands on the existing Mip Data Provider (that only supported providing streaming mips).
The new interface assumes you want to completely override the Texture2D mip data.

When Texture2D sees that it has an All Mip Provider, it will skip serializing it's own heavyweight mip data during cook, as it assumes the provider will take care of providing all mip data.

The majority of the implementation is in LandscapeTextureStorageProvider, which implements the AllMipProvider that can store landscape heightmaps in a custom compressed format.  Each mip's height data is stored using delta encoding, and normals are reconstructed.

#rb jonathan.bard, jian.ru
#jira UE-180654
#preflight 64541acf6c35ad81e61890cc
#preflight 64542713fd4b8f4e0d9a2ce9
#preflight 6459378bfd4b8f4e0dc206d2

[CL 25381191 by chris tchou in ue5-main branch]
2023-05-08 19:51:44 -04:00
paul chipchase
d91ff399b2 Add an overload to FEditorBulkData::UpdatePayload that takes a FCompressedBuffer directly
#rb Per.Larsson
#jira none
#rnx
#preflight 6453ce50d863ba2621851360

- FCompressedBuffer will calculate the FIoHash of its data and FEditorBulkData can take the hash from there rather than calculating one itself. If you create one with no compression codec set you could use that to control when the hashing takes place before passing the data to FEditorBulkData.
- In the future we might change FEditorBulkData to hold its data in a FCompressedBuffer, allowing us to avoid decompressing the payload unless someone actually asks for it in uncompressed format.
- Added some unit tests

[CL 25352762 by paul chipchase in ue5-main branch]
2023-05-05 08:27:38 -04:00
paul chipchase
f684fc8020 Do not treat FIoHash as a rvalue when updating a payload as it doens't actually do anything.
#rb trivial
#jira none
#rnx
#preflight 64536fc1743c256cd6e71b28

[CL 25332030 by paul chipchase in ue5-main branch]
2023-05-04 04:59:21 -04:00