Commit Graph

368 Commits

Author SHA1 Message Date
stu mckenna
8ae75bcbb6 [Backout] - CL33681066
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL33671805
[FYI] stu.mckenna
Original CL Desc
-----------------------------------------------------------------
- Fix for AddUsedInputMembers having inverted source / destination for arrays

#rb Laura.Hermanns

[CL 33726075 by stu mckenna in ue5-main branch]
2024-05-17 11:55:38 -04:00
bob tellez
6aeccfaf4e [Backout] - CL33671805
[FYI] stu.mckenna
Original CL Desc
-----------------------------------------------------------------
- Fix for AddUsedInputMembers having inverted source / destination for arrays

#rb Laura.Hermanns

[CL 33681068 by bob tellez in ue5-main branch]
2024-05-16 03:24:36 -04:00
stu mckenna
da68d46d3d - Fix for AddUsedInputMembers having inverted source / destination for arrays
#rb Laura.Hermanns

[CL 33671939 by stu mckenna in ue5-main branch]
2024-05-15 17:38:28 -04:00
aleksander netzel
d33a06efeb HWRT: Reducing RHI_RAYTRACING throughout the engine - Editor
#jira UE-213513

[CL 33441267 by aleksander netzel in ue5-main branch]
2024-05-03 19:21:04 -04:00
laura hermanns
ca07d105fc [Shaders] Remove unused state in FShaderConductorContext and ignore unknown attributes in shader backends.
This adds "-Wno-unknown-attributes" to DXC backends and platform specific compiler argument to their respective backend.

#rnx
#rb Yuriy.ODonnell

[CL 33437776 by laura hermanns in ue5-main branch]
2024-05-03 17:13:42 -04:00
chris kulla
5a8a0f7811 HLSL Parser: Add support for C99 style _Pragma statements
This alternative style of pragma is useful for emitting pragmas from macros.

Since these pragmas take strings as their arguments, improve the support for parsing string constants to deal with escaped characters.

Add some examples of this to the unit tests

#rb Jason.Nadro

[CL 33435643 by chris kulla in ue5-main branch]
2024-05-03 16:18:22 -04:00
laura hermanns
7a0927103c [Shaders] Remove last remaining use case of DXC rewriter in MetalCompileShaderMSC and deprecate RewriteHlsl.
#rnx
#rb carl.lloyd, dan.elksnitis

[CL 33279539 by laura hermanns in ue5-main branch]
2024-04-26 17:10:10 -04:00
zach bethel
0674d30d69 Added SRVNonPixel, SHADER_PARAMETER_RDG_NON_PIXEL_SRV, and modified RDG_TEXTURE_ACCESS to support texture subresources.
- SRVNonPixel is needed by mobile to insert a barrier between fragment -> vertex texture fetch, but since this is a heavyweight barrier, it is opt-in with SHADER_PARAMETER_RDG_NON_PIXEL_SRV.
 - Small refactor to FRDGTextureAccess to allow for arbitrary subresources, as the current model only allows full resource transitions.

#rb mihnea.balta, luke.thatcher, serge.bernier
#jira UE-211883

[CL 33179861 by zach bethel in ue5-main branch]
2024-04-23 17:02:48 -04:00
jeremy moore
ba42a867b2 #jira UE-209673
Split Work Graph shaders into multiple frequencies.
This is somewhat in anticipation of graphic nodes.
But also it is a replacement for using CFLAG_WorkgraphLocalNodes to differentiate nodes with local or global root signature.
#rb Yuriy.ODonnell

[CL 33146442 by jeremy moore in ue5-main branch]
2024-04-22 14:59:28 -04:00
john huelin
7121101cd8 SDK (1): Changes in common code needed to support SDK changes on some platforms
#rb Wojciech.Krywult

[CL 32855114 by john huelin in ue5-main branch]
2024-04-10 09:49:42 -04:00
dan elksnitis
b7bd62a7c5 [shaders]
- strip old job cache path (constructing an input hash based on all inputs); the cache key based on preprocessed source is now the One True Job Cache
- strip parallelfor-based job submission path (gamethread-blocking); the task path has been enabled for a long while now without issues
- remove the "compile job inputs" debug dump; this is no longer relevant since it's based on inputs to the now-stripped compile job path (similar functionality will be provided by the new form of debug usf once completed)

