Commit Graph

298 Commits

Author SHA1 Message Date
henrik karlsson
b5b86c796c This change is a strategical submit for a coming change that removes lots of includes in headers that are included by many files. This change contains adding of includes in files that previously got those includes transitively from other inclkudes
#preflight 6355d4940313c24974b2107b
#rb none

[CL 22783162 by henrik karlsson in ue5-main branch]
2022-10-26 12:57:32 -04:00
robert srinivasiah
a4b4dfcb03 OpenXR: Emulated world/tracker locked quad layers
If the OpenXR implementation does not support the expected amount of overlays, we restrict our usage of native layers to face-locked quads. We leverage the existing stereo layer compositing functionality in FDefaultStereoLayers to emulate world/tracker locked layers by compositing them directly in the background projection layer.

There are implementations that _do_ support the compliant number of layers, but using runtime layers significantly affects performance. This initial infrastructure allows apps to offload some performance implications by having FOpenXRHMD do some of the layer compositing in-engine.

#jira UE-137550
#preflight 6345d3118d665d55d0f126ee
#rb Jeff.Fisher

[CL 22467669 by robert srinivasiah in ue5-main branch]
2022-10-11 18:51:29 -04:00
Jules Blok
32a3446469 LiveLinkXR API changes and refactors
- Refactor XrPath manipulation using a new FOpenXRPath utility class
- Allow XrSpace to be queried from OpenXRHMD
- Rename Special motion sources to the body tracking roles

#jira UE-147549
#rb christopher.fiala
#preflight 6340a4182a0a2c1ead9dbf48

[CL 22411907 by Jules Blok in ue5-main branch]
2022-10-07 18:46:18 -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
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
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
nick darnell
8c6dccfce9 Core - Making some improvements to TObjectPtr, introducing some templating utilities so that we can better template match TObjectPtr vs UObject* pointers so that a single templated function can work for either.
Core - Added support for assigning a TObjectPtr<T> to a TScriptInterface just like you'd expect from a raw Object*.

Actor - Making a version of GetComponents that will work for TObjectPtr collections.  Additionally fixed several places in the engine where we're forcing the template parameter instead of allowing it to be determined automatically - which forced me to leave one of the GetComponent implementations, but I think we aught to remove it. e.g.

Don't Do

TArray<UPrimitiveComponent*> PrimComponents;
Actor->GetComponents<UPrimitiveComponent>(PrimComponents);

Do

TArray<UPrimitiveComponent*> PrimComponents;
Actor->GetComponents(PrimComponents);

Slate - Introducing support for collections of TObjectPtr<T>'s being used as source lists for the STableView.

#preflight 630f7af8e54ec9d581b03d65
[REVIEW] [at]Marc.Audy, [at]Steve.Robb, [at]Zousar.Shaker

[CL 21727328 by nick darnell in ue5-main branch]
2022-08-31 16:13:49 -04:00
Jules Blok
2c7a218f5d OpenXR Enhanced Input refactor
* Add Start XR Session blueprint node that allows changing the PMIC at runtime
* Make the controller action set persistent to reduce complexity
* Move interaction profile array to a local member used to build suggested bindings

#rb Jeff.Fisher
#preflight 6307da781615ec0db5291960

[CL 21571762 by Jules Blok in ue5-main branch]
2022-08-25 16:32:14 -04:00
robert srinivasiah
3df5e86b99 OpenXR PixelDensity: vr.pixeldensity active
The OpenXR plugin now adjusts the stereo render targets based on vr.pixeldensity

* AdjustViewRect respects PixelDensity, plus quantizes in order to match RenderTarget size in renderer logic (prevents upscale in MobileShadingRenderer)

* Override CalculateRenderTargetSize - previously, FOpenXRHMD was using the default implementation from FXRRenderTargetManager.
  However, it doesn't care about the per-view quanitization utilized by AdjustViewRect. Instead of modifying the shared implementation,
  we can provide a customized OpenXR version that shares logic with AdjustViewRect

* Allocate the depth texture at color alloc time - Because of the location of where IStereoRenderTargetManager::AllocateDepthTexture is called (scene texture creation time),
  it's too late for us to acquire the swapchain because it is called _after_ OnBeginRendering_RenderThread. This means we would use janky logic to acquire the swapchain after
  the frame has started. Instead, since we know if we're going to use depth at session time, and the parameters should be 'known', we can just allocate depth alongside color.
  Then the interface `AllocateDepthTexture` call is a validator + getter. In the future, we could rename some of these interfaces.

* Update layer/swapchain state in PostRenderViewFamily_RenderThread - we only need this state updated for frame end, so we can update it just-in-time. This actually happens
  'early' becase we enqueue directly onto GraphBuilder.RHICmdList. In the future, we could schedule a task onto GraphBuilder.

#rb Jules.Blok
#jira UE-131060
#preflight 62f3fff7466f8c150dba2286

