105 Commits

Author SHA1 Message Date
jeremy moore
1ea23a95d5 Various RVT tidy up fixes.
Added support for writing fixed color when baking SVT. This replaces the fixed "debug" function and allows us to use the feature outside of debug usage.
Fixed path that creates an SVT for displacement map. Here the fixed color can be used to effectively set a zero displacement for the low resolution mips.
Added r.VT.RVT.MipColors cvar which uses the fixed color support to generate RVT using debug mip colors. This is useful for debugging issues with materials sampling higher resolution mips than expected, putting pressure on the physical pools.
Removed r.VT.RVT.EnableVolumes cvar which is no longer required now that volumes can be enabled/disabled per platform without triggering page table or physical texture allocations.
Added support for custom expanding of bounds for RVT volume.
Tidied naming of categories and sections for the RVT components.

[CL 30550025 by jeremy moore in ue5-main branch]
2024-01-10 16:32:21 -05:00
jeremy moore
acb4e70a3d #jira UE-174031
When calculating RVT bounds, if the bounds align actor is a landscape, then include all of its landscape components.

[CL 30091367 by jeremy moore in ue5-main branch]
2023-12-04 14:42:40 -05:00
charles bloom
e0cc99a677 Fix VT Builder crash when first block is pow2 but later blocks are not
Texture IsPowerOfTwo check was confusingly only checking first block
most call sites want to check AreAllBlocksPowerOfTwo
deprecate the old problematic function name

#rb dan.thompson
#rnx

[CL 29820923 by charles bloom in ue5-main branch]
2023-11-17 16:27:24 -05:00
charles bloom
3979c11d90 Asset Action to resize texture sources
shrinks sources above threshold size to make uassets smaller
tries to change LODBias to keep output size the same, but that is in no way guaranteed

#rb dan.thompson
#rnx

[CL 29527423 by charles bloom in ue5-main branch]
2023-11-07 13:52:43 -05:00
zach bethel
28be363548 Resubmitted render command pipe CL's: 27048554, 27048589, 27048615, 27049788, 27049950, 27050314, 27050334.
- Niagara dynamic data
 - Cable component
 - Skinned mesh

[CL 27076836 by zach bethel in ue5-main branch]
2023-08-14 13:39:43 -04:00
zach bethel
b5b17e2ae7 Render Command Pipe Implementation and API
Render Command Pipes dedicated asynchronous task pipes for render commands. Users can easily define new pipes and enqueue commands into them. Pipes can be synchronized using a scope to run serial render commands on the render thread, but initially pipes cannot be synchronized individually with each other. Render command overhead is reduced by recording command lambdas into MPSC queues which are serviced by the task graph; both for pipes and for the render thread. This reduces the task overhead as commands are no longer 1-to-1 with tasks.

Pipe behavior is controlled with new CVars. `r.RenderCommandPipeMode` controls overall behavior:
 0 - Legacy render thread tasks,
 1 - Render thread MPSC queue,
 2 - Render thread and async pipe MPSC queues.

To define a Render Command Pipe, use DEFINE_RENDER_COMMAND_PIPE(MyPipe), or DECLARE_RENDER_COMMAND_PIPE(MyPipe, MODULE_API) to declare an extern reference.

Enqueue a command into the pipe like so:

ENQUEUE_RENDER_COMMAND(MyCommand)(UE::RenderCommandPipe::MyPipe, [] (FRHICommandList&) {}).

Omitting a pipe will fallback to the 'general' pipe which is the render thread.

Eventually pipes need to be synced back to the general pipe for scene renders and other GPU work. On the game thread timeline, use UE::RenderCommandPipe::FSyncScope to synchronize the pipes. This waits for pipes and disables recording of new pipe commands until the scope completes, at which point pipe recording is restarted. This creates a 'sync point', so render commands issued prior to a sync scope will be waited on at the start of the scope, and render commands issued after the scope ends will not be able to start until the render thread finishes processing prior commands.

#rb christopher.waters, luke.thatcher

[CL 27074956 by zach bethel in ue5-main branch]
2023-08-14 12:52:45 -04:00
bob tellez
9a6ca97f78 [Backout] - CL27048554, 27048589, 27048615, 27049788, 27049950, 27050314, 27050334
[FYI] zach.bethel
First Original CL Desc
-----------------------------------------------------------------
Moved volumetric volume to RHICmdList.

[CL 27054300 by bob tellez in ue5-main branch]
2023-08-11 20:13:53 -04:00
bob tellez
afd943db61 [Backout] - CL27042396 and 27048615
[FYI] zach.bethel
Original CL Desc
-----------------------------------------------------------------
Render Command Pipe Implementation and API

