Commit Graph

146 Commits

Author SHA1 Message Date
jason hoerner
0267d53323 DisplayCluster: Virtual Shadow Map cache can optionally be allocated per view, and enabled that feature for Virtual Production. Significant performance win by avoiding constant cache thrashing when rendering multiple families. Frame time goes from ~45 ms to ~26 ms for Valley test scene (Node 2), GPU bound in both cases. Separate cache per view isn't implemented for split screen views (single view family with multiple views), but Virtual Production doesn't use that, and support for that could be added in the future.
#jira UE-142732
#rb andrew.lauritzen ola.olsson
#preflight 628d06a45c3ef99a7b2fffa3

[CL 20351116 by jason hoerner in ue5-main branch]
2022-05-24 13:17:13 -04:00
zach bethel
e36088d967 Fix for RHI validation error in GPUScene.
#preflight trivial

[CL 20288555 by zach bethel in ue5-main branch]
2022-05-19 18:23:48 -04:00
zach bethel
94dae5bea0 Ported GPU scene buffers to RDG.
#rb Krysztof.narkowicz
#preflight 627149d0fe09c0cfbc3c7bdd

[CL 20027095 by zach bethel in ue5-main branch]
2022-05-03 12:08:20 -04:00
zach bethel
ad7da4c8b7 Simplified and fixed barriers in GPU Scene, Nanite, and Lumen.
- Fixed double 'end transition' validation error.
 - Fixed async compute access error.
 - Fixed invalid before state errors.

#preflight 623cd26dd078aec3e430c6fd
#rb none

[CL 19502289 by zach bethel in ue5-main branch]
2022-03-24 16:33:34 -04:00
graham wihlidal
fc1f34e356 Fixed broken Nanite materials for various meshes in CitySample content. Previously fix for TheOrigin was to change the GPU scene material table upload to use MaterialSlotCount instead of material max index +1, because TheOrigin has content with multiple unique sections pointing to a single material index. CitySample has the opposite in content, so max material index + 1 is needed to handle the case of more unique materials than sections. The updated fix is to take the max of these two values, so we also allocate a large enough upload range for either of these conditions.
#rb zach.bethel
#jira UE-146980
#preflight 623bd203437e1bac26bee654

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 19490625 in //UE5/Release-5.0/... via CL 19491386
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v936-19480137)

[CL 19491835 by graham wihlidal in ue5-main branch]
2022-03-23 23:45:47 -04:00
graham wihlidal
de68814fa8 Fixed Nanite material slot table crash when mesh section count is larger than max encountered material index
#rb rune.stubbe
#jira UE-145322
#preflight 6233a5f5e12e0da4a532f57c

#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 19427916 in //UE5/Release-5.0/... via CL 19429441
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v930-19419903)

[CL 19432577 by graham wihlidal in ue5-main branch]
2022-03-18 02:34:24 -04:00
jason hoerner
5f20bd8872 MGPU: Fix for light map artifacts when reloading lighting following a bake. Need to unbind SRVs used for scatter upload buffers, as we sometimes reuse the scatter upload buffers multiple times in a frame, and modifying them when they were bound can cause them to fail to update in the driver. Strangely, this was only occurring on the second GPU... I also added GPU mask blocks in a couple GPU scene update functions, for good measure.
The bound SRV issue could cause artifacts elsewhere in similar situations, but I didn't want to add perf overhead or complexity checking for this case everywhere, and decided to do a spot fix.  I didn't notice any other obvious cases where we have persistent buffers written to multiple times in a frame, like is done for the scatter upload buffers.  Still, it remains something to be alert for in case there are future rendering bugs.

#jira UE-143952
#rnx
#rb kenzo.terelst christopher.waters
#lockdown mihnea.balta
#preflight 6227ef770d5a90e98ea5f87d

#ROBOMERGE-AUTHOR: jason.hoerner
#ROBOMERGE-SOURCE: CL 19322316 in //UE5/Release-5.0/... via CL 19324110
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19348075 by jason hoerner in ue5-main branch]
2022-03-10 21:53:39 -05:00
jeannoe morissette
bdf682b099 Fix issues when ShowFlag.Rendering is disabled.
#rb Charles.deRousiers,Ola.Olsson
#jira UE-140685
#preflight 6216940bdb60b6b592f3838f

