Commit Graph

122 Commits

Author SHA1 Message Date
jordan hoffmann
7f04a77c76 - Changed "PropertiesSetBySerialization" to "SerializedProperties" and made the flag get set even for properties that were skipped during serialization. This way it's a better reflection of which properties were in the old class
- removed GMarkPropertiesSetBySerialization and added bTrackSerializedProperties flag to FUObjectSerializeContext to avoid race conditinons
#jira UE-217800
#rb Devin.Doucette

[CL 34385324 by jordan hoffmann in ue5-main branch]
2024-06-14 17:29:03 -04:00
devin doucette
b7be3b322a Added storage of unknown enum names
#jira UE-211458

[CL 34290747 by devin doucette in ue5-main branch]
2024-06-11 16:48:27 -04:00
devin doucette
58c803af96 A few IDO-related changes
- Renamed CreateUnknownPropertyTree to FindOrCreateUnknownPropertyTree.
- Fixed an edge case where the property can be set wrong on the property tag.
- Fixed an edge case where the wrong property can be recorded as initialized.
- Added a test for unknown property tracking.

#rb Francis.Hurteau

[CL 33983975 by devin doucette in ue5-main branch]
2024-05-29 15:41:20 -04:00
phillip kavan
324ff4be9c Further revise TObjectPtr to avoid indirection by keeping references to placeholder-typed objects unresolved.
Change summary:
- Reduced IsObjectHandleTypeSafe() to just a simple bit test. The LSB must also be set to require that it's a packed ref.
- Modified ResolveObjectHandleNoRead()/ResolveObjectHandleNoReadNoCheck() to update the handle only if type safe.
- Modified ObjectPtr_Private::Get() to return NULL without first resolving the handle (for pointers bound to UObject subtypes).
- Modified FLinkerLoad::operator<<() to serialize placeholder-typed object references as an "unsafe" packed reference only if the pointer type is unsafe.
- Modified TObjectPtr::GetInternalRef() to assert if the handle is not resolved. This will catch an attempt to return an unsafe pointer as a packed reference.
- Modified ToRawPtrArrayUnsafe() to assert if any item in the array is not resolved. This will catch an attempt to treat a packed reference as the element type.
- Modified TContainerElementTypeCompatibility::ReinterpretRange()/ReinterpretRangeContiguous() to assert if any element of the pointer array is not resolved.
- Modified ToRawPtrTArrayUnsafe() to reinterpret the pointer array through the type compatibility layer to catch any attempt to treat a packed reference as the element type.
- Revised TObjectPtr natvis to reduce the placeholder intrinsic query down to just a single bit test.
- Removed 'GObjectIndexToPackedObjectRefDebug' as it is no longer required for natvis support.
- Revised FObjectHandle/TObjectPtr type safety unit tests to validate the unresolved state of placeholder-typed references as well as include invalid address inputs to ensure we're only using pointer semantics.

#jira UE-215308
#rb Francis.Hurteau, Zousar.Shaker

[CL 33975641 by phillip kavan in ue5-main branch]
2024-05-29 11:43:30 -04:00
devin doucette
0aab94294a Added optional tracking and persistence of which properties have been initialized
#jira UE-212423
#rb Francis.Hurteau
#rnx

[CL 33798808 by devin doucette in ue5-main branch]
2024-05-21 12:17:02 -04:00
phillip kavan
3cac3aa6c0 Allow TObjectPtr to resolve to placeholder-typed objects regardless of 'const' qualifier when bound to the UObject base type.
Additional changes:
- Consolidated TObjectPtr natvis into a single visualizer block with an additional IsDerivedObjectType() intrinsic.
- Updated type safety unit test coverage to include 'const UObject' pointer types.

#jira UE-214693
#rb Francis.Hurteau, Zousar.Shaker

[CL 33643044 by phillip kavan in ue5-main branch]
2024-05-14 20:34:55 -04:00
devin doucette
5047df6573 Added loading of missing structs into IDOs
#jira UE-214628
#rb Francis.Hurteau
#rnx

[CL 33581357 by devin doucette in ue5-main branch]
2024-05-10 14:05:52 -04:00
devin doucette
c434656977 Fixed the IDO tests being enabled for unsupported targets
#jira UE-214395
#rnx

