Commit Graph

70 Commits

Author SHA1 Message Date
zach bethel
ac6e75533b Replaced AddCopyToResolveTarget pass with render target resolve.
#preflight 6283ea93520eb4f0a55a85c5

[CL 20262493 by zach bethel in ue5-main branch]
2022-05-18 12:31:54 -04:00
zach bethel
1a6dbc061d Deprecated FRDGBufferDesc::EUnderlyingType
#preflight 62756de8d8373707f22a6144
#rb christopher.waters

[CL 20082899 by zach bethel in ue5-main branch]
2022-05-06 15:44:23 -04:00
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
4eedc02f37 Fixes to external access RDG feature to handle async compute without validation failures.
#preflight 6270551191629533ec2b4bc9

[CL 20017395 by zach bethel in ue5-main branch]
2022-05-02 18:31:37 -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
zach bethel
3864629f00 Minor RDG improvements in preparation for UnifiedBuffer conversion.
- Added resource pool counters and events.
 - Added AllocatePooledBuffer method and refactored pool to no longer take a command list.
 - Refactored swap chain barrier logic to be a bit cleaner.
 - Added helper methods to cast between views.
 - Added power of two alignment option to buffer pool.
 - Added GetTypeHash implementations for RDG SRV | UAV descriptors.

#preflight 62631046006fa20b683d130f

[CL 19873407 by zach bethel in ue5-main branch]
2022-04-22 17:11:57 -04:00
christopher waters
31658ac660 Renderer dependency cleanup focused on removing RenderGraph.h from SceneRenderTargetParameters.h
#jira none
#rb zach.bethel
#preflight 62573bf61543022eed4bc2aa

[CL 19746250 by christopher waters in ue5-main branch]
2022-04-13 17:33:48 -04:00
zach bethel
3a2b13ceb1 Added draw texture utility to RenderGraphUtils (used for copying with format conversions).
#preflight 624efd042b29ecd3d7516cd2

[CL 19670171 by zach bethel in ue5-main branch]
2022-04-07 11:26:08 -04:00
zach bethel
f457a69101 Added RHI tracked access API to remove Unknown transitions.
- New RHI command list SetTrackedAccess method for the user to supply a current whole-resource state.
 - New RHI command context GetTrackedAccess method for querying the tracked access in RHIBeginTransitions / RHIEndTransitions on the RHI thread.
 - Hooked RHICmdList.Transition and FRHICommandListExecutor::Transition to assign tracked state automatically.
 - Refactored RDG and resource pools to use new RHI tracking.
      - FRDGPooledBuffer / FRDGPooledTexture no longer contain tracked state. RDG temp-allocates state through the graph allocator instead.
      - All prologue transitions are 'Unknown', and all epilogue transitions coalesce into a whole resource state.
 - Implemented platform support for patching the 'before' state with the tracked state.
 - Implemented various RHI validation checks:
      - Asserts that the user assigned tracked state matches RHI validation tracked state, for all subresources.
      - Asserts that tracked state is not assigned or queried from a parallel translation context.
 - Added FRHIViewableResource and FRHIView base classes to RHI. FRHIView contains a pointer to an FRHIViewableResource. This is currently a raw pointer, but should be extended to a full reference in a later CL.

NOTE on RHI thread constraint:

Transition evaluation is now restricted to the RHI thread (i.e. no parallel translation contexts). Transitions aren't performed in parallel translate contexts anyway, so this is not a problem. If, however, we decide to refactor parallel translation to be more general, this implementation could be extended to track the state per context and update from the 'dispatch' thread.

#preflight 6233b4396666d7e753a16aaf
#rb kenzo.terelst

[CL 19513316 by zach bethel in ue5-main branch]
2022-03-25 11:19:10 -04:00
christopher waters
343ba94423 Deprecating RHI*CommandList::SetComputeShader and switching uses to the PSO cache's SetComputePipelineState. This is to get compute shaders in our PSO cache lists as well as move towards ComputePipelineState as the default binding method.
#jira none
#rb arciel.rekman, mihnea.balta, jeannoe.morissette
#preflight 6202a549e85c7a08bbee815f

