Commit Graph

167 Commits

Author SHA1 Message Date
graham wihlidal
3702c00d25 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
#ROBOMERGE-BOT: (v835-16672529)

[CL 16745792 by graham wihlidal in ue5-main branch]
2021-06-22 13:49:59 -04:00
graham wihlidal
1b2976b0c9 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
#ROBOMERGE-BOT: (v834-16658389)
#ROBOMERGE-CONFLICT from-shelf

[CL 16660883 by graham wihlidal in ue5-main branch]
2021-06-14 13:42:46 -04:00
ola olsson
5560667259 Tracking GPU-Scene dirty state and specialize Primitive Id only updates to avoid redundant uploads.
- Added instance data validation
- Added general load balancer for instance processing on GPU (will move to own files later)
- Added initial GPU-side write access API for GPU scene.
- Addded specialized kernel to update primitive IDs in instances when that is the only change.

#rb graham.wihlidal
#jira UE-116671
#preflight 60c25d7b1264df0001aab80b


#ROBOMERGE-SOURCE: CL 16628528
#ROBOMERGE-BOT: (v831-16623017)

[CL 16628539 by ola olsson in ue5-main branch]
2021-06-10 15:46:35 -04:00
ola olsson
131fbfdb66 Moved Allocate/Free of GPU-Scene Instance out of AddToScene/RemoveFromScene as these are called for primitive transform updates.
#preflight 60bf262b0c76f90001ddb21d
#rb rune.stubbe,Krzysztof.Narkowicz


#ROBOMERGE-OWNER: ola.olsson
#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 16589643
#ROBOMERGE-BOT: (v828-16531559)
#ROBOMERGE-CONFLICT from-shelf

[CL 16590284 by ola olsson in ue5-main branch]
2021-06-08 14:33:44 -04:00
graham wihlidal
c3dcd43b0a Implemented a new 32bit bounding box type called FRenderBounds, which complements FRenderTransform. This implementation does not require a boolean to keep track of initial invalid state, the bounds merging is vectorized (safe for unaligned float3 data), and it also doesn't store the sphere radius (keep memory down for heavy instanced content). Future optimizations and work around tighter encoding (reduced extent precision with a conservative roundup?) and also LWC can change the underlying implementation of these types without changing every callsite; should also switch to center+extent later.
#rb krzysztof.narkowicz, rune.stubbe
[FYI] brian.karis, ola.olsson, jason.nadro, zak.middleton


#ROBOMERGE-SOURCE: CL 16577543
#ROBOMERGE-BOT: (v828-16531559)

[CL 16577575 by graham wihlidal in ue5-main branch]
2021-06-07 16:55:33 -04:00
aurel cordonnier
43fa62fcd8 Merge from Release-Engine-Test @ 16487383 to UE5/Main
This represents UE4/Main @ 16445039 and Dev-PerfTest @ 16444526

[CL 16488106 by aurel cordonnier in ue5-main branch]
2021-05-27 13:40:37 -04:00
krzysztof narkowicz
3bc46dd697 Fixed Lumen GPUSceneInstance to surface cache mapping. UpdatedSceneInfosWithStaticDrawListUpdate recreates SceneInfo->InstanceDataOffset, but this change wasn't propagated to Lumen, which maintains InstanceIndex to SurfaceCacheIndex mapping.
[FYI] Daniel.Wright

#ROBOMERGE-SOURCE: CL 16452787 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v818-16446889)

[CL 16452833 by krzysztof narkowicz in ue5-main branch]
2021-05-25 13:42:10 -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
andrew firth
a44ec91554 [INSIGHTS] - add insights zones to illuminate overall frame time.
#rb Jason.Nadro

#ROBOMERGE-SOURCE: CL 16444116 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v814-16434418)

