Commit Graph

37 Commits

Author SHA1 Message Date
mihnea balta
9a6e73dd71 Fix crash in D3D11 when GPU crash debugging is enabled.
FRDGEventScopeStack::EndExecute did not pass the value of bRDGEvents to the scope array, so we ended up trying to pop events that were never pushed when bRDGEvents was false.

#rb Zach.Bethel
#rnx
#preflight skip

[CL 22994705 by mihnea balta in ue5-main branch]
2022-11-04 16:40:10 -04:00
zach bethel
3b9b0f2d52 Resubmit of 22872901.
Added RDG_EVENT_SCOPE_FINAL variant that silences child scopes / events.
 - Added r.RDG.Events CVar to control GPU event behavior.
      - 0 disables GPU events; 1 enables GPU events and FINAL scopes suppress child scopes; 2 enables all GPU events.

#preflight 63614e16397c7af896701cae

[CL 22917968 by zach bethel in ue5-main branch]
2022-11-02 11:46:28 -04:00
nat parkinson
442a36cfd4 [Backout] - CL22872901 as it seems to have caused compile errors
[FYI] zach.bethel
Original CL Desc
-----------------------------------------------------------------
Added RDG_EVENT_SCOPE_FINAL variant that silences child scopes / events.
 - Added r.RDG.Events CVar to control GPU event behavior.
      - 0 disables GPU events; 1 enables GPU events and FINAL scopes suppress child scopes; 2 enables all GPU events.

#preflight 6360117d117bb4ce9da40ef0
#rb krzysztof.narkowicz, yuriy.odonnell, daniel.wright

[CL 22879513 by nat parkinson in ue5-main branch]
2022-11-01 07:02:14 -04:00
zach bethel
738376cef5 Added RDG_EVENT_SCOPE_FINAL variant that silences child scopes / events.
- Added r.RDG.Events CVar to control GPU event behavior.
      - 0 disables GPU events; 1 enables GPU events and FINAL scopes suppress child scopes; 2 enables all GPU events.

#preflight 6360117d117bb4ce9da40ef0
#rb krzysztof.narkowicz, yuriy.odonnell, daniel.wright

[CL 22876153 by zach bethel in ue5-main branch]
2022-10-31 20:56:49 -04:00
luke thatcher
0a443d68c5 Improve performance of RHI GPU draw call / num primitive stats
- Old code relied on atomic increments in the RHI_DRAW_CALL_INC /  RHI_DRAW_CALL_STATS macros, which is expensive, particularly on platforms with poor atomic performance.
 - New system replaces the atomic writes with a context-specific stats structure, which is accumulated by the RHI thread into the global structure.
 - Contexts write stat data through a "Stats" pointer on the IRHIComputeContext, which is set automatically by the command list management code. The pointer is replaced whenever a new "draw call category" is pushed, to redirect the counts.
 - Also moved some macro definitions around so more of the system can be removed when HAS_GPU_STATS is 0. Removed dependencies on CSV_PROFILER.

Moved Begin/EndFrame, Begin/EndScene, Begin/EndDrawingViewport into the immediate RHICmdList
 - They were already immediate-only functions due to a check() they contain.

#rb Zach.Bethel
#preflight 635fed4af97758810b50cb06

[CL 22875455 by luke thatcher in ue5-main branch]
2022-10-31 20:02:27 -04:00
luke thatcher
0c5c2b3e27 Merging //UE5/Dev-ParallelRendering (up to CL 22203289) to //UE5/Release-5.1
This change includes significant refactor work performed in //UE5/Dev-ParallelRendering. A brief summary of the work is as follows:

Refactored RHI command lists
 - Removal of the "immediate" async compute command list
 - Introduced an "active pipe" on each command list, allowing RHICmdLists to record work for either graphics or async compute. Pipes can be selected using the SwitchPipeline() function, or the FRHICommandListScopedPipeline helper.
 - New explicit command list submission RHI API (RHIFinalizeContext, RHISubmitCommandLists). The IRHICommandContextContainer type has been removed.
 - Explicit GPU submission is automatically appended to the immediate command list when it is dispatched to the RHI thread.

Platform RHI implementations
 - The new submission API has been implemented across all platforms. Some platforms required a significant refactor.

#rb Mihnea.Balta,Kenzo.Terelst
#jira UE-139550
#preflight 6332e3641003050806d802ef

[CL 22239063 by luke thatcher in ue5-main branch]
2022-09-28 21:40:05 -04:00
Bryan sefcik
b4a6e947d8 Ran IWYU on Public headers under Engine/Source/Runtime/...
Headers are updated to contain any missing #includes needed to compile and #includes are sorted.  Nothing is removed.

#ushell-cherrypick of 21065896 by bryan.sefcik
#preflight 62d4b1a5a6141b6adfb0c892
#jira

#ROBOMERGE-OWNER: Bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21150156 via CL 21151754 via CL 21154719
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)
#ROBOMERGE-CONFLICT from-shelf

[CL 21181076 by Bryan sefcik in ue5-main branch]
2022-07-20 11:31:36 -04:00
Guillaume Abadie
bbb8d0e2c8 Rewrites dynamic resolution on top of the DynamicRenderScaling API
#rb none
#jira UE-152561
#preflight 628f43e6f622d972b5cb4f2f

[CL 20377247 by Guillaume Abadie in ue5-main branch]
2022-05-26 05:34:08 -04:00
Guillaume Abadie
0734868f53 Implements DynamicRenderScaling API with GPU timing measurement integrated within RDG
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]
2022-05-26 01:58:36 -04:00
john huelin
95c1680b6e Fix DrawCallCount per pass not working when multithreaded RHI command recording is enabled.
[REVIEW]
#rnx

