Commit Graph

154 Commits

Author SHA1 Message Date
tuxerr
a531f1d4b4 PR #8679: regenerate UBO structs when platform changes (Contributed by tuxerr)
#rb Mihnea.Balta,Lukas.Hermanns
[FYI] Arciel.Rekman
#preflight 61a9017f800738dbfbbc4920

#ROBOMERGE-AUTHOR: jeannoe.morissette
#ROBOMERGE-SOURCE: CL 18408495 in //UE5/Release-5.0/... via CL 18408515
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)

[CL 18408530 by tuxerr in ue5-release-engine-test branch]
2021-12-08 13:31:51 -05:00
arciel rekman
f302f8f030 Fix CVars not being picked up from other sections (UE-135567).
- Some projects put rendering CVars in other sections than RendererSettings.

#jira UE-135567
[at]Josh.Adams, [at]Dmitriy.Dyomin
#rb Josh.Adams, Dmitriy.Dyomin

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 18270117 in //UE5/Release-5.0/... via CL 18270123
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18270137 by arciel rekman in ue5-release-engine-test branch]
2021-11-23 10:17:56 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
aurel cordonnier
fc542f6cfd Merge from Release-Engine-Staging @ 18081189 to Release-Engine-Test
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971

[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
2021-11-07 23:43:01 -05:00
carl lloyd
232f64154e Added support for full precision in Material expressions to project
Added override for half precision to Materials

#jira UE-130988
#rb Jack.Porter, Dmitriy.Dyomin
#p4v-cherrypick 17965223

#ROBOMERGE-AUTHOR: carl.lloyd
#ROBOMERGE-SOURCE: CL 18035100 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v885-17909292)

[CL 18035152 by carl lloyd in ue5-release-engine-test branch]
2021-11-03 11:57:39 -04:00
christopher waters
a43a3f735f More bring-up work on bindless in D3D12RHI and initial public RHI support:
- Bindless rendering is not enabled anywhere yet.
- Adding bSupportsBindless to DDSPI.
- Moving ED3D12DescriptorHeapType into RHI and renaming to ERHIDescriptorHeapType.
- Adding FRHIDescriptorHandle for public usage of bindless indices.
- Adding GetBindlessHandle() to RHI SamplerState, SRV, UAV.
- Adding GetDefaultShaderResourceView() to RHI Textures.
- Adding bindless Sampler heap support to D3D12.
- Cleaned up some common shader code in prep for future bindless work.

#jira none
#rb mihnea.balta
#preflight 6169f8fafeab330001591bd0

#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 17846249 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v883-17842818)

[CL 17846289 by christopher waters in ue5-release-engine-test branch]
2021-10-18 12:00:17 -04:00
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00
ben ingram
0bb0a923a0 Merging Dev-LWCRendering into Main, this includes initial work to support rendering with LWC-scale position
Basic approach is to add HLSL types FLWCScalar, FLWCMatrix, FLWCVector, etc.  Inside shaders, absolute world space position values should be represented as FLWCVector3.  Matrices that transform *into* absolute world space become FLWCMatrix.  Matrices that transform *from* world space become FLWCInverseMatrix.  Generally LWC values work by extending the regular 'float' value with an additional tile coordinate.  Final tile size will be a trade-off between scale/accuracy; I'm using 256k for now, but may need to be adjusted.  Value represented by a FLWCVector thus becomes V.Tile * TileSize + V.Offset.  Most operations can be performed directly on LWC values.  There are HLSL functions like LWCAdd, LWCSub, LWCMultiply, LWCDivide (operator overloading would be really nice here).  The goal is to stay with LWC values for as long as needed, then convert to regular float values when possible.  One thing that comes up a lot is working in translated (rather than absolute) world space.  WorldSpace + View.PrevPreViewTranslation = TranslatedWorldspace.  Except 'View.PrevPreViewTranslation' is now a FLWCVector3, and WorldSpace quantities should be as well.  So that becomes LWCAdd(WorldSpace, View.PrevPreViewTranslation) = TranslatedWorldspace.  Assuming that we're talking about a position that's "reasonably close" to the camera, it should be safe to convert the translated WS value to float.  The 'tile' coordinate of the 2 LWC values should cancel out when added together in this case.  I've done some work throughout the shader code to do this.  Materials are fully supporting LWC-values as well.  Projective texturing and vertex animation materials that I've tested work correctly even when positioned "far away" from the origin.

Lots of work remains to fully convert all of our shader code.  There's a function LWCHackToFloat(), which is a simple wrapper for LWCToFloat().  The idea of HackToFloat is to mark places that need further attention, where I'm simply converting absolute WS positions to float, to get shaders to compile.  Shaders converted in this way should continue to work for all existing content (without LWC-scale values), but they will break if positions get too large.

General overview of changed files:
LargeWorldCoordinates.ush - This defines the FLWC types and operations
GPUScene.cpp, SceneData.ush - Primitives add an extra 'float3' tile coordinate.  Instance data is unchanged, so instances need to stay within single-precision range of the primitive origin.  Could potentially split instances behind the scenes (I think) if we don't want this limitation
HLSLMaterialDerivativeAutogen.cpp, HLSLMaterialTranslator.cpp, Preshader.cpp - Translated materials to use LWC values
SceneView.cpp, SceneRelativeViewMatrices.cpp, ShaderCompiler.cpp, InstancedStereo.ush - View uniform buffer includes LWC values where appropriate
#jira UE-117101
#rb arne.schober, Michael.Galetzka

#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 17787435 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v881-17767770)

[CL 17787478 by ben ingram in ue5-release-engine-test branch]
2021-10-12 13:31:00 -04:00
lukas hermanns
85dec65f90 Add bSupportsDxc to DataDrivenPlatformInfo.
#rb Arne.Schober, Rolando.Caloca
[FYI] Josh.Adams, Brian.White, Florin.Pascu
#jira none
#rnx

#ROBOMERGE-AUTHOR: lukas.hermanns
#ROBOMERGE-SOURCE: CL 17776856 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v881-17767770)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 17776906 by lukas hermanns in ue5-release-engine-test branch]
2021-10-11 17:16:04 -04:00
aurel cordonnier
69fe095547 Merge from Release-Engine-Staging @ 17636544 to Release-Engine-Test
This represents UE4/Main @17638339 and Dev-PerfTest @17636504

[CL 17638842 by aurel cordonnier in ue5-release-engine-test branch]
2021-09-27 19:54:25 -04:00
jeremy moore
daefcfead4 Make "r.vt.FeedbackFactor" something that can be changed at runtime, instead of needing a restart/shader recompile.
This should be useful if we want to vary the feedback trade offs for different modes.
Did some comparisons of shader ISA and ALU cost is unchanged.
#jira none
#ushell-cherrypick of 17483512 by Jeremy.Moore

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 17491509 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17491521 by jeremy moore in ue5-release-engine-test branch]
2021-09-13 09:57:32 -04:00
florin pascu
6eaadba834 Read r.MobileNumDynamicPointLights from platform ini instead of project cvar
Add r.MobileNumDynamicPointLights to the shader keystring
#jira UE-125928
#rb Dmitriy.Dyomin, Jack.Porter
#preflight 6139e0f4f9a522000139e1bd
#ushell-cherrypick of 17470398 by Florin.Pascu

