Commit Graph

283 Commits

Author SHA1 Message Date
matt peters
0dd9cc3b00 LLM: Set PLATFORM_HAS_MULTITHREADED_PREMAIN for IOS platforms; the load of executables on IOS does include OS threads that can call new and delete and that run before Main.
#jira UE-209176, UE-208554
#rnx
#rb Jeff.Fisher

[CL 32090382 by matt peters in ue5-main branch]
2024-03-07 12:13:28 -05:00
carl lloyd
b7052a7976 Fixed compile errors on iOS due to missing ir_converter.h which wont be supported until later
#rb trivial
#jira UE-204112

[CL 31557348 by carl lloyd in ue5-main branch]
2024-02-16 03:50:33 -05:00
david harvey
d709133122 move the logic that determines whether __builtin_bit_cast should be used into Platform.h
- allows platform extensions to determine whether it is available

#jira UE-204162
#rnx

#rb Chris.Babcock, Devin.Doucette

[CL 31120967 by david harvey in ue5-main branch]
2024-02-02 07:07:25 -05:00
Luke Thatcher
10cdd4a111 Merging //UE5/Dev-ParallelRendering/... (up to CL 30965645) to //UE5/Main/... (base CL 30962637)
Significant refactor of RHI command list management and submission, and RHI breadcrumbs / RenderGraph (RDG) scopes, to allow for parallel translation of most RHI command lists.
See individual changelists in //UE5/Dev-ParallelRendering for details. A summary of the changes is as follows:

This work's primary goal was to allow as many RHI command lists as possible to be parallel translated, to make more efficient use of many-core systems. To achieve this:
 - The submission code paths for the immediate and parallel RHI command lists have been merged into a single function: FRHICommandListExecutor::Submit().
 - A "dispatch thread" (which is simply a series of chained task graph tasks) is used to decide which command lists are batched together in a single parallel translate job.
 - Individual command lists can disable parallel translate, which forces them to be executed on the RHI thread. This happens automatically if an RHI command list performs an operation that is not thread safe (e.g. buffer lock, or low-level resource transition).

One of the primary blockers for parallel translation was the RHI breadcrumb system, and the way RDG builds scopes. This was also refactored to remove these limitations:
 - RDG could only push/pop events on the immediate command list, which resulted in parallel and immediate work being interleaved, breaking any opportunity for parallelism.
 - Platform RHI implementations of breadcrumbs (e.g. in D3D12 RHI) was not correct across multiple RHI contexts. Push/pop operations aren't necessarily balanced within any one RHI context given that RDG builds "parallel pass sets" containing arbitrary ranges of renderer passes.

A summary of the new RHI breadcrumb system is as follows:
 - A tree of breadcrumb nodes is built by the render thread and RDG. Each node contains the node name, and pointers to the parent and next nodes. When fully built, the nodes form a depth-first linked list which is used for traversing the tree for GPU crash debugging.
 - The memory for breadcrumb nodes is provided by ref-counted allocator objects. These allocators are pipelined through the RHI, allowing the platform RHI implementation to extend their lifetime for GPU crash debugging purposes.
 - RHIPushEvent / RHIPopEvent have been removed, replaced with RHIBeginBreadcrumbGPU / RHIEndBreadcrumbGPU. Platform RHIs implement these functions to perform GPU immediate writes using the unique ID of each node, for tracking GPU progress.
 - Format string arguments are captured by-value to remove the cost of string formatting while building the breadcrumb tree. String formatting only occurs when the actual formatted string is required (e.g. during GPU crash breadcrumb stack traversal, or when calling platform GPU profiling APIs).

RenderGraph scopes have been simplified:
 - The separate scope trees / arrays of ops have been combined. There is now a single tree of RDG scopes containing all types.
 - Each RDG pass holds a pointer to the scope it was created under.
 - BeginCPU / EndCPU is called on each RDG scope as the various RDG threads enter / exit them. This allows us to mark-up each worker thread with the relevant Unreal Insights scopes.

