The goal is to simplify the code for path tracing and make room for fields that will be required by future feature additions without impacting the regular RT shaders.
Simplified the packing/unpacking logic a bit since we have more space available in this context.
Remove path tracing specific flags from RT payload and indicate which flags are free for future use
#rb Patrick.Kelly
[CL 16607005 by chris kulla in ue5-main branch]
* Moved Nanite resource ID and hierarchy offset back to primitive data (indirection cost is largely noise these days, and memory savings is more important - GetInstanceData() fetches this data and stores in the pre-existing registers so all the callsites don't have to worry about it).
* Removed FNaniteInfo from FPrimitiveInfo (and the type itself) in favor of just having a 32bit per-instance hierarchy root offset. Hierarchy offset and runtime resource ID just sourced from primitive.
* Removed PrimitiveID from CPU instance data (GPU still needs it). This value was redundantly stored per-instance, and now the GPU Scene upload just blits it over from primitive when the instance data is uploaded.
* Added new virtual GetNaniteResourceInfo on FPrimitiveSceneProxy that retrieves the Nanite resource ID and hierarchy offset stored on a given primitive (needed now that FPrimitiveInstance doesn't cache a copy). The non-virtual FPrimitiveSceneProxy::IsNaniteMesh() helper is used to avoid this virtual function call for non-Nanite proxies.
* Removed deprecated and no longer referenced Nanite::FResources array on FNaniteGeometryCollectionSceneProxy
* Removed expensive per-instance checks() in a few spots
* Stubbed out upcoming per instance payload allocator offset
* Removed deprecated and never referenced non-GPUScene GetInstanceData uniform buffer path
* Significantly cleaned up and optimized a lot of ISM instance data retrieval, including avoiding unnecessary FRenderTransform <-> FMatrix conversions.
* Removed GetInstanceShaderValues API, it was inefficient and annoying to require retrieval of all parameters when often only one or two of them were ever used. In some cases even the origin was unused but .w was needed because of the per-instance random packing.
* Implemented explicit GetInstanceRandomID() accessor to fetch (under current packing) Origin.W without exposing this to the callsites
* Implemented public API for GetInstanceLightMapData(), since the internal version was only accessible by GetInstanceShaderValues()
* Renamed GetInstanceShaderCustomDataValues() -> GetInstanceCustomDataValues() for API consistency
#rb jason.nadro, krzysztof.narkowicz
[FYI] rune.stubbe, brian.karis
#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 16583156
#ROBOMERGE-BOT: (v828-16531559)
#ROBOMERGE-CONFLICT from-shelf
[CL 16583193 by graham wihlidal in ue5-main branch]
- Adds macros check, checkBufferAccess and checkStructuredBufferAccess, along with Slow-suffixed equivalents
- A new cvar 'r.Shader.CheckLevel' which defaults to 1 (enable check but not Slow). Thus be careful when using check, if unsure use checkSlow!
- The cvar controls macros DO_CHECK=0 and DO_GUARD_SLOW=0 that mirrow the ones in host code.
- Note that SM6 version only works for CS and PS.
#rb charles.derousiers
#preflight 60be56fc1e21b4000177f07b
[CL 16576687 by Ola Olsson in ue5-main branch]
Vulkan/DXC does not support initialization of static const variable having complex type. This change lines change the initialization to some simple define instead.
#rb none
#ROBOMERGE-SOURCE: CL 16574414
#ROBOMERGE-BOT: (v828-16531559)
[CL 16574416 by charles derousiers in ue5-main branch]
- Whole scene shadows now generate their planes in the VS directly
- Persistent projected frustum geometry VS gets unprojected and reprojected in the VS for per-object and similar cases. This could be done entirely in a VS as well, but since this VS is used for sphere and cone geometry as well it avoids an additional permutation to keep it a (static) VB for now.
- Split unrelated VS's into separate entry points and parameters
#rb zach.bethel
#ROBOMERGE-SOURCE: CL 16555017
#ROBOMERGE-BOT: (v828-16531559)
[CL 16555019 by andrew lauritzen in ue5-main branch]
* Add helper functions for computing (culled) vertex fetch index.
This insures that vertex index are computed the same way and with the same group count when hair culling is enabled.
#rb none
#ROBOMERGE-SOURCE: CL 16546558
#ROBOMERGE-BOT: (v828-16531559)
[CL 16546605 by charles derousiers in ue5-main branch]
1. Jitter the offset of the sample position when writing to the light scattering volume texture, controlled with new cvar r.VolumetricFog.LightScatteringSampleJitterMultiplier
2. Per-pixel upsampling noise when reading from the volume texture, controlled with new cvar r.VolumetricFog.UpsampleJitterMultiplier
Occupancy is the same and overhead minimal.
Thanks to The Coalition!
#rb none
[CL 16546528 by Sebastien Hillaire in ue5-main branch]
- 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]
* Bumped min allocated card size to 8x8, but kept culling at 4x4. This increases cache usage by 0.5M, but allows for more efficient capture and processing of cards
* Added r.LumenScene.SurfaceCache.CardMinResolution which controls when card should be distance culled (min res is still clamped to 8x8)
[FYI] Patrick.Kelly, Daniel.Wright
#ROBOMERGE-SOURCE: CL 16539430
#ROBOMERGE-BOT: (v828-16531559)
[CL 16539456 by krzysztof narkowicz in ue5-main branch]