5244 Commits

Author SHA1 Message Date
danny couture
3c3365435c [ZenLoader]
- Fix early boot deadlock on cooked build for some platforms

#rb PJ.Kack

[CL 28844884 by danny couture in 5.3 branch]
2023-10-17 13:41:19 -04:00
jeanfrancois dube
52341e23ce Only use the object flag RF_HasExternalPackage as a hint as if the object has an external package or not, and only report a warning if the flag is set but no external package is hashed for this object.
This fixes a race condition between UStaticMesh::GetPlatformStaticMeshRenderData calling GetPackage from a task thread to know if the package is already cooked for editor, while we are moving an HLOD mesh from an external actor package into a streaming level during cooking, resulting in a discrepency betwen the package RF_HasExternalPackage and the content of the external package hash map. The situation still exists, but we know that it's not going to cause problems in that specific case.

[REVIEW] [at]francis.hurteau
#rb francis.hurteau
#p4v-cherrypick 27150485

#localization none
#tests none

[CL 27391618 by jeanfrancois dube in 5.3 branch]
2023-08-25 16:36:37 -04:00
paul chipchase
2d8cd1cd5f Prevent packages that have been saved when the editor domain is enabled from showing up as corrupted and allow the editor to load them correctly.
#rb Per.Larsson
#jira UE-192888
#rnx
#lockdown mark.lintott

### Problem
- When the bulkdata reference is written out it is either relative to a value stored in the package summary or absolute for the file that it is being written to. We only store the absolute value when writing an editor domain package or a cooked package, in which case  the bulkdata will be marked with the 'BULKDATA_NoOffsetFixUp' flag so we know not to convert the offset from relative to absolute on package load.
- If a package was loaded from the editor domain and then saved to the workspace domain it would retain the 'BULKDATA_NoOffsetFixUp' as it was not being cleared during serialization. This caused problems as we do not expect to encounter the flag when loading from the workspace domain.
-- In 5.0 and 5.1 packages saved to the workspace domain with 'BULKDATA_NoOffsetFixUp' were doing so with absolute offsets.
-- In 5.2 due to a major refactor on how we store data, packages being saved to the workspace domain with 'BULKDATA_NoOffsetFixUp' were doing so with relative offsets.

### Fix
- When saving a package the 'BULKDATA_NoOffsetFixUp' flag is cleared and then only reapplied to the package if required.
- To allow us to load packages that have been already saved out incorrectly the loading logic has been modified.
-- The existing check was to see if the package was from the editor domain, if so we assumed absolute offset and for all other cases relative. This is because the linkerloading code assumes we are loading from uncooked data in the editor.
-- We now also check the 'BULKDATA_NoOffsetFixUp' flag, and if it is set AND the package has an older version than EUnrealEngineObjectUE5Version::DATA_RESOURCES we assume the offsets are absolute, if the package is of the newer format, we assume they are relative and fix them up accordingly.

- Added a cvar "Serialization.ApplyBulkDataOffsetFix" which can be set to false to disable the loading fix and restore the previous behaviour. This is provided to de-risk the submit.

[CL 27134603 by paul chipchase in 5.3 branch]
2023-08-16 05:16:56 -04:00
robert millar
1c28f500e3 Merging 26924890 and 27046784 from Release-26.10.
Allow verification of GC assumption on full GC purges in Test builds.

Additional debug options for garbage collection.
CVars gc.VerifyAssumptions, gc.VerifyAssumptionsOnFullPurge and gc.VerifyAssumptionsChance to control frequency of verifying GC assumptions.
CVar gc.ForceEnableGCProcessor to force GC to use the debug processor to allow GC to crash in the context of a memory error / assumption violation rather than later when batchers are handled in the optimized processor.

[REVIEW] [at]mickael.gilabert

#localization none
#tests Tested in 26.10

[CL 27108238 by robert millar in 5.3 branch]
2023-08-15 13:06:11 -04:00
mickael gilabert
047bbddc3d Memory saving. Integrated 26308365, 26826015, 26954340, 26768446
[REVIEW] [at]dmytro.vovk
#rnx