#rb Laura.Hermanns

[CL 32825320 by dan elksnitis in ue5-main branch]
2024-04-09 10:29:26 -04:00
christopher waters
dd2f49d25c Adding RHIResourceCollection RHI resource type which can store bindless indices in a buffer.
#rb Luke.Thatcher

[CL 32764889 by christopher waters in ue5-main branch]
2024-04-05 13:22:22 -04:00
dan elksnitis
1d261111ce [shaders]
- modify the input hash debug dump mechanism to output an empty "debughash_<hash>" file instead of a txt file with the hash in contents, and always dump these files for the instance of the job that actually compiled
- the existing cvar will now just make it so these files are also dumped for jobs which hit in DDC or the job cache; we don't do this by default so there's only a single match for the debug hash for any given shader normally and it is inside the folder containing the full debug info, including those artifacts which are only output as a side effect of the compile step
- add the same hash as the first line in the stripped source code, so "debughash_<hash>" can be used as a search term in Everything to quickly find debug info associated with a shader (i.e. when looking at a capture in renderdoc or similar)

note: this is a resubmit with fixes for mac/linux issues (avoiding printfs and using string builders instead; since wchar_t and TCHAR are not the same size on these platforms using %ls does not work), and a further fix for problems encountered with source compression when using wide chars in preprocessing instead of ansi chars.

#rb Laura.Hermanns
#jira UE-209753

[CL 32542773 by dan elksnitis in ue5-main branch]
2024-03-27 10:15:04 -04:00
dan elksnitis
52e25ae283 [Backout] - CL32436224
[FYI] dan.elksnitis
Original CL Desc
-----------------------------------------------------------------
[shaders]
- modify the input hash debug dump mechanism to output an empty "debughash_<hash>" file instead of a txt file with the hash in contents, and always dump these files for the instance of the job that actually compiled
- the existing cvar will now just make it so these files are also dumped for jobs which hit in DDC or the job cache; we don't do this by default so there's only a single match for the debug hash for any given shader normally and it is inside the folder containing the full debug info, including those artifacts which are only output as a side effect of the compile step
- add the same hash as the first line in the stripped source code, so "debughash_<hash>" can be used as a search term in Everything to quickly find debug info associated with a shader (i.e. when looking at a capture in renderdoc or similar)

#rb Laura.Hermanns
#jira UE-209753

[CL 32448284 by dan elksnitis in ue5-main branch]
2024-03-22 16:19:02 -04:00
dan elksnitis
82e140d0c5 [shaders]
- modify the input hash debug dump mechanism to output an empty "debughash_<hash>" file instead of a txt file with the hash in contents, and always dump these files for the instance of the job that actually compiled
- the existing cvar will now just make it so these files are also dumped for jobs which hit in DDC or the job cache; we don't do this by default so there's only a single match for the debug hash for any given shader normally and it is inside the folder containing the full debug info, including those artifacts which are only output as a side effect of the compile step
- add the same hash as the first line in the stripped source code, so "debughash_<hash>" can be used as a search term in Everything to quickly find debug info associated with a shader (i.e. when looking at a capture in renderdoc or similar)

#rb Laura.Hermanns
#jira UE-209753

[CL 32436259 by dan elksnitis in ue5-main branch]
2024-03-22 11:55:53 -04:00
jeremy moore
68da7d83e1 ShaderMinifier fix to prevent presence numthreads attribute pulling in all other functions with numthreads attribute.
This regression happened when we added extraction of identifiers from attributes.
That is specifically needed for extracting name from a NodeID attribute.
To fix we now treat NodeID attributes as their own block type.
[FYI] Yuriy.ODonnell

[CL 32368430 by jeremy moore in ue5-main branch]
2024-03-20 11:50:18 -04:00
laura hermanns
0dddfc208e [DXC] Revert temporary fix in DXC and integrate public fix. Reverts CL 32280203.
- Cherry pick commit 11ee8de from GitHub to fix issue with constant evaluation of intrinsics with LitFloat arguments.
- Disable assertion of function overloading for LitFloat types.
- Rebuilt DXC for Win64, Mac, Linux.
- Revert temporary UBA fix and use DXC binary hasing again for DDC key.

#rb Dan.Elksnitis
[FYI] Graham.Wihlidal, Yuriy.Odonnell, Florin.Pascu, Henrik.Karlsson
#rnx

