199 Commits

Author SHA1 Message Date
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
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
bryan sefcik
892629fe83 Fixed some paths that got updated to include the full "ThirdParty" path.
#jira
#preflight 6320877bbc40358fa2995069

[CL 21997782 by bryan sefcik in ue5-main branch]
2022-09-13 21:48:33 -04:00
carl lloyd
54f349c2e5 Added support to reduce array size by converting to structs and allowing OpenGLShaderCompiler to pack
Fixed bug with SpvOpPhi

#jira UE-160089
#rb Laura.Hermanns
#preflight 631f555712092e9faa809684

[CL 21974093 by carl lloyd in ue5-main branch]
2022-09-12 18:18:54 -04:00
bryan sefcik
a3dddc6630 Pass 1 on Developer include fixes:
Removed redundant private include paths from build.cs files.
Fixed include paths to be relative to the private or public folders.
Hid or removed includes that reached into other private module folders.
Updated PublicInclude paths when necessary.

#jira
#preflight 631e281694758d0bf2ea1399

[CL 21960082 by bryan sefcik in ue5-main branch]
2022-09-11 18:32:18 -04:00
christopher waters
a987160f55 Reworking the parameter rewrite code to do automatic bindless
- Refactoring FShaderParameterParser to use more string views since we can rely on OriginalParsedShader not changing.
- Split FShaderParameterParser::ParseAndMoveShaderParametersToRootConstantBuffer into smaller functions
- Moving FShaderParametersMetadata::IterateShaderParameterMembers into the only module it's used in, ShaderParameterParser.cpp
- Adding CFLAG_BindlessResources which will be set when ENABLE_BINDLESS_RESOURCES is set
- Adding CFLAG_BindlessSamplers which will be set when ENABLE_BINDLESS_SAMPLERS is set
- Adding resource/sampler detection and conversion to bindless in FShaderParameterParser

#jira UE-139616
#rb guillaume.abadie, jeannoe.morissette, yuriy.odonnell, laura.hermanns
#preflight 62d180cce468fcfd0b7001a0

[CL 21111994 by christopher waters in ue5-main branch]
2022-07-15 12:25:44 -04:00
christopher waters
b28a0c467f Moving ShaderParameterParser into its own source files.
#jira none
#rb guillaume.abadie, kenzo.terelst
#preflight 62b0ecb8ec13d14b5a1897ba

[CL 20757788 by christopher waters in ue5-main branch]
2022-06-21 10:49:56 -04:00
carl lloyd
9ae2f947d7 Fixed bug with column/row mismatch on non-square matrices in OpenGL
#fyi Wei.Liu
#rb trivial
#preflight none

[CL 20436298 by carl lloyd in ue5-main branch]
2022-05-31 09:21:55 -04:00