Commit Graph

90 Commits

Author SHA1 Message Date
aurel cordonnier
d17d20ca36 Merge from Release-Engine-Test @ 16758890 to UE5/Main
This represents UE4/Main @ 16738161 and Dev-PerfTest @ 16737719 (and Release-17.00 @ 16658211)

[CL 16763350 by aurel cordonnier in ue5-main branch]
2021-06-23 17:51:32 -04:00
Ola Olsson
e9276fc6db 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

[CL 16733827 by Ola Olsson in ue5-main branch]
2021-06-21 16:51:39 -04:00
Ola Olsson
fe64cb01af 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

[CL 16729395 by Ola Olsson in ue5-main branch]
2021-06-21 12:25:46 -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
ola olsson
c6d735addf Stereo GPU-Scene Instance culling fixes
- added explicit stereo mode to instance culling context.
- fixed the stencil setup pass parameter to include the InstancedView (lost in RDG conversion probably)
- restored the hack to run the stereo stencil pass twice (needed to make FSimpleMeshDrawCommandPass support setting up stereo)

#rb andrew.lauritzen,steve.smith
[FYI] jules.blok

#ROBOMERGE-OWNER: ola.olsson
#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 15739174 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v781-15675533)
#ROBOMERGE-CONFLICT from-shelf

[CL 15739606 by ola olsson in ue5-main branch]
2021-03-18 13:39:09 -04:00
Guillaume Abadie
23194531c5 Removes the last uses of SHADER_PARAMETER_RDG_BUFFER()
#rb ola.olsson
#fyi zach.bethel
#robomerge Release-5.0-EarlyAccess

[CL 15722728 by Guillaume Abadie in ue5-main branch]
2021-03-17 10:18:43 -04:00
will damon
0a298b5d97 Disable GPU culling on Apple and Linux platforms.
- Convert preprocessor 'defined(GPUCULL_TODO)' checks to 'GPUCULL_TODO'
- Define GPUCULL_TODO to 0 for Apple and Linux platforms

#rb rolando.caloca
[FYI] carl.lloyd brandon.schaefer ola.olsson lukas.hermanns graham.wihlidal
#jira UE-109070
#rnx

#ROBOMERGE-OWNER: will.damon
#ROBOMERGE-AUTHOR: will.damon
#ROBOMERGE-SOURCE: CL 15502801 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
#ROBOMERGE-CONFLICT from-shelf

[CL 15503935 by will damon in ue5-main branch]
2021-02-23 15:21:24 -04:00
ola olsson
4fe852b5ca Implement lumen card capture rendering using GPU-Scene instance culling
#rb Krzysztof.Narkowicz

#ROBOMERGE-SOURCE: CL 15451406 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15454857 by ola olsson in ue5-main branch]
2021-02-18 13:45:50 -04:00
ola olsson
f7822cb8c5 Enable caching for Non-Nanite VSM
- added a path to propagate and cache whether material modifies position (WPO) to enable invalidating cached pages (touches whole mesh command pipeline).
- added pixel shader verision of page copying & clearing.
- also added flag for whether cached the mesh draw command supports primitive id (which enables checing this earlier).

#rb andrew.lauritzen,brian.karis,graham.wihlidal,Krzysztof.Narkowicz

#ROBOMERGE-SOURCE: CL 15436539 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15441336 by ola olsson in ue5-main branch]
2021-02-17 15:32:52 -04:00
ola olsson
0ee0c57088 Defer ID translation for dynamic primitives such that the commit can happen at any time before draw submit.
- dynamic primitive collectors now auto-commit when uploading dynamic primitives, simplifying use.
- fixed shadow stencil passes to properly use GPU-Scene instance culling (and instancing), now using FSimpleMeshDrawCommandPass
- Also move translucency shadow rendering to FSimpleMeshDrawCommandPass

#jira UE-108032
#rb Krzysztof.Narkowicz

