#include "compiler/translator/glsl/OutputGLSLBase.h"
#include "angle_gl.h"
#include "common/debug.h"
#include "common/mathutil.h"
#include "compiler/translator/Compiler.h"
#include "compiler/translator/util.h"
#include <cfloat>
namespace sh
{
namespace
{
bool isSingleStatement(TIntermNode *node)
{ … }
class CommaSeparatedListItemPrefixGenerator
{ … };
template <typename Stream>
Stream &operator<<(Stream &out, CommaSeparatedListItemPrefixGenerator &gen)
{ … }
}
TOutputGLSLBase::TOutputGLSLBase(TCompiler *compiler,
TInfoSinkBase &objSink,
const ShCompileOptions &compileOptions)
: … { … }
void TOutputGLSLBase::writeInvariantQualifier(const TType &type)
{ … }
void TOutputGLSLBase::writePreciseQualifier(const TType &type)
{ … }
void TOutputGLSLBase::writeFloat(TInfoSinkBase &out, float f)
{ … }
void TOutputGLSLBase::writeTriplet(Visit visit,
const char *preStr,
const char *inStr,
const char *postStr)
{ … }
void TOutputGLSLBase::writeFunctionTriplet(Visit visit,
const ImmutableString &functionName,
bool useEmulatedFunction)
{ … }
std::string TOutputGLSLBase::getCommonLayoutQualifiers(TIntermSymbol *variable)
{ … }
std::string TOutputGLSLBase::getMemoryQualifiers(const TType &type)
{ … }
void TOutputGLSLBase::writeLayoutQualifier(TIntermSymbol *variable)
{ … }
void TOutputGLSLBase::writeFieldLayoutQualifier(const TField *field)
{ … }
void TOutputGLSLBase::writeQualifier(TQualifier qualifier, const TType &type, const TSymbol *symbol)
{ … }
const char *TOutputGLSLBase::mapQualifierToString(TQualifier qualifier)
{ … }
namespace
{
constexpr char kIndent[] = …;
constexpr int kIndentWidth = …;
constexpr int kMaxIndentLevel = …;
}
const char *TOutputGLSLBase::getIndentPrefix(int extraIndentation)
{ … }
void TOutputGLSLBase::writeVariableType(const TType &type,
const TSymbol *symbol,
bool isFunctionArgument)
{ … }
void TOutputGLSLBase::writeFunctionParameters(const TFunction *func)
{ … }
const TConstantUnion *TOutputGLSLBase::writeConstantUnion(const TType &type,
const TConstantUnion *pConstUnion)
{ … }
void TOutputGLSLBase::writeConstructorTriplet(Visit visit, const TType &type)
{ … }
void TOutputGLSLBase::visitSymbol(TIntermSymbol *node)
{ … }
void TOutputGLSLBase::visitConstantUnion(TIntermConstantUnion *node)
{ … }
bool TOutputGLSLBase::visitSwizzle(Visit visit, TIntermSwizzle *node)
{ … }
bool TOutputGLSLBase::visitBinary(Visit visit, TIntermBinary *node)
{ … }
bool TOutputGLSLBase::visitUnary(Visit visit, TIntermUnary *node)
{ … }
bool TOutputGLSLBase::visitTernary(Visit visit, TIntermTernary *node)
{ … }
bool TOutputGLSLBase::visitIfElse(Visit visit, TIntermIfElse *node)
{ … }
bool TOutputGLSLBase::visitSwitch(Visit visit, TIntermSwitch *node)
{ … }
bool TOutputGLSLBase::visitCase(Visit visit, TIntermCase *node)
{ … }
bool TOutputGLSLBase::visitBlock(Visit visit, TIntermBlock *node)
{ … }
bool TOutputGLSLBase::visitFunctionDefinition(Visit visit, TIntermFunctionDefinition *node)
{ … }
bool TOutputGLSLBase::visitGlobalQualifierDeclaration(Visit visit,
TIntermGlobalQualifierDeclaration *node)
{ … }
void TOutputGLSLBase::visitFunctionPrototype(TIntermFunctionPrototype *node)
{ … }
bool TOutputGLSLBase::visitAggregate(Visit visit, TIntermAggregate *node)
{ … }
bool TOutputGLSLBase::visitDeclaration(Visit visit, TIntermDeclaration *node)
{ … }
bool TOutputGLSLBase::visitLoop(Visit visit, TIntermLoop *node)
{ … }
bool TOutputGLSLBase::visitBranch(Visit visit, TIntermBranch *node)
{ … }
void TOutputGLSLBase::visitCodeBlock(TIntermBlock *node)
{ … }
void TOutputGLSLBase::visitPreprocessorDirective(TIntermPreprocessorDirective *node)
{ … }
ImmutableString TOutputGLSLBase::getTypeName(const TType &type)
{ … }
ImmutableString TOutputGLSLBase::hashName(const TSymbol *symbol)
{ … }
ImmutableString TOutputGLSLBase::hashFieldName(const TField *field)
{ … }
ImmutableString TOutputGLSLBase::hashFunctionNameIfNeeded(const TFunction *func)
{ … }
void TOutputGLSLBase::declareStruct(const TStructure *structure)
{ … }
void TOutputGLSLBase::declareInterfaceBlockLayout(const TType &type)
{ … }
const char *getVariableInterpolation(TQualifier qualifier)
{ … }
void TOutputGLSLBase::declareInterfaceBlock(const TType &type)
{ … }
void WritePragma(TInfoSinkBase &out, const ShCompileOptions &compileOptions, const TPragma &pragma)
{ … }
void WriteGeometryShaderLayoutQualifiers(TInfoSinkBase &out,
sh::TLayoutPrimitiveType inputPrimitive,
int invocations,
sh::TLayoutPrimitiveType outputPrimitive,
int maxVertices)
{ … }
void WriteTessControlShaderLayoutQualifiers(TInfoSinkBase &out, int inputVertices)
{ … }
void WriteTessEvaluationShaderLayoutQualifiers(TInfoSinkBase &out,
sh::TLayoutTessEvaluationType inputPrimitive,
sh::TLayoutTessEvaluationType inputVertexSpacing,
sh::TLayoutTessEvaluationType inputOrdering,
sh::TLayoutTessEvaluationType inputPoint)
{ … }
void WriteFragmentShaderLayoutQualifiers(TInfoSinkBase &out,
const AdvancedBlendEquations &advancedBlendEquations)
{ … }
bool TOutputGLSLBase::needsToWriteLayoutQualifier(const TType &type)
{ … }
void EmitEarlyFragmentTestsGLSL(const TCompiler &compiler, TInfoSinkBase &sink)
{ … }
void EmitWorkGroupSizeGLSL(const TCompiler &compiler, TInfoSinkBase &sink)
{ … }
void EmitMultiviewGLSL(const TCompiler &compiler,
const ShCompileOptions &compileOptions,
const TExtension extension,
const TBehavior behavior,
TInfoSinkBase &sink)
{ … }
}