Commit Graph

163 Commits

Author SHA1 Message Date
christopher waters
1f21b73b25 Ran IWYU on RHI and RenderCore, private only.
#preflight 63d358c85c69f453c1f79c37

[CL 23889591 by christopher waters in ue5-main branch]
2023-01-27 14:54:10 -05:00
christopher waters
c6c2200520 Adding includes before cleaning up RHI dependencies.
[CL 23888475 by christopher waters in ue5-main branch]
2023-01-27 14:17:39 -05:00
christopher waters
0270a5f287 Moving FDeferredCleanupInterface and accompanying types to RenderDeferredCleanup.h to remove global dependencies on RenderThread.h
#preflight 6393481ebb6fefa472ddeae0

[CL 23475364 by christopher waters in ue5-main branch]
2022-12-11 23:11:39 -05:00
henrik karlsson
b985fbd1b1 Removed lots of includes in high traffic headers in order to reduce compile times. Headers are still included if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2 is set to 1
List of highlights
* PlayerController - Removed ForceFeedback and and OnlineReplStructs
* Class - Removed Package.h
* World - Pawn, Blueprint and GameInstance
* Actor - CoreNet, HitResult and ActorDatalayer
* EngineBaseTypes - TaskGraphInterface
* AssetManager - AssetData
* Scene/Child/ActorComponent - CoreNet
* AnimInstance - AttributesRuntime, Skeleton, AnimCurveTypes, AnimMontage, BonePose
* BulkData - IoDispatcher
* AssetData - IoDispatcher, LinkerLoad
* SecureHash - AsyncWork
* CanvasTypes - UnrealEngine, StaticMeshResources
* IpAddress - AsyncWork, Stats

#preflight 6363717ece676ae8688f5d8c
#rb none

[CL 22968258 by henrik karlsson in ue5-main branch]
2022-11-03 17:56:44 -04:00
Luke Thatcher
91ce45971a Restore changes lost when the DevPR copy-up robomerged back to UE5 Main
#rb none
#preflight skip
#jira none

[CL 22245170 by Luke Thatcher in ue5-main branch]
2022-09-29 06:31:56 -04:00
arne schober
a3a580763e Fix oldValue of RHIThread by setting the ThreadId on the RHI Thread itself as it was racing between the Launching and RHI Thread and add missing TaskTag for the RenderingThread
#jira UE-164332
#preflight 6334af38ce6dba4592726c66

[CL 22240502 by arne schober in ue5-main branch]
2022-09-28 22:23:22 -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
Andriy Tylychko
f78784aef7 switched back to lock-free allocator for tasks and removed CreateCompletionHandle()
#rb fransic.hurteau
#preflight 6322fb82e872d7da038cb2bb

[CL 22026345 by Andriy Tylychko in ue5-main branch]
2022-09-15 06:46:54 -04:00
nuno leiria
fcc1003574 Add RHI scope tag when setting up the RHI thread.
This fixes IsInRHIThread() when calling the function too early.

[CL 21735050 by nuno leiria in ue5-main branch]
2022-08-31 21:17:34 -04:00
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