#ROBOMERGE-SOURCE: CL 15432971 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15441234 by ola olsson in ue5-main branch]
2021-02-17 15:31:33 -04:00
Dmitriy Dyomin
edd0257c55 Remove Texture2D as a storage for GPUScene primitives, OpenGL will use StructuredBuffers supported through SSBOs
#rb jack.porter
#fyi ola.olsson

[CL 15415286 by Dmitriy Dyomin in ue5-main branch]
2021-02-16 00:46:28 -04:00
ola olsson
0224d4d591 Make InstanceCullingContext local to mesh passes to ensure correct life-time.
- Also stripped out instance culling manager and some other superseded code.

#rb rune.stubbe

#ROBOMERGE-SOURCE: CL 15314346 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15314386 by ola olsson in ue5-main branch]
2021-02-04 10:44:19 -04:00
Ola Olsson
afe7c483e1 Made GPU-Scene instance culling toggle with GPU-Scene support (UseGPUScene)
- Added dynamic switches in addition to the ifdef.
- Added ifdef to disable workaround for legacy primitives for cube shadow when not used (enabled with GPU-Scene)
- Fixed some references to PrimitiveId in hair strand shaders

#rb graham.wihlidal
#fyi charles.derousiers,andrew.lauritzen

[CL 15185037 by Ola Olsson in ue5-main branch]
2021-01-25 16:30:37 -04:00
graham wihlidal
652ab75bb8 Workaround for Dynamic Mesh Pass Draws
#author ola.olsson
#ushell-cherrypick of 15144226 by swarm
#rb graham.wihlidal
#fyi brian.karis, rune.stubbe

[CL 15150027 by graham wihlidal in ue5-main branch]
2021-01-20 19:57:54 -04:00
Emil Persson
9d7f102824 Replace FRHIVertexBuffer, FRHIIndexBuffer and FRHIStructuredBuffer with FRHIBuffer, and some additional cleanup.
#rb kenzo.terelst

[CL 15143850 by Emil Persson in ue5-main branch]
2021-01-20 06:49:41 -04:00
Ola Olsson
e595e1c516 Final set of GPU-Scene Instance Culling v0.1 changes (disabled by default)
- LocalVertexFactory can fetch instance data from GPU-Scene
- regular Shadow map rendering can use instance culling view index (route to cube face)
- HISM/ISM/SM registers instance data
- Support for overriding mesh draw commands with indirect dispatch

#rb graham.wihlidal

[CL 15135051 by Ola Olsson in ue5-main branch]
2021-01-19 08:25:03 -04:00
graham wihlidal
5964733fd0 Store PrimitiveType value on FMeshDrawCommand for GPU instance culling, and move FCompareFMeshDrawCommands into the header, and stubbed out part of the new mesh draw command API.
#author ola.olsson
#rb graham.wihlidal
#fyi brian.karis, rune.stubbe

[CL 15105156 by graham wihlidal in ue5-main branch]
2021-01-14 23:37:17 -04:00
graham wihlidal
61244769d1 Decoupled more of the GPU scene instance culling work
==
* Added instance offset and count to primitive data, along with GetPrimitiveUniformShaderParameters() diffs
* Remaining FInstanceCullingManager& hooks through functions
* Various todo comments to address later
* Calls to (disabled for now) BuildRenderCommands()
* Mutability of FViewInfo in some spots
* Additional instance culling draw params in a few places
* EVertexInputStreamType cleanup
* UseVirtualShadowMaps() feature capability helper function

#authors ola.olsson, graham.wihlidal
#rb graham.wihlidal
#fyi brian.karis, rune.stubbe

[CL 15092149 by graham wihlidal in ue5-main branch]
2021-01-14 15:46:32 -04:00
graham wihlidal
862e861803 Added instance culling manager and context (disabled, and without shader files), and tons of hooks all over the renderer in preparation for upcoming GPU culling work.
#author ola.olsson
#rb graham.wihlidal
#fyi brian.karis, rune.stubbe

[CL 15082481 by graham wihlidal in ue5-main branch]
2021-01-14 05:23:34 -04:00