Commit Graph

326 Commits

Author SHA1 Message Date
Ryan Gerleve
9988faf667 Make FBitReader and FNetBitReader Src buffer parameter const.
#jira none
#preflight 6427555e861bf344ce58d994
#rb peter.engstrom

[CL 24892903 by Ryan Gerleve in ue5-main branch]
2023-04-03 10:53:04 -04:00
carlmagnus nordin
024df6d65c ZenCook: Added support for file regions
#preflight 64269c8491589478cdeb2a6f
#rb pj.kack
#rnx

[CL 24869761 by carlmagnus nordin in ue5-main branch]
2023-03-31 08:36:14 -04:00
devin doucette
3b17707bbf CompactBinary: Optimized FCbWriter by fixing an unintentional array shrink
#rb Zousar.Shaker
#rnx

[CL 24756381 by devin doucette in ue5-main branch]
2023-03-22 19:42:37 -04:00
Ryan Gerleve
2f6b307a95 Fix stack corruption in FArchive::SerializeIntPacked64.
#jira none
#rb brian.bekich
#preflight 6414b4c2691c5ebc15add0c1

[CL 24694376 by Ryan Gerleve in ue5-main branch]
2023-03-17 15:15:20 -04:00
Brian Bekich
c962e8f6fc FNetworkGUID now supports uint64 values
#jira UE-93777
#preflight 6411f2f5352bd6a889f950a5
#rb peter.engstrom

[CL 24689288 by Brian Bekich in ue5-main branch]
2023-03-17 10:41:53 -04:00
steve robb
f19a7e55ec Fixed potential invalid quote count in CSV parser.
Added overloaded constructors for FCsvParser which move/copy rather than (move/copy)+move.
Fixed a rather weird const_cast construct.

#rb robert.manuszewski
#preflight 63fcaa40ae54ee4ce90c021b