[CL 18905326 by christopher waters in ue5-main branch]
2022-02-08 13:19:37 -05:00
zach bethel
9996233f7a Removed unused legacy MSAA multi-texture support from IPooledRenderTarget.
- Deprecated legacy members from FPooledRenderTargetDesc.
 - Deprecated ETextureRenderTarget and removed from RDG.
 - TargetableTexture always equals ShaderResourceTexture.
 - Simplified render target pool FindFreeElement.
 - Create pooled buffers and textures with a known state.

#rb graham.wihlidal
#preflight 61f8488568795b2f45852274

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18796880 in //UE5/Release-5.0/... via CL 18797840 via CL 18799070
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18799188 by zach bethel in ue5-main branch]
2022-01-31 17:22:31 -05:00
jonathan bard
98478cb6e3 Added "ultimate" version of AddClearRenderTargetPass that lets the user clear multiple mips, multiple array slices, with/without a custom clear color or viewport and does so by using a clear action if possible.
Note: the existing versions have not been deprecated since they are more straightforward (they clear only a single mip/slice).

#rb zach.bethel
#preflight 61ef0a62ca3de856bcd670de

#ROBOMERGE-OWNER: jonathan.bard
#ROBOMERGE-AUTHOR: jonathan.bard
#ROBOMERGE-SOURCE: CL 18724174 via CL 18724195 via CL 18724225 via CL 18725569 via CL 18725818
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18725830 by jonathan bard in ue5-main branch]
2022-01-25 13:49:10 -05:00
jonathan bard
79f32ed47c Misc render-related changes:
* Added single-callback version of CreateStructuredBuffer to automatically infer element size, total size, element count and data pointer (e.g. CreateStructuredBuffer(GraphBuilder, TEXT("MyBuffer"), [&]() -> auto& { return BufferSource; });, where BufferSource is a TArray)
* Added support for uint2 shader parameters
* Added ForceTracking flag to ERDGBufferFlags/ERDGTextureFlags : force the RDG to track a resource even if it can be considered as readonly (no UAV, no RTV, etc.) This allows the graph to copy from and to external textures, and handling the corresponding transitions, for example.

#rb zach.bethel, sebastien.lussier
#tests editor
#preflight 61d8bc681f62d3ad4d728095

#ROBOMERGE-OWNER: jonathan.bard
#ROBOMERGE-AUTHOR: jonathan.bard
#ROBOMERGE-SOURCE: CL 18595021 via CL 18595031 via CL 18595035 via CL 18595668 via CL 18595682 via CL 18595700
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18596726 by jonathan bard in ue5-main branch]
2022-01-13 10:11:22 -05:00
zach bethel
a618c04cbf Converted light grid injection resources to RDG.
#preflight 61ddebe6ce7fe7aeff6fb109

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18576538 in //UE5/Release-5.0/... via CL 18576549
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18576556 by zach bethel in ue5-release-engine-test branch]
2022-01-11 15:57:18 -05:00
sebastien hillaire
8a17373593 Strata
- Strata render targets follow base pass load action.
- There is now an option to never clear the non first uint target
- On console, fast clear is leveraged
- SSData is cleared during the categorisation pass if the pixel is non SSS only
- This shaved 1.3ms on one platofrms and 0.3ms on another

#rb charles.derousiers

#ROBOMERGE-AUTHOR: sebastien.hillaire
#ROBOMERGE-SOURCE: CL 18381680 in //UE5/Release-5.0/... via CL 18381698
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18381712 by sebastien hillaire in ue5-release-engine-test branch]
2021-12-06 08:54:37 -05:00
ola olsson
e856b953f3 Implement batching of instance culling for non-nanite VSM, all local lights are processed as one dispatch, also:
- Factor out the batching setup & merging from the deferred instance culling
- Refactor the instance culling load balancer to be able to share types between different allocators
- Make batching logic use scene rendering allocator
- Rename RenderVirtualShadowMapsHw to RenderVirtualShadowMapsNonNanite (and similar names)
- Refactor view setup logic for Nanite & Non into common functions

