Commit Graph

154 Commits

Author SHA1 Message Date
ben woodhouse
f01fc33a83 Make a new RenderthreadCriticalPath stat which includes dependent waits. The new stat still excludes GPU occlusion query waits, the present wait and non-critical path waits (waiting for the game thread or RHI thread). Waits for tasks kicked on the GT are included though (unlike the existing stat).
The implementation extends the existing FThreadIdleStats to track critical path vs non-critical path waits for a thread.

The cvar r.RenderThreadTimeIncludesDependentWaits forces the main renderthread stat to use the new behavior, but this is disabled by default for historical tracking reasons.

#rb Nuno Leiria

#ROBOMERGE-AUTHOR: ben.woodhouse
#ROBOMERGE-SOURCE: CL 21386702 via CL 21387159 via CL 21387356 via CL 21391039 via CL 21391830
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v975-21357124)

[CL 21394348 by ben woodhouse in ue5-main branch]
2022-08-15 17:15:00 -04:00
Jason Nadro
9c36c843b8 Removed unacceptable words from RenderCore.
#rb trivial
#jira UE-158668
#preflight 62c840a57e606620fd5c2847

[CL 21007335 by Jason Nadro in ue5-main branch]
2022-07-08 10:54:10 -04:00
Andriy Tylychko
5afd6aaf31 Fixed long-living tasks that drive total mem usage up. Tasks use ConcurrentLinearAllocator that doesn't like long-living allocs as a single alloc can hold an entire mem page occupied. A completion handle uses a different allocator that doesn't have this problem and it can be used for waiting for its parent task completion. A completion handle is used only in rare cases where it's difficult or impossible to shorten task handle lifetime, as in this CL. All other cases were fixed by resetting a task handle when it's completed and thus releasing its memory.
#rb francis.hurteau
#preflight 62b0ac5f2405b4ac9e6a1393

[CL 20754669 by Andriy Tylychko in ue5-main branch]
2022-06-21 04:17:59 -04:00
serge bernier
c2f6dffe7c Low Input latency mode fix
-Allow the frame sync to be kicked from the render thread when using the gtsync==2 (low input latency mode). On some platforms, the RHI thread will block on present. Putting the RHI as the trigger index will block the GameThread until the present is finished (vblank). In low input latency mode, some consoles uses the RHIOffsetThread to kick of the Gamethread, so we dont want it to block on present.
-Use the present mode to submit frame tokens in low input latency mode. Using GT_wait or GT_early introduce stuttering in the frame time since the gamethread will sync on the present when its double buffered. Even if we increase the frame interval (3 or 4), the WaitFrameEventX will eventually block the gamethread when the second display buffer is in used. Note that we delay the barrier transition(RT->Display) until we really use the backbuffer, so we dont technically need to throttle on the frame token, since we are in pseudo triple buffer mode. Issuing GT_Wait/GT_early mode in double buffer mode will always produce bad frame pacing when we use the FRHIFrameOffsetThread approach.
-Set the frame offset interval to zero to sync the os input pooling with the vblank.

[REVIEW] [at]Eric.McDaniel

#ROBOMERGE-OWNER: serge.bernier
#ROBOMERGE-AUTHOR: serge.bernier
#ROBOMERGE-SOURCE: CL 20749857 via CL 20750200 via CL 20750276 via CL 20750599 via CL 20750604
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v970-20704180)

[CL 20751490 by serge bernier in ue5-main branch]
2022-06-20 23:44:03 -04:00
Johan Berg
71a33b5f69 Allow users to opt-out of default crash handling.
This change allows users to opt-out of the engines default crash handling. Currently only implemented on Windows where the SEH code forwards the exception to externally registered handlers.

Thanks to Kristj�n Valur J�nsson for PR.

#rb patrick.laflamme
#preflight 62977779101592b80503b809

[CL 20452469 by Johan Berg in ue5-main branch]
2022-06-01 10:48:03 -04:00
geoff evans
d90ca97505 RenderingThread: Fix lack of logging the message and callstack for check() failures
### Notes
The check() message and callstack is actually printed in FWindowsErrorOutputDevice::HandleError which is called in the __except block after we RaiseException() inside ReportAssert(). However, RenderingThread's __except doesn't do this, so the contents of GErrorHist are lost to everyone except for CrashReporter. This change adds this necessary logging.