[CL 33529662 by devin doucette in ue5-main branch]
2024-05-08 17:34:23 -04:00
chris constantinescu
6b1a93c66b Disable play protect for Android installation
#jira UE-212645
#rb sebastian.lewicki

[CL 33494682 by chris constantinescu in ue5-main branch]
2024-05-07 16:46:58 -04:00
devin doucette
6d69fc0dc0 Added tests for InstanceDataObject tracking of values set by serialization
#rb Francis.Hurteau
#rnx

[CL 33464297 by devin doucette in ue5-main branch]
2024-05-06 14:36:10 -04:00
devin doucette
9050d6174e Deleted unused PropertyBagTest.h
#rnx

[CL 33458749 by devin doucette in ue5-main branch]
2024-05-06 12:05:13 -04:00
phillip kavan
b888aac77b Revise TObjectPtr to use pointer semantics for type safety checks (editor only).
Notes:
- This replaces the previous solution that relied on indirection.
- This solution relies on packed ref handles which requires late resolve features to also be enabled.

Change summary:
- Modified FPropertyBagRepository::IsPropertyBagPlaceholderType()/IsPropertyBagPlaceholderObject() to make the parameter read-only.
- Re-enabled UE_WITH_OBJECT_HANDLE_TYPE_SAFETY for the editor context. This will unblock testing of IDO w/ placeholder type features.
- Modified UE::CoreUObject::Private::Pack() to include a new "type" trait bit in the packed object handle reference. If set, it will signal that the reference is also a placeholder-typed object.
- Modified UE::CoreUObject::Private::MakePackedObjectRef() to include a check for whether or not the given object reference is also a placeholder-typed object, and allow this case to pass.
- Added UE::CoreUObject::Private::IsObjectHandleTypeSafeNoReadNoCheck(). This allows the implementation of IsObjectHandleTypeSafe() to rely on packed reference semantics, which are implemented as internal inline definitions.
- Modified FLinkerLoad serialization of FObjectPtr values to register a packed object reference mapping for placeholder-typed objects. Note: This requires late resolve features to also be enabled.
- Modified the TObjectPtr equality test to handle the case when only the RHS side is NULL. This can occur if the RHS is a non-UObject-type bound ptr to a placeholder object while the LHS is not.
- Revised all object handle/ptr unit tests for type safety. Ensured that TObjectPtr stress tests are still in line both with/without type safety enabled.
- Added a GObjectIndexToPackedObjectRefDebug global ptr to assist with debugger visualization of resolved placeholder-typed object references to allow for removal of RF_HasPlaceholderType.
- Updated VS natvis file to revise queries for IsPlaceholderObject() on non-UObject-typed TObjectPtr values (removed ObjectFlags check and replaced w/ GObjectIndexToPackedObjectRefDebug).
- Deprecated/removed all usage of RF_HasPlaceholderType (no longer required).
- Removed FPropertyBagRepository::PropertyBagPlaceholderTypeRegistry and decoupled the current (static) API from the repo singleton instance.
- (Minor) Fixed up some handle tracking unit tests in ObjectPropertyTest.cpp that did not compile with UE_WITH_OBJECT_HANDLE_LATE_RESOLVE disabled.

#jira UE-212508, UE-197358
#rb Zousar.Shaker

[CL 33397676 by phillip kavan in ue5-main branch]
2024-05-02 11:25:44 -04:00
danny couture
61410d3c0e [UObject]
- Add thread-safe ref-counting mecanism to UObject
  - Make TStrongObjectPtr more light-weight and usable on any thread by using ref-count instead of FGCObject
  - Add pinning API to WeakObjectPtr so they can be converted safely to StrongObjectPtr from any thread
  - Make delegate broadcast thread-safe when used with UObjects by pinning during broadcast for non game-thread.

#jira UE-211624
#rb Robert.Manuszewski

