Commit Graph

153 Commits

Author SHA1 Message Date
nick edwards
220ccc4b3e FIoDirectoryIndexReader::IterateDirectoryIndex: Use FStringViews and TStringBuilders instead of FStrings to avoid potentially unnecessary heap allocations
FPakPlatformFile::ForeachPackageInIostoreWhile: Update usage of IterateDirectoryIndex, and use overload of TryConvertFilenameToLongPackageName using string views and builders to avoid allocations

#rb elias.lozadabenavent
#rb anton.dunchev

[CL 28282945 by nick edwards in ue5-main branch]
2023-09-27 14:10:02 -04:00
paul chipchase
f5c7921948 Add support for generating OnDemandToc data from UToc files on disk rather than downloading the data each time the process is launched. This feature is off by default.
#rb PJ.Kack, Per.Larsson
#rnx

### Configuration

- New cvar 's.IasGenerateOnDemandUtoc' which when set to true will tell the IasBackend to generate the OnDemand toc file from all of the utoc files marked as supporting OnDemand currently on disk. Defaults to false.
-- When we ship the IAS feature this will be changed to true.
- Note that both cvars are used before '-dpcvars' is applied so cannot be overriden from the cmdline.
- When UE_VALIDATE_GENERATED_TOC is enabled we will download the ondemand toc from the CDN anyway and check that the generated version from disk has the same values (where important) and trigger an assert if there are differences. This is intended to help debugging future compatibility issues.

## IoDispatcher Changes

- Add new method FIoStoreReader::GetChunkCompressedInfo allowing the caller to get info about a compressed chunk without actually loading it from disk.
- Changed FIoStoreReader::Initialize to take a string view rather than raw string pointer.
- FIoStoreTocResource now has an array of meta data for chunks and another for blocks, specifically for IAS (FIoStoreTocResource::OnDemandChunkMeta/OnDemandCompressedBlockMeta)
-- This data will only be generated for utoc files with OnDemand support to avoid bloating the non-ondemand utocs.
-- This data is considered meta data and will be read when EIoStoreTocReadOptions::ReadTocMeta is enabled.
- Reordered some includes to match the IWYU tool.
- Minor optimization to FIoStoreToc::Initialize

### IAS Changes

- The IoStoreOnDemand module now includes the 'Pak'File' module so that we have access to the pak directories.
- Add FEncryptionKeyManager::GetAllKeys which would be needed if IAS data ends up being encrypted.
-- The encryption path has not yet been tested and probably will need some form of defered mounting (for cases where the encryption keys are applied at a later point)

[CL 28039592 by paul chipchase in ue5-main branch]
2023-09-20 12:06:29 -04:00
per larsson
7ee97071a4 IAS - verify chunk block(s)
#rb Martin.Ridgers
#rnx

[CL 27668179 by per larsson in ue5-main branch]
2023-09-07 06:09:25 -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
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
per larsson
58cb352bc2 I/O - delete all container partition(s) and not just the base container after upload
#rb none
#rnx

[CL 26733408 by per larsson in ue5-main branch]
2023-08-01 04:46:45 -04:00
paul chipchase
ba9220ab4a IAS: Add logging of all iorequests to complement the logging of all http requests.
The iorequest duration is very close to the actual latency as seen from the game client code.

#jira UE-188791
#rb paul.chipchase
#rnx

- Submitted on the behalf of PJ.Kack

[CL 26430435 by paul chipchase in ue5-main branch]
2023-07-18 07:08:07 -04:00
per larsson
41a7f53758 I/O - initialize container flags to None
#rb triival
#rnx

[CL 26308849 by per larsson in ue5-main branch]
2023-06-29 08:57:40 -04:00
per larsson
3bed8ef537 I/O - support for uploading on demand I/O store containers to S3 with UnrealPak
- added support for uploading containers marked as on demand directly from UnrealPak.exe
- removed C# based upload logic from automation scripts
- removed on demand I/O store writer since this change reads chunks directly from container files instead of loose files

Example usage:
UnrealPak.exe -Upload=<ContainerPathOrWildcard> -ServiceUrl=<URL> -Bucket=<BucketName> -AccessKey=<Key> -SecretKey=<Key>

Read credentials from an AWS key chain file with the following command line:
-CredentialsFile=<Path> -CredentialsFileKeyName=<EntryName>

Specify -KeepUploadedContainers to prevent UnrealPak to delete on demand containers after the upload has been completed.
Specify -BucketPrefix=<Path> to upload chunks to a specific sub directory within the bucket.

#rb none

[CL 26115169 by per larsson in ue5-main branch]
2023-06-20 04:21:22 -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
martin ridgers
70f3d54b1b Moved file cache into ioscod and eliminated base class .h/.cpp
#rb perl
#rnx
#jira
#preflight 646dd2d51b241f07480ef1b3

