Commit Graph

1749 Commits

Author SHA1 Message Date
Arciel Rekman
f5f6d47027 Make sure shader refcount cannot be 0 during the creation.
#rb Yuriy O'Donnell
#review @Arne.Schober
#jira
#preflight 636e9116953c19d435584df2

[CL 23101686 by Arciel Rekman in ue5-main branch]
2022-11-11 13:36:14 -05:00
zach bethel
df1568434e Optimized RDG async compute fence computation.
#preflight 636d34ef1c14fe4505fdfc0e
#jira none

#ushell-cherrypick of 23068227 by zach.bethel

[CL 23101437 by zach bethel in ue5-main branch]
2022-11-11 13:21:11 -05:00
yuriy odonnell
369f054047 Add CVar r.SceneDepthHZBAsyncCompute to run HZB generation on async compute
* This avoids GPU under-utilization in scenes where a very large number of individual occlusion queries is issued
* Possible r.SceneDepthHZBAsyncCompute values:
  * 0: Don't use async compute (default)
  * 1: Use async compute, start as soon as possible
  * 2: Use async compute, start after ComputeLightGrid.CompactLinks pass

#preflight 636c555f7c2b5051903a24ca
#rb Graham.Wihlidal

[CL 23072519 by yuriy odonnell in ue5-main branch]
2022-11-10 03:03:38 -05:00
christopher waters
977f66039e Removing uniform buffer name locks from FShaderType and FVertexFactory
- FlushShaderFileCache() used to be called to force all shader types to update their list of referenced uniform buffers, but they are only updated if they were ever used to compile in the current session. This would impact *any* shader type that had been used instead of just being limited to changed shader types.
- Moved the uniform buffer reference updating into a new function: UpdateReferencedUniformBufferNames.
- UpdateReferencedUniformBufferNames should be called before all shader recompiles but after FlushShaderFileCache does reset itself. This function requires a list of outdated types so we can reduce the shader type updates to only the types that need it.

#jira none
#rb jason.nadro, zach.bethel
#preflight 636a7a537c2b505190a464fb

[CL 23063334 by christopher waters in ue5-main branch]
2022-11-09 16:39:32 -05:00
zach bethel
c7762df3f0 Added counters for tracking RDG stats and CSV counters for passes / resources.
#preflight 636ab090ed07daaa9a25dba6
[FYI] ben.woodhouse

[CL 23049849 by zach bethel in ue5-main branch]
2022-11-09 04:11:18 -05:00
steve robb
1e5cb9a75c Removed legacy TAllocatorTraits::SupportsMove, which is assumed to be always be true everywhere it is used.
#rb
#preflight 636ab1e6843e6ac794dae0dc

[CL 23041494 by steve robb in ue5-main branch]
2022-11-08 17:17:09 -05:00
arciel rekman
a042c334d4 Bring back RHI resource deletion when shader library is closed.
- Also, add flushing the pending deletes in the attempt to make sure any leftover RHI resources from the assets that used that library (which should be already queued for deletion at this point) are deleted before we remove the backing storage.

#rb Rex.Hill, Justin.Marcus, Luke.Thatcher
[REVIEW] [at]Rex.Hill
#preflight 636a7adb376a9cd6a856decc

[CL 23034312 by arciel rekman in ue5-main branch]
2022-11-08 14:20:19 -05:00
zach bethel
37fe71e0d1 Latency improvements to RDG.
- Moved dispatch busy-wait out of the command-list recording task. Allows the render thread to help with jobs once it's done.
 - Added workload to pass to help load balancing.

[CL 23025379 by zach bethel in ue5-main branch]
2022-11-08 04:25:52 -05:00
charles bloom
f4f3b76663 FTexture : set debug shader bGreyScaleFormat ReplicateR property from CompressionSettings, not PixelFormat, so it matches what MaterialExpressions wil do
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]
2022-11-07 21:47:57 -05:00
zach bethel
9ab5293097 Fixed bug in RDG dependency tracking with multi-pipe skip-barrier UAVs.
[FYI] jian.ru

