Commit Graph

23 Commits

Author SHA1 Message Date
tiago costa
09ad19466e Fix readback not getting latest available data.
- Need to update index at each iteration.

#rb Rune.Stubbe, Krzysztof.Narkowicz
#preflight 61af9923b841b84301bab88f

#ROBOMERGE-AUTHOR: tiago.costa
#ROBOMERGE-SOURCE: CL 18396940 in //UE5/Release-5.0/... via CL 18396946
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v896-18170469)

[CL 18396958 by tiago costa in ue5-release-engine-test branch]
2021-12-07 13:37:50 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
aurel cordonnier
fc542f6cfd Merge from Release-Engine-Staging @ 18081189 to Release-Engine-Test
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971

[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
2021-11-07 23:43:01 -05:00
aurel cordonnier
a6e741e007 Merge from Release-Engine-Staging @ 17915896 to Release-Engine-Test
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035

[CL 17918595 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-25 20:05:28 -04:00
tiago costa
8847d8387a Fix DistanceField asset data upload when LWC is enabled.
#jira none
#rb none
#preflight 6151908d59c66a0001fe6dc5

#ROBOMERGE-AUTHOR: tiago.costa
#ROBOMERGE-SOURCE: CL 17628798 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17628811 by tiago costa in ue5-release-engine-test branch]
2021-09-27 06:59:26 -04:00
andrew davidson
57beb335f2 Merging //UE5/Dev-LargeWorldCoordinates [at] 17581892 to //UE5/Main
#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 17595295 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17595306 by andrew davidson in ue5-release-engine-test branch]
2021-09-22 10:01:48 -04:00
tiago costa
7b5c6e6ea8 Improve Distance Field rendering performance
- Reduce ALU, VGPR - move operations to CPU, reorganize asset data buffer.
- Added CSV stats to track atlas and indirection table size.
- DF shadow perf on heavy scenes improved by around 12% (3.75ms vs 4.3ms).

#rb daniel.wright
#jira UE-120168
#preflight 6144599b4778fa00018e49a6

#ROBOMERGE-AUTHOR: tiago.costa
#ROBOMERGE-SOURCE: CL 17550410 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)
#ROBOMERGE[bot1]: EMT

[CL 17550414 by tiago costa in ue5-release-engine-test branch]
2021-09-17 06:33:42 -04:00
johan torp
6d9cece365 Fix mismatching Malloc / delete
#rb paul.chipchase
#udn 00355521
#preflight 6139cdf84e83140001f58589

#ROBOMERGE-AUTHOR: johan.torp
#ROBOMERGE-SOURCE: CL 17470167 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17470183 by johan torp in ue5-release-engine-test branch]
2021-09-09 05:57:34 -04:00
zach bethel
a44fbef833 Incremental fix-up to add names to RDG passes and use the correct RHI command list.
#rb christopher.waters

#ROBOMERGE-SOURCE: CL 16923748 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16923764 by zach bethel in ue5-release-engine-test branch]
2021-07-22 11:00:18 -04:00
zach bethel
f64ba39ba7 Fix for distance field streaming pass / task filtering.
[FYI] daniel.wright, krzysztof.narkowicz

#ROBOMERGE-SOURCE: CL 16326162 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v804-16311228)

[CL 16326167 by zach bethel in ue5-release-engine-test branch]
2021-05-13 23:34:19 -04:00
zach bethel
bf7574e2d2 Don't create a distance field streaming and pass task if no streaming is requested.
[FYI] krzysztof.narkowicz

#ROBOMERGE-SOURCE: CL 16322722 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v804-16311228)

[CL 16322732 by zach bethel in ue5-release-engine-test branch]
2021-05-13 20:17:04 -04:00
Andrew Davidson
3ddc3a4da3 Merge up from //UE5/Dev-LargeWorldCoordinates
#rb none

[CL 16211417 by Andrew Davidson in ue5-main branch]
2021-05-05 15:07:25 -04:00
krzysztof narkowicz
75958e0f48 Optimized distance field streaming requests by skipping a bunch of memory reads and atomics
0.69ms -> 0.12ms of GPU time on 2080, flying with drone

#rb Daniel.Wright, Graham.Wihlidal
#lockdown Graham.Wihlidal
#jira UETOP-1088

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

[CL 16093910 by krzysztof narkowicz in ue5-main branch]
2021-04-22 11:44:49 -04:00
zach bethel
9fc8b1722d Refactored RDG ConvertToUntrackedX functionality into the RDG builder; renamed the operation to 'FinalizeAccess' for clarity, as the resource is considered finalized in the graph and will not transition to any other state. This operation now supports multiple resources, improving performance in cases where multiple resources are finalized back-to-back. Added validation to check that the user don't attempt to use it outside of its finalized state. Fixed up a few places where this assumption was being violated. Minor refactors in various places to use new API.
#rb arne.schober, christopher.waters
#jira none

[CL 15931331 by zach bethel in ue5-main branch]
2021-04-06 11:45:09 -04:00
mihnea balta
8cfbeb2596 Fixed: UpdateDistanceFieldAtlas was assuming that the maximum dispatch group size was the same in all dimensions.
This isn't true in Vulkan, so we need to use the correct dimension for the variable group size (Z, in this case).

#rb trivial
#jira none
#rnx

[CL 15914477 by mihnea balta in ue5-main branch]
2021-04-05 07:35:30 -04:00
mihnea balta
efade690cd Fixed infinite loop on Vulkan due to integer overflow.
Vulkan actually queries the device for GRHIMaxDispatchThreadGroupsPerDimension instead of hardcoding 0xffff, so the value it gets can be as large as MAX_int32, which will overflow when multiplied.

#rb trivial
#jira none
#rnx

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

[CL 15900916 by mihnea balta in ue5-main branch]
2021-04-02 10:01:03 -04:00
daniel wright
dc3f9b25cc Manually transition DistanceFieldBrickVolumeTexture to final state, fixes RHI validation errors
#ROBOMERGE-SOURCE: CL 15879969 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)

[CL 15879974 by daniel wright in ue5-main branch]
2021-03-31 15:24:40 -04:00
daniel wright
f13f203645 Workaround for zero size BulkData on Distance Field streaming requests
#ROBOMERGE-SOURCE: CL 15877580 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)

[CL 15877605 by daniel wright in ue5-main branch]
2021-03-31 13:02:11 -04:00
Daniel Wright
204bde33fb Fixed Distance Field streaming attempting to upload a completed Read Request when a different asset has been allocated at the same index since the Read Request was kicked off
Fixes crash going into PIE in Frosty -d3d12

[CL 15871066 by Daniel Wright in ue5-main branch]
2021-03-30 23:07:13 -04:00
daniel wright
b339145bac Fixed Distance Field Streaming on cooked windows
Tested TopazEntry PIE and cooked win64

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

[CL 15865757 by daniel wright in ue5-main branch]
2021-03-30 14:38:12 -04:00
daniel wright
acb3ddfb8d Speculative fix for crash streaming distance fields
#ROBOMERGE-SOURCE: CL 15828044 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v785-15821902)

[CL 15834007 by daniel wright in ue5-main branch]
2021-03-25 18:24:28 -04:00
Daniel Wright
287a6598c2 Fixed crash with meshes that have zero SDF bricks
[CL 15806944 by Daniel Wright in ue5-main branch]
2021-03-24 16:00:54 -04:00
Daniel Wright
697b5b9cf6 Sparse, narrow band, streamed Mesh Signed Distance Fields
* SDFs are now generated, allocated from the atlas and uploaded in 8^3 bricks (7^3 unique data, half voxel padding).
 * Tracing must load the brick index from the indirection table, and only bricks near the surface are stored
 * 3 mips are now generated, with the lowest resolution always loaded and the other 2 streamed
 * SDFs are now G8 narrow band.  Lower resolution mips must be traversed when querying distance to nearest surface far away from the surface
 * The Distance Field Brick Atlas is now stored for each FScene and dynamically resized based on needs with a GPU memcopy
 * Brick atlas uses a 1d pooled allocator which has no fragmentation and greatly reduces packing waste over the 3d allocator
 * Added new indirection for Distance Field Asset data, so that only a single entry needs to be updated when a mip is streamed in or out in scenes with millions of instances
 * Compute shaders operating on distance field instances generate streaming requests, which are async read back to CPU, turned into IO requests, which are polled and when complete uploaded to atlases
 * Any mesh instance inside the Global SDF extent (200m) requests mip1, and at 50m requests mip2
 * Now using a batched compute scatter to upload to the distance field atlas instead of RHIUpdateTexture3d, to bypass alignment restrictions and per-upload overhead
 * Distance Field streaming uses an async task to move Memcpy and IO request overhead off of the Rendering Thread
 * Distance Field Visualization now computes a normal from the SDF gradient and does simple lighting to better visualize the scene representation
 * Increased r.DistanceFields.MaxPerMeshResolution from 128 to 512, to better represent large objects
 * Mesh SDF generation now uses an Embree point query to calculate closest unsigned distance, and then a much smaller set of rays to count backfaces for negative region determination, for a 11x speedup
 * Upgraded mesh utilities to Embree 3.12.2 to get point queries
 * Fixed wrong transform used for SDF normals in Lumen, causing non-uniformly scaled meshes to have incorrect Surface Cache interpolation
 * Fixed Static Mesh materials not getting PostLoaded before SDF build, causing their blend modes to be wrong for the build, which corrupts the DDC.  Also included those blend modes in the DDC key.

Original costs on 1080 GTX (full updates on everything and no screen traces)
10.60ms   UpdateGlobalDistanceField
3.62ms   LumenReflectiveTest.DirectionalLight_1 Shadowmap 1
1.73ms   VoxelizeCards Clipmaps=[0,1,2,3]
0.38ms   TraceCards 1 dispatch 1 groups
0.51ms   TraceCards 1 dispatch 1 groups

Sparse SDF costs
12.06ms   UpdateGlobalDistanceField
4.35ms   LumenReflectiveTest.DirectionalLight_1 Shadowmap 1
2.30ms   VoxelizeCards Clipmaps=[0,1,2,3]
0.69ms   TraceCards 1 dispatch 1 groups
0.77ms   TraceCards 1 dispatch 1 groups

Tested: TopazEntry PC, Reverb PC and PS5, EngineTests, QAGame, Rift, Frosty P_Construct_WP, FortGPUTestbed

#rb Krzysztof.Narkowicz

#ROBOMERGE-OWNER: Daniel.Wright
#ROBOMERGE-AUTHOR: daniel.wright
#ROBOMERGE-SOURCE: CL 15784493 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v783-15756269)
#ROBOMERGE-CONFLICT from-shelf

[CL 15790658 by Daniel Wright in ue5-main branch]
2021-03-23 22:40:05 -04:00