Other changes include:
 - Fixes for bugs uncovered when parallel translate was enabled.
 - Adjusted platform affinities necessary due to the new layout of thread tasks in the renderer.
 - Refactored RHI draw call stats to better fit the new pipeline design.

#rb jeannoe.morissette, zach.bethel
#jira UE-139543

[CL 30973133 by Luke Thatcher in ue5-main branch]
2024-01-29 12:47:28 -05:00
steve robb
9a40daca8c Removed PLATFORM_COMPILER_HAS_IF_CONSTEXPR.
Deprecated CONSTEXPR, PLATFORM_COMPILER_HAS_DECLTYPE_AUTO, PLATFORM_COMPILER_HAS_FOLD_EXPRESSIONS and UE_NORETURN.
Made UE_NODISCARD mandatory (not yet deprecated as fixup is needed).

#rb devin.doucette

[CL 30617451 by steve robb in ue5-main branch]
2024-01-15 08:28:01 -05:00
carl lloyd
48f16b3e40 Change __builtin_trap to __builtin_debugtrap to allow continuing from asserts
#rb Zack.Neyland

[CL 29810873 by carl lloyd in ue5-main branch]
2023-11-17 12:01:01 -05:00
josh adams
82ea6a767a [Backout] - CL26223564
[FYI] keaton.stewart
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL26221679 [Main CIS Issue] Errors in Incremental FortniteServer Linux and Incremental Compile Monolithics - Linux
[FYI] Josh.Adams
Original CL Desc
-----------------------------------------------------------------
- Very super early support for VisionOS (requires Xcode 15 beta2 or later).
- THIS IS NOT USABLE YET - WORK IN PROGRESS!
- It builds, links with IOS libs (warnings, not errors), can cook and it boots in Simulator, but is dying in MetalRHI
- UnrealTargetPlatform.VisionOS is currently defined in Engine code, it is not pulled out like would be correct for a full true platform extension
- Refactored a lot of Build.cs files to use UnrealPlatformGroup.IOS/Apple instead of individual platform checks, to make VisionOS integration simpler
#rb zack.neyland

[CL 26226852 by josh adams in ue5-main branch]
2023-06-24 17:52:48 -04:00
keaton stewart
1fd1a77412 [Backout] - CL26221679 [Main CIS Issue] Errors in Incremental FortniteServer Linux and Incremental Compile Monolithics - Linux
#fyi Josh.Adams
#jira FORT-626566 (edited)
Original CL Desc
-----------------------------------------------------------------
- Very super early support for VisionOS (requires Xcode 15 beta2 or later).
- THIS IS NOT USABLE YET - WORK IN PROGRESS!
- It builds, links with IOS libs (warnings, not errors), can cook and it boots in Simulator, but is dying in MetalRHI
- UnrealTargetPlatform.VisionOS is currently defined in Engine code, it is not pulled out like would be correct for a full true platform extension
- Refactored a lot of Build.cs files to use UnrealPlatformGroup.IOS/Apple instead of individual platform checks, to make VisionOS integration simpler
#rb zack.neyland

[CL 26223564 by keaton stewart in ue5-main branch]
2023-06-23 20:29:27 -04:00
Josh Adams
e25e1b3daf - Very super early support for VisionOS (requires Xcode 15 beta2 or later).
- THIS IS NOT USABLE YET - WORK IN PROGRESS!
- It builds, links with IOS libs (warnings, not errors), can cook and it boots in Simulator, but is dying in MetalRHI
- UnrealTargetPlatform.VisionOS is currently defined in Engine code, it is not pulled out like would be correct for a full true platform extension
- Refactored a lot of Build.cs files to use UnrealPlatformGroup.IOS/Apple instead of individual platform checks, to make VisionOS integration simpler
#rb zack.neyland

