Commit Graph

2332 Commits

Author SHA1 Message Date
dan elksnitis
1c843b3bd7 [shaders] fix error introduced by deprecation - shaders requiring a secondary compile were still calling the single compile path as well, resulting in errors when populating an already-populated output struct. tested local cook on affected platform to confirm issue is resolved (preflights are currently broken due to an unrelated problem)
#rb Christopher.Waters

[CL 28504041 by dan elksnitis in ue5-main branch]
2023-10-05 12:34:19 -04:00
christopher waters
15a7902e46 Removing symbols deprecated in 5.2
#rb dan.elksnitis, jeannoe.morissette

[CL 28494712 by christopher waters in ue5-main branch]
2023-10-05 08:24:09 -04:00
jonathan bard
ddf6dd3934 Refactored render target to texture conversion so that it can be done on any UTextureRenderTarget / UTexture type :
* Added BP functions to create all types of UTexture from their UTextureRenderTarget counterpart (except UTextureRenderTargetCubeArray, since we don't have much of anything available to produce these ATM, but there's no reason it shouldn't work)
* Fixed crash when trying to create a UTexture out of a UTextureRenderTarget with a non-supported format. The error is also appropriately reported to the user via blueprint message log, instead of a message box in the past

Misc:
* UTextureRenderTarget have to implement CanConvertToTexture to indicate if they are currently able to be converted to a texture (e.g. valid size, supported format, etc.)
* There's now a generic UpdateTexture and ConstructTexture function on UTextureRenderTarget that can be used to update an existing texture or create a new one
* D3D11 and D3D12's RHIReadSurfaceData now support reading from (cube) texture arrays
* Added R8G8 to FColor conversion (the missing .BA channels are filled with 0 and 255, respectively)
* Deprecated all redundant ReadPixels / ReadFloat16Pixels from child classes of FRenderTarget (FTextureResource, FTextureRenderTargetVolumeResource, FTextureRenderTarget2DArrayResource). Note that ReadPixels / ReadFloat16Pixels / ReadLinearColorPixels are now virtual to avoid this situation and yet allow FTextureRenderTargetVolumeResource to implement them in its own way (unlike all other implementations, it uses Read3DSurfaceFloatData internally)
* Fixed typo in FTextureRenderTargetVolumeResource::GetDisplayGamma(), which didn't take PF_R32_FORMAT into account
* Added FTextureSourceFormatInfo and GTextureSourceFormats, which provides information about the various supported formats in ETextureSourceFormat (similar to EPixelFormat and GPixelFormats)

#jira UE-194364
#rb jon.cain
#tests editor

[CL 28494190 by jonathan bard in ue5-main branch]
2023-10-05 08:12:26 -04:00
dan elksnitis
5518e3d9f3 [shaders] deprecating old PreprocessShader and IShaderFormat::CompileShader APIs now that all shader formats have been migrated
#rb Jason.Nadro

[CL 28452658 by dan elksnitis in ue5-main branch]
2023-10-04 09:22:36 -04:00
christopher waters
5aeded6c0d Fixing bindless resource index prefixes after Constant Buffer object changes
- It was generating UniformBuffer_BindlessResource_Member instead of BindlessResource_UniformBuffer_Member.
- The prefix needs to be applied to the full symbol name for correctly mapping the index against its resource in reflection.

#jira UE-195102
#rb jeannoe.morissette

[CL 28438928 by christopher waters in ue5-main branch]
2023-10-03 19:32:50 -04:00
christopher waters
40c779a41f Adding basic comment skipping support to ShaderParameterParser.
#rb dan.elksnitis, jason.hoerner

[CL 28438906 by christopher waters in ue5-main branch]
2023-10-03 19:32:18 -04:00
sebastien hillaire
0849243179 LFV - added a project wide local fov volume toggle to remove all potential usage and for it off.
#rb none

[CL 28417798 by sebastien hillaire in ue5-main branch]
2023-10-03 12:06:40 -04:00
ola olsson
e5f34a1d9c ISM Renderer Data refactor, phase 1.
- Removed old vertex-attribute centered buffers & useless translation code & replace with GPU-scene centric data
 - Made the instance data persistent over scene proxy re-creates.
 - Tracks per-instance data changes in the ISM & implement delta updates, remove need to call "MarkRenderStateDirty" for most instance updates
 - Added preliminary ID-based interface for ISM such that users can forego needing to match the internals (e.g., remove swap, required when using indices).
 - Unified the instance data use in the renderer (removed mix of old & new buffers and processing sites) - all code now sees orthogonalized transforms, the same as is in GPU-Scene.
 - Added FInstanceSceneDataBuffers and moved instance data buffer arrays to that from the Primitive proxy
 - Added FISMInstanceDataManager, which is responsible for tracking changes & dispatching updates. The ISMC owns one of these.
 - Instance data update tasks are async and waits are only done when needed, e.g., for GPU-scene update moving this off RT and later in the frame.
 - Added FInstanceDataSceneProxy, which is the owner of the scene data buffers and is updated by the manager by way if a shared reference with the primitive proxy.
 - Removed FPerInstanceRenderData, ISMC::PerInstanceRenderData
 - Removed FInstanceUpdateCmdBuffer
 - Lumen, GPUScene, SceneCulling, RT, DF all now retrieve data from FInstanceSceneDataBuffers rather than a mix of previous buffers. All now use the primitive-relative space.
 - Geometry Collection & Spline Mesh now manage FInstanceSceneDataBuffers, since they manipulate instance data in one way or another.
 - Mass: contained re-implementations of significant internals of ISMC, converted to ID-based interface
 - PCG: minor changes to avoid touching ISM internals.

#jira UE-191955,PLAY-11918
#rb jamie.hayes,jeremy.moore,jonathan.bard,krzysztof.narkowicz,mieszko.zielinski,julien.lheureux,zach.bethel,aleksander.netzel,yuriy.odonnell

[CL 28371398 by ola olsson in ue5-main branch]
2023-10-02 05:22:58 -04:00
graham wihlidal
e39bfa81b8 Temporarily disable Nanite CS materials for Vulkan until there is support for CS explicit derivatives and implicit LOD
[FYI] brian.karis, rune.stubbe, jamie.hayes, laura.hermanns, jeannoe.morissette
#jira UE-187341

[CL 28363222 by graham wihlidal in ue5-main branch]
2023-09-29 22:53:27 -04:00
serge bernier
621a24af3b -Change r.Shaders.ForceDXC cvar to a FShaderPlatformCachedIniValue to be able to read it per platform when cooking.
-Enable DXC shader compiler for console

#jira UE-80252
#rb [at]jason.nadro

[CL 28343345 by serge bernier in ue5-main branch]
2023-09-29 11:17:10 -04:00
zach bethel
1adbcfc6f2 Fixed assert in RDG task queue flush due to waiting on task while in a task pipe.
- Converted lock free list to locked array.

[CL 28322428 by zach bethel in ue5-main branch]
2023-09-28 13:09:55 -04:00
guillaume abadie
1b2bcb8aca Fixes r.VisualizeTexture.AllowBlinking
#tests win64

[CL 28275509 by guillaume abadie in ue5-main branch]
2023-09-27 11:33:10 -04:00
dan elksnitis
4515e3b5f4 [shaders] add debug dump option to output "detailed" shader source, including the output of the preprocessing step unmodified, the stripped version used for hashing, and whatever the final source passed to the compiler is (can differ from the stripped version if further modifications are applied as part of the compile step). this is only done if the preprocessed job cache is enabled; otherwise (and if this cvar is disabled) the single output will either be the compiler-step-modified source if it exists, or the output of the preprocessing step.
#rb Jason.Hoerner

[CL 28274493 by dan elksnitis in ue5-main branch]
2023-09-27 11:02:18 -04:00
dmitriy dyomin
6a36160b83 Make sure most common VFs do not add vertex streams that will never be used. This helps to avoid exra heap allocations on MDC caching
[CL 28271765 by dmitriy dyomin in ue5-main branch]
2023-09-27 09:22:30 -04:00
kenzo terelst
0b678d4693 Add SupportsResourceType to transient allocation because certain RHIs might not support all resources types
#rb Luke.Thatcher

[CL 28266473 by kenzo terelst in ue5-main branch]
2023-09-27 04:23:25 -04:00
dmitriy dyomin
b967feaef8 Add ability to setup VT support on a per-platform basis
#rb jeremy.moore

[CL 28260983 by dmitriy dyomin in ue5-main branch]
2023-09-26 22:38:26 -04:00
zach bethel
df8c177da3 Removed PSO cache flush from command list flush method and manually placed it to happen after each scene render.
#rb graham.wihlidal
#jira UE-196266

[CL 28238003 by zach bethel in ue5-main branch]
2023-09-26 13:56:11 -04:00
dan elksnitis
6d357de9b0 [shaders]
- fix preprocess time stat - this was not accounting for time spent preprocessing jobs which subsequently hit in DDC or the job cache; required some rework to how stats are recorded (now all jobs will register with the shader compiler stats object, instead of only those that actually ran compilation)
- add option to skip dumping debug info for cache hits. having it enabled results in a deterministic set of debug information between runs, while having it disabled means only shaders which actually compile will output debug information (this is useful when used in conjunction with the shaderanalyzer tool)

#rb Jason.Nadro

[CL 28237563 by dan elksnitis in ue5-main branch]
2023-09-26 13:48:38 -04:00
jason hoerner
c2e5d49c34 Shader Compiler: Fix for unity stress test compile error. Give an inline utility function an arbitrarily different name from what it is in another C++ file that may be unity included together.
#rnx

[CL 28233008 by jason hoerner in ue5-main branch]
2023-09-26 12:24:54 -04:00
brandon dawson
7681d4b939 Add DoesTargetPlatformSupportNanite to the render utils and remove duplicated definitions.
[CL 28231394 by brandon dawson in ue5-main branch]
2023-09-26 11:47:56 -04:00
christopher waters
bf6b5ee8c9 [Backout] - CL28193985
[FYI] christopher.waters
Original CL Desc
-----------------------------------------------------------------
Instead of assuming the RootUniformBuffer is assigned to a specific slot, we should force it at code generation time.

#rb guillaume.abadie

[CL 28229982 by christopher waters in ue5-main branch]
2023-09-26 11:14:06 -04:00
jason hoerner
046ace59ff ShaderCompiler: Preprocessor optimizations, first pass. Saves 16.7% overall on ConditionalPreprocessShader.
* Inline array memory allocation added to low level preprocessor for output and various temporary buffers to reduce dynamic memory allocation and reallocation overhead.  Saved 4.6%.
* FShaderPreprocessOutput::StripCode optimized to write to FString as TCHAR array, rather than using AppendChar (over 4x speedup).  Saved 2.9%
* Shader source file cache now also stores stripped and ANSI converted source, to avoid need to convert and strip the source, plus allocating a copy is avoided.  Saved 4.3%
* Uniform buffer structure declarations stored as ANSI converted source, avoiding convert and copy.  Saved 4.9%

#rnx
#rb dan.elksnitis jason.nadro

[CL 28219741 by jason hoerner in ue5-main branch]
2023-09-26 05:29:05 -04:00
christopher waters
f2219a8251 Instead of assuming the RootUniformBuffer is assigned to a specific slot, we should force it at code generation time.
#rb guillaume.abadie

[CL 28219680 by christopher waters in ue5-main branch]
2023-09-26 05:28:28 -04:00
graham wihlidal
46002ffa10 Refactored Nanite draw command caching to avoid any bookkeeping of shading bins when CS materials are disabled (and safe to toggle at runtime still). Also addressed a shader bundle lifetime issue.
#jira UE-187341
[FYI] ben.woodhouse, arciel.rekman

[CL 28216837 by graham wihlidal in ue5-main branch]
2023-09-26 02:12:50 -04:00
graham wihlidal
7d5c1a475f Fixes to skin cache Set PSO matching up with Dispatches, and temporarily set r.RenderCommandPipeMode to 1 (instead of 2), until the PSO cache cleanup can be corrected (the refactored thread local compute PSO optimization exposes a race condition in certain cases like GPUSkinCache + render commands).
#jira UE-196266
#rb christopher.waters, zach.bethel
#fyi arciel.rekman

[CL 28215060 by graham wihlidal in ue5-main branch]
2023-09-25 22:31:06 -04:00