#include "ValidateClipCullDistance.h"
#include "compiler/translator/Diagnostics.h"
#include "compiler/translator/SymbolTable.h"
#include "compiler/translator/tree_util/IntermTraverse.h"
#include "compiler/translator/tree_util/ReplaceVariable.h"
#include "compiler/translator/util.h"
namespace sh
{
namespace
{
void error(const TIntermSymbol &symbol, const char *reason, TDiagnostics *diagnostics)
{ … }
class ValidateClipCullDistanceTraverser : public TIntermTraverser
{ … };
ValidateClipCullDistanceTraverser::ValidateClipCullDistanceTraverser()
: … { … }
bool ValidateClipCullDistanceTraverser::visitDeclaration(Visit visit, TIntermDeclaration *node)
{ … }
bool ValidateClipCullDistanceTraverser::visitBinary(Visit visit, TIntermBinary *node)
{ … }
void ValidateClipCullDistanceTraverser::validate(TDiagnostics *diagnostics,
const unsigned int maxCombinedClipAndCullDistances,
uint8_t *clipDistanceSizeOut,
uint8_t *cullDistanceSizeOut,
bool *clipDistanceRedeclaredOut,
bool *cullDistanceRedeclaredOut,
bool *clipDistanceUsedOut)
{ … }
class ValidateClipCullDistanceLengthTraverser : public TIntermTraverser
{ … };
ValidateClipCullDistanceLengthTraverser::ValidateClipCullDistanceLengthTraverser(
TDiagnostics *diagnostics,
uint8_t clipDistanceSize,
uint8_t cullDistanceSize)
: … { … }
bool ValidateClipCullDistanceLengthTraverser::visitUnary(Visit visit, TIntermUnary *node)
{ … }
bool ReplaceAndDeclareVariable(TCompiler *compiler,
TIntermBlock *root,
const ImmutableString &name,
unsigned int size)
{ … }
}
bool ValidateClipCullDistance(TCompiler *compiler,
TIntermBlock *root,
TDiagnostics *diagnostics,
const unsigned int maxCombinedClipAndCullDistances,
uint8_t *clipDistanceSizeOut,
uint8_t *cullDistanceSizeOut,
bool *clipDistanceUsedOut)
{ … }
}