[CL 23019459 by zach bethel in ue5-main branch]
2022-11-07 17:23:06 -05:00
christopher waters
584de7cf77 Make FShaderParametersMetadata authoritative on the parameters size, not the parameter type. Systems like Niagara can have more data allocated than can fit in the passed in data type, so the metadata has to be the source of the sizes here.
This ends up reverting parts of my last changes here, including a deprecation.

#jira none
#rb zach.bethel, rob.krajcarski
#preflight 636952af7c2b505190525ed7

[CL 23018217 by christopher waters in ue5-main branch]
2022-11-07 16:32:05 -05:00
zach bethel
7dd9de3f39 Refactored UpdateTexture2D, UpdateFromBufferTexture2D, and UpdateTexture3D to take a non-immediate command list.
- Added explicit SwitchPipeline calls to async command lists.
 - Moved pipeline push / pop calls from platform implementations to RHI command list.

#rb christopher.waters
#preflight 636937204d3c1d9d9264ce7b

[CL 23012810 by zach bethel in ue5-main branch]
2022-11-07 12:18:59 -05:00
Arciel Rekman
a9a272c7a9 Support concurrent shader creation within a shadermap (UE-166109).
- Avoids oversubscription deadlock when multiple background threads are creating shaders during the PSO precaching.

#rb CM Nordin, Yuriy O'Donnell
#jira UE-166109
#review
#preflight 6365bb2b4b0e01486a9753be

[CL 23010571 by Arciel Rekman in ue5-main branch]
2022-11-07 10:15:34 -05:00
henrik karlsson
80a0aeccfe [Engine]
Removal of includes to reduce transitive includes in high traffic headers to reduce compile times
Highlights
* Skeleton and BonePose not leaked out of commonly used animation headers
* AudioComponent leaking out less
* Brush not leaking Level.h (Brush is included indirectly a lot)
* VertexStreamComponent moved to its own file so Components.h can include that instead of VertexFactory (which would leak out all of RHI and others)

#preflight 6365dd15c53af2f47f8d8c40
#rb none

[CL 23003402 by henrik karlsson in ue5-main branch]
2022-11-05 20:36:27 -04:00
arciel rekman
8510cb4400 Fix another crash on exit due ot leaked global library's resources.
#rb none
[FYI] Justin.Marcus, CarlMagnus.Nordin
#preflight none

[CL 23000351 by arciel rekman in ue5-main branch]
2022-11-05 00:23:45 -04:00
evgenii babinets
c1bd5ab8a9 Removing stat scopes that are very small (2us) and are just adding noise to profiling captures; these just enqueue a render command and don't do any busy work inside.
#rb andrew.ladenberger

[CL 22996423 by evgenii babinets in ue5-main branch]
2022-11-04 17:44:59 -04:00
mihnea balta
9a6e73dd71 Fix crash in D3D11 when GPU crash debugging is enabled.
FRDGEventScopeStack::EndExecute did not pass the value of bRDGEvents to the scope array, so we ended up trying to pop events that were never pushed when bRDGEvents was false.

#rb Zach.Bethel
#rnx
#preflight skip

[CL 22994705 by mihnea balta in ue5-main branch]
2022-11-04 16:40:10 -04:00
christopher waters
5a3acc4945 ShaderParameters cleanup
- SetShaderParameters and ValidateShaderParameters now require the caller pass in the size of the parameter data. This will be useful when making SetShaderParameters run on the RHI thread.
- SetShaderParameters no longer requires a FShaderParametersMetadata argument since it was never used.

#jira none
#rb jeannoe.morissette
#preflight 636445aaf233f06a1286d576

[CL 22993813 by christopher waters in ue5-main branch]
2022-11-04 16:00:20 -04:00
Zak Middleton
9149ed2129 #ue5 - Truncation fixes for misc engine headers and modules:
- GameplayMediaEncoder
- GameplayTasks

#jira UE-160833
#rb Andrew.Davidson
#preflight 6362aead876630122ab1dead

[CL 22990977 by Zak Middleton in ue5-main branch]
2022-11-04 13:48:41 -04:00
Arciel Rekman
4ab9a1ad42 Disable logging of stereo rendering aspects in the editor.
- There are too many cases where it can be noisy (shader compilation for 3+ RHIs) and it doesn't add as much value in debugging as on a device.

