Commit Graph

207 Commits

Author SHA1 Message Date
christopher waters
1a3a1d4e90 Changing DumpDebugInfoPath conditions to use a helper function.
#rb dan.elksnitis

[CL 27681962 by christopher waters in ue5-main branch]
2023-09-07 14:45:23 -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
david harvey
da9b5b86f5 Do not include PreWindowsApi.h / PostWindowsApi.h directly in code.
- mostly just replacing them AllowWindowsPlatformTypes.h / HideWindowsPlatformTypes.h
 - some other files had both Pre/PostWindowsApi.h and Allow/HideWindowsPlatformTypes.h, so just removed
 - some occasional include order changes.

#jira UE-152863
#rnx
#rb Devin.Doucette

[CL 26985385 by david harvey in ue5-main branch]
2023-08-10 03:34:53 -04:00
david harvey
bdb4199eeb Remove unnecessary WindowsHWrapper.h & MinWindows.h include - both files will be automatically included by AllowWindowsPlatformTypes.h
#jira UE-152863
#rnx
#rb Josh.Adams

[CL 26912096 by david harvey in ue5-main branch]
2023-08-08 05:50:53 -04:00
dan elksnitis
9a5a1b6f74 [shaders] minor include cleanup
#rb Jason.Hoerner
#rb Laura.Hermanns

[CL 26817718 by dan elksnitis in ue5-main branch]
2023-08-03 13:40:32 -04:00
dan elksnitis
5f85b46590 [shaders] remove unnecessary passing of hlslcc flags as an option to debug info output. this was just used to pass a switch on the SCW directcompile cmdline which SCW no longer does anything with. also cleaned up some additional unnecessary code related to these flags in backends that no longer use hlslcc at all.
#rb Laura.Hermanns

[CL 26685354 by dan elksnitis in ue5-main branch]
2023-07-28 15:58:01 -04:00
jason hoerner
7f22080814 Shader Compiler: Made FShaderCompilerDefinitions private, to reduce code publicly visible in ShaderCore.h. For now, it's just marked deprecated for 5.4, but will be hidden more generally in 5.5.
#rnx
#rb yuriy.odonnell dan.elksnitis jason.nadro

[CL 26534998 by jason hoerner in ue5-main branch]
2023-07-22 06:35:10 -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
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