Commit Graph

195 Commits

Author SHA1 Message Date
henrik karlsson
5db685f97d [Engine]
* Moved dllexport from type to methods/staticvar in all Engine runtime code. This improves compile times, memory and performance in dll builds

[CL 26082269 by henrik karlsson in ue5-main branch]
2023-06-17 18:13:06 -04:00
richard talbotwatkin
c5b4ec9865 Removed trivial explicit copy constructors from TMeshAttributesRef, to allow the compiler to generate assignment operators automatically.
#rb

[CL 25874447 by richard talbotwatkin in ue5-main branch]
2023-06-08 12:28:37 -04:00
richard talbotwatkin
65fe15f335 Build error fix for latest clang release.
#rb Josh.Adams

[CL 25840606 by richard talbotwatkin in ue5-main branch]
2023-06-07 05:59:59 -04:00
alexis matte
e43b81ce13 Ensure the nanite hires meshdescription materials are in the same order has the LOD 0 meshdescription materials. We use the imported material name to reorder them properly.
- If there is some material that do not find a match, those materials will stay in the imported order. The import will output a log message saying the material names do not match.
- If there is less material in the hires mesh description, the import will create empty section in the hires mesh to ensure the order of the materials. No log message will be output in that case.
-If there is more material in the hires mesh description, the import will transfer extra material section triangle to the first valid hires material section data (i.e. this should be matching the LOD 0 first material section)

We do this reorder when we import a hires nanite mesh and also if we have already a hires mesh description and we re-import the LOD 0 base mesh. This ensure we always have the hires meshdescription materials in the same order of the LOD 0.

#jira UE-179144
#rb jeanluc.corenthin
#rnx
#preflight 6426fd09c463fac9c8833dcd

[CL 24876565 by alexis matte in ue5-main branch]
2023-03-31 15:18:03 -04:00
graham wihlidal
1aec7d15e9 Significant DDC memory and perfomance optimizations to Nanite landscape mesh builds (and some general optimizations to all Nanite mesh builds). In some content cooks with extremely dense Nanite landscape mesh where the process memory well exceeded ~22gb, this brings it down to ~13gb, along with faster processing times.
Highlights:

 * Only allocate and use a wedge map for non-Nanite LODs, or if the mesh is sub 300kindices and it will be cache optimized
 * Only allocate and use a remap if there are no overlapping corners
 * When the Nanite landscape mesh is created, we now ensure the mesh description is fully compacted, computed, and optimized prior to committing it, along with making sure there are no overlapping corners.
 * Since Nanite landscape is checked to ensure no overlapping corners before the build, we can also now skip computing the overlapping corners, which was an intense number of tiny allocations.
 * When Nanite landscape is being built as a static mesh, we now avoid super expensive temporary copies of the mesh description, knowing that no actual mutation will occur.
 * The original code (after building) would release the memory from the mesh description copy, but it would not release the original immutable cached copy from memory (now that is released too)
 * Fixed NaniteLODIndex incorrectly creating a mesh description at a LOD other than the expected 0
 * Removed a full loop over all vertex positions by calculating the bounding box while we're building the vertex buffer (and already processing every vertex)
 * Added a NeedsCompact() helper to MeshDescription to avoid expensive and unnecessary Compact() calls that do lots of reallocs/copies even if the mesh description is already contiguous\packed in memory.
 * Skip building distance field and mesh card representations for the Nanite landscape mesh, which also avoids more cached mesh description deserialization and copies into memory.

Note: In the near future the APIs around this wil be cleaned up further.

#rb richard.talbotwatkin, yuriy.odonnell
[FYI] zousar.shaker, brian.karis, rune.stubbe, juan.canada, danny.couture
#preflight 640b7390482188d710464d39

[CL 24601442 by graham wihlidal in ue5-main branch]
2023-03-10 20:03:17 -05:00
alexis matte
d4384565b8 Interchange: Fix importing multi uv channel that was importing only the first UV channel.
#jira UE-178100
#rb jeanluc.corenthin , richard.talbotwatkin
#preflight 63fe0fb8437ce3e7f38e1d86
#rnx

[CL 24444884 by alexis matte in ue5-main branch]
2023-02-28 12:13:16 -05:00
rinat abdrashitov
c46a287319 Added Bone element and bone attributes (name, parent index, color, pose) to the mesh description via SkeletalMeshAttributes.
#rb Richard.TalbotWatkin
#rb halfdan.ingvarsson
#preflight 63f8fbfddd78dd50f6899906

