Commit Graph

690 Commits

Author SHA1 Message Date
graham wihlidal
831fff0c59 Added CFLAG_ShaderBundle and decorated Nanite CS materials with it (some platforms can use this to build relevant data structures for internal bundle implementations).
#rb yuriy.odonnell
[REVIEW] https://p4-swarm.epicgames.net/reviews/32011926

[CL 32012726 by graham wihlidal in ue5-main branch]
2024-03-05 00:40:11 -05:00
christopher waters
15bede992d Entire engine compiling with -DisableUnity -IncludeHeaders
[CL 31778133 by christopher waters in ue5-main branch]
2024-02-23 16:51:32 -05:00
christopher waters
62f06a4bb7 Disabling PLATFORM_SUPPORTS_CONSTANTBUFFER_OBJECT for now.
We can't get usage information from reflection with this enabled, mainly for bindless, so we'll need to revisit this later.

#rb Laura.Hermanns

[CL 31741310 by christopher waters in ue5-main branch]
2024-02-22 18:32:53 -05:00
christopher waters
68308c5193 Shader statistics
- Adding utility function for easier additions to FShaderCompilerOutput::ShaderStatistics
- Simplified existing uses of FShaderCompilerOutput::ShaderStatistics
- Reworked D3D compilation to allow DXC vs FXC to specify their different shader limits.
- Adding Shader Statistics for D3D SamplerState and Resource usages.
- Adding Shader Statistics for D3D SM6.6 bindless resource usages.

#rb Jason.Nadro, Laura.Hermanns

[CL 31740056 by christopher waters in ue5-main branch]
2024-02-22 18:16:34 -05:00
josh adams
ddf367b168 - Set all *TargetPlatform.Build.cs's to set the new SDKVersionRelevantPlatforms list so that per-project SDK version overrides will compile unique versions of those modules when that platform's SDK version of overridden
[FYI] Florin.Pascu
#rb Joe.Kirchoff

[CL 31665032 by josh adams in ue5-main branch]
2024-02-20 20:01:11 -05:00
christopher waters
5a0e169c6d Getting more headers compiling solo on Win64.
#rb joe.kirchoff, henrik.karlsson

[CL 31663239 by christopher waters in ue5-main branch]
2024-02-20 18:57:35 -05:00
florin pascu
b10df2c9a1 Re-submit Desktop Platforms TP Refactor TPC/TPS Windows/Mac/Linux/WINGDK
Section Names for Windows/Mac/Linux/WindGDK will use the old names for compatibility.
#jira UE-206488
#rb Brandon.Schaefer, Josh.Adams

[CL 31522656 by florin pascu in ue5-main branch]
2024-02-15 11:46:19 -05:00
florin pascu
aa7c58b0c7 [Backout] - CL31378447
[FYI] Florin.Pascu
Original CL Desc
-----------------------------------------------------------------
Desktop Platforms TP Refactor TPC/TPS Windows/Mac/Linux/WINGDK
#jira UE-206488
#rb Brandon.Schaefer, Josh.Adams

[CL 31397940 by florin pascu in ue5-main branch]
2024-02-12 16:14:58 -05:00
florin pascu
20bd6eddc1 Desktop Platforms TP Refactor TPC/TPS Windows/Mac/Linux/WINGDK
#jira UE-206488
#rb Brandon.Schaefer, Josh.Adams

[CL 31378452 by florin pascu in ue5-main branch]
2024-02-12 06:54:43 -05:00
robert millar
69d430b79c Add synchronous version of live coding compile command for use with cmdlink tool/remote console commands in general
[CL 31067089 by robert millar in ue5-main branch]
2024-01-31 17:07:52 -05:00
arciel rekman
4c3e0b8db3 Fix inability to cook spline meshes by a cooked cooker (resubmit after backout in CL 30847866).
Cooked cooker is a relatively new platform in Unreal that allows producing a cooked editor build and using it to cook new assets (e.g. DLC for the base game). Such cooked cooker build is faster to load than the original editor build that would cook from the source assets, and it can also be more easily deployed to cloud environments.

The problem this fix is solving is as follows:

