Commit Graph

1759 Commits

Author SHA1 Message Date
arciel rekman
84798a8aea SCL: fix a deadlock by deleting library contents outside of the NamedLibrariesMutex's scope.
- Library deletion flushes render commands, but the rendering thread may be trying to access the libraries stack (for which it needs to acquire NamedLibrariesMutex), so holding that mutex during the deletion results in a deadlock. This change makes the deletion happen after the mutex is released.

- The mutex only guards the NamedLibrariesStack, not contents of any given library. It is still possible that a library being deleted is accessed by another thread that got a pointer to it beforehand, this change does not change anything in that regard. However, this should not happen if the higher level removes all the content from the unmounted plugin from memory prior to unmounting it (and closing the library), which it should do.

#rb CM Nordin, Justin Marcus
[REVIEW] [at]CarlMagnus.Nordin, [at]Mihnea.Balta, [at]Justin.Marcus
#preflight 637691b7b1509f1cc3094063

[CL 23190970 by arciel rekman in ue5-main branch]
2022-11-18 03:12:05 -05:00
christopher waters
c572922683 Bindless Resources prerequisites
- Making SetUAVParameter handle bindless UAVs.
- Changed uses of RHICommandList::SetUAVParameter to use the global SetUAVParameter.
- Changed uses of RHICommandList::SetShaderResourceViewParameter to use the global SetSRVParameter.

#jira UE-170439
#rb Stu.McKenna
#preflight 637565be0c74adb48b1bf7a2

[CL 23176960 by christopher waters in ue5-main branch]
2022-11-17 11:17:40 -05:00
kenzo terelst
64b75f7589 Skip pso with mesh shader from file cache from file cache when GRHISupportsMeshShadersTier0 is not available
[REVIEW] [at]arciel.rekman
#rb Arciel.Rekman

#localization none
#tests run local replays - needs to be tested on older GPUs which I don't have available here

[CL 23164748 by kenzo terelst in ue5-main branch]
2022-11-16 18:00:02 -05:00
Sebastien Hillaire
b19df6202a Strata - fixed static variable shadowing.
#rb none
#preflight none

[CL 23158492 by Sebastien Hillaire in ue5-main branch]
2022-11-16 13:54:10 -05:00
Sebastien Hillaire
cd4aa07281 Strata - added high quality normal according to GBuffer format.
#rb none
#preflight https://horde.devtools.epicgames.com/job/6374f970b6636838280f3278
#fyi charles.derousiers

[CL 23155230 by Sebastien Hillaire in ue5-main branch]
2022-11-16 11:35:48 -05:00
christopher waters
4b57998013 Set all parameters and resources for SetShaderParameters in a single RHI command
- Expands all RDG and non-RDG bindings into a list of RHIResource bindings.
- Future work could batch up all non-SetShaderParameters calls into similar data structures.

#rb zach.bethel, jeannoe.morissette
#preflight 637320ad3248425305112b91

[CL 23147896 by christopher waters in ue5-main branch]
2022-11-15 19:41:53 -05:00
henrik karlsson
5b96352978 Fixes for c++ headerunits/modules.
* Adding forward declarations
* Adding "inline" in front of const/constexpr variables in headers
* Adding includes
* A few moves of ctor/dtor to cpp file

#preflight 6372b3ac0c74adb48b49f313
#rb none

[CL 23130896 by henrik karlsson in ue5-main branch]
2022-11-14 19:59:41 -05:00
aleksander netzel
5fb13876bb Add proper support for streamed geometries (geometries initialized as StreamingDestination) when dynamic ray tracing is enabled:
* 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]
2022-11-14 08:48:54 -05:00
florin pascu
a945c1e0cb Remove ShaderPlatformToShaderFormatName
#rb Jason.Nadro, Jeremy.Moore
#preflight 637216e13248425305d19318

[CL 23116618 by florin pascu in ue5-main branch]
2022-11-14 07:59:15 -05:00
christopher waters
6bcc020b6c Removing deprecated code from Renderer and RenderCore.
#jira none
#rb zach.bethel
#preflight 636e8639232e3d12cbb610f9

[CL 23104907 by christopher waters in ue5-main branch]
2022-11-11 16:10:25 -05:00
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