Commit Graph

7890 Commits

Author SHA1 Message Date
Charles deRousiers
2257ad3325 Fix/Add split screen & VR support for Strata (i.e., Tiling/Lighting/SSS/Distortion).
This CL split the resources shared between views (non-buffer/tiled data) and resources unique to view (e.g., tile data). This is to ease overall setup, but we might re-regroup them later.

#rb none
#jira none
#preflight 62488f4d927e60e3418751db
#fyi sebastien.hillaire

[CL 19601993 by Charles deRousiers in ue5-main branch]
2022-04-02 14:31:01 -04:00
jason hoerner
078ea856d8 UE5_MAIN: Multi-GPU crash, corruption, and DumpGPU fixes.
* Distance Field streaming GPU mask scope clean up, to avoid startup crash.  Added single high level FRHIGPUMask::All() scope in PrepareDistanceFieldScene, to avoid the need to set the mask in multiple lower level functions, and hopefully cover future modifications to the distance field scene code.  View dependent subset of the code is then masked to the view.  Validation asserts added in case code gets moved around in the future.
* Fixed bug when generating SRVs for structured buffers -- wasn't pointing the SRV to the correct GPU buffer.  Caused GPU hangs and all sorts of corrupted rendering.
* Fixed bug that RHICopyToResolveTarget wasn't using the correct GPU index.  Main symptom was DumpGPU being non-functional on the second GPU, but could cause other artifacts as well.

#jira none
#rnx
#rb christopher.waters chris.kulla
#preflight 624716e2b6084b9832597015

[CL 19591778 by jason hoerner in ue5-main branch]
2022-04-01 13:44:07 -04:00
chris kulla
5e4ac8d493 Path Tracer: Fix missing scene invalidations when changing skylight or moving atmosphere/fog components
#rb Juan.Canada
#preflight 624725c8c667881bf408f351

[CL 19590290 by chris kulla in ue5-main branch]
2022-04-01 12:34:53 -04:00
Jeremy Moore
cd5455efbb #jira UE-147673
Fix static analysis warning.
#rnx
#preflight 624702c8dc6183e3f519a319

[CL 19587766 by Jeremy Moore in ue5-main branch]
2022-04-01 10:00:22 -04:00
Jason Nadro
e377452cf2 Prevent shifts by a negative value.
- Addresses static analysis warning: warning V610: Undefined behavior. Check the shift operator '<<'. The right operand is negative ('....' = [-1..254])
- Texture Resolution will be 1.

#rb Jeremy.Moore
#jira UE-147669
#preflight none

[CL 19587584 by Jason Nadro in ue5-main branch]
2022-04-01 09:44:47 -04:00
Charles deRousiers
61cf50b66f Change Strata binding buffer function args to take view instead of the explicit scene data.
#rb none
#jira none
#preflight 6246ee2a292f228e0914eed2
#fyi sebastien.hillaire

[CL 19586823 by Charles deRousiers in ue5-main branch]
2022-04-01 08:35:55 -04:00
Sebastien Hillaire
81d50dea0c Strata - Fixed crash in Lumen due to VS/PS mismatch
#rb none
#preflight none
#fyi charles.derousiers

[CL 19585046 by Sebastien Hillaire in ue5-main branch]
2022-04-01 02:21:26 -04:00
daniel wright
476267f434 Splitscreen support for Lumen
* Lumen Sceen Direct Lighting: Light Tiles choose which view to light with based on distance to view, with a dispatch per light per view.  These overlap so there's very little added GPU cost (0.63ms -> 0.69ms)
* Lumen Radiosity: Tiles choose which view's structures to trace against based on distance to view, with overlapping dispatches per view (0.45ms -> 0.53ms)
* Voxel Lighting and Translucency Volume are done twice as they are view dependent structures, which don't scale with resolution, so their cost is doubled (0.09ms + 0.32ms -> .22ms + 0.62ms)
* LumenScreenProbeGather and Lumen Reflections are done independently for each view, and they scale with resolution, but there's still a lot of overhead from barriers: (1.15ms -> 1.67ms), (1.16ms -> 1.64ms).  These need to be refactored to operate on all the views in the same resource to get rid of the barrier and memory cost.
* Hardware Ray Tracing doesn't support splitscreen yet, so Lumen falls back to SW tracing

