304 Commits

Author SHA1 Message Date
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
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
florin pascu
b5a6b18005 Fix GenerateGlslShader when a string is a substring of another in the ReflectData
#jira UE-185872
#preflight 646338a7cd6910375684092d

[CL 25494932 by florin pascu in ue5-main branch]
2023-05-16 15:28:39 -04:00
Steve Robb
0f44db07d5 Replaced some container operator new usage.
#rb james.hopkin
#jira none
#preflight 6459670f28155a0f41565a34

[CL 25384456 by Steve Robb in ue5-main branch]
2023-05-09 05:17:49 -04:00
jeannoe morissette
efa00a9cb5 OpenGL: Avoid StorageImageWriteWithoutFormat SPIRV capability when compiling shaders for GL by adding a "-fvk_force_storage_image_format" flag that brings back old behavior (promote 3-component UAV to 4-component instead of using Unknown format). (author: Carl.Lloyd)
Broken since 24910389.

#rb Florin.Pascu,Carl.Lloyd
#fyi Laura.Hermanns,Dmitriy.Dyomin
#preflight 6442c73d0171aae0b1c6e85e
#jira UE-183868,UE-183432
#rnx

[CL 25149146 by jeannoe morissette in ue5-main branch]
2023-04-21 13:52:26 -04:00
dan elksnitis
26464b581b [shaders] further rework of parameter parser API to simplify the independent preprocessing use case, plus adding serialization support and some minor cleanup.
#preflight 6442af0ec023bb1f734fc0d1
#rb Christopher.Waters

[CL 25148947 by dan elksnitis in ue5-main branch]
2023-04-21 13:45:43 -04:00
dan elksnitis
49d7985a85 [shaders] Add "compile argument" functionality for generic parameters consumed by compile backends, along with helper to set both a compile arg AND define for cases which require both. The purpose of this is to move towards enforcing that preprocessor defines should _only_ be used during the preprocessing phase itself; the subset of defines that are currently used only as arguments to the compile backends (or used as both actual preprocessor defines and backend arguments) should use this mechanism instead. This allows us to explicitly identify and hash such parameters to be included in a stable key based primarily on a hash of preprocessed/deadstripped source; without it we would need to hash all defines which will defeat most of the deduplication benefit of doing this. A subsequent change will deprecate the GetDefinitions function on the shader compilation environment to enforce that defines cannot be read by anything outside of core shader system functionality.
#rb Massimo.Tristano
#rb Laura.Hermanns
#preflight 64258c2e5e52099fe3d03625

[CL 24854110 by dan elksnitis in ue5-main branch]
2023-03-30 10:47:09 -04:00
florin pascu
7a8faff2fd Replace OpCompositeConstruct with OpAccessChain for OpenGL for array creation - UE5
#jira UE-180965
#preflight 641aee2cbb1320be41857a4a

[CL 24759993 by florin pascu in ue5-main branch]
2023-03-23 07:22:40 -04:00
carl lloyd
c027755aa3 Fixed bug in previous CL with fma define inserted before verion on desktop GL
Fixed bug where sampler names were matched incorrectly

#rb Jack.porter
#jira UE-177856
#preflight 6405f2f45515f4f57bd2543d

[CL 24525319 by carl lloyd in ue5-main branch]
2023-03-06 13:03:24 -05:00
christopher waters
bedc943709 Remove unnecessary private include path
[CL 24370784 by christopher waters in ue5-main branch]
2023-02-22 17:22:42 -05:00
joe kirchoff
0615aeb033 [Partial Backout] - CL24348577
[FYI] Joe.Kirchoff
Original CL Desc
-----------------------------------------------------------------
Remove unnecessary private include path

#rnx
#jira UE-177808

[CL 24352016 by joe kirchoff in ue5-main branch]
2023-02-21 17:55:23 -05:00
joe kirchoff
4eb0d7b810 Remove unnecessary private include path
#rnx
#jira UE-177808

[CL 24351077 by joe kirchoff in ue5-main branch]
2023-02-21 17:19:34 -05: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
Laura Hermanns
5a8a3b3063 Unify shader debug name in shader code output for DXC backends to improve cache hits.
The shader code output contains a little bit of plaintext such as I/O identifiers and the shader name, which was generated for the DXC backend in a way that prevents caching.
This unifies the shader name in the output code and improves the cache hit ratio for a Lyra cook from 0% to roughly 50% cache hits (for certain platforms).