---
Pack FUObjectItem in Shipping builds to avoid 20% mem waste v2
#ushell-cherrypick of 26308365 by dmytro.vovk
---
Packed Chaos::FShapeInstanceProxy to fit into 192b MB3 bin
#ushell-cherrypick of 26826015 by dmytro.vovk
---
Rearranged data in Chaos::FTrimeshBVH::FChildData to avoid padding due to alignment requiremnts
#ushell-cherrypick of 26954340 by dmytro.vovk
---
Added a proper Switch linker version script file to make all symbols hidden by default
#ushell-cherrypick of 26768446 by dmytro.vovk

[CL 27027194 by mickael gilabert in 5.3 branch]
2023-08-11 10:16:51 -04:00
robert millar
9067b95953 Add AddReferencedObjects implementation for StructOnScope which correctly handles the weak pointer.
TWeakPointers must be dereferenced with GetEvenIfUnreachable during GC because GC initially marks all possibly-collectable objects as Unreachable before scanning the heap.

#rb justin.moe, pamela.figueroa
[REVIEW] https://p4-swarm.epicgames.net/reviews/26971504/, [at]mickael.gilabert

#localization none
#tests Stepped through new implementation in the debugger in the editor.

[CL 26999856 by robert millar in 5.3 branch]
2023-08-10 13:55:15 -04:00
UnrealBot
e332249d7b Branch snapshot for CL 26969186
[CL 26969186 in 5.3 branch]
2023-08-09 20:15:04 +00:00
joe bestrotheray
f2581f863a Create csv stat for GC count
#rb tyler.staples

[CL 26848363 by joe bestrotheray in 5.3 branch]
2023-08-04 11:35:35 -04:00
louisphilippe seguin
f3a29370b8 Improved assert when replicating actor class without PushModel properly implemented
#rb Ryan.Gerleve
#rnx

[CL 26847197 by louisphilippe seguin in 5.3 branch]
2023-08-04 11:14:03 -04:00
ionut matasaru
99661dcfdb [Insights] CpuProfilerTrace:
- Enabled cpu scope tracing of object names (blueprints, functions) by default when app is not running as a commandlet (still requires "cpu" trace channel and -statnamedevents to be enabled). Enabling AssetLoadTime trace channel will enable tracing of object names also in commandlets (ex. cooking).
  - Improved performance when tracing "statnamedevents" cpu scopes (by using a new optimized code path that uses an FName stat id together with a TCHAR* descriptive name).

#jira FORT-532106
#rb Matt.Peters

[CL 26814181 by ionut matasaru in 5.3 branch]
2023-08-03 12:16:00 -04:00
nick edwards
18a16f5c78 Wrap uses of UE_TRACE_LOG_SCOPED_T in CPUPROFILERTRACE_ENABLED and LOADTIMEPROFILERTRACE_ENABLED blocks
#rb none

[CL 26808400 by nick edwards in 5.3 branch]
2023-08-03 09:20:33 -04:00
jamie dale
83cbb061fa Added an overload of ParseObject that allows the referenced object to be loaded if required
This can also be disabled globally via the CVar "s.AllowParseObjectLoading"

#jira
#rb Francis.Hurteau

[CL 26781597 by jamie dale in 5.3 branch]
2023-08-02 14:34:21 -04:00
jamie dale
ed682497ed Update FPackageName::IsValidPath and FPackageName::IsValidObjectPath to use FStringView
#jira
#rb Francis.Hurteau

[CL 26779215 by jamie dale in 5.3 branch]
2023-08-02 13:43:29 -04:00
robert millar
1711d365b5 Add assertions for bad object indices in reference chain search.
#rb none

[CL 26777780 by robert millar in 5.3 branch]
2023-08-02 13:10:04 -04:00
robert millar
597696689a Make sure that reference chain search processors skip weak references from blueprint persistent ubergraph frame
#rb none