[CL 21324195 by robert srinivasiah in ue5-main branch]
2022-08-10 15:34:39 -04:00
jeff fisher
062db5a107 UE-129957 OpenXR: Playspace
-Adding features related to play area bounds to OpenXR.
-New Blueprint to get the bounds and their origin in UE world space.
-New Delegate to respond to play area updates.
#jira UE-150888 UE-129957
#rb Robert.Srinivasiah
#preflight 62d5c8cdd54af4b9a23bf1ad

#ROBOMERGE-OWNER: jeff.fisher
#ROBOMERGE-AUTHOR: jeff.fisher
#ROBOMERGE-SOURCE: CL 21152966 in //UE5/Main/... via CL 21154942
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21181575 by jeff fisher in ue5-main branch]
2022-07-20 11:49: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
Jeff Fisher
951e052cdd UE-129957 OpenXR: Playspace
-Adding features related to play area bounds to OpenXR.
-New Blueprint to get the bounds and their origin in UE world space.
-New Delegate to respond to play area updates.
#jira UE-150888 UE-129957
#review-21074650
#rb Robert.Srinivasiah
#preflight 62d5c8cdd54af4b9a23bf1ad

[CL 21152966 by Jeff Fisher in ue5-main branch]
2022-07-18 17:26:55 -04:00
bryan sefcik
06f6cf2700 Added IWYU pragmas.
#preflight 62d018faa6141b6adfe93e82

[CL 21090145 by bryan sefcik in ue5-main branch]
2022-07-14 09:41:39 -04:00
robert srinivasiah
c408baae5c Fix NoPCH error: using QuantizeSceneBufferSize w/o include
#rb none
#jira trivial
#preflight 62ce07cab90bf539691cc932

[CL 21066567 by robert srinivasiah in ue5-main branch]
2022-07-12 21:08:38 -04:00
robert srinivasiah
292e660f8d OpenXR PixelDensity: custom quantization of width
In the scenario where we have an atlased stereo texture, we need to make sure each half
of the texture is aligned by 8 (new Strata requirement). We can do this by manually quantizing
the texture after applying pixel density.

#jira UE-131060
#rb Jules.Blok Arciel.Rekman
#preflight 62cd99da8e451a65136f8232

[CL 21057719 by robert srinivasiah in ue5-main branch]
2022-07-12 12:21:27 -04:00
zach bethel
d62d286474 Merged PreRender view extension RDG builder with scene render RDG builder.
- Ported remaining ISceneViewExtension calls to RDG.
 - Removed several empty override passes being added to the graph.
 - Merged two graphs into one.

#preflight 62c4c61a2a05d4f55bd5912f
#rb luke.thatcher

[CL 20971717 by zach bethel in ue5-main branch]
2022-07-06 15:33:30 -04:00
Jeff Fisher
ea77d232ef UE-153947 PIE needs setting to specify which of multiple instances get the VR headset.
-Added PrimaryPIEClientIndex setting to Editor Preferences->Level Editor->Play->Multiplayer Options->Client.
-Defaults to 0 which is the first pie client window (which means it could be the server in listen-server mode where the first window is both the server and a client).  -1 means no primary at all.  If it is larger than the number of indices we primary the last client.  Other negative settings are disallowed by the UI, but would also result in no primary.
-In VRPreview the primary client will track the hmd, render in stereo, etc.  The primary client's window size and position are also handled slightly differently.
-This could be hooked up to more things fairly easily.  VR provides a number of examples of how to do it, because it is a fairly extensive feature.  Much of the time the bool cached in the WorldContext is the best option.
#jira UE-153947
#review-20351483
#rb Robert.Srinivasiah Ben.Zeigler
#preflight 62b63499466962cd9a367bf6

[CL 20817989 by Jeff Fisher in ue5-main branch]
2022-06-24 18:23:15 -04:00
robert manuszewski
d1443992e1 Deprecating ANY_PACKAGE.
This change consists of multiple changes:

Core:
- Deprecation of ANY_PACKAGE macro. Added ANY_PACKAGE_DEPRECATED macro which can still be used for backwards compatibility purposes (only used in CoreUObject)
- Deprecation of StaticFindObjectFast* functions that take bAnyPackage parameter
- Added UStruct::GetStructPathName function that returns FTopLevelAssetPath representing the path name (package + object FName, super quick compared to UObject::GetPathName) + wrapper UClass::GetClassPathName to make it look better when used with UClasses
- Added (Static)FindFirstObject* functions that find a first object given its Name (no Outer). These functions are used in places I consider valid to do global UObject (UClass) lookups like parsing command line parameters / checking for unique object names
- Added static UClass::TryFindType function which serves a similar purpose as FindFirstObject however it's going to throw a warning (with a callstack / maybe ensure in the future?) if short class name is provided. This function is used  in places that used to use short class names but now should have been converted to use path names to catch any potential regressions and or edge cases I missed.
- Added static UClass::TryConvertShortNameToPathName utility function
- Added static UClass::TryFixShortClassNameExportPath utility function
- Object text export paths will now also include class path (Texture2D'/Game/Textures/Grass.Grass' -> /Script/Engine.Texture2D'/Game/Textures/Grass.Grass')
- All places that manually generated object export paths for objects will now use FObjectPropertyBase::GetExportPath
- Added a new startup test that checks for short type names in UClass/FProperty MetaData values

