- when CopySrc or CopyDest is set on either depth or stencil, force the range to include the entire texture.
- force the transitions of both depth and stencil to occur on the same pass (do not split the copy transition into two different passes if StateBefore is not the same).
#rb zach.bethel
#jira UE-143575,UE-147932
#preflight 6272c703365de864c4be9312
[CL 20050377 by jeannoe morissette in ue5-main branch]
- Refactord 'Finalized Access' feature into a more flexible 'External' vs. 'Internal' access mode per resource toggle.
- Resources can transition between modes multiple times within the graph.
- Supports async compute pipeline.
- Supports queueing of requests to avoid back-to-back helper passes.
- This feature is needed to support conversion of GPU scene buffers.
- Deprecated the ReadOnly and ForceTracking resource flags and added a 'SkipTracking' flag instead.
- Previous semantics were confusing and error prone.
- New model requires a manual flag to tell RDG never to transition a resource.
- This flag is used for read-only dummy resources as an optimization.
- Renamed some of the auxiliary 'FinalizedResource' utilities since the name no longer matches the semantics.
#preflight 6266cc6d0634d0904ce4ba46
[CL 19904734 by zach bethel in ue5-main branch]
- Added resource pool counters and events.
- Added AllocatePooledBuffer method and refactored pool to no longer take a command list.
- Refactored swap chain barrier logic to be a bit cleaner.
- Added helper methods to cast between views.
- Added power of two alignment option to buffer pool.
- Added GetTypeHash implementations for RDG SRV | UAV descriptors.
#preflight 62631046006fa20b683d130f
[CL 19873407 by zach bethel in ue5-main branch]
- New RHI command list SetTrackedAccess method for the user to supply a current whole-resource state.
- New RHI command context GetTrackedAccess method for querying the tracked access in RHIBeginTransitions / RHIEndTransitions on the RHI thread.
- Hooked RHICmdList.Transition and FRHICommandListExecutor::Transition to assign tracked state automatically.
- Refactored RDG and resource pools to use new RHI tracking.
- FRDGPooledBuffer / FRDGPooledTexture no longer contain tracked state. RDG temp-allocates state through the graph allocator instead.
- All prologue transitions are 'Unknown', and all epilogue transitions coalesce into a whole resource state.
- Implemented platform support for patching the 'before' state with the tracked state.
- Implemented various RHI validation checks:
- Asserts that the user assigned tracked state matches RHI validation tracked state, for all subresources.
- Asserts that tracked state is not assigned or queried from a parallel translation context.
- Added FRHIViewableResource and FRHIView base classes to RHI. FRHIView contains a pointer to an FRHIViewableResource. This is currently a raw pointer, but should be extended to a full reference in a later CL.
NOTE on RHI thread constraint:
Transition evaluation is now restricted to the RHI thread (i.e. no parallel translation contexts). Transitions aren't performed in parallel translate contexts anyway, so this is not a problem. If, however, we decide to refactor parallel translation to be more general, this implementation could be extended to track the state per context and update from the 'dispatch' thread.
#preflight 6233b4396666d7e753a16aaf
#rb kenzo.terelst
[CL 19513316 by zach bethel in ue5-main branch]
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]
- 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]
* 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]
- 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]
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]
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]