[CL 24422896 by steve robb in ue5-main branch]
2023-02-27 09:33:19 -05:00
henrik karlsson
c74a887e4b Header unit fixes
* Added ScriptDelegateFwd.h and put it in the right module (CoreUObject). before fwd declarations was in Core.
* Fixed problem with StructuredArchive forward declaring and used functions that was force inlined in another file. header units did not like this and caused linker errors (and I'm surprised it worked before)
* Various fixes related to how global variables are defined (static for global variables means that they are not visible outside header units)
* Various fixes related to how global functions are defined (static for global functions means that they are not visible outside header units)
* Move some method implementations to cpp file to work around header unit compile crashes (and they should probably be there firstplace)
* Removed *_API on some types to fix header unit linker errors
* Added WITH_EDITOR around code that only compiles in editor config (these headers were not included anywhere but HU can't know that)

#preflight 63f50161ac06ce789f9c34d2
#rb steve.robb

[CL 24348303 by henrik karlsson in ue5-main branch]
2023-02-21 15:24:28 -05:00
arciel rekman
a270c807f7 Harden reading/writing frozen memory images.
- Prevent maliciously crafted or damaged memory images from introducing memory stomps or otherwise disrupting loading.

#rb Josh.Adams, Jason.Nadro
[REVIEW] [at]Josh.Adams, [at]Jason.Nadro
#preflight 63efdfc03c1eb56f05d8da13

[CL 24295262 by arciel rekman in ue5-main branch]
2023-02-17 19:38:44 -05:00
henrik karlsson
c8c3d0b8b2 [Core]
* Made code compatible with modules/header units. This includes following things:
   * Removed static in front of global functions/variables (static indicates it is hidden outside of module/header unit which is not what many places want...)
   * Moved dllexport from type to methods in order to get dllexport of static constexpr fields. This is supposed to work according to microsoft but since it is a good change I don't mind doing it anyway)
   * static constexpr -> static constexpr inline for member variables and methods (this makes them available outside module/headerunit)
   * Added HEADER_UNIT_IGNORE markup to includes that are circular
   * Added HEADER_UNIT_SKIP to files that can't compile by themselves

#preflight 63e2aeba3c44c83044bfcc75
#rb steve.robb

[CL 24066986 by henrik karlsson in ue5-main branch]
2023-02-08 00:25:15 -05:00
devin doucette
8650614644 Logging: Fixed the static asserts about the format string to catch non-const format strings
#jira UE-175373
#preflight 63d444cef626715201a7f5b8
#preflight 63d444e85354589b5c0ff3df
#rb Zousar.Shaker

[CL 23919147 by devin doucette in ue5-main branch]
2023-01-30 19:21:20 -05:00
Brian Bekich
2cd4a1c575 Changed engine/game network version to be custom versions
Changed replay header version to be a custom version
Changed local file replay streamer version to be a custom version

#jira UE-149900
#preflight 639a40e12540a78d27a7c884

[CL 23836403 by Brian Bekich in ue5-main branch]
2023-01-24 15:04:19 -05:00
charles bloom
24bf4ddbcd change uses of SerializeCompressed to SerializeCompressedNew with Oodle
provide SerializeCompressedNew with default args for easier use

#preflight https://horde.devtools.epicgames.com/job/63c86c8f2a6acaf16239628d
#rb fabian.giesen

[CL 23766497 by charles bloom in ue5-main branch]
2023-01-18 17:48:24 -05:00
David Harvey
7e97b6f78b use MSVC alignment for all Microsoft platforms when compiling with Clang, not just Windows.
#jira UE-163945
#rnx
#rb Eric.McDaniel
#preflight 63c18dd270575f890041876d

[CL 23679837 by David Harvey in ue5-main branch]
2023-01-13 12:17:20 -05:00
charles bloom
a7b61ca995 Archive.cpp SerializedCompressed fix security/overflow issues
#jira UE-172449
#rb fabian.giesen
#preflight https://horde.devtools.epicgames.com/job/63bf4acdde27f9bc45fd0cb3

[CL 23659177 by charles bloom in ue5-main branch]
2023-01-11 21:47:19 -05:00
devin doucette
4d7f410ab5 CompactBinary: Added serialization of fields and arrays to JSON
#preflight 63926f23cf0e31f727cbf669
#rb Zousar.Shaker

[CL 23499880 by devin doucette in ue5-main branch]
2022-12-13 18:18:27 -05:00
devin doucette
cdd41bb565 CompactBinary: Added serialization to WIDECHAR JSON
#preflight 639213cd5c5308d18cc94fd0
#rb Tim.Smith

[CL 23449275 by devin doucette in ue5-main branch]
2022-12-08 12:45:12 -05:00
john barrett
919b021217 Added CVar to disable FBitReader overflow ensures.
#rb trivial
#preflight skip

[CL 23335073 by john barrett in ue5-main branch]
2022-11-30 12:51:18 -05:00
paul chipchase
a7d323968b Fix potential truncation when loading data from a compact binary to an array
#rb Matt.Peters, Devin.Doucette
#jira none
#rnx
#preflight 637b8b4c170bc34a9315a29d

- The array view returned by FCbFieldView uses uint64 as it's size type, but TArray uses the significantly smaller type int32.
- It is very unlikely that we will ever see a truncation here but if it doesn't happen it could create some annoyingly difficult to diagnose bugs.
- We now test to make sure that the data can fit into a TArray before loading it, if not we print an error.
- The error logging is in a private function so that the code can be in the cpp and reduce include pollution in the header, it will also help hide the expanded code from the UE_LOGGING macro.

[CL 23232164 by paul chipchase in ue5-main branch]
2022-11-22 02:21:12 -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
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
joe pribele
9c02a2df54 [Core] changed FCustomVersionContainer::ToString to use a string builder to be more efficient
#preflight 636170f70c2e7c8f9148eff3

[CL 22889943 by joe pribele in ue5-main branch]
2022-11-01 15:55:16 -04:00
Devin Doucette
4bea045328 CompactBinary: Fixed LoadCompactBinary to gracefully handle read failures and sizes larger than the archive
#preflight 63200c6be93a80888c231104
#rb Zousar.Shaker

[CL 21983905 by Devin Doucette in ue5-main branch]
2022-09-13 11:45:18 -04:00
steve robb
8d78668c12 Removed ignored calculated values from TBigInt::ToInt(), FGenericPlatformMallocCrash::InitializeSmallPools and FArchive::SerializeCompressedNew.
#rb robert.manuszewski
#preflight 62f3acf6e60c9215b9766648

#ROBOMERGE-AUTHOR: steve.robb
#ROBOMERGE-SOURCE: CL 21406572 via CL 21406687 via CL 21406745
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v975-21357124)

[CL 21411875 by steve robb in ue5-main branch]
2022-08-16 15:29:48 -04:00
UnrealBot
73409369c0 Branch snapshot for CL 21319338
[CL 21319338 in ue5-main branch]
2022-08-10 16:03:37 +00:00
chris kulla
a78346a1ea Removing unused raytracing specific code from MemoryLayout and the associated DDPI entry
#rb Josh.Adams,Yuriy.ODonnell
#jira none
#preflight 62d1961da66919b6701d8c5b

[CL 21113474 by chris kulla in ue5-main branch]
2022-07-15 13:34:52 -04:00