Commit Graph

152 Commits

Author SHA1 Message Date
Andriy Tylychko
d6e66144b2 fixed undefined order of static destruction for FSceneRenderer::OcclusionSubmittedFence
#preflight 627e620d7c26e247734d2d70

[CL 20180722 by Andriy Tylychko in ue5-main branch]
2022-05-13 10:02:16 -04:00
arciel rekman
b63703a199 Fix crash when building lighting with ISR (UE-148100).
#rb Rob.Srinivasiah
#jira UE-148100
[REVIEW] [at]Robert.Srinivasiah, [at]Jules.Blok
#preflight 6261c3446119a1a496c437a3

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 19857000 in //UE5/Release-5.0/... via CL 19857761
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)

[CL 19869186 by arciel rekman in ue5-main branch]
2022-04-22 14:51:09 -04:00
jeannoe morissette
53c9fc5e31 Clear global reference on GVisualizeReflectionTracesData in normal shutdown flow (easier for tracing).
#rb Krzysztof.Narkowicz
#jira UE-126789
#preflight 61f414b67a7f0d39dde99797

#ROBOMERGE-AUTHOR: jeannoe.morissette
#ROBOMERGE-SOURCE: CL 18772410 in //UE5/Release-5.0/... via CL 18772422 via CL 18772504
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18772514 by jeannoe morissette in ue5-main branch]
2022-01-28 11:37:56 -05:00
zach bethel
ac17c898e4 Moved FRDGSystemTexture initialization in DrawTileMesh to fix assert.
#rb none
#preflight none

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18578329 in //UE5/Release-5.0/... via CL 18578342 via CL 18578359
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18578390 by zach bethel in ue5-main branch]
2022-01-11 18:10:20 -05:00
zach bethel
a618c04cbf Converted light grid injection resources to RDG.
#preflight 61ddebe6ce7fe7aeff6fb109

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18576538 in //UE5/Release-5.0/... via CL 18576549
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18576556 by zach bethel in ue5-release-engine-test branch]
2022-01-11 15:57:18 -05:00
guillaume abadie
797bf5207d Removes GTemporalUpscaler since the interface get actually set by custom screen percentage or view family extension
#rb none
#jira none
#preflight 61ae1437ad6629a51eed054a

#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 18383510 in //UE5/Release-5.0/... via CL 18383521
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v896-18170469)

[CL 18383570 by guillaume abadie in ue5-release-engine-test branch]
2021-12-06 11:44:53 -05:00
jon nabozny
6fe75b2a8b Fix compile issues introduced in CL-17955874 and CL-17945620
FPrimitiveUniformShaderParameters::LocalToWorld / PreviousLocalToWorld renamed to LocalToRelativeWorld / PreviousLocalToRelativeWorld.

#ROBOMERGE-AUTHOR: jon.nabozny
#ROBOMERGE-SOURCE: CL 18004874 via CL 18370075 via CL 18370151
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18370180 by jon nabozny in ue5-release-engine-test branch]
2021-12-03 13:28:04 -05:00
graham wihlidal
5341373548 Temporary fix for broken velocity vectors
#rb guillaume.abadie
#preflight 614b18fe6a142b0001b8c75b
#lockdown jeff.farris

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 17596804 via CL 17955874 via CL 18364884 via CL 18364952
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18365010 by graham wihlidal in ue5-release-engine-test branch]
2021-12-02 23:52:53 -05:00
jon nabozny
3e478185e0 Moved optional GPU memory over to dynamic payload allocator + various CPU/threading optimizations (avoid expensive contention grabbing per instance render data buffer unless absolutely necessary). Saves upwards of ~222MB GPU memory in Frosty, and ~840MB GPU memory if world partition is disabled (4x more instances loaded).
#rb ola.olsson
#preflight 614a1091286e3b00010e7380
[FYI] brian.karis, rune.stubbe, jason.nadro, krzysztof.narkowicz, andy.firth
#lockdown michal.valient

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 17588680 via CL 17950709 via CL 18364633 via CL 18364726
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18364781 by jon nabozny in ue5-release-engine-test branch]
2021-12-02 23:38:54 -05:00
jon nabozny
1044ec5252 Moved per instance local bounds and Nanite hierarchy offset over to optional sidecar data, and updated all areas to source from the correct data + refactored GPU Scene to populate the new arrays correctly (the only current user of them). Also removed per instance flags in favor of dynamically deriving the important bits on GPU Scene upload. Reduces size of FPrimitiveInstance from 80 bytes down to 48 bytes (single 4x3 float FRenderTransform remains, could be 2x float4s with FCompressedTransform in the future).
#preflight 6138020f25e54000015502f6
#rb brian.karis, krzysztof.narkowicz
[FYI] daniel.wright, ola.olsson, rune.stubbe

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 17488104 via CL 17933105 via CL 18363029 via CL 18363080
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18363108 by jon nabozny in ue5-release-engine-test branch]
2021-12-02 20:49:23 -05:00
jeremy moore
695a4cddc8 Fix on screen warning delegate registration race condition crash.
#preflight 61a80658a7179bfa55f63d0b
#rb ola.olsson

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 18351496 in //UE5/Release-5.0/... via CL 18351498
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18351502 by jeremy moore in ue5-release-engine-test branch]
2021-12-02 08:41:45 -05: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
andrew davidson
57beb335f2 Merging //UE5/Dev-LargeWorldCoordinates [at] 17581892 to //UE5/Main
#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 17595295 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17595306 by andrew davidson in ue5-release-engine-test branch]
2021-09-22 10:01:48 -04:00
graham wihlidal
596b78798c Removed per instance Nanite imposter flag and changed code to fetch it from the primitive flags instead. Also removed partially implemented per instance cast shadow flag in favor of the correct one on primitive flags.
#rb rune.stubbe
[FYI] brian.karis
#preflight 6130430317a8610001a7d102