#ROBOMERGE-OWNER: john.huelin
#ROBOMERGE-AUTHOR: john.huelin
#ROBOMERGE-SOURCE: CL 20105654 via CL 20105671 via CL 20107113 via CL 20107146
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20110543 by john huelin in ue5-main branch]
2022-05-09 16:35:01 -04:00
jason hoerner
a343f80411 UE5_RELEASE: Compile error fix for CL 18591295.
#preflight trivial

#ROBOMERGE-AUTHOR: jason.hoerner
#ROBOMERGE-SOURCE: CL 18592968 in //UE5/Release-5.0/... via CL 18592969 via CL 18592980
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18592998 by jason hoerner in ue5-main branch]
2022-01-12 20:46:30 -05:00
jason hoerner
294c5dd557 UE5_RELEASE: Virtual Production, improved profiling for multiple view family scenarios.
* Increased limit for GPU profiler events on D3D12.  A typical frame with 4 view families would easily exhaust the old limit of 1K events resulting in many events not showing up in the profile -- limit increased to 8K, and confirmed negligible difference in memory.  Fixed bug where we were only using half the queries allocated as well (unnecessary multiplication by 2 when calling RHICreateRenderQueryPool).
* Added optional "ProfileDescription" to FSceneViewFamily, which is appended to the Unreal Insights profile event names for both CPU and GPU, so you can differentiate view families.
* Infrastructure added to CPU profiler to allow a verbose name to be added to a Stat timing block.
* Infrastructure added to GPU profiler to allow verbose names to be added to timing blocks in general, both Event and Stat timing blocks.
* Added stats display for Display Cluster listing the CPU and GPU cost, and GPU assignment per view family by name, with the goal of allowing clients to tune features enabled per view family to adjust performance, without needing to gather performance information from Unreal Insights.
* FSceneRenderer::DoCrossGPUTransfers uses push transfer without lockstep (logic copied from 4.27), which significantly improves perf.

#rb zach.bethel marc.audy mihnea.balta
#jira none
#rnx
#preflight 61df4d23484d866ec01f17cf

#ROBOMERGE-AUTHOR: jason.hoerner
#ROBOMERGE-SOURCE: CL 18591295 in //UE5/Release-5.0/... via CL 18591308 via CL 18591324
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18591346 by jason hoerner in ue5-main branch]
2022-01-12 18:25:48 -05:00
jeremy moore
d51269ce92 Fix GPU stat scope race condition.
Start or stop trace GPU channel could lead to mismatched scope begin/end.
[FYI] zach.bethel
#preflight 61bc0e61b12f441ed9e0e118

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 18483144 in //UE5/Release-5.0/... via CL 18483148
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18483149 by jeremy moore in ue5-release-engine-test branch]
2021-12-16 23:41:00 -05:00
jeremy moore
c6cfb9d57f Fix RDG event scope race condition.
Start or stop trace RDG channel could lead to mismatched scope begin/end.
#preflight 61bb55cfbd7d5fe54ec56d29
#rb guillaume.abadie
[FYI] zach.bethel

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 18475949 in //UE5/Release-5.0/... via CL 18481328
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18481434 by jeremy moore in ue5-release-engine-test branch]
2021-12-16 19:26:09 -05: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
zach bethel
1a85777c3b Minor clean-up of RDG event name. Simplified the 'compiled out' name and fixed misspelling of a variable name.
#rb none

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

[CL 16863834 by zach bethel in ue5-release-engine-test branch]
2021-07-15 12:40:16 -04:00
zach bethel
5ec769f91e RDG Parallel Execution (disabled by default)
- Refactored RDG to support free-threaded execution of passes.
 - Refactored renderer to use specific RHI command list variants in pass lambda. Immediate command list passes are forced to stay on the render thread, while other variants can be parallelized.

#rb christopher.waters

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

[CL 16838724 by zach bethel in ue5-release-engine-test branch]
2021-07-13 12:38:37 -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
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
aurel cordonnier
50944fd712 Merge UE5/RES @ 16162155 to UE5/Main
This represents UE4/Main @ 16130047 and Dev-PerfTest @ 16126156

[CL 16163576 by aurel cordonnier in ue5-main branch]
2021-04-29 19:32:06 -04:00
zach bethel
701f331905 Fix for RDG using MemStack allocator.
#rb rolando.caloca
#rnx

#ROBOMERGE-SOURCE: CL 15786953 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v783-15756269)

[CL 15790761 by zach bethel in ue5-main branch]
2021-03-23 22:42:59 -04:00
Marc Audy
8f73cd7fa9 Merge UE5/Release-Engine-Staging @ 15630841 to UE5/Main
This represents UE4/Main @ 15601601

[CL 15631170 by Marc Audy in ue5-main branch]
2021-03-05 19:27:14 -04:00
zach bethel
274c3b2ba7 RDG Insights Plugin
#jira none
#rb catalin.dragoiupruna

[CL 15296346 by zach bethel in ue5-main branch]
2021-02-03 13:17:04 -04:00
Marc Audy
bc88b73a29 Merge Release-Engine-Staging to Main @ CL# 15151250
Represents UE4/Main @ 15133763

[CL 15158774 by Marc Audy in ue5-main branch]
2021-01-21 16:22:06 -04:00
Marc Audy
bf80889353 UE5/Release-Engine-Staging to UE5/Main
This represents UE4/Main up to CL# 14958402

[CL 15028197 by Marc Audy in ue5-main branch]
2021-01-08 19:56:07 -04:00