[CL 16444117 by andrew firth in ue5-main branch]
2021-05-24 22:47:38 -04:00
graham wihlidal
32e893af72 Fix for race condition where GCs might reach the call to RequestGPUSceneUpdate() on initial proxy creation before the primitive scene info has a valid index (entry in GPU Scene bookkeeping), causing the updates to silently skip. Normally this problem doesn't affect the majority of GCs, since most GCs have identify transforms in rest pose, except some GCs authored in external DCC tools could use non-identify transforms that wouldn't be correctly uploaded to GPUScene until simulation would start. Also took the time to remove the virtual function calls on IsNaniteMesh() and IsAlwaysVisible() since these are called super heavily in frustum culling and init views on the CPU.
#rb brett.miller
[FYI] brice.criswell, nick.whiting, brian.karis
#jira UE-115088

#ROBOMERGE-SOURCE: CL 16261925 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v799-16237190)

[CL 16264515 by graham wihlidal in ue5-main branch]
2021-05-11 01:18:05 -04:00
chris kulla
06d5a5353d Fix compile errors on non-raytracing platforms
#rb none

[CL 16251140 by chris kulla in ue5-main branch]
2021-05-10 13:53:08 -04:00
chris kulla
6df4146582 Make sure we pick the no-lightmap shader permutation when using the path tracer
This is another small step towards enabling path tracing specific shader permutations.

This requires re-caching the raytracing mesh commands when we flip to and from path traced rendering.

Cleanup some flag handling by removing the redundant ERayTracingRenderMode enum since it is already capture by show flags.

Avoid checking the path tracing flag per view since it is always common to all views

Re-introduce the deduplication over views for the non-path tracing case since ray tracing effects can be enabled in a view dependent fashion.

Rename CanOverlayRayTracingOutput to HasRayTracedOverlay which I think is a bit clearer. Note that the meaning has flipped - it now returns true when path tracing or ray tracing debug modes are enabled.