Misc
* Lumen Reflection temporal filter no longer checks tile validity when gathering the neighborhood min/max.  The ReflectionResolveCS shader which runs right before it is now responsible for clearing tile neighbor texels instead, which is much cheaper.
* Added new uint ViewRectMinAndSize member to View, which avoids repeated type conversion from the float View.ViewRectMin when doing addressing in integers
#preflight 6244bc4cb33098a72dc0aee1
#rb Krzysztof.Narkowicz

#ROBOMERGE-AUTHOR: daniel.wright
#ROBOMERGE-SOURCE: CL 19582572 via CL 19582648 via CL 19582763
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v938-19570697)

[CL 19584235 by daniel wright in ue5-main branch]
2022-03-31 23:33:47 -04:00
krzysztof narkowicz
f9d066a72a Lumen - SurfaceCache optimizations and cleanup
* Removed Opacity surface cache atlas layer (saves 8mb with compression and 16mb without). Also doesn�t need to be ever sampled in shaders
* Unified invalid texel handling. Instead of using depth and opacity, a single bit encoded in depth is used to decide whether a pixel is masked or not
* Unified surface cache encoding and decoding through FLumenSurfaceCacheData so that they are done in a single function and it�s easy to change surface cache encoding
* Moved surface cache shaders to a SurfaceCache folder
* Fixed surface cache reversed depth

[FYI] Daniel.Wright

#ROBOMERGE-AUTHOR: krzysztof.narkowicz
#ROBOMERGE-SOURCE: CL 19574357 via CL 19574422 via CL 19574457
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v938-19570697)

[CL 19575982 by krzysztof narkowicz in ue5-main branch]
2022-03-31 14:32:56 -04:00
Charles deRousiers
9d440f6a81 Remove STRATA_DATA_TILE_XXX to avoid confusion with STRATA_TILE.
#rb none
#jira none
#preflight 6245dbf39f404234145fc039

[CL 19574692 by Charles deRousiers in ue5-main branch]
2022-03-31 13:05:44 -04:00
Charles deRousiers
e1a4461f77 Add Strata tile buffer overflow to Strata uniform buffer.
#rb none
#jira none
#preflight 6245d55dc667881bf4f91544
#fyi sebastien.hillaire

[CL 19574416 by Charles deRousiers in ue5-main branch]
2022-03-31 12:43:49 -04:00
dmitriy dyomin
d61e4c3c44 Improved mesh sorting on mobile. Better front to back sorting inside for meshes that belong to the same PSO
#rb none

#ROBOMERGE-OWNER: dmitriy.dyomin
#ROBOMERGE-AUTHOR: dmitriy.dyomin
#ROBOMERGE-SOURCE: CL 19570287 via CL 19570293 via CL 19570341 via CL 19570347
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19570509 by dmitriy dyomin in ue5-main branch]
2022-03-31 04:42:34 -04:00
Rune Stubbe
a86a7ba254 Added Non-persistent culling path. When r.Nanite.PersistentThreadsCulling is disabled, the node and cluster culling is unrolled into a chain of dependent dispatches that are easier to debug.
#rb graham.wihlidal
#preflight 6244f400981a2c8eb4791451