[CL 26221679 by Josh Adams in ue5-main branch]
2023-06-23 19:12:47 -04:00
rafa lecina
49b76464d2 Made some MacPlatformProcess methods related to retrieving directories common for iOS
[REVIEW] [at]Bertrand.Carre, [at]Adam.Kinge
#jira UE-166445

[CL 26117410 by rafa lecina in ue5-main branch]
2023-06-20 07:01:56 -04:00
mihnea balta
28e1771151 Non-immediate command lists always record commands, even if bypass mode is requested.
This is because currently QueueAsyncCommandListSubmit() only supports command lists with their own local contexts for parallel translation. When parallel translation is not used, these commands need to be replayed on the immediate context, but bypass mode would create a local context and translate commands into it, and this context is never finalized and submitted.

Also removed PLATFORM_RHITHREAD_DEFAULT_BYPASS, since bypass should be off by default on all platforms. Using this assumption, the Bypass() methods return compile-time constants in test and shipping builds, so all the bypass code can be compiled out.

#jira UE-185658
#rnx
#rb Luke.Thatcher

[CL 26052694 by mihnea balta in ue5-main branch]
2023-06-16 11:10:00 -04:00
Rafa Lecina
254dcecc06 Fixes to be able to run tests on iOS
#review @Bertrand.Carre, @Michael.Kirzinger, @Chris.Constantinescu, @Stephen.Ma
#jira UE-166445

[CL 26006367 by Rafa Lecina in ue5-main branch]
2023-06-15 04:50:22 -04:00
axel riffard
e4e5c637f8 Mallocbinned2 for iOS/tvOS
#jira UE-168561
#rb josh.adams
#preflight 64489258fa6ba3cc5b7cd679

[CL 25193985 by axel riffard in ue5-main branch]
2023-04-25 23:13:01 -04:00
ionut matasaru
c04fc14767 Removed the deprecated MemoryProfiler runtime:
* Removed code switched by USE_MALLOC_PROFILER.
* Removed the USE_MALLOC_PROFILER define and the MALLOC_PROFILER macro.
* Removed PLATFORM_RUNTIME_MALLOCPROFILER_SYMBOLICATION define.
* Removed FMallocProfilerEx and FMallocProfilerEx wrappers and the GMallocProfiler global variable.
* Removed console commands: "MPROF", "DUMPALLOCSTOFILE", "SNAPSHOTMEMORY" and "SNAPSHOTMEMORYFRAME".
Please use Unreal Insights (Memory Insights; -trace=memory) instead.

#jira UE-141779
#rb Johan.Berg
#preflight 6437f5dd00398d6f88b5b18f

[CL 25101805 by ionut matasaru in ue5-main branch]
2023-04-19 04:07:55 -04:00
Luke Thatcher
d566d29fa9 Undo //UE5/Main/... changelist 24869066 due to build errors.
#rb none
#jira none
#preflight 642c50afc6769c60826710d3

[CL 24913159 by Luke Thatcher in ue5-main branch]
2023-04-04 12:54:16 -04:00
Luke Thatcher
abed07b9f6 Remove NullRHI module from non-desktop builds
- Marked RHI modules with an [RHIModule] C# attribute, so UBT can determine how many RHIs are being included in the build via standard module references.
 - Refactored the "fixed RHI class" macros to automatically de-virtualize RHI command calls. WITH_FIXED_RHI_CLASS is always defined to 1 if there's only a single RHI module included in the build.

Unified "-rhivalidation" command line switch handling.

#rb mihnea.balta
#preflight 64247bb8c42c7fd1cb5fc582

[CL 24869066 by Luke Thatcher in ue5-main branch]
2023-03-31 06:32:14 -04:00
Matt Peters
0027082473 RequestExit Feedback: Add Callsite argument to FPlatformMisc::RequestExit
Add the argument to many but not all callsites.
#jira FORT-578919
#rnx
#rb Devin.Doucette
#preflight 6414ca9d691c5ebc15b30410