[CL 24407796 by rinat abdrashitov in ue5-main branch]
2023-02-24 15:44:22 -05:00
rinat abdrashitov
2942701c5a Added FTransform attribute to the list of supported attributes.
#rb Richard.TalbotWatkin
#preflight 63f682cb6928c1ca3de75bd5
#rnx

[CL 24372515 by rinat abdrashitov in ue5-main branch]
2023-02-22 18:18:23 -05:00
daniel coelho
c8e6deec07 MeshDescription: Explicit specialization for hashing FName attributes by their string value instead of comparison index and number.
#jira UE-175663
#rb richard.talbotwatkin
#preflight 63da3a969b664e430f238431
#lockdown jeanmichel.dignard

[CL 23990348 by daniel coelho in ue5-main branch]
2023-02-03 10:21:47 -05:00
steve robb
f8a38f7c10 Deprecated TRemoveCV.
#rb none
#preflight 63d4607e5428dc67b1818284

[CL 23897646 by steve robb in ue5-main branch]
2023-01-27 23:12:35 -05:00
steve robb
912a4cc695 Removed usage of TRemoveConst.
#rb none
#preflight 63d45e175354589b5c1a8a54

[CL 23897644 by steve robb in ue5-main branch]
2023-01-27 23:12:27 -05:00
steve robb
38612a3e15 Removed TRemoveCV usage.
#rb devin.doucette
#preflight 63d3f7005c69f453c12698ee

[CL 23890475 by steve robb in ue5-main branch]
2023-01-27 15:19:12 -05:00
paul chipchase
94695dbb5d Code cleanup to reduce the amount of places calling FEditorBulkData::GetPayloadSize
#rb Per.Larsson
#jira none
#rnx
#preflight 63c96c19c76cdd32a45a4467

- Ultimately I'd like to be able to remove FEditorBulkData::GetPayloadSize all together but there are a few places that use the byte length to make estimates about memory usage.
- To move towards this goal, this change removes a number of calls to ::GetPayloadSize which only check if the length is or isn't zero, which can be accomplished with a call to ::HasPayloadData instead.

[CL 23788105 by paul chipchase in ue5-main branch]
2023-01-20 06:44:12 -05:00
steve robb
6a31618d42 Removed TIsSame from misc. engine files (part of a larger change to deprecate TIsSame).
#rb devin.doucette
#preflight 63c01cac8f4acc7b54d8832d

[CL 23678906 by steve robb in ue5-main branch]
2023-01-13 11:47:02 -05:00
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
matt peters
d730a7df04 MeshDescription: Replace debug name CustomVersionsMrp with correct name CustomVersions.
#jira UE-165816
#rb Zousar.Shaker
#rnx
#preflight 633b1b756b10157eac5f60e0

[CL 22322302 by matt peters in ue5-main branch]
2022-10-03 20:40:51 -04:00
marc audy
311f7464bf Updated ../Engine/Source/Runtime/... to inline gen.cpp files
Before:
3648 unity files
Total CPU Time: 47886.140625 s
Total time in Parallel executor: 498.81 seconds

After:
3548 unity files
Total CPU Time: 46643.828125 s
Total time in Parallel executor: 486.06 seconds

#jira
#preflight

[CL 22173263 by marc audy in ue5-main branch]
2022-09-24 13:57:58 -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
bryan sefcik
cb0456c6d4 Cleaned up build.cs files by removing any include paths that were already being added by UBT. This was done to help identify how include paths are being added and to help with future refactoring.
#jira
#preflight 631a5c04967ffc68fbf0dd8f

[CL 21911226 by bryan sefcik in ue5-main branch]
2022-09-08 21:44:02 -04:00
richard talbotwatkin
cf33dd00a3 Export FMeshElementContainer non-inline methods.
#rb trivial
#preflight
#p4v-cherrypick 21287649

[CL 21287715 by richard talbotwatkin in ue5-main branch]
2022-08-09 10:40:35 -04:00
richard talbotwatkin
4e783e17bf Added access to Elements map in MeshDescription.
#preflight
#rb trivial
#p4v-cherrypick 21282482

[CL 21282610 by richard talbotwatkin in ue5-main branch]
2022-08-09 05:42:58 -04:00
Bryan sefcik
b4a6e947d8 Ran IWYU on Public headers under Engine/Source/Runtime/...
Headers are updated to contain any missing #includes needed to compile and #includes are sorted.  Nothing is removed.

