Commit Graph

28 Commits

Author SHA1 Message Date
christopher waters
5953546bfb Adding RHIUniformBufferLayoutInitializer and RHIUniformBufferLayout is a proper FRHIResource. This brings proper RHI lifetime support to RHIUniformBufferLayout so we don't delete the layouts while RHI commands that use them are still in flight.
This should fully address UniformBufferLayout/UniformBuffer crashes that randomly happen during shader compiling in the Editor.

#jira none
#rb arciel.rekman, ben.ingram, mihnea.balta, stu.mckenna, will.damon
#preflight 611eb6c6008be90001f8b031

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

[CL 17243630 by christopher waters in ue5-release-engine-test branch]
2021-08-19 23:56:04 -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
jian ru
95a7717441 Conditional GPU copies for RDG buffer uploads. This fixes broken GPU captures on some platforms when CPU-initialized GPU-modified buffers are used
#jira UE-118792

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

[CL 16933931 by jian ru in ue5-release-engine-test branch]
2021-07-22 22:31:13 -04:00
zach bethel
d03ba8eaba Remove split transition for swap chain textures. This avoids cases where certain platforms will stall at the beginning of graph execution.
#rb christopher.waters
#jira UE-119087

#ROBOMERGE-SOURCE: CL 16850825 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16850829 by zach bethel in ue5-release-engine-test branch]
2021-07-14 11:51:24 -04:00
zach bethel
2ab8c34577 Replaced FRDGBufferUploader with internal RDG upload. Removes several transitions and passes and removes immediate command list passes from the graph.
#rb jian.ru

[CL 16459303 by zach bethel in ue5-main branch]
2021-05-25 20:46:17 -04:00
zach bethel
b843dabf06 Minor RDG fixes and support for read-only system textures.
[CL 16456650 by zach bethel in ue5-main branch]
2021-05-25 17:11:34 -04:00
zach bethel
24c98b27a3 Fix for RDG resources never being culled.
#rb none

[CL 16412111 by zach bethel in ue5-main branch]
2021-05-20 19:00:29 -04:00
zach bethel
90bc2efada RDG refactor to enable draining of work after issuing occlusion queries.
- New Drain() method on FRDGBuilder; will flush all pending work.
 - Drained passes are not culled; resource lifetimes are extended; async compute fences are optimized as best as possible but fence joining may occur after the drain.
 - Batch up and pre-build all resource transitions. This is a prerequisite for parallel command lists.
 - Removed ServiceLocalQueue passes with built-in RDG AddDispatchHint().

#jira UE-114622

[CL 16393495 by zach bethel in ue5-main branch]
2021-05-19 17:54:58 -04:00
zach bethel
804d775535 Minor RDG optimizations.
- Simplified texture subresource tracking.
 - Removed map lookup for each resource in SetupPass.
 - Improved Compile / CollectPassResources to reduce cache misses.
 - Added some container reservations to reduce reallocation costs.
 - Added snapping of buffers to page boundaries to improve re-use.

#rb none

[CL 16208311 by zach bethel in ue5-main branch]
2021-05-05 11:58:15 -04:00
zach bethel
b67b0d2dda Added FRHI{Texture, Buffer}ViewCache to clean up FRDGPooledX / FRHITransientX duplicate code. Added support for UAVs with a format.
#rb christopher.waters
#preflight 6086ee7c1046fb00018cec87

[CL 16116698 by zach bethel in ue5-main branch]
2021-04-26 14:12:08 -04:00
zach bethel
47cf1f4458 Rewrite of RHI transient resource system.
- Views are cached on RHI transient resources; view renames are no longer necessary.
 - RHI Transient resources utilize a single cache per heap keyed off of the descriptor + offset. Resource caches and heaps are garbage collected.
 - CPU performance is effectively equivalent to the existing pooled resource method.
 - Added common RHI transient resource allocator implementation in RHI core; significantly reduces the amount of platform code.
 - Resource aliasing overlaps are tracked by the RHI and submitted through an acquire operation.
 - Fixed D3D12 implementation to support multi-GPU.
 - Removed condition that excluded small (<64k) buffers in the transient allocator.
 - RHI validation now checks that resource overlaps are valid; i.e. if an overlap occurs between resource A and B during an acquire of B, validation checks that A has been discarded.

#rb graham.wihlidal, luke.thatcher, kenzo.terelst

[CL 16076280 by zach bethel in ue5-main branch]
2021-04-21 13:03:28 -04:00
zach bethel
583f3b7ce1 Allow extracted resources to be re-used within the same graph if the reference is no longer externally held. Allows overlap of shadow HZB, saving 45MB.
#rb trivial
#lockdown michal.valient

#ROBOMERGE-SOURCE: CL 15951972 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v787-15839533)

