Commit Graph

32 Commits

Author SHA1 Message Date
zach bethel
ac11396729 Fixed test and validation regressions due to RDG changes.
#preflight 6272a1f12f6d177be3c60a53
#jira UE-150908

[CL 20043535 by zach bethel in ue5-main branch]
2022-05-04 12:41:19 -04:00
zach bethel
16dcf5b313 Refactored Lumen and Distance Field buffers to RDG.
- Replaced FRW{Structured, ByteAddress}Buffer with TRefCountPtr<FRDGPooledBuffer>
 - Replaced ResizeResourceIfNeeded with Resize{Structured, ByteAddress}BufferIfNeeded.
 - Replaced FScatterUploadBuffer with FRDGScatterUploadBuffer.
 - Removed awkward copy of page table buffers now that scatters are on the RDG timeline.
 - Reduced number of uniform buffers created by consolidating within FLumenSceneFrameTemporaries.
 - Fixed up const-correctness of FLumenSceneFrameTemporaries to sanity check that resources were not being mutated later in the frame.
 - Reduced explicit view creations somewhat.
 - Distance fields needs an FDistanceFieldSceneFrameTemporaries to cache RDG resources, but I held off on this due to the number of files it would touch.

#rb krzyzstof.narkowicz, daniel.wright

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 19921040 via CL 19922067 via CL 19922607
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19925590 by zach bethel in ue5-main branch]
2022-04-26 14:37:07 -04:00
zach bethel
10131e1285 Refactored RDG in preparation for UnifiedBuffer conversions.
- Refactord 'Finalized Access' feature into a more flexible 'External' vs. 'Internal' access mode per resource toggle.
      - Resources can transition between modes multiple times within the graph.
      - Supports async compute pipeline.
      - Supports queueing of requests to avoid back-to-back helper passes.
      - This feature is needed to support conversion of GPU scene buffers.

 - Deprecated the ReadOnly and ForceTracking resource flags and added a 'SkipTracking' flag instead.
      - Previous semantics were confusing and error prone.
      - New model requires a manual flag to tell RDG never to transition a resource.
      - This flag is used for read-only dummy resources as an optimization.

 - Renamed some of the auxiliary 'FinalizedResource' utilities since the name no longer matches the semantics.

#preflight 6266cc6d0634d0904ce4ba46

[CL 19904734 by zach bethel in ue5-main branch]
2022-04-25 13:00:12 -04:00
tiago costa
d3e0196bd2 Fix error compiling shaders sampling distance fields when using non-default Distance Field Offset Data Structure
- Shaders sampling mesh distance fields must define OFFSET_DATA_STRUCT according to r.DFShadowOffsetDataStructure.
- Also renamed cvar r.DFShadowOffsetDataStructure to r.DistanceFields.OffsetDataStructure since it applies to all techniques sampling mesh distance fields.

#preflight 626661771a71643e8b8b07df
#rb Krzysztof.Narkowicz
#jira none

[CL 19900311 by tiago costa in ue5-main branch]
2022-04-25 07:32:32 -04:00
zach bethel
a00b40ad3b Deprecated GetRenderTargetItem() from IPooledRenderTarget.
#preflight 624ddb30090236773a1a83e0
#rb luke.thatcher

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 19655641 via CL 19655653 via CL 19655661
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v938-19570697)

[CL 19657582 by zach bethel in ue5-main branch]
2022-04-06 18:24:24 -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
tiago costa
f19cad0d3d Distance Field LWC support #2
- Compute wanted mips in translated world space.

#jira UE-143275
#rb none
#preflight 6220d0006530856a975bfbfb

[CL 19243336 by tiago costa in ue5-main branch]
2022-03-03 09:36:28 -05:00
tiago costa
28b6851641 Improve DistanceFields streaming CPU perf.
- Modified PendingThrottledOperations to be a TSet, avoiding expensive Remove operation. PendingThrottledOperations is appended to PendingAddOperations which is already a TSet, so order is not guaranteed anyway.
- Use RemoveAtSwap to remove completed requests from ReadRequests.

#preflight 621d27e5d815cc2f95f4f694
#rb none
#jira none
#fyi daniel.wright

[CL 19219566 by tiago costa in ue5-main branch]
2022-03-02 05:22:04 -05:00
fred kimberley
7fbfaf57c8 Require explicit constructors/casts when converting between FVector, FVector3d, and FVector3f.
#jira UE-122078
#rb Andrew.Davidson, Colin.McGinley
#preflight standard build

#ROBOMERGE-AUTHOR: fred.kimberley
#ROBOMERGE-SOURCE: CL 18817999 in //UE5/Release-5.0/... via CL 18818012 via CL 18822871
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18824721 by fred kimberley in ue5-main branch]
2022-02-02 07:59:31 -05:00
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