#include "compiler/translator/CollectVariables.h"
#include "angle_gl.h"
#include "common/utilities.h"
#include "compiler/translator/HashNames.h"
#include "compiler/translator/SymbolTable.h"
#include "compiler/translator/tree_util/IntermTraverse.h"
#include "compiler/translator/util.h"
namespace sh
{
namespace
{
BlockLayoutType GetBlockLayoutType(TLayoutBlockStorage blockStorage)
{ … }
BlockType GetBlockType(TQualifier qualifier)
{ … }
template <class VarT>
VarT *FindVariable(const ImmutableString &name, std::vector<VarT> *infoList)
{ … }
void MarkActive(ShaderVariable *variable)
{ … }
ShaderVariable *FindVariableInInterfaceBlock(const ImmutableString &name,
const TInterfaceBlock *interfaceBlock,
std::vector<InterfaceBlock> *infoList)
{ … }
ShaderVariable *FindShaderIOBlockVariable(const ImmutableString &blockName,
std::vector<ShaderVariable> *infoList)
{ … }
class CollectVariablesTraverser : public TIntermTraverser
{ … };
CollectVariablesTraverser::CollectVariablesTraverser(
std::vector<sh::ShaderVariable> *attribs,
std::vector<sh::ShaderVariable> *outputVariables,
std::vector<sh::ShaderVariable> *uniforms,
std::vector<sh::ShaderVariable> *inputVaryings,
std::vector<sh::ShaderVariable> *outputVaryings,
std::vector<sh::ShaderVariable> *sharedVariables,
std::vector<sh::InterfaceBlock> *uniformBlocks,
std::vector<sh::InterfaceBlock> *shaderStorageBlocks,
ShHashFunction64 hashFunction,
TSymbolTable *symbolTable,
GLenum shaderType,
const TExtensionBehavior &extensionBehavior,
const ShBuiltInResources &resources,
int tessControlShaderOutputVertices)
: … { … }
std::string CollectVariablesTraverser::getMappedName(const TSymbol *symbol) const
{ … }
void CollectVariablesTraverser::setBuiltInInfoFromSymbol(const TVariable &variable,
ShaderVariable *info)
{ … }
void CollectVariablesTraverser::recordBuiltInVaryingUsed(const TVariable &variable,
bool *addedFlag,
std::vector<ShaderVariable> *varyings)
{ … }
void CollectVariablesTraverser::recordBuiltInFragmentOutputUsed(const TVariable &variable,
bool *addedFlag)
{ … }
void CollectVariablesTraverser::recordBuiltInAttributeUsed(const TVariable &variable,
bool *addedFlag)
{ … }
bool CollectVariablesTraverser::visitGlobalQualifierDeclaration(
Visit visit,
TIntermGlobalQualifierDeclaration *node)
{ … }
void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
{ … }
void CollectVariablesTraverser::setFieldOrVariableProperties(const TType &type,
bool staticUse,
bool isShaderIOBlock,
bool isPatch,
ShaderVariable *variableOut) const
{ … }
void CollectVariablesTraverser::setFieldProperties(const TType &type,
const ImmutableString &name,
bool staticUse,
bool isShaderIOBlock,
bool isPatch,
SymbolType symbolType,
ShaderVariable *variableOut) const
{ … }
void CollectVariablesTraverser::setCommonVariableProperties(const TType &type,
const TVariable &variable,
ShaderVariable *variableOut) const
{ … }
ShaderVariable CollectVariablesTraverser::recordAttribute(const TIntermSymbol &variable) const
{ … }
ShaderVariable CollectVariablesTraverser::recordOutputVariable(const TIntermSymbol &variable) const
{ … }
ShaderVariable CollectVariablesTraverser::recordVarying(const TIntermSymbol &variable) const
{ … }
void CollectVariablesTraverser::recordInterfaceBlock(const char *instanceName,
const TType &interfaceBlockType,
InterfaceBlock *interfaceBlock) const
{ … }
ShaderVariable CollectVariablesTraverser::recordUniform(const TIntermSymbol &variable) const
{ … }
bool CollectVariablesTraverser::visitDeclaration(Visit, TIntermDeclaration *node)
{ … }
InterfaceBlock *CollectVariablesTraverser::findNamedInterfaceBlock(
const ImmutableString &blockName) const
{ … }
bool CollectVariablesTraverser::visitBinary(Visit, TIntermBinary *binaryNode)
{ … }
}
void CollectVariables(TIntermBlock *root,
std::vector<ShaderVariable> *attributes,
std::vector<ShaderVariable> *outputVariables,
std::vector<ShaderVariable> *uniforms,
std::vector<ShaderVariable> *inputVaryings,
std::vector<ShaderVariable> *outputVaryings,
std::vector<ShaderVariable> *sharedVariables,
std::vector<InterfaceBlock> *uniformBlocks,
std::vector<InterfaceBlock> *shaderStorageBlocks,
ShHashFunction64 hashFunction,
TSymbolTable *symbolTable,
GLenum shaderType,
const TExtensionBehavior &extensionBehavior,
const ShBuiltInResources &resources,
int tessControlShaderOutputVertices)
{ … }
}