CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::ShaderCompiler::StructDeclaration Struct Reference

#include <CeresEngine/Material/ShaderCompiler/AST/AST.hpp>

Inheritance diagram for CeresEngine::ShaderCompiler::StructDeclaration:
CeresEngine::ShaderCompiler::Declaration CeresEngine::ShaderCompiler::TypedAST CeresEngine::ShaderCompiler::AST

Public Types

enum  : UInt32 { isShaderInput = (1u << ( 2 )) , isShaderOutput = (1u << ( 3 )) , isNestedStruct = (1u << ( 4 )) , isNonEntryPointParam = (1u << ( 5 )) }
 
- Public Types inherited from CeresEngine::ShaderCompiler::Declaration
enum  : UInt32 { isWrittenTo = (1u << ( 0 )) , isReadFrom = (1u << ( 1 )) }
 
- Public Types inherited from CeresEngine::ShaderCompiler::AST
enum class  Types {
  Program , CodeBlock , Attribute , SwitchCase ,
  SamplerValue , Register , PackOffset , ArrayDimension ,
  TypeSpecifier , VarDeclaration , BufferDeclaration , SamplerDeclaration ,
  StructDeclaration , AliasDeclaration , FunctionDeclaration , UniformBufferDeclaration ,
  VarDeclarationStatement , BufferDeclarationStatement , SamplerDeclarationStatement , AliasDeclarationStatement ,
  BasicDeclarationStatement , NullStatement , CodeBlockStatement , ForLoopStatement ,
  WhileLoopStatement , DoWhileLoopStatement , IfStatement , ElseStatement ,
  SwitchStatement , ExpressionStatement , ReturnStatement , CtrlTransferStatement ,
  LayoutStatement , NullExpression , SequenceExpression , LiteralExpression ,
  TypeSpecifierExpression , TernaryExpression , BinaryExpression , UnaryExpression ,
  PostUnaryExpression , CallExpression , BracketExpression , ObjectExpression ,
  AssignExpression , ArrayExpression , CastExpression , InitializerExpression
}
 
enum  : UInt32 { isReachable = (1u << ( 30 )) , isDeadCode = (1u << ( 29 )) , isBuiltin = (1u << ( 28 )) }
 

Public Member Functions

 StructDeclaration (const SourcePosition &astPos)
 
 StructDeclaration (const SourceArea &astArea)
 
Types getType () const override
 
void visit (Visitor *visitor, void *args=nullptr) override
 
String toString () const override
 
bool equalsMemberTypes (const StructDeclaration &rhs, const RawFlags &compareFlags=0) const
 
bool isCastableTo (const BaseTypeDenoter &rhs) const
 
VarDeclarationfetchVarDeclaration (const String &ident, const StructDeclaration **owner=nullptr) const
 
VarDeclarationfetchBaseMember () const
 
StructDeclarationfetchBaseStructDeclaration (const String &ident)
 
FunctionDeclarationfetchFunctionDeclaration (const String &ident, const Vector< TypeDenoterPtr > &argTypeDenoters, const StructDeclaration **owner=nullptr, bool throwErrorIfNoMatch=false) const
 
String fetchSimilar (const String &ident)
 
TypeDenoterPtr deriveTypeDenoter (const TypeDenoter *expectedTypeDenoter) override
 
bool hasNonSystemValueMembers () const
 
std::size_t numMemberVariables (bool onlyNonStaticMembers=false) const
 
std::size_t numMemberFunctions (bool onlyNonStaticMembers=false) const
 
void collectMemberTypeDenoters (Vector< TypeDenoterPtr > &memberTypeDens, bool includeBaseStructs=true) const
 
void forEachVarDeclaration (const VarDeclarationIteratorFunctor &iterator, bool includeBaseStructs=true)
 
void addShaderOutputInstance (VarDeclaration *varDeclaration)
 
bool hasMultipleShaderOutputInstances () const
 
bool isBaseOf (const StructDeclaration *subStructDeclaration, bool includeSelf=false) const
 
void addFlagsRecursive (UInt32 structFlags)
 
void addFlagsRecursiveParents (UInt32 structFlags)
 
std::size_t memberVarToIndex (const VarDeclaration *varDeclaration, bool includeBaseStructs=true) const
 
VarDeclarationindexToMemberVar (std::size_t idx, bool includeBaseStructs=true) const
 
