Commit Graph

7 Commits

Author SHA1 Message Date
wei liu
72e23481e9 Fix a debug crash when GPUScene and modulated shadow are enabled.
#jira none

#robomerge 5.0

#rb Dmitriy.Dyomin, Ola.Olsson
#p4v-preflight-copy 18206900

[CL 18234278 by wei liu in ue5-main branch]
2021-11-18 01:14:54 -05:00
ola olsson
b182c9a947 Add occlusion culling support to GPU-Scene Instance Culling system (disabled by default, cvar: r.InstanceCulling.OcclusionCull)
#rb Ola.Olsson
#author josie.yang
#preflight 611a4fcc5e73720001408497,611a5b008ff5540001cf0995


#ROBOMERGE-OWNER: ola.olsson
#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 17175042
#ROBOMERGE-BOT: (v855-17104924)
#ROBOMERGE-CONFLICT from-shelf

[CL 17175430 by ola olsson in ue5-main branch]
2021-08-16 09:32:45 -04:00
Dmitriy Dyomin
762b48e011 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

[CL 17093848 by Dmitriy Dyomin in ue5-main branch]
2021-08-07 07:16:17 -04:00
Dmitriy Dyomin
38a339fe09 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

[CL 17029558 by Dmitriy Dyomin in ue5-main branch]
2021-08-03 09:28:51 -04:00
zach bethel
f311bbc7a1 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

[CL 16838717 by zach bethel in ue5-main branch]
2021-07-13 12:38:27 -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
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