2166 Commits

Author SHA1 Message Date
dave belanger
f8b7bf7c84 - Add ShaderCodeLibrary api to ignore some plugins on mount (so that they can be loaded in parallel for several plugins)
- Add an optional param to OpenLibrary to not look for shader lib chunks (because there's strong thread contention surrounding FMountedPakFileInfo::KnownPakFilesAccessLock)
- Removed reading of shared-cooked override since that feature is obsolete
#rb Arciel.Rekman
#rnx

[CL 26815793 by dave belanger in 5.3 branch]
2023-08-03 12:45:22 -04:00
carl lloyd
b99d6f3be3 Temporarily disabled warning for RealtimeGPUProfiler query been unavailable
#rb Mihnea.Balta
#jira UE-186064

[CL 26773462 by carl lloyd in 5.3 branch]
2023-08-02 11:07:52 -04:00
mihnea balta
6d25088017 Fix out of memory crashes when using DumpGPU.
The views made by DumpGPU must be created with lifetime extension disabled, so they release the underlying resources immediately after each dump pass.

#rnx
#jira UE-157708
#rb Guillaume.Abadie, Zach.Bethel

[CL 26768279 by mihnea balta in 5.3 branch]
2023-08-02 07:35:05 -04:00
jian ru
1be69b9532 Add a separate upload limit r.VT.MaxUploadsPerFrame.Streaming for streaming VT pages. When the cvar is not zero, it enables the separate limit and r.VT.MaxUploadsPerFrame will only constrain non-streaming VT pages. When the cvar is zero (currently default), it disables the separate limit for backward compatibility. The motivation to separate SVT pages from other types of VT pages is mainly three-fold: 1) limiting SVT page uploads also throttles the number of loading requests. On platforms where I/O is slow, we may want to let more SVT page requests to go through so that I/O can be initiated earlier to reduce delay in obtaining page data; 2) SVT pages are usually cheaper to produce than RVT pages because they just upload the loaded data to GPU; 3) long standing SVT page requests can block the requests for other types of pages even if the other pages can be requested in parallel and turned around faster.
#rb jeremy.moore
#tests a/b tested perf and visual on two console platforms

[CL 26728143 by jian ru in 5.3 branch]
2023-07-31 20:46:48 -04:00
zach bethel
3d91d49818 Fixed validation error in transient allocator due to transient allocator being destroyed prior to the CustomDepth texture being destroyed.
#jira UE-169984

[CL 26692422 by zach bethel in 5.3 branch]
2023-07-28 19:29:34 -04:00
ross goldblum
f2c21ad2d6 Add GNearClippingPlane_RenderThread to be accessed on only on the RenderThread and use GNearClippingPlane otherwise. This avoids the need for the FlushRenderingCommands call which was causing a ~50ms hitch on Switch.
[REVIEW] [at]alex.nischwitz [at]ben.woodhouse [at]matt.hoffman [at]zach.bethel

[CL 26652645 by ross goldblum in 5.3 branch]
2023-07-27 16:05:11 -04:00
christopher waters
6976d77eae Fixing various issues with shader previews
- PC previews of SM6 platforms weren't going to DXC correctly.
- Preview platform include paths weren't initialized when compiling with local-only shader compiles.
- A few preview platform DDSPI settings weren't being initialized correctly based on the capabilites of the preview format.

#rb arciel.rekman, dan.elksnitis

[CL 26587878 by christopher waters in 5.3 branch]
2023-07-25 16:41:44 -04:00
jon cain
57aafe0e0d Backout of CL 25764433 to temporarily resolve render resource crash under certain circumstances when pushing changes in UEFN.
#rb Jason.Nadro, Andriy.Tylychko, Sebastian.Thomeczek

[CL 26579722 by jon cain in 5.3 branch]
2023-07-25 13:14:59 -04:00
daniele vettorel
a811c31d36 Handle the case where the PSO cache mask is set before the cache is opened.
Before, tasks would only be enqueued whenever the mask was changed. If the pipeline file was opened after the mask was set, the task created as a result of the file opening would not be kicked off until the mask was set again (which could be never).

