Optimized function UMaterialExpression::GetInputs() with highest exclusive run-time during material translation from 19.79% to 1.79% exclusive run time.
This change caches the inputs upon expression creation by default and return a TArrayView instead of always creating a new transient dynamic array. The optimization also simplifies code for some Expression types.
Also optimized ContainsInputLoopInternal() to use a linked list of stack allocated nodes instead of Pushing/Popping from a dynamic array.
#rb jason.nadro
#preflight 6478b849c26e3b2449ff8608
[CL 25735070 by massimo tristano in ue5-main branch]
[FYI] massimo.tristano
Original CL Desc
-----------------------------------------------------------------
Optimizations in Material translation code amounting to 50% speed up.
Optimized function UMaterialExpression::GetInputs() with highest exclusive run-time during material translation from 19.79% to 1.79% exclusive run time.
This change caches the inputs upon expression creation by default and return a TArrayView instead of always creating a new transient dynamic array. The optimization also simplifies code for some Expression types.
Also optimized ContainsInputLoopInternal() to use a linked list of stack allocated nodes instead of Pushing/Popping from a dynamic array.
#rb jason.nadro
#preflight 64776ef44a277ca8f0b9a538
[CL 25722294 by massimo tristano in ue5-main branch]
Optimized function UMaterialExpression::GetInputs() with highest exclusive run-time during material translation from 19.79% to 1.79% exclusive run time.
This change caches the inputs upon expression creation by default and return a TArrayView instead of always creating a new transient dynamic array. The optimization also simplifies code for some Expression types.
Also optimized ContainsInputLoopInternal() to use a linked list of stack allocated nodes instead of Pushing/Popping from a dynamic array.
#rb jason.nadro
#preflight 64776ef44a277ca8f0b9a538
[CL 25722174 by massimo tristano in ue5-main branch]
Tested compiling fortnite, unrealeditor, lyra, qagame with non-unity/pch
#preflight 63635997876630122adeab9f
#rb none
[CL 22958990 by henrik karlsson in ue5-main branch]
Sparse Volume Texture asset from imported OpenVDB (only a single float channel for now). Static or animated sequence.
It will be possible to generate SVT at runtime from GPU later.
Using FEditorBulkData for handling raw source without loading everything when not caching or cooking.
BulkData used at runtime for loading. No streaming yet.
Importer with dependency on OpenVDB is in a SparseVolumeTexture module only loaded when in editor
Sparse volume texture can be sampled from any materials (sample, sample parameter) and overridden on material instance and material instance dynamic.
Added support for uint in compiler (fetch from page table, see SparseVolumeTextureGetVoxelCoord)
Volume texture with u8 VirtualTextureLayerIndex!=255 (INDEX_NONE) are sparse texture. The layer index then represent what texture/attribute to sample.
#preflight https://horde.devtools.epicgames.com/job/6346a466f93be0f6345af86c
#rb Patrick.Kelly, Charles.deRousiers
[CL 22551963 by sebastien hillaire in ue5-main branch]
Also restores follow-up CLs 19973746, 19973782
FStaticParameterSet::MaterialLayers can't be deprecated, since a property with the same name is included via FStaticParameterSetRuntimeData
So instead, FMaterialLayersFunctionsRuntimeData is updated with SerializeFromMismatchedTag, to allow serializing a full FMaterialLayersFunction.
When this happens, the EditorOnly portion is stored in a separate heap allocation, and then transferred to FStaticParameterSet::EditorOnly::MaterialLayers
#preflight 626c3405e31dbb512cef1e98
[Backout] - CL19973745
#fyi bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL19964485
#fyi Ben.Ingram
Original CL Desc
-----------------------------------------------------------------
Add 'Optional' EditorOnly data for UMaterialInterface and UMaterialFunctionInterface
These are separate UObject hierarchies that store editor-only UPROPERTIES, but can be included with cooked content, which allows full editor support.
In principle, all editor-only properties could be moved over. So far, this has been limited to UMaterialExpressions, and data related to material parameters.
FStaticParameterSet, FMaterialLayersParameters, and FMaterialCachedExpressionData have all been split into separate editor-only/non-editor-only classes,
which allows the editor-only portion to be stored on the optional editor-only UObject.
#preflight 626ab21dad56c0cbbea32dc4
#rb jason.nadro, francis.hurteau
#jira FORT-463329
[CL 20043286 by Jason Nadro in ue5-main branch]
#fyi Ben.Ingram
Original CL Desc
-----------------------------------------------------------------
Add 'Optional' EditorOnly data for UMaterialInterface and UMaterialFunctionInterface
These are separate UObject hierarchies that store editor-only UPROPERTIES, but can be included with cooked content, which allows full editor support.
In principle, all editor-only properties could be moved over. So far, this has been limited to UMaterialExpressions, and data related to material parameters.
FStaticParameterSet, FMaterialLayersParameters, and FMaterialCachedExpressionData have all been split into separate editor-only/non-editor-only classes,
which allows the editor-only portion to be stored on the optional editor-only UObject.
#preflight 626ab21dad56c0cbbea32dc4
#rb jason.nadro, francis.hurteau
#jira FORT-463329
[CL 19973745 by bob tellez in ue5-main branch]
These are separate UObject hierarchies that store editor-only UPROPERTIES, but can be included with cooked content, which allows full editor support.
In principle, all editor-only properties could be moved over. So far, this has been limited to UMaterialExpressions, and data related to material parameters.
FStaticParameterSet, FMaterialLayersParameters, and FMaterialCachedExpressionData have all been split into separate editor-only/non-editor-only classes,
which allows the editor-only portion to be stored on the optional editor-only UObject.
#preflight 626ab21dad56c0cbbea32dc4
#rb jason.nadro, francis.hurteau
#jira FORT-463329
[CL 19964485 by Ben Ingram in ue5-main branch]
- SubmitCompileJobs was assumed to be render thread only. Make this explicit in the function name and add a render thread check.
- Add SubmitCompileJobs_GameThread to perform shader compilation submitted from the Game Thread safe.
- Keep a ref to a GameThreadPendingCompilerEnvironment because the one on the GameThreadShaderMap goes away after we clone.
- Add render thread check to GetRuntimeVirtualTextureOutputAttibuteMask_RenderThread
- Move simple enum types from ShaderCompiler.h to ShaderCompilerCore.h so we can access EShaderCompileJobPriority in MaterialShared.h
- Fixup incorrect usage SubmitCompileJobs that was submitted from the Game Thread using the Render Thread maps.
#rb Ben.Ingram
#jira none
#preflight 6216879fdb60b6b592f1d97f
[CL 19098715 by Jason Nadro in ue5-main branch]
- Made sure we don't call MarkPackageDirty from non game threads as its not threadsafe.
- Update the texture sampler sampling types during the factory PreImportPreCompleted callback so that we have the correct sampling type for textures that are being upgraded to virtual.
- Fixed some issues with material creation where we had some early returns in functions that shouldn't.
#preflight 61f4653ce52a8a4a91ce060d
[CL 18779420 by JeanMichel Dignard in ue5-main branch]
- This is important when running with "compile what you use" ODSC in the editor.
#rb Arciel.Rekman
#preflight 61f1a50cf8088a3d2991c8b1
#ROBOMERGE-AUTHOR: jason.nadro
#ROBOMERGE-SOURCE: CL 18752861 in //UE5/Release-5.0/... via CL 18752866 via CL 18756837
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)
[CL 18757118 by jason nadro in ue5-main branch]
This is fine, because materials will refresh the stateID of any dependent MF when loaded, and use updated stateIDs to form the ShaderMapID
#rb arciel.rekman, jason.nadro
#preflight 6125576daf9a8f0001510587
#ROBOMERGE-SOURCE: CL 17294061 via CL 17294075
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)
[CL 17294091 by ben ingram in ue5-release-engine-test branch]