Commit Graph

2111 Commits

Author SHA1 Message Date
dan elksnitis
b083d56fb1 [shaders] partial backout of preprocessor optimizations. the reasons for the performance gain were incorrectly assessed and the additional cache is not providing any measurable gains, so removing it as unnecessary complexity.
#rb Jason.Nadro
#preflight 64779d234b0d5a1eb16000b3

[CL 25724429 by dan elksnitis in ue5-main branch]
2023-06-01 09:03:52 -04:00
dan elksnitis
2acbcb9533 [shaders]
- add new fields to FShaderCompilerOutput which should be populated with the shader source and entry point name if modified by a backend compile process (in a format implementing the independent preprocessing API). this is intended to supercede "OptionalFinalShaderSource" for such shader formats, as well as being used as the source for preprocessed debug dumps when enabled.
- modify the PCD3D shader format to use these fields as intended (and so fix the debug output for pipelines which remove unused interpolators to match the final modified source).

#rb Laura.Hermanns
#preflight 64777f850848b7126dda194c

[CL 25706448 by dan elksnitis in ue5-main branch]
2023-05-31 13:31:39 -04:00
dan elksnitis
459ef8ba65 [shader preprocessor] resubmit - optimizations
- keep a preprocessor-specific shared cache of loaded shader files in ANSI format similar to the one in ShaderCore but skipping the unnecessary additional load to widechar, along with the associated extra allocations and conversions, and stripping comments directly as part of the load
- for in-memory source contained in the environment, which can't use the above due to potential different contents of same-named includes across jobs, perform the widechar->ansichar conversion and comment strip in a single step rather than converting then stripping, to save an additional allocation of the full source

#rb Jason.Nadro
#rb Yuriy.ODonnell
#preflight 64775dca2e6c1a0737f6aaef

[CL 25702732 by dan elksnitis in ue5-main branch]
2023-05-31 11:08:31 -04:00
Guillaume Abadie
b374168d80 Adds a LogDumpGPU category for improved log search
#rb trivial
#jira none
#preflight 647604654b0d5a1eb1cf537e

[CL 25677309 by Guillaume Abadie in ue5-main branch]
2023-05-30 10:33:20 -04:00
Guillaume Abadie
481856a89f Implements DumpGPU streaming to better diagnose temporal problems on isolated feature like TSR without tanking frame rate
r.DumpGPU.Stream=1 instead allocate and reuse staging resources from its own pool, only issuing copy to staging and gpu fence rhi commands.
Then every frame it polls whether the resource staging is lockable with the GPU fence on render thread.
When ready, the render thread kicks of a background task that cakes care of resource CPU post processing and disk writing.
Once disk write is complete, the render thread polls everyframe a FEvent to know when complete and unlock the staging resource.
The staging resource is then release to staging resource pool ready to be reused for dumping another resource of the current frame.

#rb none
#jira UE-179496
#preflight 64713ebcb310540a8d8e7da3

[CL 25657285 by Guillaume Abadie in ue5-main branch]
2023-05-26 21:01:27 -04:00
Guillaume Abadie
30c80b4d2e Fixes missing RHIUnmapStagingSurface() call in DumpGPU caused by 25447955
#rb trivial
#jira UE-186281
#preflight 647135490515781578e40efc

[CL 25656365 by Guillaume Abadie in ue5-main branch]
2023-05-26 19:06:04 -04:00
kirill zorin
b6ee3a6c64 Fix UE_LOG callsites that have format string-related UB
#rb trivial
#preflight 647107780a6634dbb236a0a6

[CL 25651638 by kirill zorin in ue5-main branch]
2023-05-26 15:52:39 -04:00
Guillaume Abadie
eb29ae9055 Fixes AsyncCompute passes not showing up in ProfileGPU
#rb zach.bethel
#jira none
#preflight 6470fee01a346e5e70a6cd91

[CL 25650921 by Guillaume Abadie in ue5-main branch]
2023-05-26 15:19:20 -04:00
Guillaume Abadie
23c87be73c Allows DumpGPU to captures GSystemTextures that have SkipTracking
#rb trivial
#jira none
#preflight 6470f740b20adf94d795b672

[CL 25650053 by Guillaume Abadie in ue5-main branch]
2023-05-26 14:42:30 -04:00
steve robb
ba1fe48aca Preparation for deprecating the hashing arrays and strings by pointer - now you have to be explicit and call the right function for hashing a pointer, hashing an array contents or hashing a TCHAR* pointer as a null-terminated string.
Added GetArrayHash() for hashing arrays by their contents.
Added a new pair of keyfuncs for TSets and TMaps which allow TCHAR* keys (or TCHAR* values passed to *ByHash functions) to be hashed by FCrc::Strihash_DEPRECATED().

#rb devin.doucette
#preflight 64708e7c296b2b37c6fd894a

[CL 25647216 by steve robb in ue5-main branch]
2023-05-26 12:51:39 -04:00
jeremie roy
76c44b1e3a Add YUV conversion matrix override
#jira UE-185993
#rb simon.therriault
#preflight 6470c9f5b20adf94d781abf7

[CL 25643389 by jeremie roy in ue5-main branch]
2023-05-26 11:17:11 -04:00
zach bethel
4c8c48b2cc Use a simple recursive mutex for render resource list to fix race condition when adding resources concurrently.
#preflight 646e7e5c1b241f0748600d6a