[CL 33370596 by danny couture in ue5-main branch]
2024-05-01 08:26:48 -04:00
robert millar
1af28b1b5d Implement intrusive optional states for FName and FText.
Fix FOptionalProperty flags to not set CPF_ZeroConstructor for inner types with intrusive unset states.
Make assignment of TOptional consistent between intrusive and non-intrusive types - always destroy and reconstruct the value. This allows TOptional<const T> to work correctly whether T is intrusive or not.

#rb Jamie.Dale, Johan.Torp

[CL 33214851 by robert millar in ue5-main branch]
2024-04-24 17:55:54 -04:00
robert millar
187458c7bd Implementing TOptional intrusive unset state support for FOptionalProperty.
Add new required FProperty methods HasIntrusiveUnsetOptionalState, InitializeOptionalIntrusive, IsOptionalSetIntrusive, ClearOptionalIntrusive.
Implement specific handling for not-null object pointers.
Defer to template function ::HasIntrusiveUnsetOptionalSate<T> for native struct types and types using cpp type fundamentals.

#rb Andrew.Scheidecker, Johan.Torp

[CL 33117302 by robert millar in ue5-main branch]
2024-04-19 17:10:53 -04:00
devin doucette
d169efc6e4 Deleted FPropertyBag and remaining references to it
#jira UE-212134
#rb Francis.Hurteau
#rnx

[CL 33038564 by devin doucette in ue5-main branch]
2024-04-17 12:06:15 -04:00
devin doucette
ef501dce13 Added FPropertyPathNameTree
This type will replace FPropertyBag as a means of gathering unique property paths during package loading.

#jira UE-211461
#rb Francis.Hurteau
#rnx

[CL 32932117 by devin doucette in ue5-main branch]
2024-04-12 11:44:00 -04:00
phillip kavan
9817b53199 Allow TObjectPtr instances to resolve directly to placeholder-typed references when T=UObject.
Notes:
- For placeholder-typed objects, TObjectPtr<UObject> is considered to be type safe since placeholder types are based on UObject.
- This means we can avoid having to check for and indirectly resolve placeholders via the ptr's internal object handle in these cases.

#jira UE-209831
#rb Francis.Hurteau, Zousar.Shaker

[CL 32434610 by phillip kavan in ue5-main branch]
2024-03-22 11:12:08 -04:00
devin doucette
7e47a8cc5e Assert on FPropertyTypeName with too many names and minimize its index waste
#rb Francis.Hurteau
#rnx

[CL 32383199 by devin doucette in ue5-main branch]
2024-03-20 17:39:19 -04:00
devin doucette
f806a8c06c Fixed property bag tests to use the new SetType function on FPropertyTag
#rnx

[CL 32005366 by devin doucette in ue5-main branch]
2024-03-04 18:56:08 -05:00
devin doucette
a4b19dbaef Fixed use of a deprecated variable in PropertyBagTest
#rnx

[CL 31960032 by devin doucette in ue5-main branch]
2024-03-01 17:45:14 -05:00
devin doucette
5e98f213c4 Added functions to FPropertyTypeName to query for structs and enums
These are convenience functions that cover most usage of FPropertyTypeName outside of CoreUObject.

#rb Steve.Robb
#rnx

[CL 31949226 by devin doucette in ue5-main branch]
2024-03-01 13:29:27 -05:00
paul chipchase
a50b673e3c Fix the low level FEditorBulkData tests from failing on runtime platforms.
#rb Per.Larsson
#jira UE-207889
#rnx

- The FEditorBulkData tests should only run on platforms with WITH_EDITORONLY_DATA enabled, this was lost when moving them from automation tests.
- Fixed up some poorly formatted includes.

[CL 31834360 by paul chipchase in ue5-main branch]
2024-02-27 04:20:24 -05:00
paul chipchase
972fca9224 Convert the FEditorBulkData tests to the low level test system
#rb Per.Larsson
#rnx

[CL 31717015 by paul chipchase in ue5-main branch]
2024-02-22 06:16:03 -05:00
devin doucette
379d58366f Changed FPropertyTypeName to use () instead of <> to delimit parameters
We want to use these to contain object path names, for which () is invalid and <> is not technically invalid.

#rb Matt.Peters
#rnx

[CL 31660123 by devin doucette in ue5-main branch]
2024-02-20 18:01:22 -05:00