#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]
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]
#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]
#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]
- 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]
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]
[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]
-> 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]