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]
Make sure iOS vertex shaders are compiled with PreserveInvariance option set
#jira UE-179372
#rb jack.porter
#preflight 6412df4cd0208e8564bbb732
[CL 24671983 by dmitriy dyomin in ue5-main branch]
Repurpose XcodeVersionInShaderVersion into UseFullMetalVersionInShaderVersion, setting this to true will force shaders to rebuild for each new Xcode version (reverting to previous behaviour)
#jira UE-179011
#rb Zack.Neyland, Arciel.Rekman, Carl.Lloyd
#lockdown Rolando.Caloca
#preflight 6402755daa00423335e22d0f
[CL 24525802 by calvin zheng in ue5-main branch]
The shader code output contains a little bit of plaintext such as I/O identifiers and the shader name, which was generated for the DXC backend in a way that prevents caching.
This unifies the shader name in the output code and improves the cache hit ratio for a Lyra cook from 0% to roughly 50% cache hits (for certain platforms).
#rb Jason.Nadro, Carl.Lloyd
#fyi Brian.White, Arciel.Rekman, Brandon.Schaefer
#jira FORT-548603
#preflight 63e26c6c07207b2570ba2d5b
#rnx
[CL 24050212 by Laura Hermanns in ue5-main branch]
* Significantly reduces the size of shader debug data and improves shader compilation time (reducing parsing cost in the native shader compiler)
* Remove "experimental" label for the feature
#rb Jason.Nadro
#preflight 63d455d9be1970f8824c3f9b
[CL 23894592 by Yuriy ODonnell in ue5-main branch]
* Enabling requires re-building a metalpp with appropriate flags/defines set along with an OS version that supports the RT headers/libs.
#preflight 63c72f1a0225f00e14c05c46
#jira none
[CL 23750025 by zack neyland in ue5-main branch]
* Add code to all shader format back-ends to take dead code removal into account when computing the version ID
* Not enabled in Metal and OpenGL back-ends (require further testing)
#rb dan.elksnitis
#preflight 6390f1f15c5308d18c7364fb
[CL 23433448 by Yuriy ODonnell in ue5-main branch]
* Sets the Min/Max Wave Size
* Handles Vulkan headers and Mac a bit better
* Handles missing [shader] toolchains a bit better.
#preflight 63603e161622fbf582db4e07
#jira na
[CL 22920245 by zack neyland in ue5-main branch]
- Making ConstantBufferType a constructor only argument. This removes the duplicated logic of calling ShouldUseStableConstantBuffer.
- Moving ShouldUseStableConstantBuffer to ShaderCompilerCommon.
- Made UE::ShaderCompilerCommon::ParseParameterType array arguments const
#jira UE-166341
#rb Guillaume.Abadie
#preflight 634eeceea1527f6b3bda9ff0
[CL 22608320 by christopher waters in ue5-main branch]
- Instrument how long shader preprocessing takes for each shader compilation job.
- Keep a running total in our shader stats per shader type.
- Add logging to track total thread preprocessing time for all shaders.
- Fixup local variable names to match the output log names.
#rb Dan.Elksnitis
#preflight 632a224ab40000c8f08c5815
[CL 22125080 by jason nadro in ue5-main branch]
Metal 2.3 removed, Metal 3.0 added for Mac
#jira UE-163352
#rb adam.kinge bertrand.carre
#preflight 631ea7eb94758d0bf2008668
[CL 21960671 by axel riffard in ue5-main branch]