Commit Graph

367 Commits

Author SHA1 Message Date
Yuriy ODonnell
f204ba5ed7 Suppress false positive static analysis warning
#jira UE-208257

[CL 31850131 by Yuriy ODonnell in ue5-main branch]
2024-02-27 15:05:14 -05:00
Yuriy ODonnell
5b6b5d7c68 Handle line directives in ShaderMinifier ExtractBlock()
#rb Laura.Hermanns
#jira none

[CL 31714435 by Yuriy ODonnell in ue5-main branch]
2024-02-21 22:32:37 -05:00
laura hermanns
623800cc99 [Shaders] Forward CFLAG_WarningsAsErrors to DXC compiler in SPIR-V backends.
This affects Vulkan, Metal, GLES, and SPIR-V based platform backends.
Warnings will not be treated as errors for intermediate shader code, such as the one generated by the HLSL rewriter for dead-code removal.

#rnx
#rb carl.lloyd, massimo.tristano

[CL 31645356 by laura hermanns in ue5-main branch]
2024-02-20 10:23:08 -05:00
steve robb
f8d47335a4 Replaced RemoveAt(N, 1, EAllowShrinking::*) with RemoveAt(N, EAllowShrinking::*).
[CL 31626444 by steve robb in ue5-main branch]
2024-02-19 16:51:58 -05:00
laura hermanns
03110a75dc [shaders] Support _Static_assert statement in FHlslParser for HLSL2021.
_Static_assert statements (see HLSLStaticAssert.h) in HLSL were not handled in the HLSL parser used to remove unused interpolators.

#jira UE-206870
#rnx
#rb Yuriy.ODonnell

[CL 31612832 by laura hermanns in ue5-main branch]
2024-02-19 11:11:47 -05:00
carl lloyd
e8f8a7f3a0 Added support for Metal Shader Converter to Metal
- Disabled by default
    - Removed MetalDerivedData and moved shader compiler specific code to seperate files

#rb Laura.Hermanns
#jira UE-204112

[CL 31527482 by carl lloyd in ue5-main branch]
2024-02-15 13:52:17 -05:00
dan elksnitis
f66213c368 [shaders]
- modify which version of source is dumped as a debug artifact by default to be the final preprocessed source instead of the stripped version; this is more useful when debugging in directcompile mode
- re-add the dump of defines as commented code to this artifact, which was inadvertantly removed in a previous CL (bad merge)
- make the "detailed" source dump add the stripped version, and the version modified by the compile step (if it exists)
- only add the additional debug data to the stripped version (which is still something that SCW can process successfully) but remove it from the "modified" version (which typically will cause errors when running in directcompile mode)

#rb Laura.Hermanns

[CL 31354417 by dan elksnitis in ue5-main branch]
2024-02-09 15:54:26 -05:00
dan elksnitis
6f2fd10236 [shaders] remove shader compilation related code deprecated in 5.3
#rb massimo.tristano

[CL 31339246 by dan elksnitis in ue5-main branch]
2024-02-09 10:07:32 -05:00
christopher waters
064dc45490 Removing extra '\0' from files output from ShaderConductor.
DxcCreateBlob apparently force adds this on creation of strings, so we need to account for that when creating a view of the result.

#rb dan.elksnitis, Laura.Hermanns

[CL 31311047 by christopher waters in ue5-main branch]
2024-02-08 18:28:52 -05:00
dan elksnitis
a1e2aceb07 [shaders] add additional data (serialized env, cmdline, etc) to all copies of source dumped when "detailed source" debug dump option is enabled
#rb Jeremy.Moore

[CL 31293804 by dan elksnitis in ue5-main branch]
2024-02-08 11:35:29 -05:00
jeremy moore
adb1c39e21 Add workgraph node support to shader minifier.
Missing functionality was that node functions can have a NodeID that is used to reference them.
The NodeID is set in an attribute on the function.
The fix is to always extract identifiers from function attributes.
This could be made more conservative by special casing to only NodeID function attributes. I'm not sure if the added complexity is worth it.
Note also that this works for node arrays, but doesn't remove out of array references when the NodeArraySize attribute is used. That is quite a special case though (different array slices from a shared array definition).
#rb Yuriy.ODonnell
#jira UE-206206

