Commit Graph

222 Commits

Author SHA1 Message Date
carl lloyd
ce3e8fe3fe Move Fortnite to OpenGL DXC
Fixed bug in Shader Key with OpenGL

#rb Allan.Bentham
[FYI] Pete.Sauerbrei

[CL 24312254 by carl lloyd in ue5-main branch]
2023-02-20 07:25:20 -05:00
wouter dek
3ae5c6c895 Convert shader type and parameter struct metadata from global variables to static locals to defer initialization. This allows us to create these types dynamically at startup, while keeping the rest of the infrastructure as is.
#rb jason.nadro
#preflight 63f352130803c73accb744f1

[CL 24311526 by wouter dek in ue5-main branch]
2023-02-20 06:10:39 -05:00
christopher waters
87014d9ccf Allow configuration of Bindless on a per-format basis in configs.
- The config section is the DDSPI ShaderFormat of the shader platform
- BindlessResources and BindlessSamplers can be set independently
- The cvars still exist and will take precedence over the config settings.
- Renamed RHIGetBindlessResourcesConfiguration/RHIGetBindlessSamplersConfiguration to have the word "Runtime" in them to reflect that they should only be used at runtime and not when deciding if it's enabled for a shader.

#jira UE-171919
#rb jason.nadro, yuriy.odonnell, jeannoe.morissette
#preflight 63edaabd0a06073fef07655f

[CL 24282763 by christopher waters in ue5-main branch]
2023-02-17 11:01:24 -05:00
Arciel Rekman
84d3f99470 [Backout] - CL24227640
#fyi wouter.dek

The problem with this change is that late-created shader types will not be in the shadertype list and as such will not be included in the shader map even if their ShouldCompilePermutation() would return true.

Original CL Desc
-----------------------------------------------------------------
Convert shader type and parameter struct metadata from global variables to static locals to defer initialization. This allows us to create these types dynamically at startup, while keeping the rest of the infrastructure as is.

#preflight 63eca58e7d2ec3d2fd286d9a
#rb zach.bethel

[CL 24240825 by Arciel Rekman in ue5-main branch]
2023-02-15 15:57:24 -05:00
wouter dek
7a70fa6a8f Convert shader type and parameter struct metadata from global variables to static locals to defer initialization. This allows us to create these types dynamically at startup, while keeping the rest of the infrastructure as is.
#preflight 63eca58e7d2ec3d2fd286d9a
#rb zach.bethel

[CL 24227640 by wouter dek in ue5-main branch]
2023-02-15 05:55:29 -05:00
charles derousiers
2e825249bd Add optional accurate sRGB encoding for Strata pixel payload.
#rb sebastien.hillaire
#jira none
#preflight 63e40213244dc45a2026160c
#lockdown juan.canada

[CL 24085322 by charles derousiers in ue5-main branch]
2023-02-08 18:00:32 -05:00
eric renaudhoude
4c7052d24b ColorManagement: Working color space support in volumetric cloud rendering.
#jira UE-170709
#rb sebastien.hillaire
#preflight 63e19ebbb923ed4bdd00b15d

[CL 24043003 by eric renaudhoude in ue5-main branch]
2023-02-06 19:59:13 -05:00
dmitriy dyomin
b447633a62 Fixed: Virtual texture shimmering on mobile platforms
Added manual VT filtering for mobile platforms that do not use TAA (contributed by albin.bernhardsson at ARM)
#jira UE-175862
#rb jeremy.moore
#preflight 63db903bba4fadeef046dc56

[CL 23967866 by dmitriy dyomin in ue5-main branch]
2023-02-02 09:58:44 -05:00
charles derousiers
5229394cfe Fix incorrect material appearance on raytracing material with Strata enabled
* Add adaptive RT material payload for Strata.
* Centralize all Strata settings in RenderCore/RenderUtils.h to ensure consistency

#rb chris.kulla
#jira none
#preflight 63d43bcff626715201a0ed1d
[FYI] sebastien.hillaire

[CL 23923301 by charles derousiers in ue5-main branch]
2023-01-31 01:12:18 -05:00
Dmitriy Dyomin
61048a527c Added manual VT filtering for mobile platforms that do not use TAA (contributed by albin.bernhardsson at ARM)
#jira UE-121358
#rb jeremy.moore
#preflight 63d39b78d21dbe1d290c49b4

[CL 23902542 by Dmitriy Dyomin in ue5-main branch]
2023-01-29 23:03:58 -05:00
christopher waters
1f21b73b25 Ran IWYU on RHI and RenderCore, private only.
#preflight 63d358c85c69f453c1f79c37

[CL 23889591 by christopher waters in ue5-main branch]
2023-01-27 14:54:10 -05:00
Sebastien Hillaire
8eddb7a7a9 Made DBuffer pass only usable when high quality normal is not used on non console.
This is because this pass writes highquality normal though UAV uint2 which is not supported by all graphics card on PC.

#rb charles.derousiers.
#preflight https://horde.devtools.epicgames.com/job/63c57fae2e714f64ade48477