[CL 26777028 by robert millar in 5.3 branch]
2023-08-02 12:55:49 -04:00
jamie dale
2082ffd049 Disable package reload fast path due to regression
#jira UE-191185
[FYI] wouter.burgers
#rnx

[CL 26748079 by jamie dale in 5.3 branch]
2023-08-01 14:33:10 -04:00
jamie dale
45ac387f81 Fixed FObjectPropertyBase::GetExportPath with PPF_Delimited quoting only the object part of the path
#jira
#rb Francis.Hurteau

[CL 26737268 by jamie dale in 5.3 branch]
2023-08-01 09:45:51 -04:00
andrew scheidecker
575bbaf801 Fix for unversioned serialization of arrays of optionals (or other cases where an optional property might be nested in a container).
Also fix a memory leak when doing unversioned serialization of properties with destructors and default values: "loading as zero" doesn't call the destructor on the value being overwritten, and so isn't safe to use for properties that require destruction.
#rb Devin.Doucette, Robert.Manuszewski

[CL 26706194 by andrew scheidecker in 5.3 branch]
2023-07-31 10:47:04 -04:00
dan oconnor
4e978a9711 Revert behavior introduced in 12669682, but avoid discarding InstancedSubobjects that have been loaded by FLinkerLoad, this ensures that objects with deferred intitializers have their instanced references fixed up by FObjectInitializer::InstanceSubobjects
#rb Phillip.Kavan
#jira UE-189361

[CL 26647270 by dan oconnor in 5.3 branch]
2023-07-27 13:57:00 -04:00
andrew scheidecker
81a1fe0a01 Cherry pick various changelists adding FOptionalProperty to CoreUObject.
#ushell-cherrypick of 26132976 by andrew.scheidecker
#ushell-cherrypick of 26180430 by andrew.scheidecker
#ushell-cherrypick of 26180927 by andrew.scheidecker
#ushell-cherrypick of 26184877 by andrew.scheidecker
#ushell-cherrypick of 26281078 by Johan.Torp
#ushell-cherrypick of 26346541 by andrew.scheidecker

[CL 26605123 by andrew scheidecker in 5.3 branch]
2023-07-26 09:52:42 -04:00
Francis Hurteau
a65b82ea75 Truncation warning fixes for CoreUObject
#jira UE-166274, UE-127233
#rb Devin.Doucette, Paul.Chipchase

[CL 26553302 by Francis Hurteau in 5.3 branch]
2023-07-24 15:56:25 -04:00
dan oconnor
20bec88a70 Publish soft path literals to reference collectors that run over bytecode
#jira UE-190820
#rb Matt.Peters

[CL 26518828 by dan oconnor in 5.3 branch]
2023-07-21 13:52:32 -04:00
nick edwards
0f6539f105 Added an additional FAssetRegistryTag constructor that leverages move semantics to efficiently transfer the value string into the member variable, potentially eliminating an extra copy operation
#rb matt.peters

[CL 26512923 by nick edwards in 5.3 branch]
2023-07-21 11:16:35 -04:00
matt peters
04cbe6e180 ObjectPropertyTest fixes:
1) Fix for test package names not starting with proper prefix
2) Fix incompatible value that is passed into CheckValidObject to NOT be the outer of the fallback objecte. The incompatible value now gets renamed by CheckValidObject, and renaming the outer of the fallback object would break the test.
#rnx
#rb Joe.Pribele

[CL 26500255 by matt peters in 5.3 branch]
2023-07-20 18:51:09 -04:00
wouter burgers
819bfd6807 PackageReload: Optimized ReloadPackages by doing a pre-pass using FReferencerFinder::GetAllReferencers to get all potential referencers and only inspecting those when fixing up references. The potential referencers set is expanded as new packages get (re)loaded through the FCoreUObjectDelegates::OnObjectsReplaced and FCoreUObjectDelegates::OnObjectConstructed delegates, whilst garbage collected packages end up being skipped through the use of TWeakObjectPtrs.
#rnx

[CL 26481227 by wouter burgers in 5.3 branch]
2023-07-20 07:21:59 -04:00