[CL 25599566 by martin ridgers in ue5-main branch]
2023-05-24 06:13:15 -04:00
per larsson
5bf68c3de0 I/O - extend on demand I/O store TOC with source chunk hash and compression block hashes
#rb none
#preflight 6467726975696d2bd7d424d7
#rnx

[CL 25562370 by per larsson in ue5-main branch]
2023-05-22 08:28:57 -04:00
dan thompson
1ffba2605f Don't read the source buffer in iostore if we are just copying the chunk from the reference database.
#rb fabian.giesen
#rb per.larsson
#preflight 6462a3aab87b09aadd3a9f2c

[CL 25495924 by dan thompson in ue5-main branch]
2023-05-16 15:59:34 -04:00
per larsson
f174b47daa I/O - simplified cache interface and optimized chunk requests
- replaced cache async API with TTask for easier composition with HTTP request
- combine I/O request that fetches the same chunk into one request

#rb none
#preflight 644f8c862074911121f59044

[CL 25282906 by per larsson in ue5-main branch]
2023-05-01 08:26:28 -04:00
per larsson
00573797c3 I/O - simple file based FIFO cache
#rb none
#preflight 644b6f70401d328ad90fa1c5

[CL 25238719 by per larsson in ue5-main branch]
2023-04-28 15:55:46 -04:00
per larsson
5d85c42089 I/O - parallel HTTP requests
- removed background thread in favor using Tasks
- using fixed set of task pipes to throttle HTTP requests
- updated chunk encoding API to use FIoStatus and FOffsetAndLength

#rb none
#preflight 644a50851150e908d00b36f3

[CL 25214018 by per larsson in ue5-main branch]
2023-04-27 10:06:24 -04:00
per larsson
ab30bdc35b I/O - added caching to HTTP I/O backend
-  added simple in memory LRU cache for testing purposes, enabled with -HttpBackendMemoryCache=<size>

#rb none
#preflight 6446408e0171aae0b1e8855e

[CL 25162523 by per larsson in ue5-main branch]
2023-04-24 08:27:25 -04:00
per larsson
25adb5e978 I/O - move FIoBuffer to separate header
#rb Paul.Chipchase
#preflight 64464e1f27014596f346ea3f

[CL 25162522 by per larsson in ue5-main branch]
2023-04-24 08:27:19 -04:00
per larsson
d1ab262438 I/O - move FIoStatus to separate header
#rb Paul.Chipchase
#preflight 644619984944ef78929cd295

[CL 25161501 by per larsson in ue5-main branch]
2023-04-24 05:52:11 -04:00
per larsson
7b3a9ed322 I/O - extended ondemand I/O store writer to output compressed and encrypted chunks
- renabled the ondemand PAK rule that was previously removed
- enabled handling more than one ondemand containe
- added ondemand I/O store TOC
- added support for serializing ondemand TOC's to CbObjet

#rb Martin.Ridgers
#preflight 6436cbf80c19befb6c8ee4cc

[CL 25025449 by per larsson in ue5-main branch]
2023-04-13 10:51:22 -04:00
per larsson
cf8c09a302 Fix static analysis warning in I/O chunk encoding
#rb trivial
#preflight 64310d1541783dc3d00ec5bc

[CL 24991845 by per larsson in ue5-main branch]
2023-04-11 11:27:53 -04:00
per larsson
193546c52b I/O - chunk encoding
#rb Martin.Ridgers
#preflight 642e72ddd6069e71b1c8b163

[CL 24953417 by per larsson in ue5-main branch]
2023-04-06 15:26:22 -04:00
per larsson
a63be21465 I/O - local cache interface
#rb none
#preflight 642d650cd6069e71b1593525

[CL 24953373 by per larsson in ue5-main branch]
2023-04-06 15:25:39 -04:00
carlmagnus nordin
ecfc01c258 ZenLoader: Include preload dependencies in package headers instead of relying on predetermined export bundle dependencies. This means that each package can be treated in isolation when staging. Also removes the need to keep track of export and bundle counts in the package store which saves some memory.
#preflight 642e8838441e8b2f5506dbb4
#rb pk.kack,per.larsson,francis.hurteau

[CL 24944233 by carlmagnus nordin in ue5-main branch]
2023-04-06 10:50:30 -04:00
carlmagnus nordin
462cc2a438 IoStore: Include imported package names in the header data. This removes the need to keep track of uncooked packages in the package store for editor builds.
#rnx
#rb pj.kack
#preflight 64256a01b01a25d6a044758d

[CL 24869323 by carlmagnus nordin in ue5-main branch]
2023-03-31 07:20:51 -04:00