Commit Graph

103 Commits

Author SHA1 Message Date
dmitriy dyomin
de2b738ffa Mobile: Added an option to not use PLS and FBF extension on Android OpenGL
Enabling it will force a multipass rendering where GBuffer and SceneColor are resolved to a system memory

[CL 36327269 by dmitriy dyomin in 5.5 branch]
2024-09-17 01:36:59 -04:00
Ryan Hummer
4af2fd066d Updating Dev-Release-5.5 from Main at CL #36144969
#okforversepublic

[CL 36146571 by Ryan Hummer in Dev-5.5 branch]
2024-09-10 10:26:02 -04:00
florin pascu
3a639b1afe FSceneCapturePS has highp floats forced now to fix a driver bug
FullPrecisionInPS can now be enabled on a per global shader basis and not just globally controlled by r.Mobile.FloatPrecisionMode
#rb Dmitriy.Dyomin
#jira UE-209497

[CL 32176477 by florin pascu in ue5-main branch]
2024-03-12 07:10:25 -04:00
laura hermanns
3e2c99ebce [Shaders] Remove Hlslcc form GL backend; Mobile renderer fully switched to DXC.
#rnx
#rb Carl.Lloyd, Dmitriy.Dyomin, Florin.Pascu
[FYI] Rolando.Caloca, Jason.Nadro

[CL 31258039 by laura hermanns in ue5-main branch]
2024-02-07 10:32:52 -05:00
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
88169dbd8c [shaders] implement independent preprocessing IShaderFormat API for OpenGL shader format
#rb Christopher.Waters
#rb Massimo.Tristano

[CL 27482746 by dan elksnitis in ue5-main branch]
2023-08-30 09:38:41 -04:00
dan elksnitis
d0128a9fa0 [shaders]
- enable minifier deadstripping for OpenGL shader format; bytecode is a 100% match with this change on multiple tested projects so it seems safe to enable
- deprecate FOpenGLFrontend; nothing in available code appears to inherit from it anymore so the API appears unnecessary. this makes the OpenGL shader format more similar to others (which do not expose compilation functions as API)

#rb Jason.Nadro
#rb Laura.Hermanns
#rb Yuriy.ODonnell

[CL 27338803 by dan elksnitis in ue5-main branch]
2023-08-24 09:09:10 -04:00
dan elksnitis
5c00384f67 [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 26256933 by dan elksnitis in ue5-main branch]
2023-06-27 10:11:41 -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
Dmitriy Dyomin
574c6d6d08 HLSLCC: Disable "return type can't contain a sampler" error, as it not really usefull
Upgrade HLSLCC VS projects to v143 toolset
#jira UE-177164
#preflight 63ef1ecde832ea950a626675

[CL 24278286 by Dmitriy Dyomin in ue5-main branch]
2023-02-17 01:54:42 -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
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
Dmitriy Dyomin
271c3e1047 Removed support for separate shader objects from GL RHI as it was never used for GLES
#rb none
#jira none
#preflight 626802d0943f717ebfbb2968

[CL 19920264 by Dmitriy Dyomin in ue5-main branch]
2022-04-26 10:58:48 -04:00
jack porter
4f9b4635d3 Fix hlslcc depth fetch support on Android devices not supporting GL_ARM_shader_framebuffer_fetch_depth_stencil
Reapply change that did not correctly make it into 19.01.
#rb Chris.Babcock
[FYI] Chris.Babcock

#ROBOMERGE-AUTHOR: jack.porter
#ROBOMERGE-SOURCE: CL 18465602 via CL 18465606 via CL 18465616 via CL 18465618 via CL 18465694 via CL 18465699
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18465700 by jack porter in ue5-release-engine-test branch]
2021-12-15 04:14:37 -05:00
chris babcock
51ea83d2ec Fix hlslcc depth fetch support on Android devices not supporting GL_ARM_shader_framebuffer_fetch_depth_stencil #jira FORT-436149
[REVIEW] [at]Jack.Porter
#rb Allan.Bentham

#ROBOMERGE-OWNER: chris.babcock
#ROBOMERGE-AUTHOR: chris.babcock
#ROBOMERGE-SOURCE: CL 18401734 via CL 18401750 via CL 18401764 via CL 18401786 via CL 18401802 via CL 18434826 via CL 18437068
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)

[CL 18437174 by chris babcock in ue5-release-engine-test branch]
2021-12-10 20:21:27 -05:00
dmitriy dyomin
22226ea004 Update hlslcc GL backend to match GetFirstPixelUAVUnit
[FYI] carl.lloyd
#rb none

#ROBOMERGE-AUTHOR: dmitriy.dyomin
#ROBOMERGE-SOURCE: CL 17722313 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v879-17706426)

[CL 17722322 by dmitriy dyomin in ue5-release-engine-test branch]
2021-10-05 11:39:22 -04:00
carl lloyd
f2a628b2a6 Added packed UB support to DXC and fixed bugs
#rb Lukas.Hermanns

#ROBOMERGE-SOURCE: CL 17133860 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17133863 by carl lloyd in ue5-release-engine-test branch]
2021-08-11 07:11:25 -04:00
dmitriy dyomin
009ed560ce Use GL_ARM_shader_framebuffer_fetch_depth_stencil by default for depth fetch on Android
This works better than full FBF and supported on most Adnroid devices. Fallback to FBF when extension is not supported
(merged from  Release-Engine-Staging)
#jira UE-106962

#ROBOMERGE-SOURCE: CL 15624985 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v777-15581079)

[CL 15625000 by dmitriy dyomin in ue5-main branch]
2021-03-05 11:48:50 -04:00
Dmitriy Dyomin
edd0257c55 Remove Texture2D as a storage for GPUScene primitives, OpenGL will use StructuredBuffers supported through SSBOs
#rb jack.porter
#fyi ola.olsson

[CL 15415286 by Dmitriy Dyomin in ue5-main branch]
2021-02-16 00:46:28 -04:00