Also, add Windows Launch support for -IgnoreDebugger when choosing __try/__except or not (this precedes initialization of GIgnoreDebugger). This makes debugging easier for this class of issue.

### Testing
Repro steps are in the JIRA. Tested at that change (which has a reliable RenderingThread check() failure), and at #head where no defect exists. Tests fail and pass, respectively, as expected.

#rnx
#rb francis.hurteau
#jira UE-151056
#preflight 627b0b4ac42338be653745e6

[CL 20140980 by geoff evans in ue5-main branch]
2022-05-11 11:19:14 -04:00
Andriy Tylychko
cfadd8060c fixed static destruction order bug: the completion event of FRenderCommandFence was destroyed after the allocator it uses
#jira UE-151259
#preflight 6275674de31cfc52d5caf9d8

[CL 20081730 by Andriy Tylychko in ue5-main branch]
2022-05-06 14:56:33 -04:00
Andriy Tylychko
3b82927aee removed unused NewTasks from TaskGraph's FGraphEvent::DispatchSubsequents() calls, as a preparation for deprecation
#preflight https://horde.devtools.epicgames.com/job/6244160fdc6183e3f5ef6650
#rb francis.hurteau, danny.couture

[CL 19554617 by Andriy Tylychko in ue5-main branch]
2022-03-30 04:53:52 -04:00
Devin Doucette
01274b17c8 Logging: Added a dedicated master thread for logging
#preflight 622fb0eca709bd110fea0da5
#rb Zousar.Shaker

[CL 19387540 by Devin Doucette in ue5-main branch]
2022-03-15 12:31:55 -04:00
mihnea balta
e4dd7a950d Fix assert when the render thread crashes which was obscuring the real location of the crash.
The ERenderingThread named thread tag is not removed from ActiveNamedThreads when the render thread crashes, because the stack isn't unwound; this causes the assert in FTaskTagScope to fire when the Exit() method tries to set the tag. This resulted in the assert showing up as the cause of the crash, obscuring logs, crash reports etc.

#rnx
#lockdown Juan.Canada
#jira UE-143055
#rb Andriy.Tylychko, Arne.Schober, danny.couture
#preflight 620e35768b6428e701a2098d

#ROBOMERGE-AUTHOR: mihnea.balta
#ROBOMERGE-SOURCE: CL 19068406 in //UE5/Release-5.0/... via CL 19087994
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19130574 by mihnea balta in ue5-main branch]
2022-02-24 18:45:28 -05:00
thomas ross
6049a90da8 Adding delegate that is called whenever FlushRenderingCommands is called.
Utilize new delegate to unlock AcquireCriticalSection in PreLoadScreenManager to prevent softlocks whenever FlushRenderingCommands is called during an EarlyStartup PreLoadScreen.
Remove previous hack in PreLoadScreenManager to unlock AcquireCriticalSectoin during fontcache flushes, as this was just to prevent the ensuing FlushRenderingCommands called by the font cache flush from soft locking and is now not needed.
#rb none
#tests Test/Shipping Client

#ROBOMERGE-AUTHOR: thomas.ross
#ROBOMERGE-SOURCE: CL 18671847 via CL 18671850 via CL 18671851 via CL 18671854 via CL 18671857 via CL 18671961 via CL 18671966 via CL 18671967
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v901-18665521)

[CL 18671974 by thomas ross in ue5-main branch]
2022-01-20 01:22:51 -05:00
andrew davidson
0715ebc996 Type truncation fixes - Renderer
#rb arne.schober
#preflight 61d85ab0932a02483ce13e7d

#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18544411 in //UE5/Release-5.0/... via CL 18544434
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18544466 by andrew davidson in ue5-release-engine-test branch]
2022-01-07 10:39:08 -05:00
arne schober
f9c7f55397 REL - Move RenderingThread TaskTagScope
#ROBOMERGE-AUTHOR: arne.schober
#ROBOMERGE-SOURCE: CL 18452561 in //UE5/Release-5.0/... via CL 18452568
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v898-18417669)

