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]
* Add InitializedState to RayTracingGeometry that will track how it is was crated. We cannot use provided Initializer for that because it's reset during mesh streaming.
* Use BUF_RayTracingScratch for dynamic geometry scratch buffer so we can always guarantee correct alignment.
* Add RayTracingGeometry empty ctor so we don't try to calculate the BLAS size when it is streamed out.
#rb Yuriy.Odonnell
#preflight 61f7b9d0e55232619f77fd04
#ROBOMERGE-AUTHOR: aleksander.netzel
#ROBOMERGE-SOURCE: CL 18787906 in //UE5/Release-5.0/... via CL 18787924 via CL 18788019
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)
[CL 18788021 by aleksander netzel 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]
- A ray tracing geometry RHI object replaces the TResourceArray allowing platform RHIs to access offline cooked BVH data from GPU memory.
- Removed "r.SkeletalMesh.PostbuildMeshData" cvar as it wasn't correctly versioned. Disabling skeletal mesh BVH cook should be done in the platform cooker module so to affect DDC key correctly.
Fix crash in LumenHardwareRayTracingMaterials.cpp when using -onethread mode
- Renderer code was attempting to allocate memory on the RHI command list, but this is not allowed when RHI bypass is enabled.
#preflight 611137ec0d783d0001bcc3f6
#rb Kenzo.Terelst
#ROBOMERGE-SOURCE: CL 17113910 via CL 17113948
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v854-17104634)
[CL 17113950 by luke thatcher in ue5-release-engine-test branch]
WorldPartition : Removed PreCookCommandlet and replaced with new FWorldPartitionCookPackageSplitter.
#rb matt.peters, patrick.enfedaque, jeanfrancois.dube
[CL 14806302 by Richard Malo in ue5-main branch]