[CL 19099251 by jeannoe morissette in ue5-main branch]
2022-02-23 15:12:16 -05:00
Charles deRousiers
3b1b1c0a69 Merge ShaderPrint ShaderDrawDebug to ease binding/setup.
#rb none
#jira none
#preflight 62153e289e113332ba232936

[CL 19079474 by Charles deRousiers in ue5-main branch]
2022-02-22 15:35:01 -05:00
Charles deRousiers
8aa706ffaf Add hair GPU scene bound visualization.
#rb none
#jira none
#fyi ola.olsson
#preflight 620dfe898b6428e701975d73

[CL 19031995 by Charles deRousiers in ue5-main branch]
2022-02-17 03:07:17 -05:00
jamie hayes
d39995f0e0 Update GPUSceneWriter with better support for LWC
Add ability to add instance local bounds to dynamic primitive instances

#rb graham.wihlidal, michael.galetzka, ben.ingram
#jira none
#preflight 620bf2b4483ff0ae5ec1fb05

[CL 19000040 by jamie hayes in ue5-main branch]
2022-02-15 13:59:53 -05:00
graham wihlidal
3d89d9a647 Initial submit of Nanite programmable raster binning/framework (disabled by default, and missing some WIP pieces for it to function correctly). Later submits will enable it, and also include numerous optimizations.
#rb brian.karis
#fyi rune.stubbe, ola.olsson
#preflight 6206fdc9c663666c89ba1b9f

[CL 18971638 by graham wihlidal in ue5-main branch]
2022-02-11 22:50:10 -05:00
tiago costa
6025efadc9 Add FarField flag to GPUScene InstanceSceneData
- Renamed PayloadDataFlags to InstanceFlags since it contains more than Payload related flags
- This is required to be able to identify instances in far field and apply the reference offset when building RT instance buffer in compute shader.

#jira UE-141023, UE-134293
#rb yuriy.odonnell
#lockdown michal.valient
#preflight 61fbc2d802428bcd0d38ddff

#ROBOMERGE-AUTHOR: tiago.costa
#ROBOMERGE-SOURCE: CL 18841826 in //UE5/Release-5.0/... via CL 18841892 via CL 18842251
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18842368 by tiago costa in ue5-main branch]
2022-02-03 09:15:19 -05:00
fred kimberley
7fbfaf57c8 Require explicit constructors/casts when converting between FVector, FVector3d, and FVector3f.
#jira UE-122078
#rb Andrew.Davidson, Colin.McGinley
#preflight standard build

#ROBOMERGE-AUTHOR: fred.kimberley
#ROBOMERGE-SOURCE: CL 18817999 in //UE5/Release-5.0/... via CL 18818012 via CL 18822871
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18824721 by fred kimberley in ue5-main branch]
2022-02-02 07:59:31 -05:00
andrew lauritzen
b82385b08c Fix unnecessary invalidation of VSMs for dynamic primitives that are culled in the shadow pass.
Most relevant case is in editor with the "arrow" primitives causing invalidations even though they do not cast shadows.

#rb ola.olsson
#preflight 61f8508168795b2f45879fde

#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 18798225 in //UE5/Release-5.0/... via CL 18799733 via CL 18800182
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18801231 by andrew lauritzen in ue5-main branch]
2022-01-31 18:37:11 -05:00
ben ingram
3d2fb7a697 Change LWC tile size to OLD_WORLD_MAX
Allow fractional tile values for camera matrices, gives better precision when sharing tile between WorldToView and ViewToWorld
#rb none
#jira UE-139078
#preflight 61eaebfd731e3b40889568c9