#ROBOMERGE-AUTHOR: florin.pascu
#ROBOMERGE-SOURCE: CL 17470936 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17470965 by florin pascu in ue5-release-engine-test branch]
2021-09-09 07:02:01 -04:00
carl lloyd
a0d85084b1 Added support for padding attribute locations automatically for OpenGLES
Fixed OpenGLES preview

#rb Lukas.Hermanns

#ROBOMERGE-AUTHOR: carl.lloyd
#ROBOMERGE-SOURCE: CL 17460403 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17460416 by carl lloyd in ue5-release-engine-test branch]
2021-09-08 13:00:48 -04:00
rolando caloca
17e13e521b UE5 - Remove some hlslcc vestiges from Vulkan
#rb Dmitriy.Dyomin, Lukas.Hermanns, jeannoe.morissette

#ROBOMERGE-SOURCE: CL 17369648 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17369655 by rolando caloca in ue5-release-engine-test branch]
2021-08-31 12:04:32 -04:00
christopher waters
9996d7091b Allowing r.Shaders.Optimize to be set per-platform.
#jira none
#rb arciel.rekman
#preflight 611d13819db7df00012bf70a

#ROBOMERGE-SOURCE: CL 17222081 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17222084 by christopher waters in ue5-release-engine-test branch]
2021-08-18 16:52:12 -04:00
christopher waters
1c21a5489c Shader symbol terminology changes
- Splitting symbol generation and shader "debug info" generation into two different cvars. This should now allow us to generate symbols post-packaging without generating different shader variants. This should also enable us to always generate symbols and still have the final deduplicated shader sizes.
- r.Shaders.Symbols is now the primary way to enable shader symbols for debugging.
- r.Shaders.GenerateSymbols can be enabled to always generate symbols without writing them to disk.
- r.Shaders.WriteSymbols can be used to force write symbols if they were previously generated.
- r.Shaders.ExtraData can be used to generate shader names for engine runtime systems to use.
- NotifyShaderCooked replaced with NotifyShaderCompiled, prep for upcoming non-cook symbol writing.
- PC DXC shader compiles should only generate debug info when requested, not all the time.
- PC FXC shader compiles should generate debug info when requested, not just when r.Shaders.Optimize is 0.

