Commit Graph

472 Commits

Author SHA1 Message Date
paul chipchase
6e7f255861 Add a new feature allowing bulkdata cooked output to be split into smaller files to help with data organization and patching efforts.
#rb Per.Larsson, Pere.Rifa
#jira UE-222974

- To enable the feature call FBulkData::SetCookedIndex with a FBulkDataCookedIndex set to a value between 1 - 255. Zero is currently reserved as the default/off state and can be quickly accessed via FBulkDataCookedIndex::Default.
-- Note that we might change the default value in the future, the main reason to keep it as zero for now is that it means FChunkId values will remain unchanged for bulkdata files not using the feature.
- When a bulkdata object has a cooked index it will output to a file with that value based on the following format  <packagename>.CookedIndex.<extension> so a normal bulkdata payload with a cooked index of 5 would end up writing to <packagename>.005.ubulk.
-- This allows the calling systems to control which bulkdata payloads go to which sub files.
- We currently do not support memory mapped payloads or payloads with the duplicate non optional flags. Support and testing for this will be added later.
- Tested saving/editing/loading packages with bulkdata in the editor (vector fields), build/cook/run normal builds, build/cook/run with feature enabled then running the new code with data produced from non modified code and running non modified exe on data generated with the new code.

### IPackageResourceManager
- Added overloads for most methods that take EPackageSegment that also take a FBulkDataCookedIndex and deprecated the older versions.
- Not all methods have been ported over, just the ones I could test but the rest will need the same treatment at some point.

### FLinkerSave
- Now stores each set of bulkdata, optional bulkdata and memory mapped payloads in separate archives, one per cooked index.
- Added a method ::HasCookedIndexBulkData that returns if any of the normal bulkdata payloads contain a non default cooked index. This is used for some paranoid checks when saving packages to the workspace domain.

[CL 36754477 by paul chipchase in 5.5 branch]
2024-10-01 18:59:56 -04:00
henry falconer
22e38d4c50 FBulkMetaData::FromSerialized now overwrites all fields in its output object, to ensure any stale state is cleared.
Also updated some checks in that function to ensure that zero size bulk data is loaded correctly.

This fixes a bug where loading an FBulkData with a zero element count wouldn't update the Size field, so if the same FBulkData had previously been used to load data with a non-zero size, the non-zero value for Size would incorrectly persist after loading the zero size data. I've added a regression test to the existing suite to prove that this case is now handled correctly.

#tests Ran FoundationTests and went through bug repro in editor
#rb paul.chipchase

[CL 35919288 by henry falconer in ue5-main branch]
2024-08-30 04:35:35 -04:00
matt peters
6abaa54aa1 ArchiveSavePackageData: Fix deprecation warning: Replace use of deprecated SetCookData with new SetSavePackageData.
#rnx

[CL 35905786 by matt peters in ue5-main branch]
2024-08-29 16:25:57 -04:00
matt peters
a59dac03d0 ArchiveSavePackageDataBuffer: Suppress static analysis warning.
#rnx

[CL 35901603 by matt peters in ue5-main branch]
2024-08-29 14:23:32 -04:00
matt peters
ae7cf32fb4 SavePackage/Cooke/FArchiver: Add FArchiveSavePackageData to FArchive, giving Serialize functions access to FObjectSaveContextData. This is necessary to allow structs (which do not have a PreSave function) the ability to add manage dependencies in editor saves and build dependencies in cook saves.
#rnx
#rb Francis.Hurteau

[CL 35900056 by matt peters in ue5-main branch]
2024-08-29 13:14:10 -04:00
henrik karlsson
8cec69af73 Fixed linker errors on some console platform when building modular builds. Fixes involves moving ctor/dtor and friends from header to cpp and dll import/export
[CL 35712433 by henrik karlsson in ue5-main branch]
2024-08-21 14:16:50 -04:00
paul chipchase
f4f1570e78 Add missing boilerplate code
#rb Per.Larsson
#rnx

[CL 35049566 by paul chipchase in ue5-main branch]
2024-07-24 05:37:47 -04:00
paul chipchase
5826dbb555 Add a structure for locking a FBulkData object in a given scope.
#rb Per.Larsson
#rnx

- Code was provided by a third party on UDN who waived their rights to the code and turned down credit.
- Minor bug fixing/cleanup has been applied.

[CL 35049306 by paul chipchase in ue5-main branch]
2024-07-24 05:08:51 -04:00
paul chipchase
61ebafdd07 Remove unused header that was deprecated in UE 5.1
#rb Per.Larsson
#rnx

[CL 34807668 by paul chipchase in ue5-main branch]
2024-07-15 03:00:42 -04:00
paul chipchase
9d38539cb6 Clean up FBulkData deprecations
#rb Per.Larsson
#rnx

- Removed all code marked as deprecated for UE 5.2 and earlier.
- This removes the old async streaming api, which allowed the user to request that the bulkdata payload start streaming from disk and be stored internally by the bulkdata object to be used at some point in the future via a call to FBulkData::StartAsyncLoading which has been deprecated for a number of engine releases.
- Seems we missed deprecating ::IsAsyncLoadingComplete and it's associated flag 'EBulkDataFlags::BULKDATA_HasAsyncReadPending' when deprecating ::StartAsyncLoad so marked it for deprecation now along with code comments explaining why it's not used anymore.
- Since we are removing ::StartAsyncLoad, we can completely remove UE::BulkData::Private::StartAsyncLoad as it was that only place it was being used.
- ::FlushAsyncLoading only provided functionality if 'BULKDATA_HasAsyncReadPending' was set, which would only occur if ::StartAsyncLoad was called. Since we are not removing ::StartAsyncLoad we can remove the implementation of ::FlushAsyncLoading and deprecate it.
-- In turn this means we can remove UE::BulkData::Private::FlushAsyncLoad entirely as it was only being called by ::FlushAsyncLoading.
- With both  UE::BulkData::Private::StartAsyncLoad and UE::BulkData::Private::FlushAsyncLoad removed, we can remove FAsyncBulkDataRequests aswell as there is no longer any way for people to use it.
- Removed calls to ::IsAsyncLoadingComplete from the rest of the engine, it will always be true at this point.

