This changelist is a merge of work done in //UE5/Dev-ParallelRendering to remove tech debt in the SRV/UAV create functions. See individual changelist descriptions in that stream for further details, but a summary of the change is as follows:
- We had multiple overloads of each of the RHICreateShaderResourceView and RHICreateUnorderedAccessView functions. Each function had a different set of supported view types and using them was complicated / ambiguous.
- There's now only 2 create functions, and a common FRHIViewDesc descriptor struct, which is stored on the base view class.
- FRHIView takes a reference on the underlying resource, ensuring that RHI views keep their viewed resource alive. This was not the case on some platforms, since it was previously the platform RHI implementation's responsibility.
- Platform RHI implementations resolve an FRHIViewDesc into a full FViewInfo struct using GetViewInfo. This centralizes the logic for computing num mips / num slices / format etc so it is the same across all platforms.
- Views must never be created with nullptr resources. This used to happen in the mesh streamer, but now all views require a real underlying resource. That resource can be a "BUF_NullResource" buffer, which is what the mesh streamer uses as a placeholder for buffers that have not streamed yet.
- We will eventually replace FRHITextureReference with a "null texture", similar to how BUF_NullResource works for buffers. This is not yet implemented, so there is no "null view" of a texture currently.
#rb kenzo.terelst,jeannoe.morissette,dmitriy.dyomin
#preflight 643534642855180717af410e
#jira none
[CL 24989901 by Luke Thatcher in ue5-main branch]
- 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]
Add BeginRecursiveCommand call in the RecursiveHazardous RHI command lists
- Some platform RHIs need to prepare the context (e.g. creating / opening a command list) before the lambda is called
#rb jeannoe.morissette
#jira UE-171755
#preflight 6422d148e11ce5214ffc8b93
[CL 24823554 by luke thatcher in ue5-main branch]
This behavior was inconsistent across RHIs. In some cases we called SetNumUninitialized() which is the behavior we want (a no-op when the array already has the right size). On other RHIs, the array was being emptied first and then grown which forced a re-allocation.
#rb Rolando.Caloca
#jira none
#preflight 641a174442618c85c4157166
[CL 24784728 by chris kulla in ue5-main branch]
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]