#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 18693227 in //UE5/Release-5.0/... via CL 18693266 via CL 18693434
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18693576 by ben ingram in ue5-main branch]
2022-01-21 14:26:31 -05:00
jason hoerner
5600dd7c35 UE5_RELEASE: MGPU, numerous fixes to get EngineTest AFR, and Virtual Production City map to run with multiple GPUs. Ultimately there were 3 crash sources (RayTracing, Nanite, Distance Field streaming), each of which required a couple fixes, plus infrastructure to support those fixes...
There remain significant visual artifacts in the Virtual Production City map.  Lumen has serious issues with multiple views in both single and multi-GPU modes -- I think Lumen data needs to be split per view family to solve this.  There is some corrupt geometry in the second view, which may be Nanite or instance rendering related (or something else entirely).  To narrow down these issues, I think I'm going to need to extend the DumpGPU feature to be able to do more effective MGPU graphical debugging, since none of PIX, RenderDoc, or NSight work.  But at least it doesn't crash now...

Full list of changes:
* CVAR (DC.MultiGPUMode) to override multi-GPU mode for Display Cluster, debug feature copied over from 4.27.
* Barrier and synchronization fixes for RHITransferTextures copied over 4.27.  Future work will make RDG handle multi-GPU transitions more seamlessly...
* CVAR (DC.ForceCrossGPUCopy) to force expensive full synchronization and copy of resources cross GPU at the end of each view family render (for debugging).  RHITransferTextures upgraded to support copying things besides 2D textures, including other texture resources and buffers.
* AFR temporal fixes from a previous CL (which I moved from my single GPU to multi GPU PC), now improved to avoid some validation asserts in Debug builds (pass inputs not declared, GetParent()->GetRHI() not working because parent not declared to pass).
* Ray tracing (hang):  acceleration buffers are branched per GPU, as GPU virtual addresses for resources internally referenced by these buffers may vary per GPU.  Needed to add infrastructure to support buffers that duplicate memory per GPU, rather than using driver aliasing of the underlying resource.
* Ray tracing (hang):  some buffer bindings weren't using a proper GPU index.
* Nanite (hang):  Force initial clear of Nanite.MainAndPostNodesAndClusterBatchesBuffer to run on all GPUs.  Solves GPU hang in shadow rendering the first frame (due to shadow rendering running across all GPUs), and later random hangs in view rendering.
* Distance field streaming (assert):  GPU readback staging buffers need to be branched per GPU, as the underlying class is single device.  GPU readback buffers and textures properly take into account the GPU they were last written on when locking and unlocking.  Includes handling an edge case where a write can be queued when a lock is active, due to the deferred way commands are played back in the render graph.
* Distance field streaming (assert):  UAV clear wasn't taking into account GPU index.
* GPU scene update needs to run across all GPUs.
* Fix for "DumpGPU" command to avoid assert with MGPU -- arbitrarily pick a GPU (last index) when the GPU mask contains multiple bits.  Hope to improve this in the future, but it works.

#rnx
#rb mihnea.balta juan.canada tiago.costa kenzo.terelst
#jira none
#preflight 61ba7edbdc58e54b3318fdf5

#ROBOMERGE-AUTHOR: jason.hoerner
#ROBOMERGE-SOURCE: CL 18472819 in //UE5/Release-5.0/... via CL 18473380
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18473412 by jason hoerner in ue5-release-engine-test branch]
2021-12-15 23:12:04 -05:00
jamie hayes
15da3d166d * Updates to GPU Scene and the GPUSceneCollector to support handling the upload of multiple instances and instance payload data for dynamic primitives
* Updates to the VirtualShadowMapArrayCacheManager to support the invalidation of cache pages upon removal of dynamic primitives
* Various updates and fixes to support writing dynamic primitives' instance scene data and instance payload data from the GPU
* All these changes are needed by a few existing systems that will be using them soon to render via GPU Scene

(NOTE: This change is a resubmit of 18375369 with CIS fixes that caused it to be backed out)

#rb ola.olsson
#preflight 61ae4176353890ce23d75a95

#ROBOMERGE-AUTHOR: jamie.hayes
#ROBOMERGE-SOURCE: CL 18384716 in //UE5/Release-5.0/... via CL 18384780
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v896-18170469)

[CL 18384814 by jamie hayes in ue5-release-engine-test branch]
2021-12-06 13:18:17 -05:00
aurel cordonnier
f619a78c84 Removing duplicated code due to bad merge
#rnx
#jira none
#rb trivial

