Commit Graph

393 Commits

Author SHA1 Message Date
henrik karlsson
b5164ac775 Fixes to make modules compile with IWYU. We've added to IWYU toolchain so it compiles "orphaned" headers which does not have a owning cpp file. This identified lots of headers that couldn't be compiled by themselves (or if they were to included first)
Change consist of only forward declaration and additional includes

#preflight 63789c1de30d438849c48188
#rb none

[CL 23218412 by henrik karlsson in ue5-main branch]
2022-11-21 03:22:23 -05:00
henrik karlsson
5b96352978 Fixes for c++ headerunits/modules.
* Adding forward declarations
* Adding "inline" in front of const/constexpr variables in headers
* Adding includes
* A few moves of ctor/dtor to cpp file

#preflight 6372b3ac0c74adb48b49f313
#rb none

[CL 23130896 by henrik karlsson in ue5-main branch]
2022-11-14 19:59:41 -05:00
Matt Peters
ebc8986b2e BulkDataRegistry: Compute the actual PayloadId and put it into the BulkDataRegistryPayloadId cache whenever the Payload is loaded for an EditorBulkData with a PlaceholderPayloadId. Issuing Puts in this case causes future Gets to not miss; spurious misses are expensive in the DDC cache and break our analytics. Previously we would Put only when we demanded the actual Payload Id from the build system, but this did not cover all BulkDatas for which we issue Gets, since we issue Gets speculatively without knowing for sure whether the PayloadId will be needed.
#rb Zousar.Shaker, Paul.Chipchase
#rnx
#preflight 63727a7eb663683828718abb

[CL 23121107 by Matt Peters in ue5-main branch]
2022-11-14 12:42:50 -05:00
henrik karlsson
4feb09e0b3 Compile time optimizations Managed to reduce unnamed game's biggest file compiler frontend cost from 113 seconds to 60 seconds. This also impact other things such as pch size and memory footprint when compiling which is great.
Takeaways. Try to use "friend" on functions/operators that are frequently overloaded EXCEPT if they are in a templated type that is frequently instantiated. So do not put friends in TMap, TSet, TObjectPtr etc, this will slow down compile times. There is a break-even somewhere and hard to tell where it is but taking a class that is templatized on character type probably don't matter either way and then it is nicer to use a friend since that simplies error messages when compiler can't resolve functions/operators.

If it is possible to use member functions instead of friend that is the best option in terms of compile time performance. With c++20 you only have to write operator==(Foo, Bar) and the compiler will automatically provide operator==(Bar, Foo), operator!=(Foo, Bar) and operator!=(Bar, Foo).

Changes in this changelist involes
* Making operator<< friends in non-template types and not friends in template types
* Making operator==/!= members where possible and if not possible moved out if type is a frequently instantiated templated type.

#preflight 636970f5376a9cd6a80da54a
#rb steve.robb

[CL 23038965 by henrik karlsson in ue5-main branch]
2022-11-08 15:59:46 -05:00
henrik karlsson
f4adba584c Fixed compile error in BulkData.h caused by integration
#rb none
#jira none
#preflight skipped

[CL 22968274 by henrik karlsson in ue5-main branch]
2022-11-03 17:57:06 -04:00
henrik karlsson
b985fbd1b1 Removed lots of includes in high traffic headers in order to reduce compile times. Headers are still included if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2 is set to 1
List of highlights
* PlayerController - Removed ForceFeedback and and OnlineReplStructs
* Class - Removed Package.h
* World - Pawn, Blueprint and GameInstance
* Actor - CoreNet, HitResult and ActorDatalayer
* EngineBaseTypes - TaskGraphInterface
* AssetManager - AssetData
* Scene/Child/ActorComponent - CoreNet
* AnimInstance - AttributesRuntime, Skeleton, AnimCurveTypes, AnimMontage, BonePose
* BulkData - IoDispatcher
* AssetData - IoDispatcher, LinkerLoad
* SecureHash - AsyncWork
* CanvasTypes - UnrealEngine, StaticMeshResources
* IpAddress - AsyncWork, Stats

#preflight 6363717ece676ae8688f5d8c
#rb none

[CL 22968258 by henrik karlsson in ue5-main branch]
2022-11-03 17:56:44 -04:00
henrik karlsson
4a36cfe8ff Moved operator== to be hidden friend instead of put directly in global namespace
Moved GetTypeHash function to be hidden friend instead of put directly in global namespace.