#rb Jason.Nadro, Carl.Lloyd
#fyi Brian.White, Arciel.Rekman, Brandon.Schaefer
#jira FORT-548603
#preflight 63e26c6c07207b2570ba2d5b
#rnx

[CL 24050212 by Laura Hermanns in ue5-main branch]
2023-02-07 11:15:47 -05:00
dan elksnitis
34c034f2b2 [shaders] add a mutex acquired around all calls into hlslcc as a temporary fix for parallel in-process compilation. also some minor cleanup (include sorting, remove an unused/unimplemented function prototype)
#rb Jason.Nadro
#rb Yuriy.ODonnell
#rb Laura.Hermanns
#preflight 63e272b08374ef68dfd142ea

[CL 24049810 by dan elksnitis in ue5-main branch]
2023-02-07 11:04:07 -05:00
carl lloyd
17ddda2d2c Added support for relaxing nan checks in OpenGL and enabled for Android.
Fixed bug on Adreno drivers when using mixed precision in FMA
#rb Laura.Hermanns, Jack.Porter
#jira UE-174863
#preflight 63dcd8ba78716a01e80924f9

[CL 23988703 by carl lloyd in ue5-main branch]
2023-02-03 06:43:59 -05:00
Yuriy ODonnell
1dfc32d42d Enable r.Shaders.RemoveDeadCode by default for all back-ends except Metal and OpenGL
* Significantly reduces the size of shader debug data and improves shader compilation time (reducing parsing cost in the native shader compiler)
* Remove "experimental" label for the feature

#rb Jason.Nadro
#preflight 63d455d9be1970f8824c3f9b

[CL 23894592 by Yuriy ODonnell in ue5-main branch]
2023-01-27 18:24:18 -05:00
carl lloyd
d3eab1096d Optimized reduce const array pass to match HLSLCC output
Fixed bug with input/output varyings using incorrect location for matrices
Fixed bug when attempting to read MatrixStride in structs

#preflight 63d138f2574ab9cae4b003cf
#rb Laura.Hermanns
#jira UE-173260
#jira UE-173202

[CL 23847426 by carl lloyd in ue5-main branch]
2023-01-25 09:39:15 -05:00
carl lloyd
b623602093 AR Camera Passthrough fix with TextureExternal
#jira UE-173382
#rb Laura.Hermanns
#fyi robert.srinivasiah
#preflight 63b8446a68068a8bd621699e

[CL 23598345 by carl lloyd in ue5-main branch]
2023-01-06 11:04:42 -05:00
christopher waters
6e30ddb01e Dependency cleanup around DataDrivenShaderPlatformInfo and a few other headers.
#preflight 63921e6a67018b14b5925197

[CL 23454104 by christopher waters in ue5-main branch]
2022-12-08 15:35:35 -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
carl lloyd
52be0e8e77 Fixed bug with deferred decals on OpenGL
#rb Laura.Hermanns
#jira UE-168197
#preflight 636cc9cc376a9cd6a8e9fde3

[CL 23073711 by carl lloyd in ue5-main branch]
2022-11-10 05:06:00 -05:00
Dmitriy Dyomin
f7dffe9f57 Fixed: A few issues with depth access in a mobile renderer
Make SceneDepthAux a platform constant configuration, it can't depend on runtime vars
#rb none
#preflight 635e4bed1b41d36d48d26061

[CL 22854614 by Dmitriy Dyomin in ue5-main branch]
2022-10-30 08:26:11 -04:00
dan elksnitis
ecab3b4a9a [shaders] refactor usf/directcompile.txt dump into a utility in ShaderCompilerCommon to reduce code duplication in the shader backends
#rb Jason.Nadro
#rb Christopher.Waters
#preflight 635bf1e1df01edd149f5727e

[CL 22829548 by dan elksnitis in ue5-main branch]
2022-10-28 11:45:49 -04:00
christopher waters
f5ff98f2e1 ShaderParameterParser cleanup
- Making ConstantBufferType a constructor only argument. This removes the duplicated logic of calling ShouldUseStableConstantBuffer.
- Moving ShouldUseStableConstantBuffer to ShaderCompilerCommon.
- Made UE::ShaderCompilerCommon::ParseParameterType array arguments const

#jira UE-166341
#rb Guillaume.Abadie
#preflight 634eeceea1527f6b3bda9ff0

[CL 22608320 by christopher waters in ue5-main branch]
2022-10-18 15:25:05 -04:00