[CL 24696053 by Matt Peters in ue5-main branch]
2023-03-17 16:46:34 -04:00
dmytro vovk
003258516a Detect HW CRC instructions support on ARM platforms
#jira UE-176772
#rb Allan.Bentham
#preflight 63ecf4e5205b5ccbc717ae2e

[CL 24255762 by dmytro vovk in ue5-main branch]
2023-02-16 06:54:11 -05:00
Andriy Tylychko
cc2222ca5a reused Mac semaphore for iOS
#preflight 6398595e2960b73220e958d3

[CL 23490256 by Andriy Tylychko in ue5-main branch]
2022-12-13 07:25:55 -05:00
adam kinge
3c18fe7ef8 Add missing iOS platform IOSSemaphore header
#jira UE-172621
#fyi andriy.tylychko
#preflight none for iOS

[CL 23485268 by adam kinge in ue5-main branch]
2022-12-12 19:23:54 -05:00
bryan sefcik
72be98c810 Moved IN and OUT defines to HAL/Platform.h
#jira
#preflight 63371394466fb436691a350a

[CL 22279776 by bryan sefcik in ue5-main branch]
2022-09-30 16:18:41 -04:00
bernard lambert
6a95e5db6d - Added functions to get and set allowed screen orientations through the PlatformMisc class.
- Implemented logic for setting allowed screen orientations on iOS.
- Added possibility to set allowed screen orientation to SCREEN_ORIENTATION_SENSOR  on Android so that the screen orientation can be unlocked to adjust itself according to the sensor.
- Exposed PortraitSensor, LandscapeSensor and FullSensor screen orientations in blueprint library.

#RB Chris.Babcock Adam.Kinge

#ROBOMERGE-AUTHOR: bernard.lambert
#ROBOMERGE-SOURCE: CL 21219114 via CL 21219129 via CL 21219137 via CL 21219139 via CL 21219150
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21224334 by bernard lambert in ue5-main branch]
2022-07-22 13:19:40 -04:00
nat parkinson
606862353e [Backout] - CL21196825
[FYI] bernard.lambert
Original CL Desc
-----------------------------------------------------------------
- Added functions to get and set allowed screen orientations through the PlatformMisc class.
- Implemented logic for setting allowed screen orientations on iOS.
- Added possibility to set allowed screen orientation to SCREEN_ORIENTATION_SENSOR  on Android so that the screen orientation can be unlocked to adjust itself according to the sensor.
- Exposed PortraitSensor, LandscapeSensor and FullSensor screen orientations in blueprint library.


#ROBOMERGE-AUTHOR: nat.parkinson
#ROBOMERGE-SOURCE: CL 21197038 via CL 21197050 via CL 21197054 via CL 21197064 via CL 21197075
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21197499 by nat parkinson in ue5-main branch]
2022-07-20 23:51:13 -04:00
bernard lambert
f595573ef0 - Added functions to get and set allowed screen orientations through the PlatformMisc class.
- Implemented logic for setting allowed screen orientations on iOS.
- Added possibility to set allowed screen orientation to SCREEN_ORIENTATION_SENSOR  on Android so that the screen orientation can be unlocked to adjust itself according to the sensor.
- Exposed PortraitSensor, LandscapeSensor and FullSensor screen orientations in blueprint library.


#ROBOMERGE-AUTHOR: bernard.lambert
#ROBOMERGE-SOURCE: CL 21196825 via CL 21196834 via CL 21196849 via CL 21196861 via CL 21196876
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21197495 by bernard lambert in ue5-main branch]
2022-07-20 23:51:04 -04:00
Dmitriy Dyomin
f00c0a426b Remove support for a landscape baked mesh which was used for mobile platforms only
#jira none
#rb jonathan.bard
#preflight 62d769cdbc175ec68cee67d0

[CL 21171586 by Dmitriy Dyomin in ue5-main branch]
2022-07-19 23:03:12 -04:00