1) Spline mesh needs collision data from the static mesh it deforms. This collision data is usually derived from its render data.
2) Cooked cooker target platform (see TCookedCookerTargetPlatform) is basically a server build, assets cooked for this platform do not store render data.
3) If a new (uncooked) spline mesh is referencing a static mesh from the base build, it fails to get its collision data because the render data was stripped when producing the cooked version of the base build.

The solution is

- to introduce a new target platform feature that allows to distinguish cooked cooker target platform from other platforms that strip audio-visual data.
- when cooking static meshes for a "cooked cooker" target get a separate copy of the asset's collision data and save it inline in the cooked asset.
- inside the cooked cooker, use this copy as static mesh's collision data instead of trying to derive it from (non-existent at that point) static mesh's render data.

- James Singer reviewed the fixed change.

#rb Brian.Marshall1, Francis.Hurteau, Benn.Gallagher, James.Singer

[CL 30857184 by arciel rekman in ue5-main branch]
2024-01-24 14:43:39 -05:00
sean boocock
1229fccd3c [Backout] - CL30812030
[FYI] Arciel.Rekman
Original CL Desc
-----------------------------------------------------------------
Fix inability to cook spline meshes by a cooked cooker.

Cooked cooker is a relatively new platform in Unreal that allows producing a cooked editor build and using it to cook new assets (e.g. DLC for the base game). Such cooked cooker build is faster to load than the original editor build that would cook from the source assets, and it can also be more easily deployed to cloud environments.

The problem this fix is solving is as follows:

1) Spline mesh needs collision data from the static mesh it deforms. This collision data is usually derived from its render data.
2) Cooked cooker target platform (see TCookedCookerTargetPlatform) is basically a server build, assets cooked for this platform do not store render data.
3) If a new (uncooked) spline mesh is referencing a static mesh from the base build, it fails to get its collision data because the render data was stripped when producing the cooked version of the base build.

The solution is

- to introduce a new target platform feature that allows to distinguish cooked cooker target platform from other platforms that strip audio-visual data.
- when cooking static meshes for a "cooked cooker" target get a separate copy of the asset's collision data and save it inline in the cooked asset.
- inside the cooked cooker, use this copy as static mesh's collision data instead of trying to derive it from (non-existent at that point) static mesh's render data.

#rb Brian.Marshall1, Francis.Hurteau, Benn.Gallagher

[CL 30847941 by sean boocock in ue5-main branch]
2024-01-24 11:44:40 -05:00
arciel rekman
7cd1420836 Fix inability to cook spline meshes by a cooked cooker.
Cooked cooker is a relatively new platform in Unreal that allows producing a cooked editor build and using it to cook new assets (e.g. DLC for the base game). Such cooked cooker build is faster to load than the original editor build that would cook from the source assets, and it can also be more easily deployed to cloud environments.

The problem this fix is solving is as follows:

1) Spline mesh needs collision data from the static mesh it deforms. This collision data is usually derived from its render data.
2) Cooked cooker target platform (see TCookedCookerTargetPlatform) is basically a server build, assets cooked for this platform do not store render data.
3) If a new (uncooked) spline mesh is referencing a static mesh from the base build, it fails to get its collision data because the render data was stripped when producing the cooked version of the base build.

The solution is

- to introduce a new target platform feature that allows to distinguish cooked cooker target platform from other platforms that strip audio-visual data.
- when cooking static meshes for a "cooked cooker" target get a separate copy of the asset's collision data and save it inline in the cooked asset.
- inside the cooked cooker, use this copy as static mesh's collision data instead of trying to derive it from (non-existent at that point) static mesh's render data.

#rb Brian.Marshall1, Francis.Hurteau, Benn.Gallagher

[CL 30812215 by arciel rekman in ue5-main branch]
2024-01-23 13:58:58 -05:00
nick edwards
642f1a39bb Allow enabling/disabling LiveCoding via command line switch -LiveCoding=true|false
Useful in cases where there are multiple live coding targets, and you are only interested in having live coding enabled for one.
#rb Tim.Smith

[CL 30686790 by nick edwards in ue5-main branch]
2024-01-18 11:54:34 -05:00
maxime mercier
78714aa45a Enabling LiveCoding in UEFN
Support live coding when the BaseDir is != than the Executable path

#rb Tim.Smith

