Files
UnrealEngine/Engine/Plugins/Mutable/Source/MutableTools/Private/MuT/ASTOpParameter.h
Brandyn / Techy fcc1b09210 init
2026-04-04 15:40:51 -05:00

70 lines
1.9 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "HAL/Platform.h"
#include "MuR/Image.h"
#include "MuR/Operations.h"
#include "MuR/ParametersPrivate.h"
#include "MuR/Ptr.h"
#include "MuT/AST.h"
namespace UE::Mutable::Private
{
struct FProgram;
/** Parameter operation. */
class ASTOpParameter final : public ASTOp
{
public:
//! Type of parameter
EOpType Type = EOpType::NONE;
//!
FParameterDesc Parameter;
/** Used by some parameter types (Mesh) to specify which subdata from the actual parameter value should be used in the operation. */
int32 LODIndex = 0;
int32 SectionIndex = 0;
uint32 MeshID = 0;
//** Ranges adding dimensions to this parameter. */
TArray<FRangeData> Ranges;
/** List of all the parameters that this material can be broken into. */
TArray<FString> ScalarParameterNames;
TArray<FString> ColorParameterNames;
/** Image Parameters are evaluated at runtime. */
TMap<FString, ASTChild> ImageOperations;
/** Index of the parameter in the final program parameter list.
* This is generated at link time, because the parameters may be reordered.
*/
int32 LinkedParameterIndex = -1;
public:
~ASTOpParameter() override;
// ASTOp interface.
virtual EOpType GetOpType() const override;
virtual uint64 Hash() const override;
virtual void ForEachChild(const TFunctionRef<void(ASTChild&)>) override;
virtual bool IsEqual(const ASTOp&) const override;
virtual Ptr<ASTOp> Clone(MapChildFuncRef ) const override;
virtual void Assert() override;
virtual void Link(FProgram&, FLinkerOptions*) override;
virtual int EvaluateInt(ASTOpList& Facts, bool& bOutUnknown) const override;
virtual FBoolEvalResult EvaluateBool(ASTOpList& Facts, FEvaluateBoolCache* = nullptr) const override;
virtual FImageDesc GetImageDesc(bool, FGetImageDescContext*) const override;
virtual bool IsColourConstant(FVector4f& OutColour) const override;
};
}