Commit Graph

30 Commits

Author SHA1 Message Date
zach bethel
1a6dbc061d Deprecated FRDGBufferDesc::EUnderlyingType
#preflight 62756de8d8373707f22a6144
#rb christopher.waters

[CL 20082899 by zach bethel in ue5-main branch]
2022-05-06 15:44:23 -04:00
zach bethel
0e43ad4919 Added buffer pool dump command for debugging memory usage.
#preflight 6263467c623e351b354bf3c2

[CL 19903364 by zach bethel in ue5-main branch]
2022-04-25 11:38:06 -04:00
zach bethel
3864629f00 Minor RDG improvements in preparation for UnifiedBuffer conversion.
- 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]
2022-04-22 17:11:57 -04:00
zach bethel
a00b40ad3b Deprecated GetRenderTargetItem() from IPooledRenderTarget.
#preflight 624ddb30090236773a1a83e0
#rb luke.thatcher

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 19655641 via CL 19655653 via CL 19655661
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v938-19570697)

[CL 19657582 by zach bethel in ue5-main branch]
2022-04-06 18:24:24 -04:00
zach bethel
f457a69101 Added RHI tracked access API to remove Unknown transitions.
- 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]
2022-03-25 11:19:10 -04:00
mihnea balta
3e7a9cd772 Fix crash on exit due to RHI commands enqueued by the transient allocator being executed after the allocator is destroyed.
#jira UE-145180
#rnx
#lockdown Michal.Valient
#preflight 6228a8130d5a90e98ebbfca0
#rb Zach.Bethel

#ROBOMERGE-AUTHOR: mihnea.balta
#ROBOMERGE-SOURCE: CL 19322378 in //UE5/Release-5.0/... via CL 19324115
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19348081 by mihnea balta in ue5-main branch]
2022-03-10 21:53:51 -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
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
jeannoe morissette
c8734e7588 Also clear AllocatedBufferHashes in FRDGBufferPool::ReleaseDynamicRHI so that both arrays always match. Keeps the FRDGBufferPool in a reusable state for experiments.
#rb zach.bethel
#preflight 61f1884273238441cb646293

#ROBOMERGE-AUTHOR: jeannoe.morissette
#ROBOMERGE-SOURCE: CL 18738113 in //UE5/Release-5.0/... via CL 18738347 via CL 18739391
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18739973 by jeannoe morissette in ue5-main branch]
2022-01-26 13:54:46 -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
8c6ea80834 Relaxed validation on transient resource pool shutdown due to non-deterministic static initialization order.
#preflight 61e1d2de00246899a94c26c5
#jira UE-138871

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18623506 in //UE5/Release-5.0/... via CL 18623528 via CL 18623544
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18623564 by zach bethel in ue5-main branch]
2022-01-14 16:28:58 -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
aurel cordonnier
34f55d3a4a Merge from Release-Engine-Test @ 17946149 to UE5/Main
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035

[CL 17949667 by aurel cordonnier in ue5-main branch]
2021-10-27 15:14:40 -04:00
zach bethel
8d8b93086a Reworked RDG pooled buffer size alignment so that it no longer affects the external-facing descriptor.
#rb none
#jira FROST-2514
#fyi charles.derousiers

[CL 16222555 by zach bethel in ue5-main branch]
2021-05-06 12:36:40 -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
953d21cec8 Transient allocator support for platform
#lockdown nick.whiting


#ROBOMERGE-SOURCE: CL 16106012 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16106022 by zach bethel in ue5-main branch]
2021-04-23 15:48:49 -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
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
Emil Persson
4516b985df Name all resources and make naming mandatory
#rb yuriy.odonnel, kenzo.terelst

[CL 15416919 by Emil Persson in ue5-main branch]
2021-02-16 08:37:39 -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
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
Michal Valient
95d19f95b1 [REVERB] Merging //UE4/Private-Reverb-Development@13832732
#rb graham.wihlidal, rune.stubbe, brian.karis, andrew.lauritzen, jeff.farris

[CL 13834854 by Michal Valient in ue5-main branch]
2020-07-06 18:58:26 -04:00
ryan durand
0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00