Note that the function/operator needs to be fully inlined in the type or placed in the cpp. If the function is added as friend but then implemented outside the type then hidden friend optimization won't work.

This should improve compile time somewhat according to msvc devs.

#rb Steve.Robb
#preflight 6360b7052b5338aceb26471b

[CL 22889837 by henrik karlsson in ue5-main branch]
2022-11-01 15:50:27 -04:00
henrik karlsson
cd1466475b Fixed up const/constexpr variables in header files to be "inline"
This is required for c++ modules/header units in order to decide if constexpr/const value should be available to outside module

#preflight 635c0b5c1803be35c767e0ea
#rb none

[CL 22835882 by henrik karlsson in ue5-main branch]
2022-10-28 15:38:42 -04:00
devin doucette
07741e3ca5 DerivedData: Added FDerivedData::IsCooked
#preflight 635a96265d49a96f7b458f35
#rb Zousar.Shaker
#rnx

[CL 22811235 by devin doucette in ue5-main branch]
2022-10-27 11:47:16 -04:00
pj kack
7f6ccdb4ae AsyncLoading2: Merge LoadedPackageStore and GlobalImportStore and make it more tolerant to renaming of loaded objects.
Handle loaded objects being moved to another (transient) package by cleaning up all public export state when removing a loaded package.
Handle reloading of a package with internally renamed objects by allowing StoreGlobalObject to replace the previous public export.
Note: Renaming of loaded packages is still only supported via the delegate GetOnLeakedPackageRenameDelegate.
Compile all debug verification in all builds and make it possible to toggle with s.VerifyUnreachableObject=0/1 and s.VerifyObjectLoadFlags=0/1, while enabling it by default it debug and development builds.

#jira UE-167186, FORT-524537
#rb carlmagnus.nordin
[FYI] robert.millar
#preflight 63526bdc9e14ee3c798aa429, 63527f560313c24974216206
#rnx

[CL 22710443 by pj kack in ue5-main branch]
2022-10-22 07:09:46 -04:00
Per Larsson
109822e0b0 Bulk Data - I/O dispatcher only streaming
- This change removes the explicit usage of the package resource manager when loading bulk data from loose files or the Editor Domain. A new
I/O dispatcher backend reads data from the package resource manager with a new I/O chunk type constructed from a package name/package segment. When
serializing bulk data the I/O chunk type is set to the correct chunk type depending on whether the package is cooked or not.

#rb CarlMagnus.Nordin, Paul.Chipchase
#jira none
#preflight 633bdbc66b10157eac8e1807

[CL 22523877 by Per Larsson in ue5-main branch]
2022-10-14 04:26:10 -04:00
Devin Doucette
07aec936b4 DerivedData: Fixed inadvertent size increase of FDerivedData
Flags have moved into FCookedData to avoid padding, and there is now a static_assert on the size.

A new constructor allows creating references from the private FCookedData, and FLinkerSave now returns FDerivedData instead of FCookedData.

#preflight 633ef62f2a0a2c1ead2f4061
#rb Zousar.Shaker
#rnx

[CL 22377528 by Devin Doucette in ue5-main branch]
2022-10-06 12:22:07 -04:00
Matt Peters
f7789be6bf BulkData.GetBulkDataVersions: Add GetBulkDataVersions to FBulkData so that SkeletalMesh and Cloth can use it. In FEditorBulkData, update the implementation to correctly read the versions from the WorkspaceDomain file for BulkDatas that are in EditorDomain packages and reference bytes out of their WorkspaceDomain package.
#rb Paul.Chipchase
#rnx
#preflight 633c5869680898488488a39f

[CL 22332780 by Matt Peters in ue5-main branch]
2022-10-04 12:42:03 -04:00
andrew davidson
970f8f6a18 Non-Engine module public header truncation fixes to reduce noise when compiling with truncation warnings
#jira UE-160823
#rb dave.jones2, zak.middleton
#preflight 6336a3ecc37844870af8b119

[CL 22271698 by andrew davidson in ue5-main branch]
2022-09-30 11:36:06 -04:00
per larsson
c25048d9df Bulk Data - deprecate GetPackagePath/PackageSegment
#rb Paul.Chipchase
#jira UE-165473
#preflight 63359b2e3041fbb5665410c3