bool accumulateAlignedVectorSize (UInt32 &size, UInt32 &padding, UInt32 *offset=nullptr)
 
- Public Member Functions inherited from CeresEngine::ShaderCompiler::Declaration
virtual TypeSpecifierfetchTypeSpecifier () const
 
bool isAnonymous () const
 
- Public Member Functions inherited from CeresEngine::ShaderCompiler::TypedAST
const TypeDenoterPtrgetTypeDenoter (const TypeDenoter *expectedTypeDenoter=nullptr)
 
void resetTypeDenoter ()
 
- Public Member Functions inherited from CeresEngine::ShaderCompiler::AST
virtual ~AST ()
 
template<typename T >
Tas ()
 
template<typename T >
const Tas () const
 

Public Attributes

bool isClass = false
 
String baseStructName
 
Vector< StatementPtrlocalStatements
 
Vector< VarDeclarationStatementPtrvarMembers
 
Vector< FunctionDeclarationPtrfuncMembers
 
BasicDeclarationStatementdeclarationStatementRef = nullptr
 
StructDeclarationbaseStructRef = nullptr
 
StructDeclarationcompatibleStructRef = nullptr
 
Map< String, VarDeclaration * > systemValuesRef
 
Set< StructDeclaration * > parentStructDeclarationRefs
 
Set< VarDeclaration * > shaderOutputVarDeclarationRefs
 
- Public Attributes inherited from CeresEngine::ShaderCompiler::Declaration
Identifier ident
 
- Public Attributes inherited from CeresEngine::ShaderCompiler::AST
SourceArea area
 
RawFlags flags
 

Static Public Attributes

static const Types classType = Types:: StructDeclaration
 

Additional Inherited Members

- Static Public Member Functions inherited from CeresEngine::ShaderCompiler::AST
template<typename T >
static TgetAs (AST *ast)
 
template<typename T >
static const TgetAs (const AST *ast)
 

Member Enumeration Documentation

◆ anonymous enum

Enumerator
isShaderInput 
isShaderOutput 
isNestedStruct 
isNonEntryPointParam 

Constructor & Destructor Documentation

◆ StructDeclaration() [1/2]

CeresEngine::ShaderCompiler::StructDeclaration::StructDeclaration ( const SourcePosition astPos)
inlineexplicit

◆ StructDeclaration() [2/2]

CeresEngine::ShaderCompiler::StructDeclaration::StructDeclaration ( const SourceArea astArea)
inlineexplicit

Member Function Documentation

◆ accumulateAlignedVectorSize()

bool CeresEngine::ShaderCompiler::StructDeclaration::accumulateAlignedVectorSize ( UInt32 size,
UInt32 padding,
UInt32 offset = nullptr 
)

◆ addFlagsRecursive()

void CeresEngine::ShaderCompiler::StructDeclaration::addFlagsRecursive ( UInt32  structFlags)

◆ addFlagsRecursiveParents()

void CeresEngine::ShaderCompiler::StructDeclaration::addFlagsRecursiveParents ( UInt32  structFlags)

◆ addShaderOutputInstance()

void CeresEngine::ShaderCompiler::StructDeclaration::addShaderOutputInstance ( VarDeclaration varDeclaration)

◆ collectMemberTypeDenoters()

void CeresEngine::ShaderCompiler::StructDeclaration::collectMemberTypeDenoters ( Vector< TypeDenoterPtr > &  memberTypeDens,
bool  includeBaseStructs = true 
) const

◆ deriveTypeDenoter()

TypeDenoterPtr CeresEngine::ShaderCompiler::StructDeclaration::deriveTypeDenoter ( const TypeDenoter expectedTypeDenoter)
overridevirtual

◆ equalsMemberTypes()

bool CeresEngine::ShaderCompiler::StructDeclaration::equalsMemberTypes ( const StructDeclaration rhs,
const RawFlags compareFlags = 0 
) const

◆ fetchBaseMember()

VarDeclaration * CeresEngine::ShaderCompiler::StructDeclaration::fetchBaseMember ( ) const

◆ fetchBaseStructDeclaration()

StructDeclaration * CeresEngine::ShaderCompiler::StructDeclaration::fetchBaseStructDeclaration ( const String ident)

◆ fetchFunctionDeclaration()