#rb none
#jira none
#preflight none

[CL 22989281 by Arciel Rekman in ue5-main branch]
2022-11-04 12:34:19 -04:00
arciel rekman
8615e858af Change Fatal log to a warning due to Global library's behavior.
#rb CM.Nordin
[FYI] Justin.Marcus, CarlMagnus.Nordin
#preflight none

[CL 22988920 by arciel rekman in ue5-main branch]
2022-11-04 12:17:41 -04:00
christopher waters
c6e9015a91 Cache uniform buffer definitions
- Remove shader platform specific info from uniform buffers, we can generate code with macros that translates to what each platform needs.
- With the per-platform differences removed, uniform buffer declarations (read: generated text) can be created once per shader parameter type that needs them instead of once per shader type's shader parameter type usage.
- FShaderType and FVertexFactoryType now hold a TSet of used uniform buffer names instead of a TMap that held potentially duplicated FStrings of uniform buffer defintions.
- Lists of uniform buffers are *potentially* different per platform, so the annoying CachedUniformBufferPlatform variables need to stick around for now.
- GenerateReferencedUniformBuffers renamed to GenerateReferencedUniformBufferNames and now populates a TSet instead of a TMap.
- ShaderType::AddReferencedUniformBufferIncludes renamed to ShaderType::AddUniformBufferIncludesToEnvironment which calls the shared UE::ShaderParameters::AddUniformBufferIncludesToEnvironment.
- CreateUniformBufferShaderDeclaration moved to UE::ShaderParameters::CreateUniformBufferShaderDeclaration and now returns its FString.
- CacheUniformBufferIncludes was removed since it was only populated values from CreateUniformBufferShaderDeclaration.
- Deprecated FShaderCompilerInput::SourceFilePrefix since nothing has populated it in 9 years.

#jira none
#rb dan.elksnitis, yuriy.odonnell
#preflight 63643e5ff233f06a127c11c1

[CL 22988611 by christopher waters in ue5-main branch]
2022-11-04 12:04:48 -04:00
justin marcus
c31e3bcd3a Add fatal log to ~FShaderLibraryInstance. It is impossible for it to safely release resources from it's destructor.
[REVIEW] [at]Arciel.Rekman [at]Carl-Magnus.Nordin
#preflight https://horde.devtools.epicgames.com/job/6363c9b5dc30a4ce96fec50f

[CL 22968304 by justin marcus in ue5-main branch]
2022-11-03 17:57:51 -04:00
henrik karlsson
b985fbd1b1 Removed lots of includes in high traffic headers in order to reduce compile times. Headers are still included if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2 is set to 1
List of highlights
* PlayerController - Removed ForceFeedback and and OnlineReplStructs
* Class - Removed Package.h
* World - Pawn, Blueprint and GameInstance
* Actor - CoreNet, HitResult and ActorDatalayer
* EngineBaseTypes - TaskGraphInterface
* AssetManager - AssetData
* Scene/Child/ActorComponent - CoreNet
* AnimInstance - AttributesRuntime, Skeleton, AnimCurveTypes, AnimMontage, BonePose
* BulkData - IoDispatcher
* AssetData - IoDispatcher, LinkerLoad
* SecureHash - AsyncWork
* CanvasTypes - UnrealEngine, StaticMeshResources
* IpAddress - AsyncWork, Stats

#preflight 6363717ece676ae8688f5d8c
#rb none

[CL 22968258 by henrik karlsson in ue5-main branch]
2022-11-03 17:56:44 -04:00
aleksander netzel
ecb3f3cbe2 Required changes to enable dynamic ray tracing by default on PC:
* r.RayTracing.EnableOnDemand - controls whether ray tracing can be toggled on demand at runtime.
* r.RayTracing.Enable - now controls if ray tracing is enabled
* Set appropriate defaults for the engine in WindowsEngine.ini to match previous state
* Enable toggling ray tracing on/off only in frontend

#rb yuriy.odonnell
#preflight 636392240c2e7c8f91e93585

[CL 22959117 by aleksander netzel in ue5-main branch]
2022-11-03 14:23:22 -04:00