[CL 22271509 by per larsson in ue5-main branch]
2022-09-30 11:25:58 -04:00
Devin Doucette
e80df527fd DerivedData: Extracted private FCookedData from FDerivedData
The new FCookedData has been used to clean up the FLinkerSave API and the implementation of FDerivedData.

#preflight 63344bde0530d7c4b9c115d0
#rb Zousar.Shaker
#rnx

[CL 22221553 by Devin Doucette in ue5-main branch]
2022-09-28 10:07:08 -04:00
Matt Peters
97d33caf50 MeshDescription: In addition to applying the package's CustomVersions when deserializing MeshDescription out of BulkData, also apply the UEVersion and LicenseeUEVersion.
#jira UE-160855
#rb Richard.TalbotWatkin
#rnx
#preflight 63289253ea1c94f4c5e2fd67

[CL 22076022 by Matt Peters in ue5-main branch]
2022-09-19 13:01:00 -04:00
joe pribele
73e907afca [CoreUObject] changed DuplicateDataReader/Writer to handle TObjectPtr
#rb zousar.shaker
#preflight 6320f8078c478acecf7abfaa

[CL 21998836 by joe pribele in ue5-main branch]
2022-09-13 22:44:01 -04:00
Devin Doucette
0ce0756966 DerivedData: Added a way to request compressed data from derived data references
- FDerivedDataIoBatch::Compress requests the entire compressed value.
- FDerivedDataIoResponse::GetCompressedData gets the compressed buffer from the response when available.
- FDerivedDataIoResponse::GetCacheValueId has been added to get the FValueId when available.
- FDerivedDataIoResponse::GetCacheKey has been fixed to return a non-null cache key when appropriate.
- Asserts about FDerivedData now log the derived data reference too.

#preflight 631a5f6fa60c539c98ab5fa9
#rb Zousar.Shaker

[CL 21920523 by Devin Doucette in ue5-main branch]
2022-09-09 10:36:44 -04:00
Andriy Tylychko
3fe8b0bcb6 fixed non-unity compilation by including the correct header
https://horde.devtools.epicgames.com/job/6318b22ba31879aea8d85c9b?step=8e3f&issue=209198
#preflight 6318d0b8d135b61bc5bc12aa

[CL 21855577 by Andriy Tylychko in ue5-main branch]
2022-09-07 13:26:59 -04:00
carlmagnus nordin
e582c065d7 ZenLoader: Initial support for loading packages in the editor
#rb pj.kack
#preflight 6310b0d1ea685939704bded6, 6311a3fa7778595cd69d7f6b
#jira UE-162812

[CL 21790081 by carlmagnus nordin in ue5-main branch]
2022-09-05 04:36:25 -04:00
Per Larsson
2f11775439 Bulk Data - fix bug when merging I/O batch read request(s)
- This change fixes an issue when batching bulk data I/O requests where the bulk data is layed out contiguous in the chunk/file. Internally
the max read size was previously capped to the size of the bulk data but when merging read requests we read past the first bulk data
instance, i.e. from first to last. This is safe as long as the range is stored contiguously in the same chunk/file.

#rb Paul.Chipchase
#jira UE-162910
#preflight 6314d66ba20b67673bca3713

[CL 21788475 by Per Larsson in ue5-main branch]
2022-09-05 02:56:20 -04:00
Per Larsson
60dc823b46 Bulk Data - inline reloading ensures
#rb Paul.Chipchase
#jira UE-162155
#preflight 630dfb9ea416f6df25d0c82c

[CL 21699599 by Per Larsson in ue5-main branch]
2022-08-30 09:38:27 -04:00
Per Larsson
6181aa421f Bulk Data - refactored batch API to better support Nanite streaming
#rb Paul.Chipchase
#jira none
#preflight 630c97370345de4ccf7f202b
#rnx

[CL 21675673 by Per Larsson in ue5-main branch]
2022-08-29 08:53:10 -04:00
Per Larsson
6fce9705f5 Bulk Data - skip stream to instances that is already loaded
#rb Paul.Chipchase
#rnx
#jira none
#preflight 62ff8c6d3f75602b2f589a92

[CL 21456502 by Per Larsson in ue5-main branch]
2022-08-19 09:38:02 -04:00