#pf 64b999681c55de20cf59e305

[CL 26545096 by daniele vettorel in 5.3 branch]
2023-07-24 11:58:40 -04:00
daniele vettorel
6f1600e64a Add an option to only enable the user pipeline cache and disable the static (packaged) file cache.
#pf 64b6de9e5f0e72af69e5a39b

[CL 26460334 by daniele vettorel in 5.3 branch]
2023-07-19 10:25:19 -04:00
joe kirchoff
b49f39d7e7 Replace __FILE__ with __builtin_FILE() in constexpr
#rnx

[CL 26422999 by joe kirchoff in 5.3 branch]
2023-07-17 20:52:27 -04:00
carl lloyd
f62785b14b Merge from UE5 Main
Fixed Nanite bugs with Atomic64Compatible on Mac
Fixed missing AtomicCompatible flags in NaniteCullRaster
Fixed incorrect image transition when using DumpGPU

#rb Luke.Thatcher
#jira UE-186909

[CL 26408393 by carl lloyd in 5.3 branch]
2023-07-17 11:25:13 -04:00
dan elksnitis
6286f1559f [shaders]
- Remove the condition causing SCW to automatically exit after a single job if HLSLcc was used. This doesn't appear to be beneficial; HLSLcc uses a lot of memory but does not appear to leak it, so we're wasting time spinning up new processes unnecessarily here. This allows us to deprecated the associated field in the compiler output and function in IShaderFormat.
- Strip out compiler invocations stats; this was not accurate in some cases and it was decided after discussion that at this point the effort to fix the problems was not worth the utility we get from it.

#rb Jason.Nadro
#rb Laura.Hermanns

[CL 26256807 by dan elksnitis in 5.3 branch]
2023-06-27 10:08:04 -04:00
christopher waters
9489d96773 Removing uses of ForceIntoNonStreamingMemoryTracking while we figure out what's going on with FFT caching.
#jira UE-189364
#rnx

[CL 26214437 by christopher waters in 5.3 branch]
2023-06-23 14:26:28 -04:00
christopher waters
449110a195 Changing FComputeShaderUtils to be a namespace instead of a struct. Deduplicating the majority of code in the FComputeShaderUtils Dispatch methods.
#rb zach.bethel, elizabeth.baumel

[CL 26196322 by christopher waters in 5.3 branch]
2023-06-22 18:11:25 -04:00
zach bethel
003552b730 Deprecated non-command list RHI methods.
- RHICreate{Vertex, Index, Structured}Buffer
 - RHICreate{ShaderResource, UnorderedAccess}View
 - RHIUpdateUniformBuffer
 - Various initialization / locking methods for helper buffer types in RHIUtilities.h

The goal is to continue to force resource creation through command lists to avoid surprises with moving things off the render thread.

#rb christopher.waters

[CL 26183746 by zach bethel in 5.3 branch]
2023-06-22 11:25:09 -04:00
christopher waters
e081123c3c Working on making Texture and Buffer memory accounting consistent
- Renaming GRHIGlobals.CurrentTextureMemorySize to GRHIGlobals.StreamingTextureMemorySizeInKB
- Renaming GRHIGlobals.CurrentRendertargetMemorySize to GRHIGlobals.NonStreamingTextureMemorySizeInKB
- Adding GRHIGlobals.BufferMemorySize and GRHIGlobals.UniformBufferMemorySize
- Deduplicating RHI stat accounting code and changing it to use RHI Descs.
- UE::RHICore::UpdateGlobalTextureStats is for StreamingTextureMemorySizeInKB and NonStreamingTextureMemorySizeInKB. This still allows platforms to control where the memory is counted.
- Adding more Buffer RHI stat accounting code to RHIs that were missing it.
- UE::RHICore::UpdateGlobalBufferStats is for BufferMemorySize and UniformBufferMemorySize.
- FillBaselineTextureMemoryStats initializes and fills the common members of FTextureMemoryStats.
- Adding ETextureCreateFlags::ForceIntoNonStreamingMemoryTracking which will force the texture to be counted in NonStreamingTextureMemorySizeInKB.
- Changing all RenderTargetPool textures to be flagged with ETextureCreateFlags::ForceIntoNonStreamingMemoryTracking so they aren't counted against streaming budgets.
- Adding UAV Texture stats instead of lumping them with regular textures
- Adding Buffer stats for ByteAddressBuffer, DrawIndirect and Misc