AssetRegistry:
- Deprecated any member variables (FAssetData / FARFilter) or functions that use FNames to represent class names and replaced them with FTopLevelAssetPath
- Added new member variables and new function overloads that use FTopLevelAssetPath to represent class names
- This also applies to a few other modules' APIs to match AssetRegistry changes

Everything else:
- Updated code that used ANY_PACKAGE (depending on the use case) to use FindObject(nullptr, PathToObject), UClass::TryFindType (used when path name is expected, warns if it's a short name) or FindFirstObject (usually for finding types based on user input but there's been a few legitimate use cases not related to user input)
- Updated code that used AssetRegistry API to use FTopLevelAssetPaths and USomeClass::StaticClass()->GetClassPathName() instead of GetFName()
- Updated meta data and hardcoded FindObject(ANY_PACKAGE, "EEnumNameOrClassName") calls to use path names

#jira UE-99463
#rb many.people
[FYI] Marcus.Wassmer
#preflight 629248ec2256738f75de9b32

#codereviewnumbers 20320742, 20320791, 20320799, 20320756, 20320809, 20320830, 20320840, 20320846, 20320851, 20320863, 20320780, 20320765, 20320876, 20320786

#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20430220 via CL 20433854 via CL 20435474 via CL 20435484
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)

[CL 20448496 by robert manuszewski in ue5-main branch]
2022-06-01 03:46:59 -04:00
Jeff Fisher
626b6c7ca2 OpenXR: Expose xrGetCurrentInteractionProfile to blueprint
#review-20053136
#rb Jules.Blok
#preflight 627ed81e5a0a06a57eadb6b9

[CL 20190729 by Jeff Fisher in ue5-main branch]
2022-05-13 18:29:11 -04:00
Victor Brodin
6ac1c3de9b XR | Added keyword "HMD" to IsHeadMountedDisplayEnabled, and IsHeadMountedDisplayConnected
#Preflight 6272e6bfe73769b67fe803d0

[CL 20059938 by Victor Brodin in ue5-main branch]
2022-05-05 13:06:12 -04:00
jeff fisher
5dac39ce5d UE-147360 VR Preview w. Net Mode Play As Client doesn't function as intended
-Previous code said that the first PIE world was allowed to track the HMD.  However sometimes the first PIE world is a dedicated server.  Now the first non-dedicated-server PIE world gets HMD tracking.
-This fix is a bit ugly to fit with hotfix rules.  I think it would be better to cache this value somewhere, but didn't see anywhere that was not a public header.
#jira UE-147360
[REVIEW]
#rb Arciel.Rekman
#preflight none

#ROBOMERGE-AUTHOR: jeff.fisher
#ROBOMERGE-SOURCE: CL 19929072 in //UE5/Release-5.0/... via CL 19930613
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19932812 by jeff fisher in ue5-main branch]
2022-04-26 20:14:45 -04:00
Jeff Fisher
960b6cd6de XR LockModularFeatureList fixes.
-Thread safety of Modular Features has been improved and we were hitting ensures in the render thread update of motion controllers.
-Now we are caching the IMotionController that is used for the game thread update and only attempting to use that one for the render thread update.  We are also watching for unregistered modules to null out cached IMotionControllers as necessary (this is unlikely, but if it happened it would be very bad).
#review-19473653
#rb Robert.Srinivasiah
#preflight 6255a4af3f5641db59f763ae

[CL 19723508 by Jeff Fisher in ue5-main branch]
2022-04-12 12:29:45 -04:00
Jeff Fisher
ff37ecdf3c Remove GetScreenPercentage blueprint function deprecated since 4.19.
-Time for this to go.
#review-19621453
#rb Jules.Blok
#preflight 624f449d6d3bb118aaf9352b

[CL 19677364 by Jeff Fisher in ue5-main branch]
2022-04-07 16:24:18 -04:00
jonathan bard
d8ab74f285 Fixed assert when accessing IHeadMountedDisplay modular feature on the render thread
#rb nick.whiting

#ROBOMERGE-AUTHOR: jonathan.bard
#ROBOMERGE-SOURCE: CL 19612823 via CL 19613038 via CL 19613161
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v938-19570697)

[CL 19615109 by jonathan bard in ue5-main branch]
2022-04-04 17:14:50 -04:00
Jeff Fisher
c4cb60b32c UE-147503 OpenXR: Threading ensures during VRPIE startup
-We started hitting some game thread asserts because the timing of render thread destruction/creation for VRPreview changed such that some code that used to run while the RenderThread did not exist, and thus ran on the game thread, now runs on the render thread.
-Changed CalculateRenderTargetSize assert so that it tolerates Game or Rendering thread.  The HMD methods that it calls are already pipelined on some platforms.  Fixing others.  Ignoring some that are on their way out.
#review-19563892
#rb robert.srinivasiah
#jira UE-147503
#preflight 6245ce0dc51908059abd9103

[CL 19573899 by Jeff Fisher in ue5-main branch]
2022-03-31 12:04:30 -04:00