Commit Graph

105 Commits

Author SHA1 Message Date
jamie hayes
15da3d166d * Updates to GPU Scene and the GPUSceneCollector to support handling the upload of multiple instances and instance payload data for dynamic primitives
* Updates to the VirtualShadowMapArrayCacheManager to support the invalidation of cache pages upon removal of dynamic primitives
* Various updates and fixes to support writing dynamic primitives' instance scene data and instance payload data from the GPU
* All these changes are needed by a few existing systems that will be using them soon to render via GPU Scene

(NOTE: This change is a resubmit of 18375369 with CIS fixes that caused it to be backed out)

#rb ola.olsson
#preflight 61ae4176353890ce23d75a95

#ROBOMERGE-AUTHOR: jamie.hayes
#ROBOMERGE-SOURCE: CL 18384716 in //UE5/Release-5.0/... via CL 18384780
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v896-18170469)

[CL 18384814 by jamie hayes in ue5-release-engine-test branch]
2021-12-06 13:18:17 -05:00
aurel cordonnier
46a2f40da2 [Backout] - CL18359911 (due to CIS errors)
[FYI] jamie.hayes
Original CL Desc
-----------------------------------------------------------------
* Updates to GPU Scene and the GPUSceneCollector to support handling the upload of multiple instances and instance payload data for dynamic primitives
* Updates to the VirtualShadowMapArrayCacheManager to support the invalidation of cache pages upon removal of dynamic primitives
* Various updates and fixes to support writing dynamic primitives' instance scene data and instance payload data from the GPU
* All these changes are needed by a few existing systems that will be using them soon to render via GPU Scene

#rb ola.olsson

#ROBOMERGE-AUTHOR: aurel.cordonnier
#ROBOMERGE-SOURCE: CL 18375767 via CL 18375771 via CL 18375781
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18375783 by aurel cordonnier in ue5-release-engine-test branch]
2021-12-03 19:54:06 -05:00
jamie hayes
4523c7cecd * Updates to GPU Scene and the GPUSceneCollector to support handling the upload of multiple instances and instance payload data for dynamic primitives
* Updates to the VirtualShadowMapArrayCacheManager to support the invalidation of cache pages upon removal of dynamic primitives
* Various updates and fixes to support writing dynamic primitives' instance scene data and instance payload data from the GPU
* All these changes are needed by a few existing systems that will be using them soon to render via GPU Scene

#rb ola.olsson

#ROBOMERGE-AUTHOR: jamie.hayes
#ROBOMERGE-SOURCE: CL 18359911 via CL 18375369 via CL 18375397
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18375424 by jamie hayes in ue5-release-engine-test branch]
2021-12-03 17:54:14 -05:00
dmitriy dyomin
9a53094474 Fixed couple issues with a mobile path in GPUScene (LWC and compressed instance transforms)
#rb none
[FYI] brian.karis, graham.wihlidal

#ROBOMERGE-AUTHOR: dmitriy.dyomin
#ROBOMERGE-SOURCE: CL 17732436 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v879-17706426)

[CL 17732462 by dmitriy dyomin in ue5-release-engine-test branch]
2021-10-06 02:20:54 -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
arciel rekman
63977655d7 Make sure shaders are only created on one thread in DX11 (UE-125050).
(cherry pick of 17507631 including later followup fixes in 17526511 and 17542272)

- Disable RDG parallel execution on D3D11.
- Precreate ClearReplacement shaders
- Also add a check to catch other possible issues before it's too late.

#rb Chris.Waters (in Dev-EMT)
#jira UE-125050

#ushell-cherrypick of 17507631 by Arciel.Rekman

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 17586312 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17586354 by arciel rekman in ue5-release-engine-test branch]
2021-09-21 15:10:29 -04:00
jeremy moore
e0e56ca2c1 #jira UE-125240
Always translate primitive ID for use by mesh draw commands.
Fixes regression from 17093848 which meant that we sometimes earlied out from TranslatePrimitiveId() for a deferred translate that no longer happens.
#preflight 6139374fd9c85a00018dae0e
#rb dmitriy.dyomin

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

[CL 17466057 by jeremy moore in ue5-release-engine-test branch]
2021-09-08 20:06:34 -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
christopher waters
204ad930d4 Changing WaitForTasksAndClearSnapshots Task to add the required tasks as prerequisites instead of actually waiting on them.
#rb zach.bethel

#ROBOMERGE-OWNER: christopher.waters
#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 17060898 via CL 17061464 via CL 17061469 via CL 17062912
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v850-17047176)
#ROBOMERGE-CONFLICT from-shelf
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 17063891 by christopher waters in ue5-release-engine-test branch]
2021-08-04 23:10:26 -04:00
dmitriy dyomin
8b92621f88 Use a regular draw calls (no indirect) for primitives with a single instance when possible
Move SubmitDrawCommands functionality into FInstanceCullingContext so we may use per-draw auxiliary information collected at Setup step
"UnCulled" bucket will use an optimized permutation that assumes that all submitted items are 'single instance'.
#rb ola.olsson
[FYI] krzysztof.narkowicz

#ROBOMERGE-SOURCE: CL 17029558 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v846-17029325)

[CL 17029645 by dmitriy dyomin in ue5-release-engine-test branch]
2021-08-03 09:31:28 -04:00
zach bethel
2b3e6e1148 Removing dead code path in mesh draw command task that would break RDG parallelism if enabled.
#rb trivial

#ROBOMERGE-SOURCE: CL 17000221 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)

