Commit Graph

307 Commits

Author SHA1 Message Date
jamie hayes
9abe13b5f9 Don't check for 64-bit atomic support of the local machine when adding Nanite config to the shader map DDC key. Fixes issues with mismatched keys when the cooker doesn't have support. Also fixes potential issues when r.Nanite is configured differently for the cooking platform than the target platform.
#rb jason.nadro

[CL 36758892 by jamie hayes in 5.5 branch]
2024-10-01 19:43:20 -04:00
dan elksnitis
5bcff15345 [shaders] modify FShaderCode finalize to create a FSharedBuffer object, and modify all downstream uses of shader code to re-use this buffer (job cache, pushes to DDC, shader maps, and shader library). This reduces total amount of LLM tracked memory allocated at the end of a cold Lyra PS4 cook by about ~350MB; impact likely much larger for cooks of larger projects.
resubmit with following fixes:
- static analysis error which caught an >=0 check on a uint64 which should have been >0
- fix for an inverted guard on multiprocess cook sending bytecode to director (was only sending code across if empty instead of non-empty)
- fix for uninitialized padding in the FShaderCodeResource::FHeader struct causing nondeterministic puts
- fix for incorrect size passed to job cache hashing on receiving buffers from DDC

#rb Devin.Doucette, Laura.Hermanns, Zousar.Shaker
#lockdown Marc.Audy

[CL 36754792 by dan elksnitis in 5.5 branch]
2024-10-01 19:02:22 -04:00
dan elksnitis
fd01802612 [Backout] - CL36470025
[FYI] dan.elksnitis
Original CL Desc
-----------------------------------------------------------------
[shaders] modify FShaderCode finalize to create a FSharedBuffer object, and modify all downstream uses of shader code to re-use this buffer (job cache, pushes to DDC, shader maps, and shader library). This reduces total amount of LLM tracked memory allocated at the end of a cold Lyra PS4 cook by about ~350MB; impact likely much larger for cooks of larger projects.

#rb Devin.Doucette, Zousar.Shaker
#lockdown Marc.Audy
resubmit with SA+MP cook fix

[CL 36747522 by dan elksnitis in 5.5 branch]
2024-10-01 17:45:02 -04:00
dan elksnitis
8c666d2108 [shaders] modify FShaderCode finalize to create a FSharedBuffer object, and modify all downstream uses of shader code to re-use this buffer (job cache, pushes to DDC, shader maps, and shader library). This reduces total amount of LLM tracked memory allocated at the end of a cold Lyra PS4 cook by about ~350MB; impact likely much larger for cooks of larger projects.
#rb Devin.Doucette, Zousar.Shaker
#lockdown Marc.Audy

resubmit with SA+MP cook fix

[CL 36746984 by dan elksnitis in 5.5 branch]
2024-10-01 17:40:02 -04:00
dan elksnitis
c02d3f0517 [Backout] - CL36437712
[FYI] dan.elksnitis
Original CL Desc
-----------------------------------------------------------------
[shaders] modify FShaderCode finalize to create a FSharedBuffer object, and modify all downstream uses of shader code to re-use this buffer (job cache, pushes to DDC, shader maps, and shader library). This reduces total amount of LLM tracked memory allocated at the end of a cold Lyra PS4 cook by about ~350MB; impact likely much larger for cooks of larger projects.

#rb Zousar.Shaker
#lockdown marc.audy

[CL 36440265 by dan elksnitis in 5.5 branch]
2024-09-19 13:16:02 -04:00
dan elksnitis
c7dfb5d9b6 [shaders] modify FShaderCode finalize to create a FSharedBuffer object, and modify all downstream uses of shader code to re-use this buffer (job cache, pushes to DDC, shader maps, and shader library). This reduces total amount of LLM tracked memory allocated at the end of a cold Lyra PS4 cook by about ~350MB; impact likely much larger for cooks of larger projects.
#rb Zousar.Shaker
#lockdown marc.audy

[CL 36437741 by dan elksnitis in 5.5 branch]
2024-09-19 12:21:59 -04:00
dmitriy dyomin
de2b738ffa Mobile: Added an option to not use PLS and FBF extension on Android OpenGL
Enabling it will force a multipass rendering where GBuffer and SceneColor are resolved to a system memory

[CL 36327269 by dmitriy dyomin in 5.5 branch]
2024-09-17 01:36:59 -04:00
eric renaudhoude
6d635a864d Alpha: New (deferred) renderer project setting for primitive alpha holdout support, separating it regular propagate alpha which now becomes runtime-toggleable.
POST_PROCESS_ALPHA is completely removed from the engine, and the holdout-specific shader code is conditionally compiled based on a new SUPPORT_PRIMITIVE_ALPHA_HOLDOUT definition to isolate its added cost in the deferred renderer.