#rb andrew.lauritzen

#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 18293379 via CL 18373760 via CL 18373855
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18373879 by ola olsson in ue5-release-engine-test branch]
2021-12-03 16:38:33 -05:00
sebastien hillaire
7860d37f19 Fixed mistake from 18313006.
#rb none
[FYI] charles.derousiers

#ROBOMERGE-AUTHOR: sebastien.hillaire
#ROBOMERGE-SOURCE: CL 18323041 in //UE5/Release-5.0/... via CL 18323048
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18323052 by sebastien hillaire in ue5-release-engine-test branch]
2021-11-30 06:16:00 -05:00
charles derousiers
6f0f0706d6 Fix Strata material buffer being cleared twice.
This ensure that the clearing happen only through the dedicated UAV pass.
This fixes classification issue for tile at the horizon.

#rb none
#jira none
[FYI] sebastien.hillaire

#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 18313006 in //UE5/Release-5.0/... via CL 18313327
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18313568 by charles derousiers in ue5-release-engine-test branch]
2021-11-29 14:12:23 -05:00
sebastien hillaire
f8e0092b8b New start material buffer: 2 uint using rop and the rest is written through UAV.
Huge optimisation for console.

#rb charles.derousiers

#ROBOMERGE-AUTHOR: sebastien.hillaire
#ROBOMERGE-SOURCE: CL 18309039 in //UE5/Release-5.0/... via CL 18309083
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18309131 by sebastien hillaire in ue5-release-engine-test branch]
2021-11-29 09:31:58 -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
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
ola olsson
c78ae71b1f Replace side-effect invalidation during instance/cluster cull with a buffer appended to at instance cull.
- preparational step to enable HZB culling of invalidations in an uniform way.
- also add FComputeShaderUtils helper to set up an indirect dispatch.

#rb andrew.lauritzen
#preflight 6130818017a8610001b0cfc7

#ROBOMERGE-SOURCE: CL 17400532 via CL 17400838
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17400862 by ola olsson in ue5-release-engine-test branch]
2021-09-02 07:13:18 -04:00
charles derousiers
a5d9c590f0 Add copy buffer pass to RDG utility functions.
#rb zach.bethel
#preflight 6101782bab06550001e89ddd

#ROBOMERGE-SOURCE: CL 16985200 via CL 16986684
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)

[CL 16986765 by charles derousiers in ue5-release-engine-test branch]
2021-07-28 16:21:28 -04:00
zach bethel
89fc4cf833 Parallel RDG execution improvements.
- Added ERDGBuilderFlags::AllowParallelExecute to tag specific builders to attempt parallel execution. This avoids cases where small graphs fork tasks and end up causing contention. Only the main scene render graphs are tagged.
 - Moved RHI transition creation to an async task.
 - Moved parallel execute setup and dispatch to an async task.
 - Fixed RDG draining asserts using a short-term workaround by tagging relevant scene textures as non-transient.
 - Deprecated RDG AddPass utilities without names and fixed up last remnants.
 - Enabled parallel RDG execution by default.

[FYI] christopher.waters

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

[CL 16925957 by zach bethel in ue5-release-engine-test branch]
2021-07-22 12:43:00 -04:00
ola olsson
2a33ebc4f9 Add simple functionality to wrap 1D dispatches into 2D or 3D as needed with minimal overhead, and add utility shader function to retrieve the linear index.
- Makes the assumption (checked) that dimensions are at least 128 in both X and Y.

#rb Krzysztof.Narkowicz,Sebastien.Hillaire,Rune.Stubbe
#preflight 60d059002ab2180001122cef

#ROBOMERGE-SOURCE: CL 16725805 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16725819 by ola olsson in ue5-release-engine-test branch]
2021-06-21 06:08:41 -04:00