[CL 31277592 by jeremy moore in ue5-main branch]
2024-02-07 18:41:32 -05:00
graham wihlidal
28229f90c0 Fixed some additional ISA issues by adding v_fmaak_f32, v_fmamk_f32, v_fmamk_f16, and v_fmaak_f16 to the trailing literal check
[FYI] rune.stubbe, brian.karis, jian.ru, jamie.hayes, luke.thatcher

[CL 31164583 by graham wihlidal in ue5-main branch]
2024-02-04 18:31:55 -05:00
graham wihlidal
592a890924 Fixed RDNA2 disassembler to correctly handle v_madak_f32 and v_madmk_f32 advancing with a trailing literal
[FYI] rune.stubbe, brian.karis, john.huelin, jian.ru, jamie.hayes

[CL 31148557 by graham wihlidal in ue5-main branch]
2024-02-02 18:37:10 -05:00
steve robb
f43fc1d782 Fixed up more bool-taking calls to take EAllowShrinking instead.
[CL 30894388 by steve robb in ue5-main branch]
2024-01-25 14:09:12 -05:00
steve robb
f029468598 Fixed up a lot of bool-taking container resize functions to take EAllowShrinking instead.
[CL 30729174 by steve robb in ue5-main branch]
2024-01-19 16:41:35 -05:00
aris theophanidis
8ae2292282 Remove Compression.h from CoreMinimal.h
It's about 1/4 of CoreMinimal.h but rarely needed (Compression.h pulls on CriticalSection.h and Map.h that are costly).
#rb Yoan.StAmant

[CL 30683417 by aris theophanidis in ue5-main branch]
2024-01-18 09:56:55 -05:00
yuriy odonnell
a09c23c4f6 ShaderMinifier - Use memstack for various temporary allocations
#jira UE-203990
#rb Jason.Nadro

[CL 30647996 by yuriy odonnell in ue5-main branch]
2024-01-16 17:45:20 -05:00
dan elksnitis
89776aba21 [shaders] add ANSICHAR path for FShaderSource and enable by default
#rb Yuriy.ODonnell, Laura.Hermanns
#jira UE-196110

[CL 30632304 by dan elksnitis in ue5-main branch]
2024-01-16 09:15:51 -05:00
dan elksnitis
f230a0d2d0 [shaders] shaderconductorcontext improvements:
- add support to shaderconductor to load shader source from a FAnsiStringView
- remove internal string conversion helpers in favour of using FAnsiString
- don't make copies of input strings if they are provided in ANSI format

#rb Laura.Hermanns

[CL 30594203 by dan elksnitis in ue5-main branch]
2024-01-12 11:06:50 -05:00
dan elksnitis
9bcbc546f7 [shaders] fix minifier test inputs to include simd padding
#rb Yuriy.ODonnell
#jira UE-203438

[CL 30567118 by dan elksnitis in ue5-main branch]
2024-01-11 09:14:09 -05:00
graham wihlidal
74a234bb5d RDNA disassembler fixes
**
- Support for DS instructions
- Fixed DS microcode format
- Added missing instructions

#rb Rune.Stubbe
#fyi brian.karis, yuriy.odonnell, dan.elksnitis, luke.thatcher
#jira none

[CL 30513791 by graham wihlidal in ue5-main branch]
2024-01-09 14:57:00 -05:00
dan elksnitis
3dacd52109 [shaders] add support for single byte char path for minifier simd optimizations
#rb Yuriy.ODonnell
#jira UE-196110

[CL 30393653 by dan elksnitis in ue5-main branch]
2023-12-19 08:59:03 -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
be1f64ef8d [shaders] remove unused remnants of TEXT macro parsing code
#rb massimo.tristano

[CL 30214077 by dan elksnitis in ue5-main branch]
2023-12-08 12:36:13 -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