#jira none
#rb arciel.rekman, lukas.hermanns
#preflight 611ad9035e737200015992db

#ROBOMERGE-SOURCE: CL 17186155 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17186162 by christopher waters in ue5-release-engine-test branch]
2021-08-16 23:18:23 -04:00
yuriy odonnell
fa14d532ba Merging pull requests to improve rendering determinism through more stable draw sorting.
* Use a shader code hash instead of sorting by shader pointer in CalculateBasePassMeshStaticSortKey()
* Added a serial number to UPrimitiveComponent, which is generated in OnRegister() and then used in FPrimitiveArraySortKey as an extra sort key.

Contributed by andrewtop-cruise.

#github 7934
#github 8273
#preflight 61128303afd67e0001e7a14b
#rb Arciel.Rekman

#ROBOMERGE-SOURCE: CL 17150851 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17150861 by yuriy odonnell in ue5-release-engine-test branch]
2021-08-12 08:35:25 -04:00
graham wihlidal
5eea21442d Refactored mesh shader RHI abstraction into tiers, allowing various platforms to correctly check for optional features (like primitive attribute support)
[FYI] christopher.waters, luke.thatcher, eric.mcdaniel
#preflight 61143a4c9c7bb10001f06277

#ROBOMERGE-SOURCE: CL 17143667 via CL 17143685
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17143691 by graham wihlidal in ue5-release-engine-test branch]
2021-08-11 18:29:54 -04:00
carl lloyd
f2a628b2a6 Added packed UB support to DXC and fixed bugs
#rb Lukas.Hermanns

#ROBOMERGE-SOURCE: CL 17133860 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17133863 by carl lloyd in ue5-release-engine-test branch]
2021-08-11 07:11:25 -04:00
florin pascu
4eb62c93ed Remove MOBILE_PROPAGATE_ALPHA shader define
Temporary remove premultiply alpha
FXAA luminance calculation moved from tonemapper to FXAA when MobilePropagateAlpha enabled
#rb Dmitriy.Dyomin
#jira none
#preflight 610c117c6b1f8c0001720cfb

#ROBOMERGE-SOURCE: CL 17074095 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v853-17066230)

[CL 17074105 by florin pascu in ue5-release-engine-test branch]
2021-08-05 15:22:21 -04:00
wei liu
4663783554 Make mobile HQ BRDF to be enabled per material instead of globally.
#jira none

#rb Dmitriy.Dyomin
#preflight 61092dc603d30300012d54ea

#ROBOMERGE-SOURCE: CL 17029260 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v845-17028103)

[CL 17029268 by wei liu in ue5-release-engine-test branch]
2021-08-03 09:05:29 -04:00
arciel rekman
a09bfec58c Properly support r.ShaderPipelines when filtering out non-pipelined shader types.
- Also, include this in the DDC key.

#rb Kevin.Ortegren
[at]Jason.Nadro
#jira UE-117881

#ROBOMERGE-SOURCE: CL 16897479 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16897491 by arciel rekman in ue5-release-engine-test branch]
2021-07-20 11:42:43 -04:00
aurel cordonnier
02c0f425e8 Copy up from Release-Engine-Staging @ 16738359
This represents UE4/Main @ 16738161 and Dev-PerfTest @ 16737719

[CL 16738582 by aurel cordonnier in ue5-release-engine-test branch]
2021-06-22 00:27:54 -04:00
wei liu
e88d4df7d0 1. Unify the lighting calculation for both mobile deferred and forward.
2. Add an option to use high quality BRDF on mobile as the same with PC.
3. Fallback to default light shading model if it is not supported on mobile.
4. Use EnvBrdf for mobile deferred lighting pass.

#jira none

#rb Dmitriy.Dyomin
#preflight 60cdef32be81e8000118d85c

#ROBOMERGE-SOURCE: CL 16722349 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16722356 by wei liu in ue5-release-engine-test branch]
2021-06-19 10:07:01 -04:00
florin pascu
5c1e32c73c RG11B10 + SceneDepthAux 16/32F + Alpha Propagate
For Forward ES31
 Default SceneColor RG11B10 + R16F\32F Depth texture
 With PropagateAlpha on RGBA16F + R16F\32F
 PostProcess we sample SceneDepthAux for Depth
For Deferred ES31
 SceneDepthAux only for Metal
 PropagateAlpha not working yet
 PostProcess we sample SceneDepthTexture for Depth

cvar to change Depth texture from 16 to 32Fr.Mobile.SceneDepthAux
cvar for AlphaPropagate r.Mobile.PropagateAlpha
#jira UE-98033
#rb Dmitriy.Dyomin, Carl.Lloyd, Jack.Porter

#ROBOMERGE-SOURCE: CL 16644095 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v833-16641396)

[CL 16644108 by florin pascu in ue5-release-engine-test branch]
2021-06-11 13:47:20 -04:00