#jira UE-188415
#rb mihnea.balta, zach.bethel

[CL 26158700 by christopher waters in 5.3 branch]
2023-06-21 15:26:22 -04:00
zach bethel
c716a9d71b Deprecated InitRHI() in favor of InitRHI(FRHICommandListBase&).
#rb mihnea.balta, luke.thatcher, christopher.waters

[CL 26097154 by zach bethel in 5.3 branch]
2023-06-19 14:00:50 -04:00
christopher waters
9901985b35 Removing MemoryLayout includes from global RHI headers. This required moving FRHIUniformBufferLayoutInitializer to its own file.
Did a few more minor dependency cleanups in RHI headers.

[CL 26067103 by christopher waters in 5.3 branch]
2023-06-16 15:54:44 -04:00
sebastien hillaire
af67f733af Substrate - added glint global bias and min level cvars.
ShaderVersion bumped since View data has been changed.

#rb none
[FYI] charles.derousiers

[CL 26057089 by sebastien hillaire in 5.3 branch]
2023-06-16 12:33:45 -04:00
laura hermanns
c7eb305347 Add full memory stats to OOM error handler in SCW.
#rb Dan.Elksnitis

[CL 26053187 by laura hermanns in 5.3 branch]
2023-06-16 11:19:12 -04:00
serge bernier
cb29e2d03d Fix global usage of all cvars related to shader pipelines:
r.ShaderPipelines
r.Material.ExcludeNonPipelinedShaders

Both cvars are currently disable on WindowsEngine.ini which make them also disable when we cook for consoles. ExcludeNonPipelinedShaderTypes is currently used only at cooking time when we compile shaders which is currently returning false, since the value is disabled on windows. Making those cvars use FShaderPlatformCachedIniValue, will allow to have specific platform value when cooking for a specific target. Moving r.Material.ExcludeNonPipelinedShaders to the defaultengine.ini file to keep it disable for the moment and not affecting shader key string. Will enable it progressively on console later.


r.Shaders.RemoveUnusedInterpolators

Make that cvar platform agnostic, since it will be used in on other consoles eventually. Platforms supporting the stripping of unused interpolators will check the same flag (CFLAG_ForceRemoveUnusedInterpolators) to enable it. Since windows can run opengl, and stripping is not supported on that shader platform, add extra logic to exclude the flag.

-Make the RHISupportsShaderPipelines function access a real DDPI attribute and not just test if we are not on mobile. Will need this to be able to have stripping unused shader interpolators on Switch.

[REVIEW] Laura.Hermanns

[CL 26038736 by serge bernier in 5.3 branch]
2023-06-16 02:51:55 -04:00
dan elksnitis
2d9382a3b9 [shaders] Fix for "duplicate definitions" errors when a material shader compile job is executed in the cook process. This was caused by some (rather bizzarre) behaviour in FShaderCompileEnvironment::Merge which causes in-memory source files to be appended to each other if the same key is found in both the source and target environment, along with an erroneous/redundant merge step occurring in the compile path if a backend has implemented the independent preprocessing API but the preprocessed cache is disabled.
#rb Massimo.Tristano

[CL 26037158 by dan elksnitis in 5.3 branch]
2023-06-16 02:00:21 -04:00
christopher waters
cea8a966b7 Adding missing comma to HLSL keyword parsing.
[CL 25995560 by christopher waters in ue5-main branch]
2023-06-14 17:00:19 -04:00
dan elksnitis
e2f9277ed6 adding "return false" to except block in preprocessor invocation to satisfy msvc static analysis
#rb trivial

[CL 25984129 by dan elksnitis in ue5-main branch]
2023-06-14 12:56:34 -04:00