FunctionDeclaration * CeresEngine::ShaderCompiler::StructDeclaration::fetchFunctionDeclaration ( const String ident,
const Vector< TypeDenoterPtr > &  argTypeDenoters,
const StructDeclaration **  owner = nullptr,
bool  throwErrorIfNoMatch = false 
) const

◆ fetchSimilar()

String CeresEngine::ShaderCompiler::StructDeclaration::fetchSimilar ( const String ident)

◆ fetchVarDeclaration()

VarDeclaration * CeresEngine::ShaderCompiler::StructDeclaration::fetchVarDeclaration ( const String ident,
const StructDeclaration **  owner = nullptr 
) const

◆ forEachVarDeclaration()

void CeresEngine::ShaderCompiler::StructDeclaration::forEachVarDeclaration ( const VarDeclarationIteratorFunctor iterator,
bool  includeBaseStructs = true 
)

◆ getType()

Types CeresEngine::ShaderCompiler::StructDeclaration::getType ( ) const
inlineoverridevirtual

◆ hasMultipleShaderOutputInstances()

bool CeresEngine::ShaderCompiler::StructDeclaration::hasMultipleShaderOutputInstances ( ) const

◆ hasNonSystemValueMembers()

bool CeresEngine::ShaderCompiler::StructDeclaration::hasNonSystemValueMembers ( ) const

◆ indexToMemberVar()

VarDeclaration * CeresEngine::ShaderCompiler::StructDeclaration::indexToMemberVar ( std::size_t  idx,
bool  includeBaseStructs = true 
) const

◆ isBaseOf()

bool CeresEngine::ShaderCompiler::StructDeclaration::isBaseOf ( const StructDeclaration subStructDeclaration,
bool  includeSelf = false 
) const

◆ isCastableTo()

bool CeresEngine::ShaderCompiler::StructDeclaration::isCastableTo ( const BaseTypeDenoter rhs) const

◆ memberVarToIndex()

std::size_t CeresEngine::ShaderCompiler::StructDeclaration::memberVarToIndex ( const VarDeclaration varDeclaration,
bool  includeBaseStructs = true 
) const

◆ numMemberFunctions()

std::size_t CeresEngine::ShaderCompiler::StructDeclaration::numMemberFunctions ( bool  onlyNonStaticMembers = false) const

◆ numMemberVariables()

std::size_t CeresEngine::ShaderCompiler::StructDeclaration::numMemberVariables ( bool  onlyNonStaticMembers = false) const

◆ toString()

String CeresEngine::ShaderCompiler::StructDeclaration::toString ( ) const
overridevirtual

◆ visit()

void CeresEngine::ShaderCompiler::StructDeclaration::visit ( Visitor visitor,
void args = nullptr 
)
inlineoverridevirtual

Member Data Documentation

◆ baseStructName

String CeresEngine::ShaderCompiler::StructDeclaration::baseStructName

◆ baseStructRef

StructDeclaration* CeresEngine::ShaderCompiler::StructDeclaration::baseStructRef = nullptr

◆ classType

const Types CeresEngine::ShaderCompiler::StructDeclaration::classType = Types:: StructDeclaration
static

◆ compatibleStructRef

StructDeclaration* CeresEngine::ShaderCompiler::StructDeclaration::compatibleStructRef = nullptr

◆ declarationStatementRef

BasicDeclarationStatement* CeresEngine::ShaderCompiler::StructDeclaration::declarationStatementRef = nullptr

◆ funcMembers

Vector<FunctionDeclarationPtr> CeresEngine::ShaderCompiler::StructDeclaration::funcMembers

◆ isClass

bool CeresEngine::ShaderCompiler::StructDeclaration::isClass = false

◆ localStatements

Vector<StatementPtr> CeresEngine::ShaderCompiler::StructDeclaration::localStatements

◆ parentStructDeclarationRefs

Set<StructDeclaration*> CeresEngine::ShaderCompiler::StructDeclaration::parentStructDeclarationRefs

◆ shaderOutputVarDeclarationRefs

Set<VarDeclaration*> CeresEngine::ShaderCompiler::StructDeclaration::shaderOutputVarDeclarationRefs

◆ systemValuesRef

Map<String, VarDeclaration*> CeresEngine::ShaderCompiler::StructDeclaration::systemValuesRef

◆ varMembers

Vector<VarDeclarationStatementPtr> CeresEngine::ShaderCompiler::StructDeclaration::varMembers

The documentation for this struct was generated from the following file: