- FlushShaderFileCache() used to be called to force all shader types to update their list of referenced uniform buffers, but they are only updated if they were ever used to compile in the current session. This would impact *any* shader type that had been used instead of just being limited to changed shader types.
- Moved the uniform buffer reference updating into a new function: UpdateReferencedUniformBufferNames.
- UpdateReferencedUniformBufferNames should be called before all shader recompiles but after FlushShaderFileCache does reset itself. This function requires a list of outdated types so we can reduce the shader type updates to only the types that need it.
#jira none
#rb jason.nadro, zach.bethel
#preflight 636a7a537c2b505190a464fb
[CL 23063334 by christopher waters in ue5-main branch]
- Remove shader platform specific info from uniform buffers, we can generate code with macros that translates to what each platform needs.
- With the per-platform differences removed, uniform buffer declarations (read: generated text) can be created once per shader parameter type that needs them instead of once per shader type's shader parameter type usage.
- FShaderType and FVertexFactoryType now hold a TSet of used uniform buffer names instead of a TMap that held potentially duplicated FStrings of uniform buffer defintions.
- Lists of uniform buffers are *potentially* different per platform, so the annoying CachedUniformBufferPlatform variables need to stick around for now.
- GenerateReferencedUniformBuffers renamed to GenerateReferencedUniformBufferNames and now populates a TSet instead of a TMap.
- ShaderType::AddReferencedUniformBufferIncludes renamed to ShaderType::AddUniformBufferIncludesToEnvironment which calls the shared UE::ShaderParameters::AddUniformBufferIncludesToEnvironment.
- CreateUniformBufferShaderDeclaration moved to UE::ShaderParameters::CreateUniformBufferShaderDeclaration and now returns its FString.
- CacheUniformBufferIncludes was removed since it was only populated values from CreateUniformBufferShaderDeclaration.
- Deprecated FShaderCompilerInput::SourceFilePrefix since nothing has populated it in 9 years.
#jira none
#rb dan.elksnitis, yuriy.odonnell
#preflight 63643e5ff233f06a127c11c1
[CL 22988611 by christopher waters in ue5-main branch]
- Focused around moving GlobalBeginCompileShader and friends.
- ModifyCompilationEnvironment and ValidateCompiledResult now only compiled in Editor builds.
- Measured 0.5MB to 1.0MB elf size reduction depending on platform.
#jira none
#rb jason.nadro, arciel.rekman, florin.pascu
#preflight 63613f992b5338aceb442902
[CL 22890964 by christopher waters in ue5-main branch]
This is meant to help avoid inconsistencies between GetRayTracingPayloadType() and the shader code.
As an example of the usage, convert RayTracingDebug related shaders to only enable the payload conditionally. Fix the current incorrect mixing of payload uses in the same shader by introducing a permutation for the material version of the debug shader vs. the one that uses the debug payload (this was previously a runtime shader parameter only which implied two different payloads could theoretically be compiled into one RTPSO).
Also conditionaly enable some of the simpler payload types like the niagara and decal ones that are only used in a few places. Other payloads will be handled in future refactors.
Split RayTracingDebug.usf into smaller files that only have one raytracing entry in them to reduce the amount of counditional logic needed around payloads.
#rb Yuriy.ODonnell
#jira none
#preflight 635c49e9ae6840072d4df82f
[CL 22849513 by chris kulla in ue5-main branch]
This allows the raytracing payload type to vary according to shader permutation parameters which is more flexible and simplifies the code for complex cases like Lumen or deferred reflections
#rb Yuriy.ODonnell
#jira none
#preflight 635a8ba96a2a692f5d720eb3
[CL 22809506 by chris kulla in ue5-main branch]
Originally reviewed in review 22330833.
#rb andrew.lauritzen, Ola.Olsson, Sebastien.Hillaire
#jira FORT-515227
#rnx
#preflight 6356c6700313c24974e8f7dd
[CL 22749579 by tim doerries in ue5-main branch]
Every shader now has the ability to declare which payload it uses. HitGroup, Miss and Callable shaders may only specify a single type, whereas Raygen shaders may provide more than one.
The global raytracing shader libraries have been categorized according to their payload type, which helps facilitate the creation of minimal ray-tracing pipelines.
Avoid adding callable shaders to the RTPSO if they are not being used.
All RHI shader compilers and shader loaders that support ray tracing have been modified to track an extra uint representing the payload type flagged in the source (at time of compilation).
Add the RayTracingPayloadType to the shadermap DDC key so that we can properly detect when a shader's payload type is invalidated. This is required because we serialize the payload type into the shaders from the C++ side.
#rb Yuriy.ODonnell
#jira none
#preflight 635715cae6096564af4dd28e
[CL 22742893 by chris kulla in ue5-main branch]
[Backout] - CL22476756
[FYI] tim.doerries
Original CL Desc
-----------------------------------------------------------------
Added support for filtered virtual shadow maps on SingleLayerWater. Implemented by applying the VSM shadow mask to the SeparateMainDirLight texture that is written out by the main water pass in the presence of distance field shadows (or VSM filtering) and then later composing it back into the scene. Also removed EncodeLightAttenuationFromMask() function from VirtualShadowMapMaskBitsCommon.ush.
#rb andrew.lauritzen, Ola.Olsson, Sebastien.Hillaire
#rnx
#preflight 6345d0aeb757820b7a90db71
[CL 22587146 by bob tellez in ue5-main branch]
* Enforce shader change when the CVar is toggled
#rb none
#jira none
#preflight 633ea5163a20cf302cb21de2
#fyi sebastien.hillaire
[CL 22373221 by Charles deRousiers in ue5-main branch]
#ushell-cherrypick of 21812612 by tim.doerries
#rb Ola.Olsson, andrew.lauritzen, Sebastien.Hillaire
#rnx
#preflight 6331ccc3a4769ad714ad3473
[CL 22307543 by ola olsson in ue5-main branch]
Remove r.Shadow.CSM.MaxMobileCascades, use r.Shadow.CSM.MaxCascades to limit number of cascades
#jira UE-142377
#rb jack.porter
#preflight 632843baf258fccf9879925a
[CL 22084614 by dmitriy dyomin in ue5-main branch]
The post base-pass dbuffer blending only works for simple and single materials. Complex material are still apply during the base pass. This pass is disabled by default, and will be enabled only per-platform. Following needs to happen making unpacking/packing modulare and reusable.
On lower-platform this allows to reduce significatly the cost of base pass (BasePass:-1.2ms DBufferPass+0.4ms = -0.8ms net), as the compiler can better prune code, and allows to increase occupancy.
#rb none
#jira none
#preflight 6324633b74361465145e0f75
#fyi sebastien.hillaire
[CL 22048223 by Charles deRousiers in ue5-main branch]
r.Mobile.ShadingModelsMask can be used to mask out specific shading models on mobile platforms.
Masked shading models will fallback to DefaultLit
[CL 21540496 by dmitriy dyomin in ue5-main branch]
2.Uses the same shading models and dynamic lightings code path on desktop.
3.Remove the division of PI on mobile directional light's color in C++ to line up with desktop in shaders.
#jira UE-114145
#rb Dmitriy.Dyomin, Sebastien.Hillaire
#preflight 62b0411fd8082c5c200fa32a
[CL 20734991 by wei liu in ue5-main branch]