#ushell-cherrypick of 21065896 by bryan.sefcik
#preflight 62d4b1a5a6141b6adfb0c892
#jira

#ROBOMERGE-OWNER: Bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21150156 via CL 21151754 via CL 21154719
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)
#ROBOMERGE-CONFLICT from-shelf

[CL 21181076 by Bryan sefcik in ue5-main branch]
2022-07-20 11:31:36 -04:00
paul chipchase
f85fad88ff It is now possible to disable virtualization for all payloads owned by a specific asset type by adding the name of the asset to [Core.ContentVirtualization]DisabledAsset string array in the engine ini file.
#rb Per.Larsson
#rnx
#jira UE-151377
#preflight 628364050039ea57a52d6989

### Virtualization
- [Core.ContentVirtualization] in the engine ini file now supports an array called 'DisabledAsset' which can be used to name asset types that should not virtualize their payloads.
-- By default (in BaseEngine.ini) we have disabled the StaticMesh asset as we know it will crash if a payload is missing and the SoundWave asset as it still is pending testing.
- This new way to disable virtualization is data driven. The older hard coded method has not been removed but will likely be reworked in a future submit.
- Now when an editor bulkdata is adding it's payload to the package trailer builder during package save it will poll the virtualization system with a call to the new method ::IsDisabledForObject by passing in it's owner.
-- If the owner is valid and was present in the 'DisabledAsset' array then the method will return true and the EPayloadFlags::DisableVirtualization flag will be applied.

### Package Trailer
- The pre-existing functionality of enum EPayloadFilter has been moved to a new enum EPayloadStorageType as will only filter payloads based on their storage type.
- EPayloadFilter has been modified to filter payloads based on functionality although at the moment the only thing it can filter for is to return payloads that can be virtualized, it is left for future expansion.
- EPayloadFlags has been reduced to a uint16 with the remaining 2bytes being turned into a new member EPayloadFilterReason.
- This new member allows us to record the exact reason why a payload is excluded from virtualization. If it is zero then the payload can virtualize, otherwise it will contain one or more reasons as to why it is being excluded. For this reason the enum is a bitfield.
- Added overloads of ::GetPayloads and ::GetNumPayloads that take EPayloadFilter rather than a EPayloadStorageType
- Added wrappers around all AccessMode types for FLookupTableEntry.
- FPackageTrailerBuilder has been extended to take a EPayloadFilterReason so that the caller can already provide a reason why the payload cannot be virtualized.
-- As a future peace of work this will probably be changed and we will ask the caller to pass in the owner UObject pointer instead and then we will process the filtering when building the package trailer to a) keep all of the filtering code in one place b) keep the filtering consistent

### PackageSubmissionChecks
- The virtualization process in  will now request the payloads that can be virtualized from the package trailer, which respects the new payload flag, rather than requesting all locally stored payloads.

### UObjects
- There is no need for the SoundWave or MeshDescription classes to opt out of virtualization on construction. This will be done when the package is saved and is now data driven rather than being hardcoded.

### DumpPackagePayloadInfo
- The command has been updated to also display the filter reasons applied to each payload

[CL 20240971 by paul chipchase in ue5-main branch]
2022-05-17 07:54:28 -04:00
Steve Robb
f4d1564ffe New BitCast<>() function which works like C++20's std::bit_cast<>().
Deprecation of FPlatformMath::IsNegative*() functions.
New FPlatformMath::IsNegativeOrNegativeZero().
Fix up of existing usage to either use < 0 or IsNegativeOrNegativeZero where appropriate.
Fixes for aliasing problems in various FMath functions, including IsNegative*().

Resubmission of CL# 19833778 with fixes for problematic Mac and Android toolchains, causing spurious errors while building PCHs.

#rb devin.doucette, charles.bloom, will.damon, chris.babcock
#jira UE-148435
#preflight 6260764d91376845adf9893f

[CL 19840896 by Steve Robb in ue5-main branch]
2022-04-20 19:05:47 -04:00
Steve Robb
5c1f45e9a8 Undo //UE5/Main/Engine/... changelist 19833778 due to Mac and Android compilation failure.
#rb none
#jira none
#preflight none
#fyi will.damon

[CL 19835840 by Steve Robb in ue5-main branch]
2022-04-20 15:09:51 -04:00