59 Commits

Author SHA1 Message Date
dan elksnitis
a9037b25ed [shaders]
- add FShaderSource class which wraps source as populated by preprocessing and subsequently accessed by compilation and other debug features; this class automatically inserts zeroed padding such that 16-byte-wide SIMD string comparison operations do not require a non-SIMD tail to process any overhang.
- add typedefs for the string/view/character types and update preprocessing code to use these typedefs instead of the explicit types
- add explicit if constexprs in minifier code around char width to disable simd optimizations for char width != 2 (and subsequently skip the non-simd tail if char width == 2 since FShaderSource automatically adds the required padding)

#rb Jason.Nadro, Yuriy.ODonnell

[CL 30358137 by dan elksnitis in ue5-main branch]
2023-12-15 15:28:27 -05:00
dan elksnitis
6ed653a189 [shaders] further preprocessing cleanup
- move sequence of preprocessing steps out of ShaderPreprocessor module and into UE::ShaderCompilerCommon::ExecuteShaderPreprocessingSteps; the former is now explicitly just the low-level preprocessor lib
- add an implementation of PreprocessShader in FBaseShaderFormat so backends which have no custom code to execute as part of preprocessing can just automatically inherit this implementation, and fix up such backends to eliminate now-unnecessary overrides

#rb christopher.waters, Laura.Hermanns

[CL 30178136 by dan elksnitis in ue5-main branch]
2023-12-07 08:55:41 -05:00
dan elksnitis
cc7c2c54f4 [shaders] shader format preprocessing cleanup & refactoring
- move uniform buffer cleanup and dead stripping into ShaderPreprocessor module's PreprocessShader function
- add "required symbols" to compiler input struct to specify additional symbols to keep during minification aside from those specified by the entrypoint; modify API such that both an entry point string and additional symbols can be specified (to avoid each backend needing to manually parse the compound RT entry point string)
- make use of ModifyShaderCompilerInput in all backends to set additional defines and required symbols on input struct up front; only use the AdditionalDefines map in cases where it's actually necessary
- remove the various per-platform defines for enabling minifier, no longer required now that this has been rolled out for all backends
- fix SCW directcompile mode; this had rotted due to pieces of the FShaderCompilerEnvironment having been added that weren't explicitly serialized to either cmdline or in the shader source. this now serializes as a base64 string written inside the USF containing all portions of the environment required for compilation (using the same serialization function as is used to write/read the SCW input file)
- use a debug flag for indicating we're in "direct compile" mode and should load the debug USF off disk, rather than the poorly named "bSkipPreprocessedCache" (this name is both inaccurate and also confusing due to the addition of the preprocessed job cache)
- modify platform "force wave32" mechanism to use a pragma directive to set a compiler define, instead of doing string replacement in the preprocessed source
- add a view version of the RT entrypoint parsing to use in preprocessing, note that other paths still need to construct fstrings due to further manipulation so keeping the FString path around too
- clean up backends manually checking the "directcompile" cmdline arg

#rb christopher.waters, Yuriy.ODonnell
#rb Chris.Waters
#rb Laura.Hermanns

[CL 30023082 by dan elksnitis in ue5-main branch]
2023-11-30 15:56:34 -05:00
christopher waters
a1af36037f Shader versioning cleanup
- Changing all shader versions to Guid.
- Fixing shader version guids in shaders to not be in comments.
- Adding a shader version to RayTracingCommon.ush.

#rb dan.elksnitis, Jason.Nadro, Yuriy.ODonnell, Laura.Hermanns

[CL 29168287 by christopher waters in ue5-main branch]
2023-10-26 23:06:40 -04:00
dan elksnitis
54fb5cf56d [shaders] further deprecation (SupportsIndependentPreprocessing/OptionalFinalShaderSource/bIndependentPreprocessed are no longer needed since all backends are migrated)
#rb Laura.Hermanns

[CL 29117027 by dan elksnitis in ue5-main branch]
2023-10-25 22:21:30 -04:00
christopher waters
6797229f23 Moving more platforms to use ShaderParameterParser in the compile step.
#rb Jason.Nadro
#jira UE-197328

[CL 28655234 by christopher waters in ue5-main branch]
2023-10-11 03:20:39 -04:00
dan elksnitis
78b1767069 [shaders] implement independent preprocessing API for vulkan shader format
#rb Massimo.Tristano

[CL 26739541 by dan elksnitis in ue5-main branch]
2023-08-01 11:03:24 -04:00
christopher waters
20984328ea Removing the cvar lookup string for shader dead code removal in all shader formats. This cvar can't be loaded on SCW startup so it was causing a hash mismatch.
#rb yuriy.odonnell
#preflight 646bc8f764351d76f3c85f5e

[CL 25570191 by christopher waters in ue5-main branch]
2023-05-22 16:57:05 -04:00
jeannoe morissette
75364b7008 VulkanRHI: Add VULKAN_SM6. Move features and requirements around to match what was done on d3d.
#rb arciel.rekman, carl.lloyd
#preflight 643996128901e5ef982dc887