#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 17397605 via CL 17397964
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17397969 by graham wihlidal in ue5-release-engine-test branch]
2021-09-02 00:54:16 -04:00
graham wihlidal
29b4ac53b7 Implemented a new payload data allocator and buffer in GPU Scene that will be used to allow instances to dynamically allocate optional side-car data rather than always paying a fixed high watermark cost in the scene data layout (often features are never used by most instances).
#rb brian.karis
[FYI] christopher.waters, ola.olsson, krzysztof.narkowicz
#preflight 6123e56d8ff55400011df401
[FYI] Dmitriy.Dyomin

#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 17275101 via CL 17276332
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v858-17259218)

[CL 17276338 by graham wihlidal in ue5-release-engine-test branch]
2021-08-23 16:47:16 -04:00
jonathan bard
3ce02b6146 Only update the FVirtualTextureSystem during DrawTileMesh when the material being rendered actually samples from a virtual texture. This was introducing lags in processing VT feedbacks, particularly evident when rendering the water brush which uses lots of DrawTileMesh internally
#rb jeremy.moore
#jira UE-115801

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

[CL 17139445 by jonathan bard in ue5-release-engine-test branch]
2021-08-11 14:23:18 -04:00
dmitriy dyomin
b0828d6beb Mobile specific implementation for auto-instancing. (disabled by default atm)
Run a compute job that packs most commonly used instance data (LocalToWorld matrix and some other bits - 80 bytes) into per-instance vertex buffer. Vertex shader does not have access to GPUScene and instead loads instance data from a per-instance vertex buffer. If it needs more primitive/instance data than available then it will load it from Primitive UB, binding unique uniform buffer and breaking auto-instancing. Pixel shader has a full access to a GPUScene
There are 3 ways how FSceneDataIntermediates gets populated
 1. PrimitiveId + GPUScene (Desktop)
 2. Per-Instance data + Primitive UB (Mobile)
 3. Primitive UB (auto-instancing disabled)
Details for GPUScene specific vertex inputs and access to FSceneDataIntermediates are hidden behind a macro:
VF_GPUSCENE_DECLARE_INPUT_BLOCK
VF_GPUSCENE_GET_INTERMEDIATES
FSceneDataIntermediates is now stored in FVertexFactoryIntermediates, FMaterialVertexParameters. Added a few GetPrimitiveData() overloads that allows you to access PrimitiveData depending on current context. Removed most of the cases where GetPrimitiveData() gets used with PrimitiveId.
#rb Ola.Ollson

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

[CL 17093856 by dmitriy dyomin in ue5-release-engine-test branch]
2021-08-07 07:20:52 -04:00
graham wihlidal
bb6f46d1bf Added InstancePayloadDataOffset and InstancePayloadDataStride to primitive scene info and primitive uniform shader parameters. The range allocator has also been implemented, but no GPU resource allocations are performed at this time.
#rb ola.olsson
[FYI] brian.karis