Render Command Pipes dedicated asynchronous task pipes for render commands. Users can easily define new pipes and enqueue commands into them. Pipes can be synchronized using a scope to run serial render commands on the render thread, but initially pipes cannot be synchronized individually with each other. Render command overhead is reduced by recording command lambdas into MPSC queues which are serviced by the task graph; both for pipes and for the render thread. This reduces the task overhead as commands are no longer 1-to-1 with tasks.

Pipe behavior is controlled with new CVars. `r.RenderCommandPipeMode` controls overall behavior:
 0 - Legacy render thread tasks,
 1 - Render thread MPSC queue,
 2 - Render thread and async pipe MPSC queues.

To define a Render Command Pipe, use DEFINE_RENDER_COMMAND_PIPE(MyPipe), or DECLARE_RENDER_COMMAND_PIPE(MyPipe, MODULE_API) to declare an extern reference.

Enqueue a command into the pipe like so:

ENQUEUE_RENDER_COMMAND(MyCommand)(UE::RenderCommandPipe::MyPipe, [] (FRHICommandList&) {}).

Omitting a pipe will fallback to the 'general' pipe which is the render thread.

Eventually pipes need to be synced back to the general pipe for scene renders and other GPU work. On the game thread timeline, use UE::RenderCommandPipe::FSyncScope to synchronize the pipes. This waits for pipes and disables recording of new pipe commands until the scope completes, at which point pipe recording is restarted. This creates a 'sync point', so render commands issued prior to a sync scope will be waited on at the start of the scope, and render commands issued after the scope ends will not be able to start until the render thread finishes processing prior commands.

#rb christopher.waters, luke.thatcher

[CL 27054009 by bob tellez in ue5-main branch]
2023-08-11 20:05:11 -04:00
zach bethel
052195e828 Added missing FSyncScope for VT thumbnail renderer.
[CL 27048647 by zach bethel in ue5-main branch]
2023-08-11 17:49:48 -04:00
zach bethel
2d143afc83 Render Command Pipe Implementation and API
Render Command Pipes dedicated asynchronous task pipes for render commands. Users can easily define new pipes and enqueue commands into them. Pipes can be synchronized using a scope to run serial render commands on the render thread, but initially pipes cannot be synchronized individually with each other. Render command overhead is reduced by recording command lambdas into MPSC queues which are serviced by the task graph; both for pipes and for the render thread. This reduces the task overhead as commands are no longer 1-to-1 with tasks.

Pipe behavior is controlled with new CVars. `r.RenderCommandPipeMode` controls overall behavior:
 0 - Legacy render thread tasks,
 1 - Render thread MPSC queue,
 2 - Render thread and async pipe MPSC queues.

To define a Render Command Pipe, use DEFINE_RENDER_COMMAND_PIPE(MyPipe), or DECLARE_RENDER_COMMAND_PIPE(MyPipe, MODULE_API) to declare an extern reference.

Enqueue a command into the pipe like so:

ENQUEUE_RENDER_COMMAND(MyCommand)(UE::RenderCommandPipe::MyPipe, [] (FRHICommandList&) {}).

Omitting a pipe will fallback to the 'general' pipe which is the render thread.

Eventually pipes need to be synced back to the general pipe for scene renders and other GPU work. On the game thread timeline, use UE::RenderCommandPipe::FSyncScope to synchronize the pipes. This waits for pipes and disables recording of new pipe commands until the scope completes, at which point pipe recording is restarted. This creates a 'sync point', so render commands issued prior to a sync scope will be waited on at the start of the scope, and render commands issued after the scope ends will not be able to start until the render thread finishes processing prior commands.

#rb christopher.waters, luke.thatcher

[CL 27042459 by zach bethel in ue5-main branch]
2023-08-11 15:51:26 -04:00
zach bethel
a7a9029b20 Deprecated InitRHI() in favor of InitRHI(FRHICommandListBase&).
#rb mihnea.balta, luke.thatcher, christopher.waters

[CL 26097009 by zach bethel in ue5-main branch]
2023-06-19 13:56:56 -04:00
kirill zorin
de8db5ff76 Converting ARO-facing raw pointers to TObjectPtr ahead of raw pointer ARO API deprecation.
#rb zousar.shaker
#rb markus.breyer
#rb robert.manuszewski

#preflight 646391406b1406b54ab15460

[CL 25489627 by kirill zorin in ue5-main branch]
2023-05-16 10:52:49 -04:00
charles bloom
4da5363385 fix infinite loop introduced in Convert To VT
#rb none
#preflight none

