#include "ValidateVaryingLocations.h"
#include "compiler/translator/Diagnostics.h"
#include "compiler/translator/SymbolTable.h"
#include "compiler/translator/tree_util/IntermTraverse.h"
#include "compiler/translator/util.h"
namespace sh
{
namespace
{
void error(const TIntermSymbol &symbol, const char *reason, TDiagnostics *diagnostics)
{ … }
int GetStructLocationCount(const TStructure *structure);
int GetFieldLocationCount(const TField *field)
{ … }
int GetStructLocationCount(const TStructure *structure)
{ … }
int GetInterfaceBlockLocationCount(const TType &varyingType, bool ignoreVaryingArraySize)
{ … }
int GetLocationCount(const TType &varyingType, bool ignoreVaryingArraySize)
{ … }
bool ShouldIgnoreVaryingArraySize(TQualifier qualifier, GLenum shaderType)
{ … }
struct SymbolAndField
{ … };
LocationMap;
void MarkVaryingLocations(TDiagnostics *diagnostics,
const TIntermSymbol *varying,
const TField *field,
int location,
int elementCount,
LocationMap *locationMap)
{ … }
VaryingVector;
void ValidateShaderInterfaceAndAssignLocations(TDiagnostics *diagnostics,
const VaryingVector &varyingVector,
GLenum shaderType)
{ … }
class ValidateVaryingLocationsTraverser : public TIntermTraverser
{ … };
ValidateVaryingLocationsTraverser::ValidateVaryingLocationsTraverser(GLenum shaderType)
: … { … }
bool ValidateVaryingLocationsTraverser::visitDeclaration(Visit visit, TIntermDeclaration *node)
{ … }
bool ValidateVaryingLocationsTraverser::visitFunctionDefinition(Visit visit,
TIntermFunctionDefinition *node)
{ … }
void ValidateVaryingLocationsTraverser::validate(TDiagnostics *diagnostics)
{ … }
}
unsigned int CalculateVaryingLocationCount(const TType &varyingType, GLenum shaderType)
{ … }
bool ValidateVaryingLocations(TIntermBlock *root, TDiagnostics *diagnostics, GLenum shaderType)
{ … }
}