[CL 34671288 by paul chipchase in ue5-main branch]
2024-06-26 06:53:39 -04:00
devin doucette
36f5a24ddd Moved TSharedString from DDC into Core
#rb Steve.Robb

[CL 34340152 by devin doucette in ue5-main branch]
2024-06-13 10:40:59 -04:00
michael nicolella
62aa1c50bb autortfm (resubmit):
- when running under autortfm, we now conditionally take the SerializeAndPostLoadCritical only when the async loading thread is enabled
- we still always take the lock when not running under autortfm (!AutoRTFM::IsClosed()) to preseve the existing behavior in uninstrumented code
- this is expected to work for us for now because on the server, the async loading thread is disabled, so we can avoid taking this lock

#rb Brandon.Schaefer

[CL 34055055 by michael nicolella in ue5-main branch]
2024-06-01 10:52:01 -04:00
devin doucette
118ab112d0 Deprecated GetSerializeContext and SetSerializeContext on FArchive
Implementations have been effectively using the thread context and these changes make that the only available context.

#rb kevin.macaulayvacher

[CL 34011179 by devin doucette in ue5-main branch]
2024-05-30 16:02:03 -04:00
matt peters
27ac0fddf2 HLSLMaterialTranslator: Fix crash when UMaterialCollection referred to in an FEnvironmentDefines DDC entry has been redirected and an ObjectRedirector left behind.
#rnx
#rb Massimo.Tristano, Francis.Hurteau

[CL 33398774 by matt peters in ue5-main branch]
2024-05-02 12:01:55 -04:00
dmytro ivanov
95a7d45732 Duplicate audio data when reading from memory mapped files
#rb Peter.Sauerbrei

[CL 33393746 by dmytro ivanov in ue5-main branch]
2024-05-02 07:54:32 -04:00
per larsson
e5610c178b Do not crash when waiting or cancelling a bulk data request that has not been started.
#rb Paul.Chipchase

[CL 33257668 by per larsson in ue5-main branch]
2024-04-26 02:30:13 -04:00
joe kirchoff
fb6334a7c2 [Backout] - CL32838690
[FYI] Joe.Kirchoff
Original CL Desc
-----------------------------------------------------------------
Prevent clang analysis warnings for uninitialized data from FArchive derived readers

#rnx

[CL 32857977 by joe kirchoff in ue5-main branch]
2024-04-10 11:20:19 -04:00
joe kirchoff
76bd93d0de Prevent clang analysis warnings for uninitialized data from FArchive derived readers
#rnx

[CL 32838765 by joe kirchoff in ue5-main branch]
2024-04-09 16:44:38 -04:00
steve robb
fdb0b82bc4 Fixed subtree parsing in FJsonArchiveInputFormatter.
#rb robert.manuszewski

[CL 32664317 by steve robb in ue5-main branch]
2024-04-02 08:45:26 -04:00
daniele pieroni
50ab97d38c Manual integration of 32610366 by Per.Larsson
Potential fix when issuing empty texture streaming requests with batch API.

[CL 32638117 by daniele pieroni in ue5-main branch]
2024-04-01 09:50:50 -04:00
kevin macaulayvacher
baa2f53421 Changes the trace marker used for denoting GameThread async flushes to now clarify if a flush of all async loads is being performed or if the game thread is flushing only a subset of all loads. The name "Flush All Async Loads GT" was chosen as it closely mirrors the old name ""Flush Async Loading GT" but this specific name has a colour in insights that pops more in traces. This new marker makes it easier to detect and fix bad behaviour since, except for a few special cases, we should never wait for all loads and instead should be specifying a subset.
#jira UE-204065
#rb danny.couture
[FYI] Francis.Hurteau

[CL 32185525 by kevin macaulayvacher in ue5-main branch]
2024-03-12 13:46:31 -04:00
dan thompson
2b3a8d681c FCompression interface update to 64 bit.
-> Done because UE disables 32 bit down cast - silently could overflow.
-> General use should automatically work.
-> Deprecate some old 32 bit functions not generally used.
-> Deprecate/rename some ancient flags for future removal.
-> Update CompressorData to uint ptr for future use
-> Remove some stuff deprecated in 4.21 (2018)
#rb fabian.giesen
#jira UE-173911

[CL 31688300 by dan thompson in ue5-main branch]
2024-02-21 12:49:23 -05:00
per larsson
a71cafc0b6 BulkData - removed return value from issue batch
#rb Paul.Chipchase

[CL 31171929 by per larsson in ue5-main branch]
2024-02-05 09:24:10 -05:00
steve robb
da3a1210fc Made the JsonArchive structured formatters non-copyable so that their useless copy and move consturctors don't show up in IntelliSense.
#rb devin.doucette

[CL 30712630 by steve robb in ue5-main branch]
2024-01-19 05:41:27 -05:00
steve robb
66266c6a11 Fixed up DerivedDataCache, DesktopPlatform, ApplicationCore, AssetRegistry, Core, CoreUObject, Projects, Sockets code to use EAllowShrinking instead of bools.
[CL 30676428 by steve robb in ue5-main branch]
2024-01-17 19:51:06 -05:00