[CL 19567899 by Rune Stubbe in ue5-main branch]
2022-03-30 21:21:16 -04:00
graham wihlidal
9c8fa1c395 Implemented a GPU Scene API for primitives explicitly enabling/disabling WPO support driven by events. This will be important for disabling WPO overhead in Nanite and other systems when unnecessary. The material system MayModifyMeshPosition hints are insufficient when using an MICD with static params that ultimately disable WPO, but the material system still reports WPO usage. This hint can also be used in new LOD systems to disable expensive features like WPO in the distance, but without doing a full shader switch. Nanite now supports a debug view that shows WPO off (red) and on (green) for meshes in the scene (r.Nanite.Visualize EvaluateWPO).
This change also remaps the original bEvaluateWorldPositionOffset on SMC into bEvaluateWorldPositionOffsetInRayTracing, because this var was only ever driven by ray tracing specific methods. The original bEvaluateWorldPositionOffset is now used by this more generic API.

Lastly, a new cvar (r.OptimizedWPO) has been added that indicates if the hint should be respected or not (default is false, which means WPO is always active, regardless of hint)

#rb rune.stubbe, marc.audy, derek.ehrman
[FYI] brian.karis, jamie.hayes, ola.olsson, andrew.lauritzen, jian.ru
#preflight 6244a8dcdc6183e3f5f8de98

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 19564957 via CL 19564973 via CL 19564978
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19566743 by graham wihlidal in ue5-main branch]
2022-03-30 19:41:19 -04:00
aleksander netzel
7c789be35d Lumen - Inline raytracing code improvements:
* Add Lumen RayTraceDispatch pass helpers.
* Changed base shader from RGS to ShaderBase from which both RGS/CS can be created.
* Final RGS/CS shaders are implemented using macros.
* IndirectArgsCS passes now take output size as shader param instead of using permutation for inline.

#rb krzysztof.narkowicz
#preflight 62443a9173665f7d5e3ed115

#ROBOMERGE-AUTHOR: aleksander.netzel
#ROBOMERGE-SOURCE: CL 19556681 via CL 19556685 via CL 19556688
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19561521 by aleksander netzel in ue5-main branch]
2022-03-30 14:41:17 -04:00
jamie hayes
190b00c3c0 Implement WPO in Nanite SW rasterizer.
Refactored FetchNaniteMaterialPixelParameters with an overload to be able to pre-calculate some factors per triangle and pass it through.
Fixed an issue where previous screen position was not being calculated with previous frame's WPO.

#rb rune.stubbe
[FYI] graham.wihlidal, brian.karis
#preflight 62433a4fc51908059a9aa481

#ROBOMERGE-AUTHOR: jamie.hayes
#ROBOMERGE-SOURCE: CL 19556551 via CL 19556574 via CL 19556622
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19561515 by jamie hayes in ue5-main branch]
2022-03-30 14:40:46 -04:00
andrew davidson
692c7957c1 Require explicit constructors/casts when converting between FVector, FVector3d, and FVector3f.
Runtime files
#jira UE-122078
#rb Andrew.Davidson, Colin.McGinley
#preflight standard build

#ushell-cherrypick of 18817999 by Fred.Kimberley
#preflight 62441346f73c316f68db20c0

#ROBOMERGE-OWNER: andrew.davidson
#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 19554852 via CL 19555052 via CL 19555055
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19561417 by andrew davidson in ue5-main branch]
2022-03-30 14:37:45 -04:00
christopher waters
f12afe6c73 Deprecating RHICreateTexture2DArray, RHICreateTexture3D, RHICreateTextureCube, RHICreateTextureCubeArray.
Converted a few additional RHICreateTexture2D calls to RHICreateTexture.
Adding a few more FRHITextureCreateDesc::CreateXXX variants to quickly specify extents and formats.
Merging FTextureRWBuffer2D and FTextureRWBuffer3D into a single class FTextureRWBuffer and deprecated the old ones.

#jira none
#rb luke.thatcher
#preflight 62448deb927e60e3415508e5

[CL 19560161 by christopher waters in ue5-main branch]
2022-03-30 13:36:17 -04:00
Arciel Rekman
ac58a74d1c Fix too dark mobile preview (UE-145593)
- Contributed by Remi Palandri.

