#include "libANGLE/VaryingPacking.h"
#include "common/CompiledShaderState.h"
#include "common/utilities.h"
#include "libANGLE/Program.h"
#include "libANGLE/ProgramExecutable.h"
#include "libANGLE/Shader.h"
namespace gl
{
namespace
{
bool ComparePackedVarying(const PackedVarying &x, const PackedVarying &y)
{ … }
bool InterfaceVariablesMatch(const sh::ShaderVariable &front, const sh::ShaderVariable &back)
{ … }
GLint GetMaxShaderInputVectors(const Caps &caps, ShaderType shaderStage)
{ … }
GLint GetMaxShaderOutputVectors(const Caps &caps, ShaderType shaderStage)
{ … }
bool ShouldSkipPackedVarying(const sh::ShaderVariable &varying, PackMode packMode)
{ … }
std::vector<unsigned int> StripVaryingArrayDimension(const sh::ShaderVariable *frontVarying,
ShaderType frontShaderStage,
const sh::ShaderVariable *backVarying,
ShaderType backShaderStage,
bool isStructField)
{ … }
PerVertexMember GetPerVertexMember(const std::string &name)
{ … }
void SetActivePerVertexMembers(const sh::ShaderVariable *var, PerVertexMemberBitSet *bitset)
{ … }
}
VaryingInShaderRef::VaryingInShaderRef(ShaderType stageIn, const sh::ShaderVariable *varyingIn)
: … { … }
VaryingInShaderRef::~VaryingInShaderRef() = default;
VaryingInShaderRef::VaryingInShaderRef(VaryingInShaderRef &&other)
: … { … }
VaryingInShaderRef &VaryingInShaderRef::operator=(VaryingInShaderRef &&other)
{ … }
PackedVarying::PackedVarying(VaryingInShaderRef &&frontVaryingIn,
VaryingInShaderRef &&backVaryingIn,
sh::InterpolationType interpolationIn)
: … { … }
PackedVarying::PackedVarying(VaryingInShaderRef &&frontVaryingIn,
VaryingInShaderRef &&backVaryingIn,
sh::InterpolationType interpolationIn,
GLuint arrayIndexIn,
GLuint fieldIndexIn,
GLuint secondaryFieldIndexIn)
: … { … }
PackedVarying::~PackedVarying() = default;
PackedVarying::PackedVarying(PackedVarying &&other)
: … { … }
PackedVarying &PackedVarying::operator=(PackedVarying &&other)
{ … }
unsigned int PackedVarying::getBasicTypeElementCount() const
{ … }
VaryingPacking::VaryingPacking() = default;
VaryingPacking::~VaryingPacking() = default;
void VaryingPacking::reset()
{ … }
void VaryingPacking::clearRegisterMap()
{ … }
bool VaryingPacking::packVaryingIntoRegisterMap(PackMode packMode,
const PackedVarying &packedVarying)
{ … }
bool VaryingPacking::isRegisterRangeFree(unsigned int registerRow,
unsigned int registerColumn,
unsigned int varyingRows,
unsigned int varyingColumns) const
{ … }
void VaryingPacking::insertVaryingIntoRegisterMap(unsigned int registerRow,
unsigned int registerColumn,
unsigned int varyingColumns,
const PackedVarying &packedVarying)
{ … }
void VaryingPacking::collectUserVarying(const ProgramVaryingRef &ref,
VaryingUniqueFullNames *uniqueFullNames)
{ … }
void VaryingPacking::collectUserVaryingField(const ProgramVaryingRef &ref,
GLuint arrayIndex,
GLuint fieldIndex,
GLuint secondaryFieldIndex,
VaryingUniqueFullNames *uniqueFullNames)
{ … }
void VaryingPacking::collectUserVaryingTF(const ProgramVaryingRef &ref, size_t subscript)
{ … }
void VaryingPacking::collectUserVaryingFieldTF(const ProgramVaryingRef &ref,
const sh::ShaderVariable &field,
GLuint fieldIndex,
GLuint secondaryFieldIndex)
{ … }
void VaryingPacking::collectVarying(const sh::ShaderVariable &varying,
const ProgramVaryingRef &ref,
PackMode packMode,
VaryingUniqueFullNames *uniqueFullNames)
{ … }
void VaryingPacking::collectTFVarying(const std::string &tfVarying,
const ProgramVaryingRef &ref,
VaryingUniqueFullNames *uniqueFullNames)
{ … }
bool VaryingPacking::collectAndPackUserVaryings(gl::InfoLog &infoLog,
GLint maxVaryingVectors,
PackMode packMode,
ShaderType frontShaderStage,
ShaderType backShaderStage,
const ProgramMergedVaryings &mergedVaryings,
const std::vector<std::string> &tfVaryings,
const bool isSeparableProgram)
{ … }
bool VaryingPacking::packUserVaryings(gl::InfoLog &infoLog,
GLint maxVaryingVectors,
PackMode packMode,
const std::vector<PackedVarying> &packedVaryings)
{ … }
ProgramVaryingPacking::ProgramVaryingPacking() = default;
ProgramVaryingPacking::~ProgramVaryingPacking() = default;
const VaryingPacking &ProgramVaryingPacking::getInputPacking(ShaderType backShaderStage) const
{ … }
const VaryingPacking &ProgramVaryingPacking::getOutputPacking(ShaderType frontShaderStage) const
{ … }
bool ProgramVaryingPacking::collectAndPackUserVaryings(InfoLog &infoLog,
const Caps &caps,
PackMode packMode,
const ShaderBitSet &activeShadersMask,
const ProgramMergedVaryings &mergedVaryings,
const std::vector<std::string> &tfVaryings,
bool isSeparableProgram)
{ … }
ProgramMergedVaryings GetMergedVaryingsFromLinkingVariables(
const LinkingVariables &linkingVariables)
{ … }
}