The RDG builder holds a scope in order to avoid deletion of any resources during the graph setup / execution. This resolves the need to hold a strong reference during the RDG graph lifetime.
If FlushPendingDeletes is called within one of these scopes, the resources are instead queued onto the immediate command list and flushed at the end of the scope.
This change removes strong references held of uniform buffers held by RHI commands and certain platform contexts. When a flush is encountered, the backends will clear all caches removing any potential dangling references.
Resources can opt out of lifetime extension by calling ->DisableLifetimeExtension(). Subsequent calls to FlushPendingDeletes will release the resource immediately. This is used by a couple edge cases where resources must be deleted mid-frame (namely, DumpGPU and BVH building).
#rb christopher.waters
#preflight 63c5e5722e714f64ad017cfd
[CL 23734079 by zach bethel in ue5-main branch]
[FYI] christopher.waters
Original CL Desc
-----------------------------------------------------------------
RHI header dependency cleanup
- Reducing other header dependencies from RHIDefinitions.h
- Moved a few functions to the new RHIStrings.h
- Uniform buffer layout initializer moved to its own file to reduce RHI dependency on MemoryLayout.
#preflight 63bca752577437afe604b097
[CL 23631957 by bob tellez in ue5-main branch]
- Reducing other header dependencies from RHIDefinitions.h
- Moved a few functions to the new RHIStrings.h
- Uniform buffer layout initializer moved to its own file to reduce RHI dependency on MemoryLayout.
#preflight 63bca752577437afe604b097
[CL 23631946 by christopher waters in ue5-main branch]
This allows to define a new dynamic scaling in the renderer with low amount of boiler plate:
DynamicRenderScaling::FHeuristicSettings GetDynamicTranslucencyResolutionSettings()
{
RenderingDynamicScaling::FHeuristicSettings BucketSetting;
BucketSetting.Model = RenderingDynamicScaling::EHeuristicModel::Quadratic;
BucketSetting.bModelScalesWithPrimaryScreenPercentage = true;
BucketSetting.MinResolutionFraction = ...
...
return BucketSetting;
}
DynamicRenderScaling::FBudget GDynamicTranslucencyResolution(TEXT("DynamicTranslucencyResolution"), &GetDynamicTranslucencyResolutionSettings);
And then simply define a scope to measure the GPU timing as such:
{
DynamicRenderScaling::FRDGScope DynamicTranslucencyResolutionScope(GraphBuilder, GDynamicTranslucencyResolution);
// add passes to GraphBuilder
}
#rb zach.bethel
#jira UE-152561
#preflight 628f1219bb14235aa38c904c
[CL 20376428 by Guillaume Abadie 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]
* Page captures are now tracked separately per GPU, to avoid problems with uninitialized pages on other GPUs. Pages that need capturing for the first time on a given GPU are prioritized and not counted against the throttled limit for page recaptures.
* Lumen scene buffer uploads are run across all GPUs.
* Lumen one-time procedural texture generation (OctahedralSolidAngleTexture) runs across all GPUs.
* DumpGPU was upgraded to be able to preview compressed formats used by Lumen (BC4, BC5, BC6H, BC7), critical for debugging Lumen behavior.
#jira UE-146458
#rnx
#rb krzysztof.narkowicz guillaume.abadie
#preflight 62374b6ff101b8d0afc6ac7f
#lockdown Mihnea.Balta
#ROBOMERGE-AUTHOR: jason.hoerner
#ROBOMERGE-SOURCE: CL 19807327 in //UE5/Release-5.0/... via CL 19807923
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v939-19570697)
[CL 19812041 by jason hoerner in ue5-main branch]