[CL 32335434 by laura hermanns in ue5-main branch]
2024-03-19 15:20:21 -04:00
matthew sorrels
b1018568f8 Fix crash when cooking Android OpenGLES on Linux by replacing swscanf based parser with native FindNextHLSLDefinitionOfType
#jira UE-205727
#rnx
#rb dan.elksnitis, Dmitriy.Dyomin, Florin.Pascu

[CL 32299451 by matthew sorrels in ue5-main branch]
2024-03-18 10:05:42 -04:00
laura hermanns
4b6652e7dc [DXC] Fix CIS build issue with DXC by interpreting float-literals as float instead of double.
- Interpret floating-point literlas as 'float'-type instead of 'double'-type in ASTContext.
- Integrated missing fix in DeclPrinter.cpp that was accidentally reverted during GitHub merge.

#rnx
#rb graham.wihlidal
[FYI] Yuriy.Odonnell, Dan.Elksnitis, Chris.Kulla, Massimo.Tristano

[CL 32280236 by laura hermanns in ue5-main branch]
2024-03-15 14:37:03 -04:00
christopher waters
07a7863d21 HlslParser improvements
- Adding support for templated function return types (Texture2d<float> etc)
- Adding support for ignoring empty statements (ie a ";" without code before it)

#rb Laura.Hermanns

[CL 32263255 by christopher waters in ue5-main branch]
2024-03-14 18:44:20 -04:00
laura hermanns
815e1b4690 [DXC] Temporarily disable DXC versioning to fix new DXC version with UBA.
"ImageGetDigestStream" is used to hash the dxcompiler.dll and dxil.dll files to detect outdated SCW builds. This function is buggy on POSIX/Wine, which is used in UBA and causes all shader complations through DXC to fail.

#rb Yuriy.Odonnell
[FYI] Henrik.Karlsson, Dan.Elksnitis
#rnx

[CL 32262207 by laura hermanns in ue5-main branch]
2024-03-14 18:08:57 -04:00
christopher waters
4ecaa5b7ef Fixing _Static_assert parsing.
- _Static_assert should be handled on the global scope.
- GetCurrentToken() doesn't advance to the next token, you have to PeekToken() and then MatchToken.
- No output was written on successful parsing of _Static_assert
- Removing debug assert when writing static_assert code back out.

#rb Laura.Hermanns

[CL 32250433 by christopher waters in ue5-main branch]
2024-03-14 13:31:50 -04:00
christopher waters
cd0d92d515 Moving copy-pasted code into ShaderCompilerCommon.
#rb dan.elksnitis, jeannoe.morissette

[CL 32215186 by christopher waters in ue5-main branch]
2024-03-13 11:33:04 -04:00
dan elksnitis
8906e7ca0b [shaders] further fixes for debug dump artifacts. if the shader format modifies source, ensure that is output as the <ShaderTypeName>.usf file as .bat files for invoking platform compiler directly use this version; in this case we output the directcompile-compatible version with a "_DirectCompile" suffix attached. For backends that don't modify source (i.e. don't set the ModifiedShaderSource field on the output struct) just output the directcompile-compatible version as the single <ShaderTypeName>.usf file (CL also includes cosmetic changes to suffix the dumped .usf files instead of prefixing, to avoid needing extra logic to combine prefixes when the backend already adds its own)
#rb christopher.waters
#jira UE-208327

[CL 32211196 by dan elksnitis in ue5-main branch]
2024-03-13 09:31:38 -04:00
jeremy moore
804418158d #jira UE-206245, UE-206247
Add basic DX12 Work Graph support.
For this first pass there is no exposed RHI functionality for directly dispatching a work graph. Instead shader bundles have been extended to support a work graph based implementation.
Nanite compute materials now can use work graph shader bundles on D3D12 when r.Nanite.AllowWorkGraphMaterials and r.Nanite.Bundle.Shading are both set. Both of these default to off at the moment.
Also DataDrivenPlatformInfo now expose bSupportsWorkGraphs. This is false everywhere, but will be enabled for D3D12_SM6 as soon as we have the latest DXC shader compiler with lib_6_8 support submitted.
#rb Kenzo.Terelst, Yuriy.ODonnell

[CL 32196717 by jeremy moore in ue5-main branch]
2024-03-12 18:42:09 -04:00