Commit Graph

253 Commits

Author SHA1 Message Date
Yuriy ODonnell
fc92061821 Automatic bindless resource declaration conversion step will now explicitly expand AUTO_BINDLESS_SAMPLER/RESOURCE_INDEX/VARIABLE macros
This is required because subsequent shader compilation steps assume that the code has been fully preprocessed. In particular, the dead code elimination system does not handle macros such as ones in BindlessResources.ush.

#preflight 63bef4ba6e6e8d4662ffd485
#rb christopher.waters

[CL 23649118 by Yuriy ODonnell in ue5-main branch]
2023-01-11 13:03:47 -05:00
henrik karlsson
ce587eb612 Added markups for headers that can't be compiled standalone.. this is needed for both Header units and IWYU
#preflight 63789b0c170bc34a93a869e5
#rb none

[CL 23552160 by henrik karlsson in ue5-main branch]
2022-12-21 02:46:50 -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
laura hermanns
bcf95545bd Add host machine name to OOM report in DXC backend and refactor global SCW error-code handling. Bumped ShaderCompileWorkerOutputVersion to 9.
#rb Jason.Nadro, Dan.Elksnitis, Yuriy.Odonnell, Arciel.Rekman
#preflight 638e610c255f07df8ea212f4
#rnx

[CL 23428544 by laura hermanns in ue5-main branch]
2022-12-07 10:29:08 -05:00
kate ellis
839f9f1889 [Backout] - CL23401851
[FYI] Laura.Hermanns
Original CL Desc
-----------------------------------------------------------------
Add host machine name to OOM report in DXC backend and refactor global SCW error-code handling.

#rb Jason.Nadro, Dan.Elksnitis, Yuriy.Odonnell, Arciel.Rekman
#preflight 638e610c255f07df8ea212f4
#rnx

[CL 23421737 by kate ellis in ue5-main branch]
2022-12-06 19:47:06 -05:00
laura hermanns
c17b2976f9 Add host machine name to OOM report in DXC backend and refactor global SCW error-code handling.
#rb Jason.Nadro, Dan.Elksnitis, Yuriy.Odonnell, Arciel.Rekman
#preflight 638e610c255f07df8ea212f4
#rnx

[CL 23421619 by laura hermanns in ue5-main branch]
2022-12-06 19:45:07 -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
Yuriy ODonnell
6911020bba ShaderMinifier - Fix handling of anonymous struct shader parameters
Declarations like `struct { uint Param; } Foo;` were previously incorrectly removed from code.

Also report explicit error when encountering 'namespace' keyword (which is currently unsupported)

#preflight 6387c5b1f213a116ebc18c5f
#rb dan.elksnitis

[CL 23343976 by Yuriy ODonnell in ue5-main branch]
2022-11-30 18:57:20 -05:00
Matt Peters
c9f018dced Use ZipArchiveReader to merge shader symbol zip files created during MPCook.
#rb Christopher.Waters
#rnx
#preflight 638643c47b4bd3f057981494

[CL 23313433 by Matt Peters in ue5-main branch]
2022-11-29 13:13:26 -05:00
axel riffard
105479f091 Fix Metal 3.0 shader compilation on iOS
#rb jack.porter
#jira UE-166909
#preflight 6385cd67d76995cb142c0695

[CL 23303343 by axel riffard in ue5-main branch]
2022-11-29 05:55:31 -05:00
Matt Peters
2b78f8441a ShaderSymbolExport: Rename temporary class to avoid name collision with the real class that has just been implemented.
#rb None, trivial
#rnx
#preflight None, Nottestedbypreflight

[CL 23300398 by Matt Peters in ue5-main branch]
2022-11-28 19:20:39 -05:00
matt peters
d2bb8963dd ShaderSymbolExport: Fix missing header for non-unity compile.
#rnx
#rb None, trivial
#preflight None, fixing build break

[CL 23263099 by matt peters in ue5-main branch]
2022-11-24 19:15:00 -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
f9824703c2 ShaderMinifier - Add basic test for MinifyShader, change SkipUntilNextLine to exclude new line character
#rb none (trivial)
#preflight 636068cde271e75dea59c739

[CL 22876523 by Yuriy ODonnell in ue5-main branch]
2022-10-31 21:34:29 -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
dan elksnitis
b81ae6648c [shader compilation] changes to error handling in ShaderCompileWorker
- each platform compilation request is now wrapped in __try/__except rather than a single exception handling block at the top level of the worker; this allows us to log an exception (with callstack) as a compilation error and continue the batch
- remove SEH code from ShaderConductorContext, the above makes this redundant (and it didn't provide any actionable information)
- strip down SEH code in D3DShaderCompiler; now only used for the purposes of pre-compiling with DXC in the case of an FXC crash. dumping preprocessed source will be handled in a different manner in a forthcoming CL
- minor change in the DXC precompile path to not log an unnecessary warning when performing an explicitly-requested DXC precompile

#rb Jason.Nadro
#rb Laura.Hermanns
#rb Yuriy.ODonnell
#preflight 63514c798176062ea73acb41
#jira FORT-524383

[CL 22654436 by dan elksnitis in ue5-main branch]
2022-10-20 09:43:50 -04:00
jeremy moore
4fd942ac5e Consider the minimizer to not have succeeded if it returns an empty result.
[CL 22636282 by jeremy moore in ue5-main branch]
2022-10-19 15:51:11 -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
Yuriy ODonnell
9ab9403717 ShaderMinifier - Track and output line directives
#rb Jason.Nadro
#preflight 63406dd22a0a2c1ead8d1145

[CL 22405822 by Yuriy ODonnell in ue5-main branch]
2022-10-07 14:31:38 -04:00
christopher waters
66f2a6bcc5 Make the parsed resource/sampler name be the authoritative casing of the variable names. The rest of the shader system is case insensitive but the shader code that uses the variables isn't, so we need to preserve the case we found in the shader.
#jira UE-166341
#rb Guillaume.Abadie, mihnea.balta, jeannoe.morissette
#preflight 634055772a0a2c1ead83dc02

[CL 22404161 by christopher waters in ue5-main branch]
2022-10-07 13:35:29 -04:00