The new holdout project setting is called "Support Primitive Alpha Holdout (Deferred)" and can be found in under the "Optimizations" section of the renderer settings. Engine component, MRQ & HoldoutComposite plugin toast notifications for setting activation is left as separate CL.

#jira UE-220034
#rb chris.kulla, Sebastien.Hillaire

[CL 35895537 by eric renaudhoude in ue5-main branch]
2024-08-29 10:20:09 -04:00
eric renaudhoude
b2e388a83a Alpha: Converts "Enable alpha channel support in post processing" (r.PostProcessing.PropagateAlpha) back to a boolean where "True" propagates alpha through post-processing.
This relaxes the "linear-only" constraint with 1, and simplifies the option for users. Values 1 & 2 are automatically converted to "True" upon config/cvar load, and thus both existing values remain valid. While most backwards compatiblity is preserved, there are two instances where external code will need to be updated:
 * Calls to FindTConsoleVariableDataInt(..) will need to be replaced with regular FindConsoleVariable(..), since the former call would silently fail on a bool cvar.
 * Any literal comparison to "2" not using EAlphaChannelMode::Type, which is now deprecated.
We believe this remains preferable over migration to an entirely new cvar. This change also removes experimental naming.

#jira UE-220034
#rb Florin.Pascu, Matt.Hoffman, Aleksander.Netzel, juan.canada

[CL 35501877 by eric renaudhoude in ue5-main branch]
2024-08-13 14:26:15 -04:00
dmitriy dyomin
9c224413a4 Mobile: Removed Linear64 and Gamma32 permutations variants as we do not support both permutations at the same time. Cleaned up material stats and fixed missing one for a projects with a CSM branch in the shader
[CL 35392896 by dmitriy dyomin in ue5-main branch]
2024-08-08 07:27:55 -04:00
florian penzkofer
688f324056 Mobile SSR: SSR is now done in deferred shading pass.
#rb Dmitriy.Dyomin
#jira UE-120565

[CL 34559883 by florian penzkofer in ue5-main branch]
2024-06-21 09:09:19 -04:00
sebastien hillaire
2415feaccd Added project option for Height fog to match volumetric fog.
Emissive of volumetric fog now follow the distribution of the exp height fog.
Exp fog follow the emissive and albedo of the volumetric fog. And it also uses the same PhaseG and phase function as the volumetric fog (the UI for in scattering is then disabled when the project setting is enabled)
Now volumetric fog looks mostly different due to the lact of shadow casting or difference integration of ambient (through lumen for instance).

This allows for lumen fog sampling to even better match the environment. (currently not including volumetric fog material and local fog volume as this would be a lot more expenssive).

[FYI] Krzysztof.Narkowicz

[CL 34421633 by sebastien hillaire in ue5-main branch]
2024-06-17 10:38:08 -04:00
jason nadro
48fa80a2e1 Fix global shader non-determinism due to un-initialized data in the memory images for shader maps due to the TMaps and Variants used by the generic stat system.
- Memory Image serialization is problematic due to padding in structures and uninitialized data.  This can be handled by marking up each class and member with macros, but this can be invasive for common types like TMaps and TVariants.
- To fix the issue I've completely removed the shader stats from the memory image serialization and this avoids the issue, and most of the code can stay the same.
- Generic stats aren't store on the FShader anymore, and the stats have been moved to an array on the FShaderEditorOnlyDataEntry data object owned by the FShaderMapResourceCode owned by the base shader map class.  This data is natively serializated we don't have the issues that the memory images do.
- This required fixup on the interfaces that query for the generic shader stats to get this data from a different location.
- Wrap all the code in WITH_EDITORONLY_DATA
- Turn the stats into a struct, FGenericShaderStat, and we just store an array of them.  We don't really need fast lookup.

#rb dan.elksnitis, Laura.Hermanns

[FYI] Zousar.Shaker

[CL 34317171 by jason nadro in ue5-main branch]
2024-06-12 14:41:45 -04:00
dmitriy dyomin
4d83c873d2 Mobile: Added rect lights support to a deferred shading
r.Mobile.Forward.RenderRectLightsAsSpotLights will only affect lights that use LightGrid, translucency or clustered