[CL 25624446 by zach bethel in ue5-main branch]
2023-05-25 13:32:58 -04:00
christopher waters
523ee6df6d Adding a fast path for shader parameter unsets, or "Unbinds"
- FRHIBatchedShaderUnbinds acts like FRHIBatchedShaderParameters but doesn't need to collect pointers.
- The context code can also avoid any attempts to access the resource since we know it's always null.
- This change will let us easily remove Unbinds for RHIs that won't need them in the future, aka after the parameter batching is done once per draw.
- This addresses the bulk of unbind performance regressions but there is still some a minor regression in the single unbind case.

#jira UE-186381
#rb jeannoe.morissette
#preflight 646d3ec9f85111e06c4b696f

[CL 25622480 by christopher waters in ue5-main branch]
2023-05-25 11:49:17 -04:00
tiago costa
32c29a6efa Use FMath::RoundUpToPowerOfTwo64 in FRDGScatterUploadBuffer::Init
- the 32 bit version could return 0 when inputs caused an overflow which caused a bad result due to the usage of FMath::Min afterwards.

#jira UE-185981
#rb Ola.Olsson
#preflight 646f6feac34463d6e84723b2

[CL 25621463 by tiago costa in ue5-main branch]
2023-05-25 10:57:33 -04:00
jamie hayes
56a34dbd05 Experimental work in progress for Nanite support of SplineMeshComponent.
#rb brian.karis
#fyi rune.stubbe, graham.wihlidal
#jira UE-181795
#preflight 646bac02b82cb3fe67620d66

[CL 25620628 by jamie hayes in ue5-main branch]
2023-05-25 10:06:57 -04:00
Ola Olsson
3a5d3963f6 Add ensure to report aligned resource overflow & set back to unaligned size.
#jira UE-185973
#rb zach.bethel
#preflight 646f56f94422ba05f47e37d6

[CL 25619638 by Ola Olsson in ue5-main branch]
2023-05-25 08:51:15 -04:00
Arciel Rekman
2ef9b07d34 Add ability to trace shader group preload entries.
#rb Dan.Elksnitis
#jira FORT-592551
#review
#preflight 646e66032c0a5da0dc38bbce

[CL 25611745 by Arciel Rekman in ue5-main branch]
2023-05-24 16:21:48 -04:00
Sebastien Hillaire
302b839027 Substrate - added platofrm control for specular profile through r.Substrate.SpecularProfile.
#rb none
#preflight none
#fyi charles.derousiers

[CL 25601366 by Sebastien Hillaire in ue5-main branch]
2023-05-24 09:15:47 -04:00
Sebastien Hillaire
fdcce957e2 Substrate
- glint can be enabled/disabled per platofm still.
- Glints are enabled by default now.
- Simplified the complexspecial path defines to only have one.

#rb none
#preflight none
#fyi charles.derousiers

[CL 25600737 by Sebastien Hillaire in ue5-main branch]
2023-05-24 08:20:05 -04:00
jason hoerner
88d847a0ad GlobalBeginCompileShader optimizations. 3.2x improvement in performance of the function on Lyra cook:
* Early out when adding uniform buffer resource entries, by checking if uniform buffer had been processed, before processing individual entries.
* Changed resource entry list from a map to an array, saving the cost of map operations adding items to it.
* Resource entries for global uniform buffers cached once at startup.
* Resource entry member names stored in an external buffer, to avoid per-entry string memory allocation overhead.
* Miscellaneous smaller optimizations -- for example, using ByHash to avoid redundant hashing and FString construction.

#jira none
#rnx
#rb jason.nadro dan.elksnitis
#preflight 646cfdbc1134ffac7034af60

[CL 25596308 by jason hoerner in ue5-main branch]
2023-05-23 20:16:11 -04:00
joe pribele
f5481ce835 changed FShaderCodeLibraryPluginUnmountedCallback to close the shader library at the end of the render pipeline
#preflight 646cf60a1b241f0748ae995d
https://p4-swarm.epicgames.net/reviews/25511457
#rb justin.marcus

[CL 25592363 by joe pribele in ue5-main branch]
2023-05-23 18:16:09 -04:00
christopher waters
af1699892c Removing CoreMinimal includes from public RHI headers.
#preflight 646bd9264130b0ce505eb56f

[CL 25571096 by christopher waters in ue5-main branch]
2023-05-22 17:49:00 -04:00
ben woodhouse
31208ca2a1 Add a new set of ASTC pixel formats for storing high precision normals in RG channels. The texture is encoded as LA for higher precision, swizzled to RG at runtime for shader compatibility with BC5. Requires RHI support.
Runtime pixel formats are named  PF_ASTC_<blocksize>_NORM_RG. Use texture format name ASTC_NormalRG_Precise for encoding.

[CL 25563983 by ben woodhouse in ue5-main branch]
2023-05-22 10:41:55 -04:00
dan elksnitis
f645f93588 [shaders] remove legacy preprocessor option & mcpp library
#rb Jason.Nadro
#preflight 6467bf0c2c0a5da0dcd7aaf2
#fyi Yuriy.ODonnell

[CL 25549427 by dan elksnitis in ue5-main branch]
2023-05-19 14:50:25 -04:00
dan elksnitis
7d8d67af36 [shaders]
- expose a helper function for shader file path fixup
- fix an uinintentional copy in the FindShaderFormat API

#preflight 646658dab91ab13b09c201c5
#rb Jason.Nadro
#rb Yuriy.ODonnell
#rb Jeremy.Moore

[CL 25546585 by dan elksnitis in ue5-main branch]
2023-05-19 12:29:29 -04:00