#rb Rob.Srinivasiah, JNM
#review @Robert.Srinivasiah, @Jeannoe.Morissette
#jira UE-145593
#preflight 62438ad8f4217035fa731436

[CL 19551308 by Arciel Rekman in ue5-main branch]
2022-03-29 19:15:38 -04:00
zach bethel
38c542c200 Fixed irradiance accumulation sampling with incorrect UV.
#jira UE-147363
#preflight trivial

[CL 19545730 by zach bethel in ue5-main branch]
2022-03-29 13:58:27 -04:00
guillaume abadie
88f3bd15dc Reland: Uses the first HLSL template
Tested locally with r.RHI.Name verifications:
1) -d3d11
2) -d3d12
3) -d3d12 -sm6
4) -vulkan
5) consoles

#rb none
#preflight 62430608b33098a72da77bab

#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 19541959 via CL 19541962 via CL 19541973
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19543597 by guillaume abadie in ue5-main branch]
2022-03-29 12:07:21 -04:00
Sebastien Hillaire
e451c47107 SLW - reworked rdg event names to follow our convention.
#rb kevin.ortegren
#preflight none

[CL 19540415 by Sebastien Hillaire in ue5-main branch]
2022-03-29 07:57:48 -04:00
Rune Stubbe
0c8a6dd861 Optimizations for programmable raster HW path
-Instead of deriving barycentrics from pixel coordinates, they are reconstructed using intrinsics (where available).
-Intrinsic path exports just vertexID and uses that to reconstruct the barycentrics in the correct order
-The intrinsic path uses the exported vertexIDs as triangle indices instead of redundantly decoding them from memory again
-When the intrinsics are not available, SV_Barycentrics are used instead
-When they are not available either, 2 barycentrics are exported and the 3. is reconstructed in the PS.
-Changed IS_NANITE_PROGRAMMABLE from define to permutation, so default material can support both without compromising perf for non-programmable materials
-All other materials only have the programmable path.

Added platform intrinsic GetViVjPerspectiveCenter for getting perspective correct barycentrics.
Renamed LoadParameterCachePN to GetAttributeAtVertexN to be more in line with the naming in SM6.1.
Support for GetViVjPerspectiveCenter and GetAttributeAtVertexN is determined by COMPILER_SUPPORTS_BARYCENTRIC_INTRINSICS.

#rb graham.wihlidal
#fyi brian.karis, jamie.hayes
#preflight 6242c0849f4042341438de59

[CL 19539774 by Rune Stubbe in ue5-main branch]
2022-03-29 04:53:31 -04:00
marc audy
6c0928eb6d Unshelved from pending changelist '19434316':
[Engine] Enable color Calibration Material Visualization for shipping
-Enabled the calibration flags
-Removed the no-shipping guards around associated logic

#rb [at]philip.buuck [at]christina.tempelaarl
[FYI] arturo.oppen, alex.gonzalez


#ushell-cherrypick of 19536400 by antonio.delascarrer

#ROBOMERGE-AUTHOR: antonio.delascarrer
#ROBOMERGE-SOURCE: CL 19536397 via CL 19536663 via CL 19536680
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19537137 by marc audy in ue5-main branch]
2022-03-28 23:45:10 -04:00
eric mcdaniel
4db47c9f3c [Backout] - CL19530715
- backing out change due to cook failures
#preflight 6242640f637925b5d3a06f1c
[FYI] Guillaume.Abadie

Original CL Desc
-----------------------------------------------------------------
Uses the first HLSL template

#rb none
#preflight 6241edc8f4217035fa5ce91c

#ROBOMERGE-OWNER: eric.mcdaniel
#ROBOMERGE-AUTHOR: eric.mcdaniel
#ROBOMERGE-COMMAND: _robomerge[bot4] UE5-MAIN
#ROBOMERGE-SOURCE: CL 19536431 via CL 19536436 via CL 19536443
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19536451 by eric mcdaniel in ue5-main branch]
2022-03-28 22:11:33 -04:00