Commit Graph

200 Commits

Author SHA1 Message Date
aleksander netzel
9a8aa76713 Add ERDGPassFlags::NeverParallel to allow RDG passes to stay on render thread.
Both Immediate/AsyncCompute passes are always executed in order on the render thread but other RDG passes can run in parallel.
With my previous change, RayTracingScene pass was changed to Compute/AsyncCompute to have the correct order on the GPU.
But when it was set to Compute (when AsyncCompute was disabled) it was running in parallel with passes it depends on which led to random crashes.
Because the dependency between passes was implicit, we needed a new flag to express the intent and get the desired order between execution lambdas.

On behalf of Zach Bethel.

#rb zach.bethel
#jira UE-141003
#preflight 61fb0d9e923ac18db7015160
#lockdown michal.valient

#ROBOMERGE-AUTHOR: aleksander.netzel
#ROBOMERGE-SOURCE: CL 18841970 in //UE5/Release-5.0/... via CL 18841984 via CL 18842341
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18842374 by aleksander netzel in ue5-main branch]
2022-02-03 09:15:49 -05:00
zach bethel
9996233f7a Removed unused legacy MSAA multi-texture support from IPooledRenderTarget.
- Deprecated legacy members from FPooledRenderTargetDesc.
 - Deprecated ETextureRenderTarget and removed from RDG.
 - TargetableTexture always equals ShaderResourceTexture.
 - Simplified render target pool FindFreeElement.
 - Create pooled buffers and textures with a known state.

#rb graham.wihlidal
#preflight 61f8488568795b2f45852274

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18796880 in //UE5/Release-5.0/... via CL 18797840 via CL 18799070
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18799188 by zach bethel in ue5-main branch]
2022-01-31 17:22:31 -05:00
zach bethel
2230e96167 Removal of RDG drain experiment for UE5 release. It is currently unused and hasn't proven itself necessary yet. It would be relatively straightforward to re-add if the need arises in the future.
#rb mihnea.balta
#preflight 61f82d9b3e13556eb9c3eb34

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18794948 in //UE5/Release-5.0/... via CL 18795422 via CL 18796381
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18796735 by zach bethel in ue5-main branch]
2022-01-31 15:55:31 -05:00
zach bethel
25f20493c4 Backing out changes to remove unknown states in pooled resources. Unported code is still transitioning pooled resources while not updating the tracked state. This will result in incorrect before states.
#rb none
#preflight 61f1920ef8088a3d298fb3a9

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18740193 in //UE5/Release-5.0/... via CL 18740756 via CL 18741541
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18742250 by zach bethel in ue5-main branch]
2022-01-26 15:04:14 -05:00
zach bethel
516e26c7e3 Fix for assert when async compute pass creates a transient resource. The resource lifetime was being properly extended to the graphics fork pass, but the graphics fork pass was also within a merged render pass, and the resource lifetime was not properly extended to the start of the render pass. This is important because resource transitions cannot occur within a render pass. This fix adjusts async compute resource lifetimes to begin and end on render pass boundaries of the fork / join graphics pass.
#jira UE-139261
#rb ben.woodhouse
#preflight none

#ROBOMERGE-OWNER: zach.bethel
#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18678963 via CL 18678972 via CL 18680925 via CL 18681076 via CL 18681103
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v902-18672795)

[CL 18681506 by zach bethel in ue5-main branch]
2022-01-20 16:30:26 -05:00
zach bethel
14085dec09 RDG now reuses tracked state for external pooled textures and buffers. Added a variant of RegisterExternal{Texture, Buffer} that allows the user to specify the actual state if transitioned outside of RDG.
#preflight 61e84c67276892ce107685a0
#rb kenzo.terelst

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18662047 in //UE5/Release-5.0/... via CL 18662058 via CL 18662082
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v900-18638592)

[CL 18662103 by zach bethel in ue5-main branch]
2022-01-19 14:08:44 -05:00
zach bethel
2f790c0cc8 Removed r.RenderTargetPool.Events visualizer. It has been replaced by RDG insights.
#rb none
#preflight 61e6f8bb837b79f7cced82ee

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18642485 in //UE5/Release-5.0/... via CL 18644124 via CL 18644421
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v900-18638592)

