Commit Graph

140 Commits

Author SHA1 Message Date
dan elksnitis
29eff27476 [shaders] build fixes
#preflight none
#rb trivial

[CL 25317313 by dan elksnitis in ue5-main branch]
2023-05-03 10:28:59 -04:00
dan elksnitis
b52faed5d5 [shaders]
- add new IShaderFormat API for separate preprocessing and compilation; backends can implement one or the other depending on the return value of SupportsIndependentPreprocessing
- add support for executing preprocessing in the cook process prior to job submission and constructing job input hashes based on preprocessed source (and a subset of the environment used as compile inputs). controlled by a cvar for now and disabled by default
- add a BaseShaderFormat class in ShaderCompilerCommon which implements common behaviour for output of debug data - note this function is only called for formats which support independent preprocessing, so is expected to be used only by formats which have been converted to use this API
- add new cvars for output of some additional shader debug data - 1. a txt file containing the input hash a.k.a. job cache key 2. a text file containing all diagnostic messages (errors and warnings) for the job
- minor change to how input hashes are constructed for pipeline jobs - sum hashes as 256-bit ints instead of adding to a buffer and re-hashing. faster and simpler, and also more collision resistant (sum of two well distributed hashes equally well distributed)

#rb Jason.Nadro
#rb Yuriy.ODonnell
#preflight 64512c88c86798f650b953d3

[CL 25317218 by dan elksnitis in ue5-main branch]
2023-05-03 10:17:48 -04:00
dan elksnitis
476f6b5335 [shaders]
- add a debug info flags enum/field to indicate which shader debug outputs are desired
- change direct compile txt file mechanism to use this (more options will be added in the near future)
- rename the field on the debug info dump options which indicates that the direct compile file should be skipped to bSourceOnly (when addtional outputs are added these should be skipped as well)

#preflight 6447f6c4b208f61af876e215
#rb Jason.Nadro
#rb Massimo.Tristano

[CL 25183084 by dan elksnitis in ue5-main branch]
2023-04-25 12:45:20 -04:00
dan elksnitis
d934fe3be0 [shaders] move ShaderParameterParser & some related functions to RenderCore so it can be used in the core shader compilation code (forthcoming change requires this)
#preflight 643eda5473470c177c27590d
#rb Yuriy.ODonnell
#rb Christopher.Waters

[CL 25106284 by dan elksnitis in ue5-main branch]
2023-04-19 10:32:12 -04:00
dan elksnitis
5a98357ef7 [shaders] minor change to shader parameter parser parsed param struct to store member data inline rather than a pointer (precursor change to adding serialization to this type)
#preflight 643e9f77a35280ed4f238109
#rb Christopher.Waters

[CL 25085579 by dan elksnitis in ue5-main branch]
2023-04-18 10:06:12 -04:00
christopher waters
ae1bd451f9 Bindless Resources
- Adding correct handling for bindless uniform buffer parameters.
- Reworking RHITextureReference creation to allow the RHI to create them differently, especially with bindless views.
- Adding RHITextureReference bindless view updates to D3D12RHI.

#jira UE-162014
#rb mihnea.balta, jeannoe.morissette
#preflight 642dba03c6769c6082f592f6

[CL 24936647 by christopher waters in ue5-main branch]
2023-04-05 17:03:17 -04:00
Laura Hermanns
cbc4db6343 Minor improvements in shader backends.
#rb Dan.Elksnitis
#jira none
#preflight 642ad56dc6769c6082ade6cf
#rnx

[CL 24892320 by Laura Hermanns in ue5-main branch]
2023-04-03 10:17:45 -04:00
Charles deRousiers
93a0362053 Fix non-determinism in ShaderPrint hashes.
#rb none
#jira UE-181440
#preflight 642472cf803cb466e8c99241
#fyi dan.elksnitis

[CL 24841311 by Charles deRousiers in ue5-main branch]
2023-03-29 14:23:30 -04:00
jeannoe morissette
29f4674898 VulkanRHI: Move to UE::RHICore::SetResourcesFromTables to match other RHIs.
#rb Mihnea.Balta
#preflight 640a3ffed778f88975c84441
#rnx

[CL 24581810 by jeannoe morissette in ue5-main branch]
2023-03-09 15:58:42 -05:00
benjamin rouveyrol
083a8df6f3 StructuredBuffer stride validation: some platforms use the SRV's stride instead of the declared HLSL type to index in structured buffers. This should allow us to catch issues like UE-177214 or UE-178039 by running with -rhivalidation
#rb mihnea.balta
#preflight 6407abb7fb10f393c210ce82
#jira UE-178276
#rnx