[CL 17000227 by zach bethel in ue5-release-engine-test branch]
2021-07-29 15:48:43 -04:00
daniel wright
2ca2fe3fbf Translucent surfaces use Lumen Radiance Cache for reflections
* Translucent surfaces are rasterized with 4x downsampling to mark Radiance Cache probes
 * Translucency base pass interpolates from Radiance Cache for reflections instead of ushadowed skylight
 * No roughness handling yet, always sampling from mip 0
 * Causes full shader recompile

#ROBOMERGE-OWNER: daniel.wright
#ROBOMERGE-AUTHOR: daniel.wright
#ROBOMERGE-SOURCE: CL 16927021 via CL 16927456
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)

[CL 16927472 by daniel wright in ue5-release-engine-test branch]
2021-07-22 13:51:03 -04:00
florin pascu
8b0c31429c Remove Opacity Pass MobileSceneCapture
Remove MobileSceneCapture, move everything to the shared SceneCaptureRendering file
Remove MobileSceneCapture.usf
#jira UE-118450
#rb Dmitriy.Dyomin, Jack.Porter
#preflight 60f56cd41d824300016bdb7a

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

[CL 16882856 by florin pascu in ue5-release-engine-test branch]
2021-07-19 09:12:09 -04:00
brian white
2f373ddcf4 Fix deadlock during WaitForMeshPassSetupTask
#jira UE-119712
#rb Zach.Bethel
#rnx

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

[CL 16869504 by brian white in ue5-release-engine-test branch]
2021-07-15 20:00:42 -04:00
zach bethel
5ec769f91e RDG Parallel Execution (disabled by default)
- Refactored RDG to support free-threaded execution of passes.
 - Refactored renderer to use specific RHI command list variants in pass lambda. Immediate command list passes are forced to stay on the render thread, while other variants can be parallelized.

#rb christopher.waters

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

[CL 16838724 by zach bethel in ue5-release-engine-test branch]
2021-07-13 12:38:37 -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
ola olsson
30b717b963 Combing GPU-Scene instance culling and the id-list generation into one step, and the same for VSM
- Uses the InstanceCullingLoadBalancer to pre-distribute the work on the CPU to ensure even load.
 - Make instance culling use the instance data offset in MDC instead of translating primitive IDs.
 - Track single-instance draws separately from instanced to optimize handling (disable culling for single-instance primitives).

#rb Graham.wihlidal,andrew.lauritzen
[FYI] dmitriy.dyomin
#preflight 60d0eafa2ab2180001269160

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

[CL 16733837 by ola olsson in ue5-release-engine-test branch]
2021-06-21 16:52:03 -04:00
ola olsson
137fd18fbb Add InstanceSceneDataOffset to visible/cached mesh draw commands and propagate
- Intermediate step towards making renderer instance-first.
 - Enables simplification of instance culling setup.

#rb Krzysztof.Narkowicz

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

[CL 16729413 by ola olsson in ue5-release-engine-test branch]
2021-06-21 12:27:09 -04:00
Ola Olsson
075ef36828 Move SetupGPUInstancedDraws into FInstanceCullingContext
- provides easier iteration on related code, plus sets the stage for abstraction for desktop/mobile version.
#preflight 60bf64925bc96f0001ba7fe1

[CL 16587267 by Ola Olsson in ue5-main branch]
2021-06-08 10:54:17 -04:00
Jian Ru
13d2d6e79e Batch BuildRenderingCommands from major mesh passes inside the main render function
#jira UE-117281
#rb ola.olsson, zach.bethel

[CL 16572282 by Jian Ru in ue5-main branch]
2021-06-07 12:19:06 -04:00
Ola Olsson
91ed2ab3ba Move instance ID buffer to RDG and out of the View uniform buffer and into own UB.
- Enables overlapping batched and non-batched instance culling (needed for batching work).
 - Removes some explicit transitions & minor cleanup.
 - Added tracking the required number of instances (fixes non-nanite VSM for large ISMs)

#rb graham.wihlidal,jian.ru,yujiang.wang,zach.bethel
#preflight 60b73f38107dc600017d931b

[CL 16544217 by Ola Olsson in ue5-main branch]
2021-06-03 02:19:28 -04:00
Ola Olsson
df492855e0 Removed GPUCULL_TODO define (fixed in on-state)
#preflight 60acc49b58f02e0001a0a996
#rb graham.wihlidal,Arciel.Rekman,Brandon.Schaefer,will.damon

[CL 16446355 by Ola Olsson in ue5-main branch]
2021-05-25 08:15:14 -04:00
zach bethel
67229c547a Reworked scene renderer lifetime to allow deferral of scene render cleanup.
This avoids a long stall on mesh draw command recording tasks at the end of the frame and saves about .1 ms of work off the render thread.

#jira UE-114622
#rb luke.thatcher

[CL 16419616 by zach bethel in ue5-main branch]
2021-05-21 11:30:17 -04:00
jamie hayes
9389c3eb1e Add another optional separate translucency pass that gets composited after motion blur. Has no depth test (due to TAA color upsample with no upsampled depth), and is intended to work around reprojection and motion blur artifacts with translucency.
#rb zach.bethel, michal.valient
#jira none

[CL 16381727 by jamie hayes in ue5-main branch]
2021-05-19 02:09:02 -04:00
Ola Olsson
e49320f038 Batch GPU-Scene Instance Culling passes for shadows
#rb graham.wihlidal
#preflight 609e26220e81c70001cc778f

[CL 16327421 by Ola Olsson in ue5-main branch]
2021-05-14 04:16:02 -04:00