[CL 18644664 by zach bethel in ue5-main branch]
2022-01-18 14:18:07 -05:00
jonathan bard
79f32ed47c Misc render-related changes:
* Added single-callback version of CreateStructuredBuffer to automatically infer element size, total size, element count and data pointer (e.g. CreateStructuredBuffer(GraphBuilder, TEXT("MyBuffer"), [&]() -> auto& { return BufferSource; });, where BufferSource is a TArray)
* Added support for uint2 shader parameters
* Added ForceTracking flag to ERDGBufferFlags/ERDGTextureFlags : force the RDG to track a resource even if it can be considered as readonly (no UAV, no RTV, etc.) This allows the graph to copy from and to external textures, and handling the corresponding transitions, for example.

#rb zach.bethel, sebastien.lussier
#tests editor
#preflight 61d8bc681f62d3ad4d728095

#ROBOMERGE-OWNER: jonathan.bard
#ROBOMERGE-AUTHOR: jonathan.bard
#ROBOMERGE-SOURCE: CL 18595021 via CL 18595031 via CL 18595035 via CL 18595668 via CL 18595682 via CL 18595700
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18596726 by jonathan bard in ue5-main branch]
2022-01-13 10:11:22 -05:00
zach bethel
26caf068be Fixed flashing artifact with transient allocator due to incorrect barrier placement. Fixed FastVRAM path in RDG to actually check if FastVRAM is supported.
#rb none
#preflight trivial

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18592457 in //UE5/Release-5.0/... via CL 18592471 via CL 18592497
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18592511 by zach bethel in ue5-main branch]
2022-01-12 19:38:45 -05:00
zach bethel
3b9e24d8b2 Replaced legacy XB1 transient page allocator with RDG page table mapped transient allocator. Added support for ESRAM page pool.
#rb ben.woodhouse
#preflight 61df2577ff67b6fe7ac00eae

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18587728 in //UE5/Release-5.0/... via CL 18587798 via CL 18587831
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18587909 by zach bethel in ue5-main branch]
2022-01-12 14:29:07 -05:00
andrew davidson
b134ef04a2 Type truncation fixes - Renderer
#rb arne.schober
#preflight 61d85ab0932a02483ce13e7d

#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18544411 in //UE5/Release-5.0/... via CL 18544434 via CL 18544466
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18544487 by andrew davidson in ue5-main branch]
2022-01-07 10:40:12 -05:00
andrew davidson
0715ebc996 Type truncation fixes - Renderer
#rb arne.schober
#preflight 61d85ab0932a02483ce13e7d

#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18544411 in //UE5/Release-5.0/... via CL 18544434
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18544466 by andrew davidson in ue5-release-engine-test branch]
2022-01-07 10:39:08 -05:00
zach bethel
a23f0c81d4 Major refactor of transient allocator to support page table mapping implementation and extracted transient resources.
- Implemented common transient page allocator in RHICore.
 - Implemented XBox specific GPU page table mapping allocator.
 - Extended RDG insights to support viewing heap visualization or page pool visualization.

#preflight 61d356682e0e436c725818bf

[CL 18504626 by zach bethel in ue5-main branch]
2022-01-03 18:28:16 -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
guillaume abadie
dd1c4774d5 Improves DumpGPU command
Dumps improvements:
1) Bring up for consoles
2) Better out of memory resiliency during the dumping process
3) Dumps console variables in CSV
4) Dumps process' log after completion
5) Dumps mip chains through FDumpTextureCS compute shader
6) Dumps depth & stencil texture formats through the FDumpTextureCS compute shader
7) Dumps at draw granularity with FRDGBuilder::DumpDraw(); (experimental)
8) Dumps final png screenshot to the dump directory
9) Adds & Dumps the FRDGBufferDesc::Metadata for viewer to decode buffer binary automatically
10) Dumps the PassParameters with structure metadata to decode shader parameters automatically
11) Adds CTRL+SHIFT+/ shortcut

Viewer improvements:
1) Tips display onload to spread some knowledge to the user
2) Supports for opening any pass/resources in new web browser tab
3) Emulates 16 and 32 bits UINT texture visualization with multiple webgl 8bit UINT textures
4) Fixes the webpage's tab going out of memory after visualizing many large resources.
5) Fixes the webpage's tab going out of memory after loading large buffer.
6) Adds support for more texture format with RGB channel reswizzling
7) Implements UI color-sheme based on UE5's editor theme
8) Implements texel color picker capabable of decoding every pixel format.
9) Implements texture viewer zooming with the mouse wheel
10) Implements a r.DumpGPU.Viewer.Visualize to open a specific RDG output resource when opening the viewer

