#ifndef LIBANGLE_UNIFORMLINKER_H_
#define LIBANGLE_UNIFORMLINKER_H_
#include <GLSLANG/ShaderVars.h>
#include "angle_gl.h"
#include "common/PackedEnums.h"
#include "common/angleutils.h"
#include "libANGLE/Uniform.h"
#include "libANGLE/VaryingPacking.h"
#include <functional>
namespace sh
{
class BlockLayoutEncoder;
struct BlockMemberInfo;
struct InterfaceBlock;
struct ShaderVariable;
class BlockEncoderVisitor;
class ShaderVariableVisitor;
struct ShaderVariable;
}
namespace gl
{
struct BufferVariable;
struct Caps;
class Context;
class InfoLog;
struct InterfaceBlock;
enum class LinkMismatchError;
class ProgramState;
class ProgramPipelineState;
class ProgramBindings;
class ProgramAliasedBindings;
class Shader;
struct AtomicCounterBuffer;
struct VariableLocation;
struct Version;
ShaderUniform;
struct UnusedUniform
{ … };
struct UsedUniform : public sh::ShaderVariable
{ … };
class UniformLinker final : angle::NonCopyable
{ … };
GetBlockSizeFunc;
GetBlockMemberInfoFunc;
class InterfaceBlockLinker : angle::NonCopyable
{ … };
class UniformBlockLinker final : public InterfaceBlockLinker
{ … };
class ShaderStorageBlockLinker final : public InterfaceBlockLinker
{ … };
class AtomicCounterBufferLinker final : angle::NonCopyable
{ … };
struct ProgramLinkedResources
{ … };
struct LinkingVariables final : private angle::NonCopyable
{ … };
class CustomBlockLayoutEncoderFactory : angle::NonCopyable
{ … };
class ProgramLinkedResourcesLinker final : angle::NonCopyable
{ … };
ShaderInterfaceBlock;
InterfaceBlockMap;
bool LinkValidateProgramGlobalNames(InfoLog &infoLog,
const ProgramExecutable &executable,
const LinkingVariables &linkingVariables);
bool LinkValidateShaderInterfaceMatching(const std::vector<sh::ShaderVariable> &outputVaryings,
const std::vector<sh::ShaderVariable> &inputVaryings,
ShaderType frontShaderType,
ShaderType backShaderType,
int frontShaderVersion,
int backShaderVersion,
bool isSeparable,
InfoLog &infoLog);
bool LinkValidateBuiltInVaryingsInvariant(const std::vector<sh::ShaderVariable> &vertexVaryings,
const std::vector<sh::ShaderVariable> &fragmentVaryings,
int vertexShaderVersion,
InfoLog &infoLog);
bool LinkValidateBuiltInVaryings(const std::vector<sh::ShaderVariable> &inputVaryings,
const std::vector<sh::ShaderVariable> &outputVaryings,
ShaderType inputShaderType,
ShaderType outputShaderType,
int inputShaderVersion,
int outputShaderVersion,
InfoLog &infoLog);
LinkMismatchError LinkValidateProgramVariables(const sh::ShaderVariable &variable1,
const sh::ShaderVariable &variable2,
bool validatePrecision,
bool treatVariable1AsNonArray,
bool treatVariable2AsNonArray,
std::string *mismatchedStructOrBlockMemberName);
void AddProgramVariableParentPrefix(const std::string &parentName,
std::string *mismatchedFieldName);
bool LinkValidateProgramInterfaceBlocks(const Caps &caps,
const Version &clientVersion,
bool webglCompatibility,
ShaderBitSet activeProgramStages,
const ProgramLinkedResources &resources,
InfoLog &infoLog,
GLuint *combinedShaderStorageBlocksCountOut);
}
#endif