[CL 34120289 by dmitriy dyomin in ue5-main branch]
2024-06-05 07:16:52 -04:00
dmitriy dyomin
ed3c09ec8a Invalidate shaders when r.Mobile.Forward.RenderRectLightsAsSpotLights is toggled
[CL 34118776 by dmitriy dyomin in ue5-main branch]
2024-06-05 05:00:12 -04:00
florin pascu
549e2d4a2e Add MetalOptimizeBySize setting for MetalShaderFormat
#rb carl.lloyd

[CL 34096192 by florin pascu in ue5-main branch]
2024-06-04 12:10:32 -04:00
charles derousiers
84b0d0490b * Fix incorrect output texture format during SLW base pass with Substrate, causing SLW to be incorrect.
* Share logic for enabling/disabling SLW directional texture

#jira UE-214432

[CL 34027623 by charles derousiers in ue5-main branch]
2024-05-31 02:34:02 -04:00
kenzo terelst
3df923dab2 - Add FShaderBindingLayout as RenderCore wrapper for FRHIShaderBindingLayout which can also cache static uniform buffer declerations used during shader code gen
- Add option for ShaderType to declare which FShaderBindingLayout needs to be used for shader gen and runtime binding
- Add helper function to generate FShaderBindingLayoutContainer from array of uniform buffers and EShaderResourceTableFlags (only supports bindless mode right now)
- Serialize the FRHIShaderBindingLayout in FShaderCompilerEnvironment so it can be used by the shader compiler backends
- FShaderBindingLayout can add required symbols to the FShaderCompilerInput which shouldn't be dead code eliminated (required for Shader resource table building)
- Serialize the hash of RHIShaderResourceTable in the platform specific shader binary data so it can be used during runtime RTPSO validation (all shaders in the RTPSO need the same RHIShaderResourceTable)
- Renamed pRootSignaure member to RootSignature (style guide)

#jira UE-212347

[CL 33624453 by kenzo terelst in ue5-main branch]
2024-05-14 04:49:23 -04:00
christopher fiala
d93e6246a4 Refactor VRS RHI implementation and manager to avoid using GRHI variables bound to CVars, and to allow disabling support for VRS with a read-only variable (requires shader recompile, may avoid performance cost on some platforms).
#jira UE-197460
#rb Josie.Yang

[CL 33505949 by christopher fiala in ue5-main branch]
2024-05-07 22:29:35 -04:00
aleksander netzel
cb2db589bd HWRT: Turn r.RayTracing.CompileMaterialCHS/AHS into per-platform cvars.
#rb Arciel.Rekman

[CL 33201400 by aleksander netzel in ue5-main branch]
2024-04-24 11:51:05 -04:00
graham wihlidal
6483e2aaaa [Nanite-Materials] First large scale removal of legacy PS material shading path from Nanite (in favor of new system). Lumen needs to be moved over to the new system in order to fully remove the legacy path (WIP).
#rb zach.bethel
#jira UE-187480
#fyi brian.karis, rune.stubbe, jamie.hayes, juan.canada

[CL 33127625 by graham wihlidal in ue5-main branch]
2024-04-20 00:25:44 -04:00
graham wihlidal
9fceb67705 Removed r.Nanite.AllowTessellation to always compile in support for Nanite tessellation. Can still use r.Nanite.Tessellation runtime toggle, but shaders are always built now.
#rb Brian.Karis
#jira UE-190057
#fyi rune.stubbe, jamie.hayes

[CL 33016018 by graham wihlidal in ue5-main branch]
2024-04-16 17:39:19 -04:00
john huelin
2affa78392 Fix CIS compilation issue
#rb Wojciech.Krywult

[CL 32856120 by john huelin in ue5-main branch]
2024-04-10 10:20:42 -04:00
john huelin
7121101cd8 SDK (1): Changes in common code needed to support SDK changes on some platforms
#rb Wojciech.Krywult

[CL 32855114 by john huelin in ue5-main branch]
2024-04-10 09:49:42 -04:00
matt peters
24ea789e44 MaterialInterface: Refactor GetMaterialShaderMapKey into RecordOrEmitMaterialShaderMapKey which takes an FMaterialKeyGeneratorContext instead of an FShaderKeyGenerator. FMaterialKeyGeneratorContext can handle any one of three modes: emit hash strings or save/load data needed for hash strings to compact binary. Use the new RecordOrEmitMaterialShaderMapKey to Save/Load and Emit the material dependency hash for incremental cooking.
#jira UE-203846
#rnx
#rb dan.elksnitis

[CL 32725752 by matt peters in ue5-main branch]
2024-04-04 08:29:57 -04:00