#rb juan.canada
#preflight 619bb638fa0b360c406c42c5
[FYI] juan.canada, zach.bethel

#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 18260079 via CL 18372399 via CL 18372914
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18373039 by guillaume abadie in ue5-release-engine-test branch]
2021-12-03 16:04:00 -05:00
guillaume abadie
d39d2e2bd9 Fixes VisualizeTexture not listing all RDG resources
#rb none
#lockdown michal.valient
#preflight 615dc3f477b42c00019e6d4c

#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 17740153 via CL 17982088 via CL 18367271 via CL 18367315
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18367334 by guillaume abadie in ue5-release-engine-test branch]
2021-12-03 03:42:23 -05:00
guillaume abadie
e0202048e8 Implements r.DumpGPU command
#rb yuriy.odonnell
#lockdown michal.valient
#preflight 615ace99e69d8c00011a309f

#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 17706889 via CL 17969938 via CL 18366598 via CL 18366692
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18366749 by guillaume abadie in ue5-release-engine-test branch]
2021-12-03 02:41:52 -05:00
zach bethel
dfe9fe4b19 Engine changes to enable RDG transient heap visualization mode.
#rb none
#preflight 61379013d9c85a00012fb2ba

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 17447083 via CL 17902765 via CL 18360627 via CL 18360774
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18360847 by zach bethel in ue5-release-engine-test branch]
2021-12-02 18:04:03 -05:00
tuxerr
d299b17d29 PR #8517: fix VK_FDM usage on Vulkan (Contributed by tuxerr)
3 fixes:
* Fixes the GRHISupportsVariableRateShading logic to ensure that bool doesn't get nuked if the device supports FragmentDensityMap but not ShadingRateAttachment.
* Ensures Scene Textures are created as an array when multiview enabled.
* Ensures the RenderPass2 impl supports the Multiview Mask.

#jira UE-131846
#rb steve.smith jeannoe.morissette

#ROBOMERGE-AUTHOR: steve.smith
#ROBOMERGE-SOURCE: CL 17864739 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v883-17842818)

[CL 17864759 by tuxerr in ue5-release-engine-test branch]
2021-10-19 15:28:06 -04:00
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00
charles derousiers
e17a01e51a Add RDG Upload variant which take a lambda function for freeing the CPU memory once the data are uploaded.
#rb zach.bethel
#preflight 612f0d3779d62b0001b43362

#ROBOMERGE-SOURCE: CL 17383153 via CL 17383415
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17383421 by charles derousiers in ue5-release-engine-test branch]
2021-09-01 03:09:25 -04:00
zach bethel
aed2812399 Reworked acquire / discard transitions in RDG to use split barriers to improve overlap.
#jira none

#ROBOMERGE-SOURCE: CL 17182512 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17182558 by zach bethel in ue5-release-engine-test branch]
2021-08-16 17:32:38 -04:00
zach bethel
447ab7a28a Fixed bug with RDG drain and async compute. Fixed transition bug with UAV workaround in upload buffers. Added some command line arguments. Optimiized checks to disable RDG validation if parallel.
#rb none

#ROBOMERGE-SOURCE: CL 16997303 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)

[CL 16997322 by zach bethel in ue5-release-engine-test branch]
2021-07-29 13:02:16 -04:00
zach bethel
a6c2b7ea30 Fixed state merging when r.RDG.Drain is enabled.
#rb trivial

#ROBOMERGE-SOURCE: CL 16962979 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)

[CL 16962993 by zach bethel in ue5-release-engine-test branch]
2021-07-26 19:49:38 -04:00
zach bethel
2f133f4f37 Fixed GPU scene and Nanite resources to support cross-pipeline SRV access.
Re-enabled async compute for Nanite. Fixed submission bug with async compute and parallel RDG where the async compute command list wasn't being submitted correctly in order.

#rb jamie.hayes, luke.thatcher
[FYI] graham.wihlidal
#jira UE-114775

#ROBOMERGE-SOURCE: CL 16937065 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)

[CL 16937073 by zach bethel in ue5-release-engine-test branch]
2021-07-23 10:18:32 -04:00