#ROBOMERGE-AUTHOR: aurel.cordonnier
#ROBOMERGE-SOURCE: CL 18376039 in //UE5/Release-5.0/... via CL 18376042
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18376044 by aurel cordonnier in ue5-release-engine-test branch]
2021-12-03 21:11:09 -05:00
bryan johnson
bc27cdd50d Removing duplicate definition due to bad automerge
#rnx
#jira none
#rb trivial

#ROBOMERGE-AUTHOR: bryan.johnson
#ROBOMERGE-SOURCE: CL 18375809 in //UE5/Release-5.0/... via CL 18375814
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18375818 by bryan johnson in ue5-release-engine-test branch]
2021-12-03 20:00:51 -05:00
aurel cordonnier
46a2f40da2 [Backout] - CL18359911 (due to CIS errors)
[FYI] jamie.hayes
Original CL Desc
-----------------------------------------------------------------
* Updates to GPU Scene and the GPUSceneCollector to support handling the upload of multiple instances and instance payload data for dynamic primitives
* Updates to the VirtualShadowMapArrayCacheManager to support the invalidation of cache pages upon removal of dynamic primitives
* Various updates and fixes to support writing dynamic primitives' instance scene data and instance payload data from the GPU
* All these changes are needed by a few existing systems that will be using them soon to render via GPU Scene

#rb ola.olsson

#ROBOMERGE-AUTHOR: aurel.cordonnier
#ROBOMERGE-SOURCE: CL 18375767 via CL 18375771 via CL 18375781
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18375783 by aurel cordonnier in ue5-release-engine-test branch]
2021-12-03 19:54:06 -05:00
jamie hayes
4523c7cecd * Updates to GPU Scene and the GPUSceneCollector to support handling the upload of multiple instances and instance payload data for dynamic primitives
* Updates to the VirtualShadowMapArrayCacheManager to support the invalidation of cache pages upon removal of dynamic primitives
* Various updates and fixes to support writing dynamic primitives' instance scene data and instance payload data from the GPU
* All these changes are needed by a few existing systems that will be using them soon to render via GPU Scene

#rb ola.olsson

#ROBOMERGE-AUTHOR: jamie.hayes
#ROBOMERGE-SOURCE: CL 18359911 via CL 18375369 via CL 18375397
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18375424 by jamie hayes in ue5-release-engine-test branch]
2021-12-03 17:54:14 -05:00
jon nabozny
5fd91e8942 Working around D3D11 hitches caused by unpaged memory returned from Map. The workaround is to have UnifiedBuffer create brand new resources instead of updating existing ones.
#rb ola.olsson, kenzo.terelst, chris.bunner, ben.woodhouse
#preflight 619d019e47752856c967e8e9

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 18272226 via CL 18272299 via CL 18272307 via CL 18272369 via CL 18272376 via CL 18273256 via CL 18277581 via CL 18373265 via CL 18373289
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18373442 by jon nabozny in ue5-release-engine-test branch]
2021-12-03 16:21:10 -05:00
graham wihlidal
53d72c2081 Implemented Nanite support for per-instance hit proxy picking, and also for the visualize level instance workflows.
#ushell-cherrypick of 18060277 by graham.wihlidal
#preflight 619575d4b06e66c4f6aa549f
#rb brian.karis, ola.olsson, matt.kuhlenschmidt
[FYI] richard.talbotwatkin, michal.valient

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 18233098 via CL 18372219 via CL 18372315
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18372361 by graham wihlidal in ue5-release-engine-test branch]
2021-12-03 15:37:56 -05:00
ola olsson
3070fe148e Fix VSM invalidation handling such that uninitialized instances are not processed when multiple UpdateAllPrimitiveSceneInfos are called back to back (without an UpdateGPUScene in between).
- Fix debug visualization that was inverted (red should be for invalidated)

#rb andrew.lauritzen

#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 18205579 via CL 18372165 via CL 18372288
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18372332 by ola olsson in ue5-release-engine-test branch]
2021-12-03 15:36:38 -05:00