Commit Graph

58 Commits

Author SHA1 Message Date
dan elksnitis
f2c9000b60 [shaders] deprecate GetDefinitions accessor on FShaderCompilerEnvironment; encapsulate internal usage of definitions object in friend classes and remove some superfluous code calling the function unnecessarily
#preflight 6425b46391589478cdab0c35
#rb Laura.Hermanns
#rb Sameer.Mirza

[CL 24870640 by dan elksnitis in ue5-main branch]
2023-03-31 09:55:19 -04:00
Matt Peters
6be2b0412d ShaderPreprocessor: Fix access violation due to reading off the end of the input text when the text contains an unterminated /* comment.
#jira UE-178273
#rnx
#rb charles.derousiers
#preflight 63f79630ef1b24bf940b32e0

[CL 24382270 by Matt Peters in ue5-main branch]
2023-02-23 11:44:33 -05:00
dan elksnitis
e5d2976d39 [shaders] fix msvc static analysis warning - enforce that loaded includes are non-empty when loading via stb file load callback.
#rb Yuriy.ODonnell
#preflight 6388f525303395f6c93adb67

[CL 23357182 by dan elksnitis in ue5-main branch]
2022-12-01 14:02:18 -05:00
dan elksnitis
93c67debf3 [shaders] move stb_ds and stb_alloc implementations to a .c file rather than using the single-header #define'd implementation pattern. IncludeTool doesn't like this.
#preflight 6388cb61cb3b75418301b20a
#rb Yuriy.ODonnell

[CL 23353516 by dan elksnitis in ue5-main branch]
2022-12-01 11:15:26 -05:00
dan elksnitis
8801f83bb2 [shaders] add support to run STB preprocessor instead of MCPP; add a cvar to disable this and instead use the legacy preprocessor (currently this is set to true - i.e. still using MCPP - by default)
#rb Yuriy.ODonnell
#rb Jason.Nadro
#preflight 6387663c3377450900c5522b

[CL 23350844 by dan elksnitis in ue5-main branch]
2022-12-01 09:27:13 -05:00
florin pascu
a945c1e0cb Remove ShaderPlatformToShaderFormatName
#rb Jason.Nadro, Jeremy.Moore
#preflight 637216e13248425305d19318

[CL 23116618 by florin pascu in ue5-main branch]
2022-11-14 07:59:15 -05:00
christopher waters
c6e9015a91 Cache uniform buffer definitions
- Remove shader platform specific info from uniform buffers, we can generate code with macros that translates to what each platform needs.
- With the per-platform differences removed, uniform buffer declarations (read: generated text) can be created once per shader parameter type that needs them instead of once per shader type's shader parameter type usage.
- FShaderType and FVertexFactoryType now hold a TSet of used uniform buffer names instead of a TMap that held potentially duplicated FStrings of uniform buffer defintions.
- Lists of uniform buffers are *potentially* different per platform, so the annoying CachedUniformBufferPlatform variables need to stick around for now.
- GenerateReferencedUniformBuffers renamed to GenerateReferencedUniformBufferNames and now populates a TSet instead of a TMap.
- ShaderType::AddReferencedUniformBufferIncludes renamed to ShaderType::AddUniformBufferIncludesToEnvironment which calls the shared UE::ShaderParameters::AddUniformBufferIncludesToEnvironment.
- CreateUniformBufferShaderDeclaration moved to UE::ShaderParameters::CreateUniformBufferShaderDeclaration and now returns its FString.
- CacheUniformBufferIncludes was removed since it was only populated values from CreateUniformBufferShaderDeclaration.
- Deprecated FShaderCompilerInput::SourceFilePrefix since nothing has populated it in 9 years.

#jira none
#rb dan.elksnitis, yuriy.odonnell
#preflight 63643e5ff233f06a127c11c1

[CL 22988611 by christopher waters in ue5-main branch]
2022-11-04 12:04:48 -04:00
Florin Pascu
f64fc575d2 Re-submiting with Mac fixes
Changed ShaderArchive, GlobalShaderCache, ShaderDebugInfo and Autogen to use ShaderPlatformName and not ShaderFormat when naming their output files.
#rb Jack.Porter, Chris.Waters, Mihnea.Balta, Jason.Nadro
#jira UE-120561
#preflight 62c31f6fc9410537282296c6

[CL 20937870 by Florin Pascu in ue5-main branch]
2022-07-04 19:06:33 -04:00
Florin Pascu
09cb19fcfd Backout 20871665 to fix Mac cook
#rb none
#jira none
#preflight 62be0c68d94b57687c3ff309

[CL 20904999 by Florin Pascu in ue5-main branch]
2022-06-30 17:41:55 -04:00
Florin Pascu
1844e8e514 Changed ShaderArchive, GlobalShaderCache, ShaderDebugInfo and Autogen to use ShaderPlatformName and not ShaderFormat when naming their output files.
#rb Jack.Porter, Chris.Waters, Mihnea.Balta, Jason.Nadro
#jira UE-120561
#preflight 62bbf93ae353c20ac2361d94

[CL 20871665 by Florin Pascu in ue5-main branch]
2022-06-29 04:19:06 -04:00
Jason Nadro
65a90154a6 Add scoped cpu markers to various D3D shader compiler functions to make this easier to profile when shader compilation is done in process.
#rb trivial
#jira none
#preflight 62389f8fec68595f3b78e9df

[CL 19453136 by Jason Nadro in ue5-main branch]
2022-03-21 12:17:22 -04:00
Lukas Hermanns
39181ee030 Undo //UE5/Main/Engine/Source/... changelist 17355504
#fyi Krzysztof.Narkowicz, Rolando.Caloca, Mihnea.Balta
#jira none
#rnx

[CL 17408288 by Lukas Hermanns in ue5-main branch]
2021-09-02 16:05:32 -04:00
Lukas Hermanns
42015c8185 Ensure escape characters are encoded correctly in '#line'-directives of shader preprocessor.
#rb Krzysztof.Narkowicz
#jira none
#rnx

[CL 17377839 by Lukas Hermanns in ue5-main branch]
2021-08-31 17:10:04 -04:00
Lukas Hermanns
83d05953f7 Enable '-fdiagnostics-format' option in DXC and emit asbolute file paths in '#line'-directives.
#rb Krzysztof.Narkowicz
#fyi Rolando.Caloca, Mihnea.Balta
#jira none
#rnx

[CL 17355504 by Lukas Hermanns in ue5-main branch]
2021-08-30 14:04:53 -04:00
guillaume abadie
0bb3821623 Allows SHADER_USE_PARAMETER_STRUCT() to submit all shader parameters in a single RHISetShaderParameter()
#rb yuriy.odonnell
#preflight 611d572d9db7df000134eb13


#ROBOMERGE-SOURCE: CL 17222098
#ROBOMERGE-BOT: (v855-17104924)

[CL 17222140 by guillaume abadie in ue5-main branch]
2021-08-18 16:55:41 -04:00
Steve Robb
1f3fe8c9ac Some ANSICHAR/UTF8CHAR cast fixes for upcoming changes to StringConv.h.
#rb none
#jira none

[CL 16469364 by Steve Robb in ue5-main branch]
2021-05-26 10:45:12 -04:00
Ryan Vance
4b1da36730 Simple clean up
#rb trivial

[CL 15243405 by Ryan Vance in ue5-main branch]
2021-01-28 13:35:53 -04:00
john hable
5f3ff39aed First major checkin for flexible GBuffer.
#rb kevin.ortegren, arciel.rekman

[CL 14547614 by john hable in ue5-main branch]
2020-10-22 14:41:45 -04:00
danny couture
8f88f4a055 Add some useful Insights trace
#rb Francis.Hurteau

[CL 14487717 by danny couture in ue5-main branch]
2020-10-13 21:04:47 -04:00
arciel rekman
e1db3cb334 Don't include commented out defines in the preprocessed code by default.
- Defines will still be there if we're dumping the shader code for debug.
- This makes the code less unique in general case and also avoids unnecessary works that no one sees.

#rb Lukas.Hermanns
[FYI] Lukas.Hermanns, Rolando.Caloca


#ROBOMERGE-SOURCE: CL 11311362 via CL 11311438
#ROBOMERGE-BOT: (v653-11302973)

[CL 11311455 by arciel rekman in Main branch]
2020-02-10 16:07:53 -05:00
Rolando Caloca
bbb9564388 Copying //UE4/Dev-RenderPlat-Staging@11110326 to //UE4/Main
#rb none
#rnx

[CL 11110369 by Rolando Caloca in Main branch]
2020-01-24 18:07:01 -05:00
ryan durand
471d972e62 Updating copyright for Engine Developer.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869240 via CL 10869516 via CL 10869902
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870584 by ryan durand in Main branch]
2019-12-26 15:32:37 -05:00
jack porter
1dcbbfe7e5 Report unhandled mcpp failures back to UE4 instead of asserting in SWC
#jira UE-80424
#rb None
[FYI] Lukas.Hermanns

#ROBOMERGE-SOURCE: CL 10108886 in //UE4/Release-4.24/...
#ROBOMERGE-BOT: RELEASE (Release-4.24 -> Main) (v586-10095595)

[CL 10108946 by jack porter in Main branch]
2019-11-11 21:45:54 -05:00
lukas hermanns
165d7f6ba7 Fixed crash in shader preprocessor when parsing MCPP error messages.
#rb none
[FYI] Jon.Cain, Jack.Porter, Will.Damon
#jira nona
#rnx

#ROBOMERGE-SOURCE: CL 10104388 in //UE4/Release-4.24/...
#ROBOMERGE-BOT: RELEASE (Release-4.24 -> Main) (v586-10095595)

[CL 10104393 by lukas hermanns in Main branch]
2019-11-11 17:06:26 -05:00
jack porter
a49f0a85e1 Fix for SCW crash while cooking for iOS
- Added error reporting to prevent future silent mcpp failures
- Merged CL 9919664 from //UE4/Dev-Rendering to Release-4.24, Fixes compiler warnings in MCPP and made main arguments a dynamic array when MAX_OPTIONS is exceeded.
#jira UE-80424
#rb Dmitriy.Dyomin
[FYI] Lukas.Hermanns

#ROBOMERGE-SOURCE: CL 10092550 in //UE4/Release-4.24/...
#ROBOMERGE-BOT: RELEASE (Release-4.24 -> Main) (v574-10069753)

[CL 10092553 by jack porter in Main branch]
2019-11-11 05:58:53 -05:00