Commit Graph

68 Commits

Author SHA1 Message Date
jian ru
798eacf38e Fix a memory stomp caused by writing to a released FLastRenderTimeContainer
[REVIEW] [at]peter.sauerbrei, [at]ben.woodhouse, [at]allan.bentham
#localization none
#tests ran ReplayRun tests on multiple platforms

#ROBOMERGE-AUTHOR: jian.ru
#ROBOMERGE-SOURCE: CL 19315963 via CL 19315975 via CL 19315977 via CL 19316728 via CL 19317123 via CL 19317129
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19347780 by jian ru in ue5-main branch]
2022-03-10 21:40:52 -05:00
evgenii babinets
b2a6f3b688 Another attempt at fixing a GameThread stall (waiting for render thread) whenever a CVar is changed during gameplay.
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]
2022-02-10 11:26:38 -05:00
evgenii babinets
7dd8af4ddb Backing out 18896978 due to another EngineTest failure. Original description:
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]
2022-02-09 09:35:00 -05:00
evgenii babinets
00605f283c 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

[CL 18896978 by evgenii babinets in ue5-main branch]
2022-02-07 20:04:27 -05:00
eric mcdaniel
4ae57bc005 [Backout] - CL18864159
- 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]
2022-02-04 20:48:30 -05:00
evgenii babinets
1446e36b0f 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 18864159 by evgenii babinets in ue5-main branch]
2022-02-04 11:07:20 -05:00
aleksander netzel
ad5a49f993 Fix incorrect checks in RayTracingGeometry:
* 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]
2022-01-31 06:22:37 -05:00
aleksander netzel
ca5533d4dd Use TRHIResourceUpdateBatcher to load & unload FRHIRaytracingGeometry during MeshStreaming.
* 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]
2022-01-13 10:06:50 -05:00
tiago costa
6b7761501e Added flag to FRayTracingGeometry to track if geometry requires an initial BLAS build.
- 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]
2021-12-03 09:55:58 -05:00
danny couture
5d39274636 Fix 1.2MB of untagged memory when initializing the ResourceList array
#rb Jian.Ru, Ben.Ingram

#ROBOMERGE-AUTHOR: danny.couture
#ROBOMERGE-SOURCE: CL 18291829 in //UE5/Release-5.0/... via CL 18291858
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18291870 by danny couture in ue5-release-engine-test branch]
2021-11-24 22:03:48 -05:00
tiago costa
e5d619ac73 Added r.Raytracing.DebugForceRuntimeBLAS to control whether to use offline built BLAS.
#preflight 61363483bdfce00001d57e87
#rb Yuriy.ODonnell

#ROBOMERGE-AUTHOR: tiago.costa
#ROBOMERGE-SOURCE: CL 17439046 via CL 17439864
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17439966 by tiago costa in ue5-release-engine-test branch]
2021-09-06 15:24:51 -04:00
luke thatcher
08de6f1c71 Improvements to offline BVH cook.
- 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]
2021-08-10 06:07:45 -04:00
zach bethel
64b5ad0dde Removed high-frequency trace event.
#rb none

#ROBOMERGE-SOURCE: CL 16317043 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v804-16311228)

[CL 16317071 by zach bethel in ue5-release-engine-test branch]
2021-05-13 15:34:04 -04:00
Yuriy ODonnell
5fde1014df Implemented the full fix for UE-106993 and removed workaround put in place for 4.26 hotfix. BeginReleaseResource() can now be used with FRayTracingGeometry, as it now implements FRenderResource::ReleaseResource() interface.
#jira UE-106993

[CL 16019715 by Yuriy ODonnell in ue5-main branch]
2021-04-15 07:39:16 -04:00
danny couture
9ac59bee66 Add meaningful Insights trace affecting either map loading or PIE
#rb Francis.Hurteau

[CL 15777110 by danny couture in ue5-main branch]
2021-03-23 10:58:12 -04:00
Marc Audy
8f73cd7fa9 Merge UE5/Release-Engine-Staging @ 15630841 to UE5/Main
This represents UE4/Main @ 15601601

[CL 15631170 by Marc Audy in ue5-main branch]
2021-03-05 19:27:14 -04:00
Emil Persson
4516b985df Name all resources and make naming mandatory
#rb yuriy.odonnel, kenzo.terelst

[CL 15416919 by Emil Persson in ue5-main branch]
2021-02-16 08:37:39 -04:00
Kenzo Terelst
35ec639f68 - Allow creation of RHIRayTracingGeometry when IndexBuffer is nullptr
- Remove RT GPUSkinCache spam to log

#jira UE-107670
#rb Yuriy.ODonnell

[CL 15316955 by Kenzo Terelst in ue5-main branch]
2021-02-04 12:12:07 -04:00
Marc Audy
bf80889353 UE5/Release-Engine-Staging to UE5/Main
This represents UE4/Main up to CL# 14958402

[CL 15028197 by Marc Audy in ue5-main branch]
2021-01-08 19:56:07 -04:00
Marc Audy
ada7c144fa Merge //UE5/Release-Engine-Staging @14903491 to //UE5/Main
[CL 14906022 by Marc Audy in ue5-main branch]
2020-12-11 14:21:20 -04:00
Emil Persson
72db809300 Replace legacy LockVertexBuffer()/LockIndexBuffer()/LockStructuredBuffer() calls with the unified LockBuffer()
#rb kenzo.terelst

[CL 14898308 by Emil Persson in ue5-main branch]
2020-12-10 11:51:32 -04:00
Richard Malo
1d647220fe Cook: Added possibility to generate packages during the cook process using CookPackageSplitter (currently only support using cook commandlet).
WorldPartition : Removed PreCookCommandlet and replaced with new FWorldPartitionCookPackageSplitter.
#rb matt.peters, patrick.enfedaque, jeanfrancois.dube

[CL 14806302 by Richard Malo in ue5-main branch]
2020-11-23 09:11:36 -04:00
Marc Audy
50a3d7d368 Merge Release-Engine-Staging to Main @ CL# 14467590
This represents UE4/Main @ 14432125 + some cherrypick fixes

[CL 14468207 by Marc Audy in ue5-main branch]
2020-10-09 22:42:26 -04:00
Marcus Wassmer
3b81cf8201 Merging using //UE5/Main_to_//UE5/Release-Engine-Staging @14384769
autoresolved files
#rb none

[CL 14384911 by Marcus Wassmer in ue5-main branch]
2020-09-24 00:43:27 -04:00
Marc Audy
a7c9001a94 Merging //UE5/Release-Engine-Staging to Main (//UE5/Main) @ 14075166
#rb
#rnx

[CL 14075271 by Marc Audy in ue5-main branch]
2020-08-11 01:36:57 -04:00