[CL 23735443 by Sebastien Hillaire in ue5-main branch]
2023-01-17 02:37:24 -05:00
bob tellez
971983eb65 [Backout] - CL23624045
[FYI] christopher.waters
Original CL Desc
-----------------------------------------------------------------
RHI header dependency cleanup
- Reducing other header dependencies from RHIDefinitions.h
- Moved a few functions to the new RHIStrings.h
- Uniform buffer layout initializer moved to its own file to reduce RHI dependency on MemoryLayout.

#preflight 63bca752577437afe604b097

[CL 23631957 by bob tellez in ue5-main branch]
2023-01-10 15:28:15 -05:00
christopher waters
3df5dae685 RHI header dependency cleanup
- Reducing other header dependencies from RHIDefinitions.h
- Moved a few functions to the new RHIStrings.h
- Uniform buffer layout initializer moved to its own file to reduce RHI dependency on MemoryLayout.

#preflight 63bca752577437afe604b097

[CL 23631946 by christopher waters in ue5-main branch]
2023-01-10 15:27:33 -05:00
christopher waters
b646d3c719 Moving FShaderPlatformCachedIniValue into its own file.
Preparing RenderUtils for include removal.

#preflight 638f63a09549ddaa2869ddf0

[CL 23422383 by christopher waters in ue5-main branch]
2022-12-06 20:00:07 -05:00
christopher waters
aebe064d06 Moving some shader system methods into cpp files to remove header file dependencies on FDataDrivenShaderPlatformInfo.
#rb jeremy.moore
#preflight 6389397c303395f6c955ab10

[CL 23376303 by christopher waters in ue5-main branch]
2022-12-02 13:38:49 -05:00
dan elksnitis
8801f83bb2 [shaders] add support to run STB preprocessor instead of MCPP; add a cvar to disable this and instead use the legacy preprocessor (currently this is set to true - i.e. still using MCPP - by default)
#rb Yuriy.ODonnell
#rb Jason.Nadro
#preflight 6387663c3377450900c5522b

[CL 23350844 by dan elksnitis in ue5-main branch]
2022-12-01 09:27:13 -05:00
chris kulla
408b0b8553 Ray Tracing: Compute the maximum payload size from the shader's payload type
Serialize the payload size as part of the raytracing shader so it can be examined in the RHI layer.

Validate that the RTPSO is configured with the appropriate payload size.

Add macros to ensure the payloads have the expected size

Ensure that all raytracing pipelines explicitly bind a miss shader

Add a shared shader header to implement static asserts for those shader compilers that support them (like dxc).

Fix payload type on main deferred reflection raygen shader

Fix incorrect raygen shader included in the deferred RTPSO list for RTGI

Don't add builtin shaders to the RTPSO from the RHI layer as these are unlikely to ever match the required payload type

Add new method to register payload types so that plugins can more easily describe custom payloads they may be using (up to a maximum of 32 unique payload types since we use a bitmask to represent payload sets).

#rb Yuriy.ODonnell
#jira UE-157946
#preflight 636aff4363037c102679f13a
#preflight 63869dde170bc34a93e8c90e

[CL 23337139 by chris kulla in ue5-main branch]
2022-11-30 13:53:00 -05:00
Charles deRousiers
2e960e0763 Add mobile byte per pixel explicit limit.
#rb none
#jira none
#preflight 637e28dbcc307d6fa50c3e59
#fyi sebastien.hillaire

[CL 23249178 by Charles deRousiers in ue5-main branch]
2022-11-23 09:48:41 -05:00
graham wihlidal
19f7e8e93f LWC shader optimization - If both sides are LWC and we are subtracting, assume relative space going forward and demote to floating point precision. Also implemented a TruncateLWC node that can allow for targeted optimizations of random expressions in the material graph. r.MaterialEditor.LWCTruncateMode is now defined to control 0: off, 1: node only, 2: auto trunc (default is 2)
#rb brian.karis, yuriy.odonnell
[FYI] ben.woodhouse, kevin.ortegren, jason.nadro, rune.stubbe, elizabeth.bunner
#preflight 637bfb762a05dabce9253302

[CL 23245878 by graham wihlidal in ue5-main branch]
2022-11-22 22:37:46 -05:00
Sebastien Hillaire
b19df6202a Strata - fixed static variable shadowing.
#rb none
#preflight none

[CL 23158492 by Sebastien Hillaire in ue5-main branch]
2022-11-16 13:54:10 -05:00
Sebastien Hillaire
cd4aa07281 Strata - added high quality normal according to GBuffer format.
#rb none
#preflight https://horde.devtools.epicgames.com/job/6374f970b6636838280f3278
#fyi charles.derousiers

[CL 23155230 by Sebastien Hillaire in ue5-main branch]
2022-11-16 11:35:48 -05:00
christopher waters
977f66039e Removing uniform buffer name locks from FShaderType and FVertexFactory
- 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]
2022-11-09 16:39:32 -05:00
christopher waters
c6e9015a91 Cache uniform buffer definitions
- 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]
2022-11-04 12:04:48 -04:00
christopher waters
0621d20368 More shader compiling code wrapped with WITH_EDITOR checks
- 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]
2022-11-01 16:31:27 -04:00