[CL 25045731 by jeannoe morissette in ue5-main branch]
2023-04-14 14:26:06 -04:00
jeannoe morissette
c96eadede6 VulkanRHI: Fix issue where incorrect TargetEnvironment was selected when previewing other SM5 modes.
#rb Mihnea.Balta
#jira UE-171188
#preflight 63ea8f8f956709374a50bf8a

[CL 24210191 by jeannoe morissette in ue5-main branch]
2023-02-14 09:25:04 -05:00
Yuriy ODonnell
bddca76c94 ShaderMinifier - Add support for dead code removal to all shader formats
* Add code to all shader format back-ends to take dead code removal into account when computing the version ID
* Not enabled in Metal and OpenGL back-ends (require further testing)

#rb dan.elksnitis
#preflight 6390f1f15c5308d18c7364fb

[CL 23433448 by Yuriy ODonnell in ue5-main branch]
2022-12-07 15:13:42 -05:00
dmitriy dyomin
d50ef617bb Bump vulkan shader format version to invalidate Android VK shaders
[CL 22594922 by dmitriy dyomin in ue5-main branch]
2022-10-18 03:18:01 -04:00
Florin Pascu
3cd6b6da4b - Checking the SF instead of the SP in the Vulkan Shader Compiler
#rb Dmitriy.Dyomin
#jira none
#preflight 6322c8498838676d108e02a1

[CL 22031695 by Florin Pascu in ue5-main branch]
2022-09-15 13:03:31 -04:00
dmitriy dyomin
12eb52b317 Fixed: Water texture missing throughout the map in BR on Android
#rb peter.sauerbrei

[CL 21864603 by dmitriy dyomin in ue5-main branch]
2022-09-07 18:03:53 -04:00
dmitriy dyomin
8edf003c00 Invalidate GL and Vulkan shaders
#ROBOMERGE-AUTHOR: dmitriy.dyomin
#ROBOMERGE-SOURCE: CL 21438408 via CL 21438416 via CL 21438418 via CL 21438420
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v981-21435820)

[CL 21438584 by dmitriy dyomin in ue5-main branch]
2022-08-18 02:04:03 -04:00
carl lloyd
4c5af4bae8 Fix for Android bug when using OpTypeImage and setting depth to unknown
#rb Lukas.Hermanns
[FYI] Dmitriy.Dyomin

#ROBOMERGE-OWNER: carl.lloyd
#ROBOMERGE-AUTHOR: carl.lloyd
#ROBOMERGE-SOURCE: CL 18309759 via CL 18309767 via CL 18310351 via CL 18310386 via CL 18310920 via CL 18310950 via CL 18312599 via CL 18312697
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18312969 by carl lloyd in ue5-release-engine-test branch]
2021-11-29 13:35:16 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
aurel cordonnier
fc542f6cfd Merge from Release-Engine-Staging @ 18081189 to Release-Engine-Test
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971

[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
2021-11-07 23:43:01 -05:00
rolando caloca
17e13e521b UE5 - Remove some hlslcc vestiges from Vulkan
#rb Dmitriy.Dyomin, Lukas.Hermanns, jeannoe.morissette

#ROBOMERGE-SOURCE: CL 17369648 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17369655 by rolando caloca in ue5-release-engine-test branch]
2021-08-31 12:04:32 -04:00
rolando caloca
f6cd88c157 UE5 - Remove platform
#rb Steve.Smith
[FYI] Jules.Blok, Ryan.Durand, Ben.Marsh

#ROBOMERGE-SOURCE: CL 17295935 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)

[CL 17295945 by rolando caloca in ue5-release-engine-test branch]
2021-08-24 19:28:38 -04:00
Marc Audy
8f73cd7fa9 Merge UE5/Release-Engine-Staging @ 15630841 to UE5/Main
This represents UE4/Main @ 15601601

[CL 15631170 by Marc Audy in ue5-main branch]
2021-03-05 19:27:14 -04:00
Marc Audy
9753392e2b Merge UE5/RES CL# 15462083 to UE5/Main
This represents UE4/Main @ 15414221

[CL 15463811 by Marc Audy in ue5-main branch]
2021-02-18 18:13:28 -04:00
Lukas Hermanns
a4dfdcd0ad Moved dxil.dll from DirectX folder into ShaderConductor binary folder and load dxil.dll manually to ensure it's always loaded from that location.
#rb Yuriy.ODonnell, Emil.Persson, Kenzo.Terelst
#fyi Mihnea.Balta, Rolando.Caloca, Graham.Wihlidal
#jira none
#rnx

[CL 15337426 by Lukas Hermanns in ue5-main branch]
2021-02-05 10:29:11 -04:00
Yuriy ODonnell
8789e0bb07 Include shader compiler DLL version in FShaderFormatD3D/Vulkan::GetVersion(), similar to how it's done for other platforms.
#rb Lukas.Hermanns

[CL 15276007 by Yuriy ODonnell in ue5-main branch]
2021-02-01 18:54:58 -04:00
Marcus Wassmer
3b81cf8201 Merging using //UE5/Main_to_//UE5/Release-Engine-Staging @14384769
autoresolved files
#rb none

[CL 14384911 by Marcus Wassmer in ue5-main branch]
2020-09-24 00:43:27 -04:00