Navigation
API > API/Runtime > API/Runtime/Engine
This class represents the intermediate representation (IR) of a material build. The IRModule includes an IR value graph, produced through expression analysis, as well as metadata on resource usage and reflection. The IR graph serves as an abstract representation of the material and must be translated into a target backend such as HLSL or specific Preshader opcodes for execution.
This class is designed to be backend-agnostic, meaning it does not contain any HLSL code nor does it configure a MaterialCompilationOutput instance. The data stored within this class should be sufficient to enable translation to any supported backend without requiring additional processing or validation.
| Name | FMaterialIRModule |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/Materials/MaterialIRModule.h |
| Include Path | #include "Materials/MaterialIRModule.h" |
Syntax
class FMaterialIRModule
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMaterialIRModule() |
Materials/MaterialIRModule.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FMaterialIRModule() |
Materials/MaterialIRModule.h |
Structs
| Name | Remarks |
|---|---|
| FError | Represents an error encountered during material processing. |
| FStatistics | Stores information about the resources used by the translated material. |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Allocator | FMemStackBase | Memory allocator used to allocate IR data (values, payloads, etc). | Materials/MaterialIRModule.h | |
| CompilationOutput | FMaterialCompilationOutput | Compilation output data. | Materials/MaterialIRModule.h | |
| EnvironmentDefines | TSet< FName > | Environment define names for shader compilation. | Materials/MaterialIRModule.h | |
| Errors | TArray< FError > | List of compilation errors. | Materials/MaterialIRModule.h | |
| FMaterialIRModuleBuilder | friend | Materials/MaterialIRModule.h | ||
| FMaterialIRModuleBuilderImpl | friend | Materials/MaterialIRModule.h | ||
| Outputs | TArray< MIR::FSetMaterialOutput * > | Output nodes per stage. | Materials/MaterialIRModule.h | |
| ParameterIdToData | TArray< TPair< FMaterialParameterInfo, FMaterialParameterMetadata > > | Parameter metadata. | Materials/MaterialIRModule.h | |
| ParameterInfoToId | TMap< FMaterialParameterInfo, uint32 > | Maps parameter info to IDs. | Materials/MaterialIRModule.h | |
| RootBlock | MIR::FBlock * | Root blocks per stage. | Materials/MaterialIRModule.h | |
| ShaderPlatform | EShaderPlatform | Target shader platform. | Materials/MaterialIRModule.h | |
| Statistics | FStatistics | Compilation statistics. | Materials/MaterialIRModule.h | |
| UserStrings | TArray< FString > | Stores user-defined strings. | Materials/MaterialIRModule.h | |
| Values | TArray< MIR::FValue * > | List of all the IR values contained in this module. | Materials/MaterialIRModule.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddError
(
UMaterialExpression* Expression, |
Reports a translation error. | Materials/MaterialIRModule.h | |
void Empty() |
Clears the module, releasing all stored data. | Materials/MaterialIRModule.h | |
const FMaterialCompilationOutput & GetCompilationOutput() |
Retrieves the material compilation output. | Materials/MaterialIRModule.h | |
| Returns a list of all environment define names this module requires to be enabled for shader compilation. | Materials/MaterialIRModule.h | ||
TArrayView< const FError > GetErrors() |
Returns a list of errors encountered during processing. | Materials/MaterialIRModule.h | |
TArrayView< const MIR::FSetMaterialOutput *const > GetOutputs
(
MIR::EStage Stage |
Returns the material outputs for a given stage. | Materials/MaterialIRModule.h | |
const FMaterialParameterInfo & GetParameterInfo
(
uint32 ParameterId |
Retrieves parameter info for a given parameter ID. | Materials/MaterialIRModule.h | |
const FMaterialParameterMetadata & GetParameterMetadata
(
uint32 ParameterId |
Retrieves parameter metadata for a given parameter ID. | Materials/MaterialIRModule.h | |
const MIR::FBlock & GetRootBlock
(
MIR::EStage Stage |
Retrieves the root block (i.e. the "main" scope) for a specific shader stage. | Materials/MaterialIRModule.h | |
EShaderPlatform GetShaderPlatform() |
Returns the shader platform associated with this module. | Materials/MaterialIRModule.h | |
const FStatistics & GetStatistics () |
Provides access to the translated material statistics. | Materials/MaterialIRModule.h | |
FStatistics & GetStatistics () |
Provides mutable access to the translated material statistics. | Materials/MaterialIRModule.h | |
bool IsValid() |
Checks if the module is valid (i.e., contains no errors). | Materials/MaterialIRModule.h | |
const TCHAR * PushUserString
(
FString InString |
Stores a user-defined string and returns a pointer to it. | Materials/MaterialIRModule.h |