Remove leftovers of GAveragePathTracedMRays (which wasn't hooked up to anything anymore)

Refactor static variables used to store path tracing state into a pimpl object off of the ViewState

#rb Patrick.Kelly, Yuriy.ODonnell, Juan.Canada

[CL 16249998 by chris kulla in ue5-main branch]
2021-05-10 12:22:42 -04:00
Jaren Peterson
e4271ebde7 #ue5 - Fix crash when loading editor with help from Brandon.Dawson
#fyi Brandon.Dawson

[CL 16207992 by Jaren Peterson in ue5-main branch]
2021-05-05 11:34:26 -04:00
brandon dawson
4da77d6fab Fix for major frame hitches when adding levels to a world. Previously, adding a level to the world would trigger a linear loop through all primitives in the scene, testing to see if they were in the current level, and calling OnLevelAddedToWorld() if they were flagged to do so. The more primitives in the scene, the larger the hitch.
Now, proxiess can register for needing an on added/removed from level call.  If this is requested, they are added to a map, which maintains a list of primitives that need the add/remove call, per level.

The only component that currently utilizes this is the Landscape component.  To facilitate it's needs, the generic flags used to determine if it should be visible have been removed from FPrimitiveSceneProxy, bRequiresVisibleLevelToRender bIsComponentLevelVisible, and replaced with bForceHidden.  The landscape component will now set that flag under the same circumstances as before.

[REVIEW] [at]sebastien.lussier [at]Nick.Whiting [at]patrick.enfedaque
#jira UE-UE-114943
#lockdown nick.whiting

#ROBOMERGE-SOURCE: CL 16207473 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v796-16191650)

[CL 16207501 by brandon dawson in ue5-main branch]
2021-05-05 10:47:54 -04:00
chris kulla
333d4ec98c Customize RTPSO for Path Tracer
A small first step towards customizing the RayTracingPipeline for path tracing. As a first step, I am building the pipeline with just the path tracing related raygen shaders in it (and removing the path tracing raygen shader from the regular RT pipeline). I removed the miss shader for lighting from the path tracer's pipeline since its not used there.

Other minor refactors include consolidating the ray tracing related cached command logic and simplifying the RT command storage to avoid a verbose indirection.

#rb Yuriy.ODonnell

[CL 16160139 by chris kulla in ue5-main branch]
2021-04-29 14:41:17 -04:00
brandon dawson
e4c331e5a7 Parallelize CacheNaniteDrawCommands.
[REVIEW] [at]Graham.Wihlidal [at]Nick.Whiting

#ROBOMERGE-SOURCE: CL 16136130 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16136147 by brandon dawson in ue5-main branch]
2021-04-27 23:56:28 -04:00
brandon dawson
680503233c Prevent memory leaks when caching mesh draw commands in parallel thread.
[REVIEW] [at]Graham.Wihlidal,[at]Nick.Whiting

#ROBOMERGE-SOURCE: CL 16136078 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16136086 by brandon dawson in ue5-main branch]
2021-04-27 23:53:02 -04:00
brandon dawson
742b10538b Use ReadWrite locks isntead of critical sections to protect cached mesh draw commands
Use ReadWrite locks instead of critical sections to protect the Graphics Minimal Pipline State ID's persistent table.
Use remove locking around the pipeline id table size, and use atomic operators instead.
Disable the pipeline id table size completely in test or shipping builds

[REVIEW] [at]Graham.Wihlidal [at]Nick.Whiting
#lockdown nick.whiting

#ROBOMERGE-SOURCE: CL 16136028 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16136043 by brandon dawson in ue5-main branch]
2021-04-27 23:50:55 -04:00
Yuriy ODonnell
8806331f70 FRayTracingGeometryInstance now only uses array views. Actual bulk data is typically owned by either FRayTracingScene or by CachedRayTracingInstanceTransforms in FSceneProxy.
Added ERayTracingInstanceFlags, which covers all equivalent DXR functionality. Explicitly specified that FRayTracingGeometryInstance.NumTransforms is what defines how many elements will be read from CPU or GPU transform buffers (which may themselves be larger). Added FRayTracingGeometryInstance.CommonUserData that's used if UserData array view is empty. Otherwise UserData must have at least as many elements as NumTransforms.

Also fix System.Renderer.RayTracing.BasicRayTracing failure, as a side-effect.

#rb Juan.Canada

[CL 16072216 by Yuriy ODonnell in ue5-main branch]
2021-04-21 09:25:44 -04:00
Yujiang Wang
9182a62389 Fix visible in ray tracing flag
#rb none

[CL 16069699 by Yujiang Wang in ue5-main branch]
2021-04-20 23:11:45 -04:00
Yujiang Wang
f31946fc06 Implement cached ray tracing mesh commands for Nanite proxies
#rb yuriy.odonnell

[CL 16062618 by Yujiang Wang in ue5-main branch]
2021-04-20 12:18:22 -04:00
daniel wright
11a77e830b Make sure primitives remove themselves from the velocity scene data even if the conditions for being put in the velocity scene data have changed. The underlying bug of FPrimitiveSceneProxy::SetIsBeingMovedByEditor_RenderThread not correctly updating velocity scene data remains - this change is a patch to avoid the crash when a primitive is removed from the scene but doesn't remove itself from velocity data.
#jira UE-113831
#lockdown Graham.Wihlidal
[FYI] nick.whiting

#ROBOMERGE-SOURCE: CL 16054789 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16061039 by daniel wright in ue5-main branch]
2021-04-20 10:25:16 -04:00
andrew lauritzen
968b88f36a Avoid unnecessary CPU culling of nanite meshes in shadow rendering
#rb graham.wihlidal
#lockdown michal.valient

#ROBOMERGE-SOURCE: CL 15960758 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v787-15839533)

[CL 15979143 by andrew lauritzen in ue5-main branch]
2021-04-12 12:47:10 -04:00
Marc Audy
01b7c9f4f5 Merge UE5/RES @ 15958325 to UE5/Main
This represents UE4/Main @ 15913390 and Dev-PerfTest @ 15913304

[CL 15958515 by Marc Audy in ue5-main branch]
2021-04-08 14:32:07 -04:00
krzysztof narkowicz
6bb5373841 Fixed two bugs causing missing meshes in Lumen surface cache. First one was that HasLumenCaptureMeshPass was checking for existance of mesh draw commands before those were updated. Second is that visible mesh draw commands were gathered before MDC update.
#rb Daniel.Wright

#ROBOMERGE-SOURCE: CL 15740414 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v781-15675533)

[CL 15740421 by krzysztof narkowicz in ue5-main branch]
2021-03-18 15:04:18 -04:00