[CL 30592990 by maxime mercier in ue5-main branch]
2024-01-12 10:16:10 -05:00
yuriy odonnell
01419a8913 Add strongly typed EShaderOptionalDataKey to access shader optional data instead of adhoc characters
#rb carl.lloyd, christopher.waters, Colton.Daniels

[CL 30572888 by yuriy odonnell in ue5-main branch]
2024-01-11 13:36:32 -05:00
chris kulla
2cd6fd99d1 Shader Compiler - Propagate filename to dxc command line instead of using the same dummy name (zzz) for all shaders.
This is helpful when using a profiler such as nSight

#rb christopher.waters

[CL 30514398 by chris kulla in ue5-main branch]
2024-01-09 15:23:12 -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
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
dan elksnitis
cc7c2c54f4 [shaders] shader format preprocessing cleanup & refactoring
- move uniform buffer cleanup and dead stripping into ShaderPreprocessor module's PreprocessShader function
- add "required symbols" to compiler input struct to specify additional symbols to keep during minification aside from those specified by the entrypoint; modify API such that both an entry point string and additional symbols can be specified (to avoid each backend needing to manually parse the compound RT entry point string)
- make use of ModifyShaderCompilerInput in all backends to set additional defines and required symbols on input struct up front; only use the AdditionalDefines map in cases where it's actually necessary
- remove the various per-platform defines for enabling minifier, no longer required now that this has been rolled out for all backends
- fix SCW directcompile mode; this had rotted due to pieces of the FShaderCompilerEnvironment having been added that weren't explicitly serialized to either cmdline or in the shader source. this now serializes as a base64 string written inside the USF containing all portions of the environment required for compilation (using the same serialization function as is used to write/read the SCW input file)
- use a debug flag for indicating we're in "direct compile" mode and should load the debug USF off disk, rather than the poorly named "bSkipPreprocessedCache" (this name is both inaccurate and also confusing due to the addition of the preprocessed job cache)
- modify platform "force wave32" mechanism to use a pragma directive to set a compiler define, instead of doing string replacement in the preprocessed source
- add a view version of the RT entrypoint parsing to use in preprocessing, note that other paths still need to construct fstrings due to further manipulation so keeping the FString path around too
- clean up backends manually checking the "directcompile" cmdline arg

#rb christopher.waters, Yuriy.ODonnell
#rb Chris.Waters
#rb Laura.Hermanns

[CL 30023082 by dan elksnitis in ue5-main branch]
2023-11-30 15:56:34 -05:00
christopher waters
b2f21e1cd0 D3D Bindless
- Forcing EShaderResourceUsageFlags bindless flags when bindless is enabled to avoid ping ponging issues at runtime.

#jira UE-162014
#rb dan.elksnitis

[CL 30001874 by christopher waters in ue5-main branch]
2023-11-29 18:13:23 -05:00
marc audy
a88b71c8b7 Fix/silence C4702 warnings
#rnx

[CL 29883627 by marc audy in ue5-main branch]
2023-11-22 01:04:15 -05:00
christopher waters
a58fadbd0e Removing invalid check on AutoBindingSpace. The ~0 check was leftover from a long-gone default argument.
[CL 29848711 by christopher waters in ue5-main branch]
2023-11-20 15:10:55 -05:00
jason nadro
eb817693a3 Remove redundant error logging from DXC.
- Only log a system error message if we didn't get any error messages back from the DXC error blob.

#rb Laura.Hermanns
#rnx

[CL 29810728 by jason nadro in ue5-main branch]
2023-11-17 11:58:36 -05:00
christopher waters
15bc726977 Adding Barycentrics support checks
- Adding EShaderCodeFeatures::Barycentrics
- Adding GRHIGlobals.SupportsBarycentricsSemantic
- Adding FDataDrivenShaderPlatformInfo::GetSupportsBarycentricsIntrinsics to control COMPILER_SUPPORTS_BARYCENTRIC_INTRINSICS
- Adding FDataDrivenShaderPlatformInfo::GetSupportsBarycentricsSemantic to control PLATFORM_SUPPORTS_BARYCENTRICS_SEMANTIC

#jira UE-193429
#rb graham.wihlidal, mihnea.balta

[CL 29771745 by christopher waters in ue5-main branch]
2023-11-16 00:28:03 -05:00