[CL 24884452 by charles bloom in ue5-main branch]
2023-04-01 02:37:58 -04:00
charles bloom
75cc1982eb Convert To VT : only UpdateList once, after user textures are set
#rb none
#preflight none

[CL 24851103 by charles bloom in ue5-main branch]
2023-03-30 02:10:41 -04:00
matt peters
85354d0163 FindAllTexturesAndMaterials_Iteration: Optimize by changing array to set and by avoiding duplicated work.
#rb Jeremy.Moore
#rnx
#preflight 64244d07b72410fc1740fddb

[CL 24839175 by matt peters in ue5-main branch]
2023-03-29 13:04:29 -04:00
dmitriy dyomin
ea9a5ee31f Added a separate entry in a RuntimeVirtualTexture component for a streaming VT that is specific to mobile rendering
Depending on target platform shading path one or the other SVT will be used
This is required for projects that has a significantly different landscape materials for each shading path
#rb jeremy.moore

[CL 24376462 by dmitriy dyomin in ue5-main branch]
2023-02-23 01:23:57 -05:00
dmitriy dyomin
80324d62ab [Backout] - CL24335980
[FYI] Dmitriy.Dyomin
Original CL Desc
-----------------------------------------------------------------
Added a separate entry in a RuntimeVirtualTexture component for a streaming VT that is specific to mobile rendering
Depending on target platform shading path one or the other SVT will be used
This is required for projects that has a significantly different landscape materials for each shading path
#rb jeremy.moore

[CL 24343407 by dmitriy dyomin in ue5-main branch]
2023-02-21 13:05:08 -05:00
dmitriy dyomin
ba94b1e506 [Backout] - CL24336341
[FYI] Dmitriy.Dyomin
Original CL Desc
-----------------------------------------------------------------
Fixed: interface for backward compat from CL# 24335980

[CL 24343402 by dmitriy dyomin in ue5-main branch]
2023-02-21 13:05:03 -05:00
dmitriy dyomin
b1253628a0 Fixed: interface for backward compat from CL# 24335980
[CL 24336795 by dmitriy dyomin in ue5-main branch]
2023-02-21 06:00:42 -05:00
dmitriy dyomin
65ad8e95e6 Added a separate entry in a RuntimeVirtualTexture component for a streaming VT that is specific to mobile rendering
Depending on target platform shading path one or the other SVT will be used
This is required for projects that has a significantly different landscape materials for each shading path
#rb jeremy.moore

[CL 24336769 by dmitriy dyomin in ue5-main branch]
2023-02-21 06:00:13 -05:00
zach bethel
67e95c0191 Fixed non-unity build break.
#preflight trivial

[CL 23880136 by zach bethel in ue5-main branch]
2023-01-26 21:41:50 -05:00
zach bethel
316bf6d91d Recreate render proxies prior to rendering virtual textures in order to recreate cached mesh commands that get invalidated.
#jira none
#preflight trivial

[CL 23874325 by zach bethel in ue5-main branch]
2023-01-26 15:39:08 -05:00
Luke Thatcher
75cee9fd43 Marked several functions on the immediate RHICmdList that do not use "this" as deprecated.
- Replaced uses of these functions in the engine with the global scope equivalents.
 - Added some missing global scope RHI...() functions.
 - LLM scopes have been moved into the global scope function, where necessary.

Removed several _RenderThread() RHICmdList functions
 - These were previously provided for the automatic RHI thread stall / flush mechanism, but now provide no benefit
 - Removing these also helps prevent use of FRHICommandListExecutor::GetImmediateCommandList() on threads other than the rendering thread.

Remove RHIExecuteCommandList
 - Unused, legacy code path. No platform RHIs provide an implementation. No need to deprecate since there's no way anyone would be calling it already.

#jira none
#rb Zach.Bethel
#preflight 63c86e2dfb1a8cf245f44469

[CL 23771476 by Luke Thatcher in ue5-main branch]
2023-01-19 06:13:08 -05:00
christopher waters
f8abec7a8e Material header dependency cleanup
- Removing MaterialAttributeDefinitionMap and MaterialRenderProxy from MaterialShared.h
- Removing MaterialShared from Material.h

#preflight 639cbb35776b61ba3b82f03e

[CL 23541603 by christopher waters in ue5-main branch]
2022-12-16 16:24:02 -05:00
christopher waters
e886ebc3cd Adding includes that code depended on implicitly. This is preperation for upcoming header dependency improvements.
#preflight 6397418acb2317695e1f3b2b

[CL 23480135 by christopher waters in ue5-main branch]
2022-12-12 13:40:46 -05:00