#include "GLSLANG/ShaderLang.h"
#include "common/PackedEnums.h"
#include "compiler/translator/Compiler.h"
#include "compiler/translator/InitializeDll.h"
#include "compiler/translator/length_limits.h"
#ifdef ANGLE_ENABLE_HLSL
# include "compiler/translator/hlsl/TranslatorHLSL.h"
#endif
#include "angle_gl.h"
#include "compiler/translator/VariablePacker.h"
namespace sh
{
namespace
{
bool isInitialized = …;
template <typename VarT>
const std::vector<VarT> *GetVariableList(const TCompiler *compiler);
template <>
const std::vector<InterfaceBlock> *GetVariableList(const TCompiler *compiler)
{ … }
TCompiler *GetCompilerFromHandle(ShHandle handle)
{ … }
template <typename VarT>
const std::vector<VarT> *GetShaderVariables(const ShHandle handle)
{ … }
#ifdef ANGLE_ENABLE_HLSL
TranslatorHLSL *GetTranslatorHLSLFromHandle(ShHandle handle)
{
if (!handle)
return nullptr;
TShHandleBase *base = static_cast<TShHandleBase *>(handle);
return base->getAsTranslatorHLSL();
}
#endif
GLenum GetGeometryShaderPrimitiveTypeEnum(sh::TLayoutPrimitiveType primitiveType)
{ … }
GLenum GetTessellationShaderTypeEnum(sh::TLayoutTessEvaluationType type)
{ … }
}
bool Initialize()
{ … }
bool Finalize()
{ … }
void InitBuiltInResources(ShBuiltInResources *resources)
{ … }
ShHandle ConstructCompiler(sh::GLenum type,
ShShaderSpec spec,
ShShaderOutput output,
const ShBuiltInResources *resources)
{ … }
void Destruct(ShHandle handle)
{ … }
ShBuiltInResources GetBuiltInResources(const ShHandle handle)
{ … }
const std::string &GetBuiltInResourcesString(const ShHandle handle)
{ … }
bool Compile(const ShHandle handle,
const char *const shaderStrings[],
size_t numStrings,
const ShCompileOptions &compileOptions)
{ … }
void ClearResults(const ShHandle handle)
{ … }
int GetShaderVersion(const ShHandle handle)
{ … }
ShShaderOutput GetShaderOutputType(const ShHandle handle)
{ … }
const std::string &GetInfoLog(const ShHandle handle)
{ … }
const std::string &GetObjectCode(const ShHandle handle)
{ … }
const BinaryBlob &GetObjectBinaryBlob(const ShHandle handle)
{ … }
bool GetShaderBinary(const ShHandle handle,
const char *const shaderStrings[],
size_t numStrings,
const ShCompileOptions &compileOptions,
ShaderBinaryBlob *const binaryOut)
{ … }
const std::map<std::string, std::string> *GetNameHashingMap(const ShHandle handle)
{ … }
const std::vector<ShaderVariable> *GetUniforms(const ShHandle handle)
{ … }
const std::vector<ShaderVariable> *GetInputVaryings(const ShHandle handle)
{ … }
const std::vector<ShaderVariable> *GetOutputVaryings(const ShHandle handle)
{ … }
const std::vector<ShaderVariable> *GetVaryings(const ShHandle handle)
{ … }
const std::vector<ShaderVariable> *GetAttributes(const ShHandle handle)
{ … }
const std::vector<ShaderVariable> *GetOutputVariables(const ShHandle handle)
{ … }
const std::vector<InterfaceBlock> *GetInterfaceBlocks(const ShHandle handle)
{ … }
const std::vector<InterfaceBlock> *GetUniformBlocks(const ShHandle handle)
{ … }
const std::vector<InterfaceBlock> *GetShaderStorageBlocks(const ShHandle handle)
{ … }
WorkGroupSize GetComputeShaderLocalGroupSize(const ShHandle handle)
{ … }
int GetVertexShaderNumViews(const ShHandle handle)
{ … }
uint32_t GetShaderSpecConstUsageBits(const ShHandle handle)
{ … }
bool CheckVariablesWithinPackingLimits(int maxVectors, const std::vector<ShaderVariable> &variables)
{ … }
bool GetShaderStorageBlockRegister(const ShHandle handle,
const std::string &shaderStorageBlockName,
unsigned int *indexOut)
{ … }
bool GetUniformBlockRegister(const ShHandle handle,
const std::string &uniformBlockName,
unsigned int *indexOut)
{ … }
bool ShouldUniformBlockUseStructuredBuffer(const ShHandle handle,
const std::string &uniformBlockName)
{ … }
const std::map<std::string, unsigned int> *GetUniformRegisterMap(const ShHandle handle)
{ … }
const std::set<std::string> *GetSlowCompilingUniformBlockSet(const ShHandle handle)
{ … }
unsigned int GetReadonlyImage2DRegisterIndex(const ShHandle handle)
{ … }
unsigned int GetImage2DRegisterIndex(const ShHandle handle)
{ … }
const std::set<std::string> *GetUsedImage2DFunctionNames(const ShHandle handle)
{ … }
uint8_t GetClipDistanceArraySize(const ShHandle handle)
{ … }
uint8_t GetCullDistanceArraySize(const ShHandle handle)
{ … }
uint32_t GetMetadataFlags(const ShHandle handle)
{ … }
GLenum GetGeometryShaderInputPrimitiveType(const ShHandle handle)
{ … }
GLenum GetGeometryShaderOutputPrimitiveType(const ShHandle handle)
{ … }
int GetGeometryShaderInvocations(const ShHandle handle)
{ … }
int GetGeometryShaderMaxVertices(const ShHandle handle)
{ … }
int GetTessControlShaderVertices(const ShHandle handle)
{ … }
GLenum GetTessGenMode(const ShHandle handle)
{ … }
GLenum GetTessGenSpacing(const ShHandle handle)
{ … }
GLenum GetTessGenVertexOrder(const ShHandle handle)
{ … }
GLenum GetTessGenPointMode(const ShHandle handle)
{ … }
unsigned int GetShaderSharedMemorySize(const ShHandle handle)
{ … }
uint32_t GetAdvancedBlendEquations(const ShHandle handle)
{ … }
const char kUserDefinedNamePrefix[] = …;
const char *BlockLayoutTypeToString(BlockLayoutType type)
{ … }
const char *BlockTypeToString(BlockType type)
{ … }
const char *InterpolationTypeToString(InterpolationType type)
{ … }
}
ShCompileOptions::ShCompileOptions()
{ … }
ShCompileOptions::ShCompileOptions(const ShCompileOptions &other)
{ … }
ShCompileOptions &ShCompileOptions::operator=(const ShCompileOptions &other)
{ … }
ShBuiltInResources::ShBuiltInResources()
{ … }
ShBuiltInResources::ShBuiltInResources(const ShBuiltInResources &other)
{ … }
ShBuiltInResources &ShBuiltInResources::operator=(const ShBuiltInResources &other)
{ … }