// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "HAL/Platform.h" #include "MuR/Image.h" #include "MuR/Operations.h" #include "MuR/Ptr.h" #include "MuR/RefCounted.h" #include "MuT/AST.h" namespace mu { struct FProgram; struct FProxyFileContext; /** A constant mesh, image, volume or layout. */ class ASTOpConstantResource final : public ASTOp { private: //! TSharedPtr LoadedValue; Ptr Proxy; //! Value hash uint64 ValueHash; //! We tried to link already but the result is a null op. bool bLinkedAndNull = false; public: //! Type of constant EOpType Type; /** Source data descriptor. */ FSourceDataDescriptor SourceDataDescriptor; public: ~ASTOpConstantResource() override; // Own interface //! Get a hash of the stored value. uint64 GetValueHash() const; //! Get a pointer to the stored value. TSharedPtr GetValue() const; /** Set the value to store in this op. * If the DiskCacheContext is not null, the disk cache will be used. */ void SetValue(const TSharedPtr& Value, FProxyFileContext* DiskCacheContext); // ASTOp interface virtual EOpType GetOpType() const override { return Type; } virtual void ForEachChild(const TFunctionRef) override; virtual bool IsEqual(const ASTOp& otherUntyped) const override; virtual Ptr Clone(MapChildFuncRef mapChild) const override; virtual uint64 Hash() const override; virtual void Link(FProgram& program, FLinkerOptions*) override; virtual FImageDesc GetImageDesc(bool, class FGetImageDescContext*) const override; virtual void GetBlockLayoutSize(uint64 BlockId, int32* pBlockX, int32* pBlockY, FBlockLayoutSizeCache* cache) override; virtual void GetLayoutBlockSize(int32* pBlockX, int32* pBlockY) override; virtual bool GetNonBlackRect(FImageRect& maskUsage) const override; virtual bool IsImagePlainConstant(FVector4f& colour) const override; virtual Ptr GetImageSizeExpression() const override; virtual FSourceDataDescriptor GetSourceDataDescriptor(FGetSourceDataDescriptorContext*) const override; virtual EClosedMeshTest IsClosedMesh(TMap* Cache) const override; }; }