#ROBOMERGE-SOURCE: CL 16745716 via CL 16745792
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16745805 by graham wihlidal in ue5-release-engine-test branch]
2021-06-22 13:50:35 -04:00
graham wihlidal
4b4b2d87d9 Implemented initial (half-proper, half-insane-hack) support for Nanite custom per-instance data (single float at this time). The proper architecture for arbitrary data is in place except the new GPU payload allocator and de-interleaving. To unblock art (only need a single per-instance float right now) I've repurposed 4 bytes from the payload data offset and stuffed float0 in there, safely clamping if you use more than a single float per instance. The other caveat is that only materials that run at pixel frequently will support Nanite per-instance custom data, so vertex interpolator nodes can't be used or the default value will silently be returned. The opposite is alsop true for non-Nanite usage, without a vertex interpolator node, the default value will be silently returned. These caveats will be removed going forward, but this unblocks art for the time being.
#rb jeff.farris
[FYI] brian.karis

#ROBOMERGE-SOURCE: CL 16701346 via CL 16701348
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16701350 by graham wihlidal in ue5-release-engine-test branch]
2021-06-17 03:09:14 -04:00
graham wihlidal
860e7f89bb De-interleaved dynamic/material/uncommon data from FPrimitiveInstance into separate data streams to reduce CPU memory footprint, and an upcoming change will also de-interleave this data on the GPU, dramatically saving GPU memory/performance, and also optimizing GPU Scene uploads. This is a mid-refactor change with some crufty temporary code in places since the GPU memory is still interleaved, but it should be removed soon.
#rb brian.karis
[FYI] krzysztof.narkowicz, michal.valient, ola.olsson
#preflight 60ca8449634cd100013c3673

#ROBOMERGE-SOURCE: CL 16699435 via CL 16699447
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16699461 by graham wihlidal in ue5-release-engine-test branch]
2021-06-16 20:44:01 -04:00
graham wihlidal
f602dcf242 Big cleanup/refactor of InstanceData* (renamed to InstanceSceneData* to match many other places already calling it that, and to disambiguate upcoming changes that add another instance data buffer to GPU Scene for arbitrary data payloads). This change also removes the virtuals on FPrimitiveSceneProxy for the instance list along with lots of copy paste code for all the derived types, and instead makes it a built-in feature of the base proxy (since nearly everything supports GPU Scene instancing now).
#rb ola.olsson
[FYI] brian.karis
#preflight 60c4d5c586ce760001377f2a

#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 16660135 via CL 16660883
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v834-16658389)

[CL 16660909 by graham wihlidal in ue5-release-engine-test branch]
2021-06-14 13:43:26 -04:00
graham wihlidal
effe8c943b Fixed broken velocity vectors
#ROBOMERGE-SOURCE: CL 16638081 via CL 16638096
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v831-16623017)

[CL 16638108 by graham wihlidal in ue5-release-engine-test branch]
2021-06-11 03:39:20 -04:00
graham wihlidal
0ee0bbe666 Removed LocalToWorld and PrevLocalToWorld from FPrimitiveInstance (instead the concatenating of instance and primitive transforms happens during SoA construction right before GPU Scene upload). In the future we'll also have a custom GPU Scene upload kernel that can do things like the concatentation (among other derivations) right on the GPU, but not affect the hot path of stuff like GetInstanceData(). This change also renames (Prev)InstanceToLocal to (Prev)LocalToPrimitive to make a lot more sense than the previous naming.
#rb ola.olsson, krzysztof.narkowicz, rune.stubbe
[FYI] brian.karis, jason.nadro

#ROBOMERGE-SOURCE: CL 16614552 via CL 16614986
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v828-16531559)

[CL 16615041 by graham wihlidal in ue5-release-engine-test branch]
2021-06-09 19:10:52 -04:00
graham wihlidal
6f93930e59 Instance data optimizations - removed NonUniformScale and InvNonUniformScale from CPU, since they are already derived on the GPU from LocalToWorld as of CL 15961534
#rb ola.olsson
[FYI] brian.karis, rune.stubbe, krzysztof.narkowicz

#ROBOMERGE-SOURCE: CL 16590891 via CL 16590932
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v828-16531559)

[CL 16590946 by graham wihlidal in ue5-release-engine-test branch]
2021-06-08 15:22:21 -04:00