[CL 18452570 by arne schober in ue5-release-engine-test branch]
2021-12-14 02:09:39 -05:00
mark lintott
b28cc533dc Non-Unity Fix
#rb none
#jira none
#preflight 61adf4f19c77d61007d653aa

#ROBOMERGE-AUTHOR: mark.lintott
#ROBOMERGE-SOURCE: CL 18381150 in //UE5/Release-5.0/... via CL 18381154
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18381157 by mark lintott in ue5-release-engine-test branch]
2021-12-06 06:51:29 -05:00
david harvey
10cba7f17e fix FPlatformProcess::SetupRHIThread calling location.
#jira UECON-499
#rnx
[FYI] mihnea.balta

#ROBOMERGE-SOURCE: CL 17300129 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)

[CL 17300133 by david harvey in ue5-release-engine-test branch]
2021-08-25 05:31:46 -04:00
david harvey
6aaf7c17b5 add FPlatformProcess::SetupRHIThread to match SetupGameThread, SetupRenderThread and SetupAudioThread.
#jira UECON-499
#rnx
#rb eric.mcdaniel

#ROBOMERGE-SOURCE: CL 17300007 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)

[CL 17300012 by david harvey in ue5-release-engine-test branch]
2021-08-25 05:15:14 -04:00
danny couture
a7d587af81 Skip FlushRenderingCommand in slowtask tick when there is nothing to cleanup
#rnx
#rb Francis.Hurteau

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

[CL 16857578 by danny couture in ue5-release-engine-test branch]
2021-07-14 20:21:08 -04:00
Arne Schober
a3c4f5230f U5 - moving the flush from before FlushRHIThreadFlushResources to after FlushRHIThreadFlushResources resulted in the "removal" of the quiescent state of the PipelineStateCache as now parallel RT commands were still able to run while we handle the PSO cache deletions. Unfortunately we now have to double flush (before and after) for some GT related flush cases, but as we try to remove flushes in general this might be acceptable until we find a better solution.
#jira UE-116592
#RB zach.bethel

[CL 16520718 by Arne Schober in ue5-main branch]
2021-06-01 15:37:22 -04:00
dmytro vovk
e9ecfd141a Fixed OGL RHI thread ownership task tag scope
#rb none
#jira none

[CL 16507573 by dmytro vovk in ue5-main branch]
2021-05-31 00:32:31 -04:00
dmytro vovk
481f73da89 Fixed a crash in OGL RHIAcquireThreadOwnership
#codereview Dmitriy.Dyomin
#jira none

[CL 16497719 by dmytro vovk in ue5-main branch]
2021-05-27 23:06:20 -04:00
zach bethel
67229c547a Reworked scene renderer lifetime to allow deferral of scene render cleanup.
This avoids a long stall on mesh draw command recording tasks at the end of the frame and saves about .1 ms of work off the render thread.

#jira UE-114622
#rb luke.thatcher

[CL 16419616 by zach bethel in ue5-main branch]
2021-05-21 11:30:17 -04:00
christopher waters
f872e769eb Before shutting down and deleting the Dynamic RHI, flush any potential queued commands.
PipelineStateCache specifically can now enqueue commands but this should also catch any other uses before here.
Adding explicit Command List argument to FRHIResource::FlushPendingDeletes to a) emphasize that it enqueues commands and b) allow the caller the option to flush the command list afterwards.

#jira none
#rb Arne.Schober
#preflight 60a6c7f60569f300012d6d01

[CL 16411660 by christopher waters in ue5-main branch]
2021-05-20 18:24:37 -04:00
Arne Schober
b2b27bcd1f U5 - Delete Resources on the RHI Thread to fix layering violation
[CL 16246026 by Arne Schober in ue5-main branch]
2021-05-09 23:20:16 -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
Marc Audy
9753392e2b Merge UE5/RES CL# 15462083 to UE5/Main
This represents UE4/Main @ 15414221

[CL 15463811 by Marc Audy in ue5-main branch]
2021-02-18 18:13:28 -04:00