#include "compiler/translator/tree_util/ReplaceClipCullDistanceVariable.h"
#include "common/bitset_utils.h"
#include "common/debug.h"
#include "common/utilities.h"
#include "compiler/translator/Compiler.h"
#include "compiler/translator/SymbolTable.h"
#include "compiler/translator/tree_util/BuiltIn.h"
#include "compiler/translator/tree_util/FindMain.h"
#include "compiler/translator/tree_util/IntermNode_util.h"
#include "compiler/translator/tree_util/IntermTraverse.h"
#include "compiler/translator/tree_util/ReplaceVariable.h"
#include "compiler/translator/tree_util/RunAtTheBeginningOfShader.h"
#include "compiler/translator/tree_util/RunAtTheEndOfShader.h"
namespace sh
{
namespace
{
ClipCullDistanceIdxSet;
AssignFunc;
template <typename Variable>
const Variable *FindVariable(const std::vector<Variable> &mVars, const ImmutableString &name)
{ … }
class GLClipCullDistanceReferenceTraverser : public TIntermTraverser
{ … };
class ReplaceVariableExceptOneTraverser : public TIntermTraverser
{ … };
TIntermNode *simpleAssignFunc(const unsigned int index,
TIntermSymbol *leftSymbol,
TIntermSymbol *rightSymbol,
const TIntermTyped * )
{ … }
TIntermNode *assignFuncWithEnableFlags(const unsigned int index,
TIntermSymbol *leftSymbol,
TIntermSymbol *rightSymbol,
const TIntermTyped *enableFlags)
{ … }
class ReplaceClipCullDistanceAssignments : angle::NonCopyable
{ … };
unsigned int ReplaceClipCullDistanceAssignments::getEnabledClipCullDistance(
const bool useNonConstIndex,
const unsigned int maxConstIndex)
{ … }
const TVariable *ReplaceClipCullDistanceAssignments::declareANGLEVariable(
const TVariable *originalVariable)
{ … }
bool ReplaceClipCullDistanceAssignments::assignOriginalValueToANGLEVariableImpl()
{ … }
bool ReplaceClipCullDistanceAssignments::assignValueToOriginalVariableImpl(
const bool isRedeclared,
const TIntermTyped *enableFlags,
const ClipCullDistanceIdxSet *constIndices,
AssignFunc assignFunc)
{ … }
[[nodiscard]] bool ReplaceClipCullDistanceAssignments::assignOriginalValueToANGLEVariable(
const GLenum shaderType)
{ … }
[[nodiscard]] bool ReplaceClipCullDistanceAssignments::assignValueToOriginalVariable(
const GLenum shaderType,
const bool isRedeclared,
const TIntermTyped *enableFlags,
const ClipCullDistanceIdxSet *constIndices)
{ … }
[[nodiscard]] bool ReplaceClipCullDistanceAssignmentsImpl(
TCompiler *compiler,
TIntermBlock *root,
TSymbolTable *symbolTable,
const GLenum shaderType,
const TIntermTyped *clipDistanceEnableFlags,
const char *builtInName,
const char *replacementName,
TQualifier builtInQualifier)
{ … }
}
[[nodiscard]] bool ReplaceClipDistanceAssignments(TCompiler *compiler,
TIntermBlock *root,
TSymbolTable *symbolTable,
const GLenum shaderType,
const TIntermTyped *clipDistanceEnableFlags)
{ … }
[[nodiscard]] bool ReplaceCullDistanceAssignments(TCompiler *compiler,
TIntermBlock *root,
TSymbolTable *symbolTable,
const GLenum shaderType)
{ … }
[[nodiscard]] bool ZeroDisabledClipDistanceAssignments(TCompiler *compiler,
TIntermBlock *root,
TSymbolTable *symbolTable,
const GLenum shaderType,
const TIntermTyped *clipDistanceEnableFlags)
{ … }
}