[CL 24572578 by benjamin rouveyrol in ue5-main branch]
2023-03-09 03:03:11 -05:00
dan elksnitis
2834fb7c85 [shaders] strip out some 5.2 deprecations
#rb Jason.Nadro
#preflight 63d9227ecf52968117a45f9a

[CL 23926994 by dan elksnitis in ue5-main branch]
2023-01-31 10:14:30 -05:00
Yuriy ODonnell
e5d4d76bed ShaderMinifier - Add basic namespace support
* Track namespaces for symbols
* Re-emit namespace scopes
* Conservatively include symbols from all namespaces in minified code (as if they were all global)
* Additional parsing work will be required to more accurately track used symbols based on active namespaces (i.e. handle `using` keyword, etc.)
* Added RemoveDeadCode() overload that takes an explicit list of required symbols instead of just an entry point name

#rb dan.elksnitis
#preflight 6398be5e35203bc7aa7f9b47

[CL 23494729 by Yuriy ODonnell in ue5-main branch]
2022-12-13 13:42:42 -05:00
yuriy odonnell
a9591ee1e1 ShaderMinifier - Disable some of the debug features by default
#rb none (trivial)
#preflight skip

[CL 23385508 by yuriy odonnell in ue5-main branch]
2022-12-04 02:56:30 -05:00
christopher waters
85bd9bb007 Moving ShaderSymbolExport implementation into its own compilation unit.
#jira none
#rb matt.peters
#preflight 637d24918b12eb83a7ddea74

[CL 23241530 by christopher waters in ue5-main branch]
2022-11-22 16:14:14 -05:00
dan elksnitis
a3253bae46 [shaders] tiny change to allow skipping output of directcompile.txt file ignoring bool in compile input (used in some forthcoming debug code which dumps extra copies of preprocessed shader code and doesn't need these)
#preflight 6377fcab8b12eb83a7e6e3d1
#rb Jason.Nadro

[CL 23235560 by dan elksnitis in ue5-main branch]
2022-11-22 10:25:53 -05:00
matt peters
df72d2d4e9 ShaderCompilerCommon: Fix missing symbols in monolithic editor build due to spurious inline keyword in on function definition.
#rb None, trivial
#rnx
#preflight None, fixing build break

[CL 23212668 by matt peters in ue5-main branch]
2022-11-18 20:36:49 -05:00
Matt Peters
3fc09ce67b Multiprocess editor support: Add the parameter -MultiprocessId=<N> to allow instances of the engine to have a unique id in their group of multiprocess instances.
MPCook and Shaders: Change ShaderSymbolExport to export to different .zip files when in a -MultiprocessId environment.
Add part of the implementation for merging the different zip files created by CookWorkers together. The rest of the implementation requires reading from .zip files and will be coming in a future change.

#rb Christopher.Waters, Zousar.Shaker
#rnx
#preflight 6377fcedfa348e8480e25a2b

[CL 23209604 by Matt Peters in ue5-main branch]
2022-11-18 18:47:21 -05:00
Yuriy ODonnell
398f6e6d79 ShaderMinifier - Add an option to preserve comment lines
#rb dan.elksnitis
#preflight 63630eac522c8f7ab36344e0

[CL 22943808 by Yuriy ODonnell in ue5-main branch]
2022-11-03 02:13:18 -04:00
yuriy odonnell
9de862ab0b Add UE::ShaderCompilerCommon::RemoveDeadCode() high-level wrapper for shader minifier, to be consistently used in all shader compiler back-ends
#preflight 635af3aa1b7de936a5295629
#rb jason.nadro

[CL 22850483 by yuriy odonnell in ue5-main branch]
2022-10-29 01:51:27 -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
christopher waters
93ae33e36e Fixing parsing resource types like "Texture3D < uint4 >" where the space between the type and the "<" prevented the type from being found.
#jira UE-166341
#rb yuriy.odonnell
#preflight 633f0069607039cbc1082ef0

[CL 22378331 by christopher waters in ue5-main branch]
2022-10-06 13:04:52 -04:00
Yuriy ODonnell
bdcb1cc814 Move duplicated implementations of ParseRayTracingEntryPoint() to ShaderCommon module
#preflight 631a28a0967ffc68fbe3d8a7
#rb jason.nadro

[CL 21900443 by Yuriy ODonnell in ue5-main branch]
2022-09-08 15:20:52 -04:00
christopher waters
bd14aa177e Moving bindless resource count validation into the new UE::ShaderCompilerCommon::ValidatePackedResourceCounts
#jira UE-161950
#rb kenzo.terelst, yuriy.odonnell
#preflight 6307a0d03703fd9528673032

[CL 21567446 by christopher waters in ue5-main branch]
2022-08-25 13:02:21 -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