[CL 15951980 by zach bethel in ue5-main branch]
2021-04-08 00:39:34 -04:00
zach bethel
9fc8b1722d Refactored RDG ConvertToUntrackedX functionality into the RDG builder; renamed the operation to 'FinalizeAccess' for clarity, as the resource is considered finalized in the graph and will not transition to any other state. This operation now supports multiple resources, improving performance in cases where multiple resources are finalized back-to-back. Added validation to check that the user don't attempt to use it outside of its finalized state. Fixed up a few places where this assumption was being violated. Minor refactors in various places to use new API.
#rb arne.schober, christopher.waters
#jira none

[CL 15931331 by zach bethel in ue5-main branch]
2021-04-06 11:45:09 -04:00
Yuriy ODonnell
e022bafd5d Groundwork for managing ray tracing resources in RDG.
- Added BVHRead to ERHIAccess::ReadOnlyExclusiveMask BVHRead
- Added FRDGBufferDesc::EUnderlyingType::AccelerationStructure
- Added acceleration structure handling in EnumerateBufferAccess, FindFreeBufferInternal, GetOrCreateSRV, FRDGBufferSRVDesc

#fyi zach.bethel

[CL 15820134 by Yuriy ODonnell in ue5-main branch]
2021-03-25 06:36:58 -04:00
zach bethel
8c1793ad5a Integration of RHI transient allocator into RDG.
- Replaced legacy transient support from RDG and replaced with new API.
 - Reworked acquire / discard operations a bit and added RHI validation to track correctness.
 - Reworked RDG barrier batching to include acquire / discard operations.
 - Hardened render pass merging logic and expanded to support lifetime extension of transient resources.
 - Added transient tag to RDG insights to track which resources are transient.

#rb luke.thatcher, kenzo.terelst

[CL 15726534 by zach bethel in ue5-main branch]
2021-03-17 12:44:59 -04:00
zach bethel
cfcbdd1d90 Removed dead code from render target pool; removed 'passthrough' RDG hacks used during conversion.
#rb none
#rnx

[CL 15584180 by zach bethel in ue5-main branch]
2021-03-03 12:56:07 -04:00
zach bethel
b544f9a0a6 Fixed bad merge of 4.26 transient resource fixes in RDG.
#rnx
#rb none

[CL 15566509 by zach bethel in ue5-main branch]
2021-03-02 00:38:03 -04:00
zach bethel
af9ebacf59 Reimplemented fix for transient resources in RDG.
#rnx

[CL 15474055 by zach bethel in ue5-main branch]
2021-02-19 14:33:45 -04:00
zach bethel
0a145b23fe Improved RDG state merging to better handle subresources. Subresource tracking is used for the rest of the graph if subresource states are encountered. Improved error reporting for edge case where transitions are inserted out of order. Added explicit merge check for depth read / write to make sure that it doesn't merge with anything else.
#rb none

[CL 14874576 by zach bethel in ue5-main branch]
2020-12-07 18:45:31 -04:00
zach bethel
7ae3cdb31f Implemented support for multi-pipe UAV access. Implemented command list stats on RDG builder to avoid helper passes. Added {Begin, End}UAVOverlap to RDG UAVs.
#rb none

[CL 14821597 by zach bethel in ue5-main branch]
2020-11-30 13:27:08 -04:00
Marc Audy
a7f9391231 Merge UE5/Release-Engine-Staging @ 14811410 to UE5/Main
This represents UE4/Main @ 14768117

For ReleaseObjectVersion.h
#lockdown Marcus.Wassmer

[CL 14811440 by Marc Audy in ue5-main branch]
2020-11-24 18:42:39 -04:00
zach bethel
7c55500b43 RDG refactors in preparation for scene render targets refactor.
- Added simple blackboard container.
 - Added support for checking if a resource has been produced within the graph.
 - Moved all RHI validation into user validation cpp file.
 - Fixed bug in graph producer compilation logic when switching to subresources.

#rb none

[CL 14766062 by zach bethel in ue5-main branch]
2020-11-17 17:04:48 -04:00
zach bethel
5630bcfd89 Added Multi-pipeline Transition Support to platforms and RDG. Fixed uniform buffer hack in composition lighting.
#rb luke.thatcher, kenzo.terelst
#jira none

[CL 14727873 by zach bethel in ue5-main branch]
2020-11-11 19:22:36 -04:00
zach bethel
55454613b7 Merged CL to fix UAV crash: Refactored RDG pooled buffer UAV/SRV creation into public helper functions to aid with hair conversion.
#rnx
#jira UESP-3926
#rb charles.derousiers
#ushell-cherrypick of 14480968 by zach.bethel

[CL 14540380 by zach bethel in ue5-main branch]
2020-10-21 18:38:31 -04:00
Marcus Wassmer
3b81cf8201 Merging using //UE5/Main_to_//UE5/Release-Engine-Staging @14384769
autoresolved files
#rb none

[CL 14384911 by Marcus Wassmer in ue5-main branch]
2020-09-24 00:43:27 -04:00