* Add FRayTracingGeometry::EGeometryStateFlags for tracking the state instead of several bools:
- Add new state for tracking if the geometry was streamed in - its primary use is for dynamic ray tracing.
- When ray tracing is toggled on at runtime we only recreate geometries that were marked as streamed in.
* Streamed geometries have to be created in a different way than regular geometries:
- Creating geometry with StreamingDestination type will not allocate any memory for BLAS buffers.
- Those can only be initialized by InitRHIForStreaming from temporary geometry with a StreamingSource type
- Added FRayTracingGeometry::InitRHIForDynamicRayTracing() to handle both StreamingDestination and Rendering
- For StreamingDestination it will do similar steps as normal mesh streaming does.
* Add missing RayTracingGeometry initialization when dynamic ray tracing was enabled but ray tracing was disabled.
#rb tiago.costa, yuriy.odonnell
#preflight 6372245ebf76990b71f5d021
[CL 23116977 by aleksander netzel in ue5-main branch]
bGreyScaleFormat is only used by debug/editor shaders, game runtime uses SamplerType from MaterialExpressions
bGreyScaleFormat bool is needed because FTexture does not have access to CompressionSettings
behavior is observably different with Grayscale G16 and cases like TC_Alpha non-multiple-of-4
#preflight 636968d6d0174259ccea87f5
#rb dan.thompson
[CL 23023252 by charles bloom in ue5-main branch]
* Split IsRayTracingEnabled() into 2 parts: IsRayTracingEnabled() which can be changed at runtime and IsRayTracingAllowed() for checking if ray tracing can be enabled.
* r.Raytracing can now have following values: 0 - disabled, 1 - enabled all the time, 2 - enabled dynamic
* When ray tracing is dynamic, RayTracingGeometryManager will collect all FRayTracingGeometry and allocate/release RHI objects as needed depending on if ray tracing is enabled or not.
* Ray tracing can be switched on/off with r.Raytracing.Enable (default is 1).
* Add support to most features used in CitySample/Lyra for switching ray tracing at runtime.
* TODO: Hair geometries are not yet released.
#rb yuriy.odonnell
#preflight 634feac68176062ea7da933f
[CL 22622885 by aleksander netzel in ue5-main branch]
- Don't create FRayTracingMeshProcessor when IsRayTracingEnabled is false
- Only Add RayTracingGeometries when IsRayTracingEnabled returns true
They are added to the FRayTracingMeshProcessor and will try to compile SF_RayHitGroup shaders
#rb Dmitriy.Dyomin, Carl.Lloyd
#jira UE-160278
#preflight 63208193e93a80888c3ea4d9
[CL 21988506 by florin pascu in ue5-main branch]
#ROBOMERGE-AUTHOR: arne.schober
#ROBOMERGE-SOURCE: CL 21198085 via CL 21198090 via CL 21198094
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)
[CL 21198504 by arne schober in ue5-main branch]
Headers are updated to contain any missing #includes needed to compile and #includes are sorted. Nothing is removed.
#ushell-cherrypick of 21065896 by bryan.sefcik
#preflight 62d4b1a5a6141b6adfb0c892
#jira
#ROBOMERGE-OWNER: Bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21150156 via CL 21151754 via CL 21154719
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)
#ROBOMERGE-CONFLICT from-shelf
[CL 21181076 by Bryan sefcik in ue5-main branch]
The resource list uses a thread local free list that is coalesced later.
#preflight 62bf468c8d5e6787591b22e5
#rb yuriy.odonnell
[CL 20919518 by zach bethel in ue5-main branch]
- Refactored relevant FDynamicRHI APIs to take an FRHICommandListBase reference. Platforms which require operations deferred to the RHI thread will enqueue commands into the command list.
- Hardened platform implementations to use locks where needed.
- Added unit tests to stress test creating and locking many buffers in parallel.
#preflight 62a2855c54169bd8aa114d29
#rb christopher.waters, jeannoe.morissette, luke.thatcher, will.damon, kenzo.terelst
[CL 20659113 by zach bethel in ue5-main branch]
- added bSupportsRayTracingCallableShaders to DDPI.
- only Windows D3D12 RHI supports callable shaders at the moment.
#rb yuriy.odonnell
#preflight 628bb493693c5e1de282983f
[CL 20331097 by tiago costa in ue5-main branch]
*) All skin cache entries needing RT geometry update are processed altogether in end-of-frame update whether batch dispatching or not, simplifies the logic.
*) Transition buffers to read immediately after skin cache DoDispatch calls, simplifies the logic.
*) No longer cache the flag to indicate whether RT geometry needs rebuild, the logic is calculated directly when updating RT geometry.
#jira FORT-447473
#rb Aleksander.Netzel, Juan.Canada
#preflight 621cd5339a5676d19a327a29
[CL 19177064 by Josie Yang in ue5-main branch]
Last attempt failed some editor tests since those tests construct buffers with bNeedsCpuAccess = false even though editors must keep all resources. Changing the condition for freeing the resource object to see if its array was freed directly.
Original description:
It seems like the intent of the callback sink for r.FreeSkeletalMeshBuffers was to free eligible CPU buffers when the CVar was raised to 1, but unfortunately we're currently relying on this sink to free certain helper structures.
This change allows those structures to be freed after submitting the buffers to RHI so that we can change the callback sink to only do work on the rising edge (which generally only happens when switching game-mode/device profile and not during gameplay).
#rb jordan.cristiano
#preflight 620529984c6c33118fa6fdc7
[CL 18937113 by evgenii babinets in ue5-main branch]
Second attempt at fixing a GameThread stall (waiting for render thread) whenever a CVar is changed during gameplay.
It seems like the intent of the callback sink for r.FreeSkeletalMeshBuffers was to free eligible CPU buffers when the CVar was raised to 1, but unfortunately we're currently relying on this sink to free certain helper structures.
This change allows those structures to be freed after submitting the buffers to RHI so that we can change the callback sink to only do work on the rising edge (which generally only happens when switching game-mode/device profile and not during gameplay).
#rb josie.yang
#preflight 62017cbae9567e667308aa18
#ROBOMERGE-OWNER: evgenii.babinets
#ROBOMERGE-AUTHOR: evgenii.babinets
#ROBOMERGE-SOURCE: CL 18894475 via CL 18894521 via CL 18894553 via CL 18896447 via CL 18896609
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)
#ROBOMERGE-CONFLICT from-shelf
#preflight 6203cc23530b346f8618b67b
[CL 18917352 by evgenii babinets in ue5-main branch]
It seems like the intent of the callback sink for r.FreeSkeletalMeshBuffers was to free eligible CPU buffers when the CVar was raised to 1, but unfortunately we're currently relying on this sink to free certain helper structures.
This change allows those structures to be freed after submitting the buffers to RHI so that we can change the callback sink to only do work on the rising edge (which generally only happens when switching game-mode/device profile and not during gameplay).
#rb josie.yang
#preflight 62017cbae9567e667308aa18
#ROBOMERGE-OWNER: evgenii.babinets
#ROBOMERGE-AUTHOR: evgenii.babinets
#ROBOMERGE-SOURCE: CL 18894475 via CL 18894521 via CL 18894553 via CL 18896447 via CL 18896609
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)
#ROBOMERGE-CONFLICT from-shelf
[CL 18896978 by evgenii babinets in ue5-main branch]
- backing out this change as it broke Xbox in UE5/Main
- Example failed Horde tests:
- https://horde.devtools.epicgames.com/job/61fd7dc8a6165e535689f6e4?step=0856
- https://horde.devtools.epicgames.com/job/61fd7dc8a6165e535689f6e4?step=0250
#rb evgenii.babinets
#jira none
#preflight 61fdcfa1e65336d1455736bc
#fyi evgenii.babinets
Original CL Desc
-----------------------------------------------------------------
Fixed a GameThread stall (waiting for render thread) whenever a CVar is changed during gameplay.
It seems like the intent of the callback sink for r.FreeSkeletalMeshBuffers was to free eligible CPU buffers when the CVar was raised to 1, but unfortunately we're currently relying on this sink to free certain helper structures.
This change allows those structures to be freed after submitting the buffers to RHI so that we can change the callback sink to only do work on the rising edge (which generally only happens when switching game-mode/device profile and not during gameplay).
#rb josie.yang
#preflight Horde doesn't work, but compiled locally.
#ROBOMERGE-OWNER: evgenii.babinets
#ROBOMERGE-AUTHOR: evgenii.babinets
#ROBOMERGE-SOURCE: CL 18862796 via CL 18862801 via CL 18862826 via CL 18863875 via CL 18864138
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)
[CL 18878916 by eric mcdaniel in ue5-main branch]
It seems like the intent of the callback sink for r.FreeSkeletalMeshBuffers was to free eligible CPU buffers when the CVar was raised to 1, but unfortunately we're currently relying on this sink to free certain helper structures.
This change allows those structures to be freed after submitting the buffers to RHI so that we can change the callback sink to only do work on the rising edge (which generally only happens when switching game-mode/device profile and not during gameplay).
#rb josie.yang
#preflight Horde doesn't work, but compiled locally.
#ROBOMERGE-OWNER: evgenii.babinets
#ROBOMERGE-AUTHOR: evgenii.babinets
#ROBOMERGE-SOURCE: CL 18862796 via CL 18862801 via CL 18862826 via CL 18863875 via CL 18864138
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)
[CL 18864159 by evgenii babinets in ue5-main branch]
* FRayTracingGeometry can now be initialized in one of 3 states: Rendering, StreamingDestination and StreamingSource:
- Rendering: buffer and shader parameters are created.
- StreamingSource: only buffer is created
- StreamingDestination: nothing is created.
* Life of a streamed FRayTracingGeometry looks as follows:
1. Created with StreamingDestination
2. TStaticMeshStreamIn_IO::DoCreateBuffers creates a temporary FRayTracingGeometry (StreamingSource type) from CPU data.
3. FStaticMeshStreamIn::DoFinishUpdate: schedules a copy of RayTracingGeometryRHI on RHI thread (InitRHIForStreaming) and enqueues a render command to update hit group parameters and schedules a build if needed (RequestBuildIfNeeded).
4. Temporary FRayTracingGeometry is released.
5. When no longer needed the original FRayTracingGeometry is released (ReleaseRHIForStreaming)
* Added code to SetInitializer and Swap FRHIRayTracingGeometry that is needed for RHITransferRayTracingGeometryUnderlyingResource.
#rb Kenzo.Terelst, Luke.Thatcher, Yuriy.Odonnell
#jira UE-132838
#preflight 61df5a6e9c1e5c90b618bbec
#ROBOMERGE-AUTHOR: aleksander.netzel
#ROBOMERGE-SOURCE: CL 18595099 in //UE5/Release-5.0/... via CL 18595107 via CL 18595110
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)
[CL 18596644 by aleksander netzel in ue5-main branch]
- For example, if it was created using ERTAccelerationStructureBuildPriority::Skip.
- Fix assert for skinned meshes using WorldPositionOffset.
#rb Yuriy.ODonnell, Juan.Canada
#preflight 615f2f21635a7a0001717cdd
#lockdown Michal.Valient
#ROBOMERGE-AUTHOR: tiago.costa
#ROBOMERGE-SOURCE: CL 17753623 via CL 17985240 via CL 18368045 via CL 18368107
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)
[CL 18368140 by tiago costa in ue5-release-engine-test branch]
* Add IsRayTracingEnabledForProject() to check if ray tracing is enabled independently from RT shader support
* Skip creating the RayTracingMaterialPipeline when RT shaders are not supported
* Update FRayTracingMeshProcessor::Process() to work without full RT sahders, as it's still needed to compute the RT instance masks
#rb aleksander.netzel, tiago.costa
#ROBOMERGE-AUTHOR: yuriy.odonnell
#ROBOMERGE-SOURCE: CL 18295300 in //UE5/Release-5.0/... via CL 18295310
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)
[CL 18295319 by yuriy odonnell in ue5-release-engine-test branch]
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971
[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]