Commit a2fbb840 by Jamie Madill

Move CollectVariables to sh namespace.

BUG=angle:466 Change-Id: I903ea840e333dfeb44f242a1759aed39974d0510 Reviewed-on: https://chromium-review.googlesource.com/213505Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Reviewed-by: 's avatarNicolas Capens <capn@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 54ad4f81
......@@ -502,18 +502,18 @@ bool TCompiler::enforceVertexShaderTimingRestrictions(TIntermNode* root)
void TCompiler::collectVariables(TIntermNode* root)
{
CollectVariables collect(&attributes,
&outputVariables,
&uniforms,
&varyings,
&interfaceBlocks,
hashFunction);
sh::CollectVariables collect(&attributes,
&outputVariables,
&uniforms,
&varyings,
&interfaceBlocks,
hashFunction);
root->traverse(&collect);
// For backwards compatiblity with ShGetVariableInfo, expand struct
// uniforms and varyings into separate variables for each field.
ExpandVariables(uniforms, &expandedUniforms);
ExpandVariables(varyings, &expandedVaryings);
sh::ExpandVariables(uniforms, &expandedUniforms);
sh::ExpandVariables(varyings, &expandedVaryings);
}
bool TCompiler::enforcePackingRestrictions()
......
......@@ -11,15 +11,18 @@
#include "compiler/translator/IntermNode.h"
namespace sh
{
// Traverses intermediate tree to collect all attributes, uniforms, varyings.
class CollectVariables : public TIntermTraverser
{
public:
CollectVariables(std::vector<sh::Attribute> *attribs,
std::vector<sh::Attribute> *outputVariables,
std::vector<sh::Uniform> *uniforms,
std::vector<sh::Varying> *varyings,
std::vector<sh::InterfaceBlock> *interfaceBlocks,
CollectVariables(std::vector<Attribute> *attribs,
std::vector<Attribute> *outputVariables,
std::vector<Uniform> *uniforms,
std::vector<Varying> *varyings,
std::vector<InterfaceBlock> *interfaceBlocks,
ShHashFunction64 hashFunction);
virtual void visitSymbol(TIntermSymbol *symbol);
......@@ -33,13 +36,13 @@ class CollectVariables : public TIntermTraverser
template <typename VarT>
void visitInfoList(const TIntermSequence &sequence, std::vector<VarT> *infoList) const;
std::vector<sh::Attribute> *mAttribs;
std::vector<sh::Attribute> *mOutputVariables;
std::vector<sh::Uniform> *mUniforms;
std::vector<sh::Varying> *mVaryings;
std::vector<sh::InterfaceBlock> *mInterfaceBlocks;
std::vector<Attribute> *mAttribs;
std::vector<Attribute> *mOutputVariables;
std::vector<Uniform> *mUniforms;
std::vector<Varying> *mVaryings;
std::vector<InterfaceBlock> *mInterfaceBlocks;
std::map<std::string, sh::InterfaceBlockField *> mInterfaceBlockFields;
std::map<std::string, InterfaceBlockField *> mInterfaceBlockFields;
bool mPointCoordAdded;
bool mFrontFacingAdded;
......@@ -51,6 +54,8 @@ class CollectVariables : public TIntermTraverser
// Expand struct variables to flattened lists of split variables
template <typename VarT>
void ExpandVariables(const std::vector<VarT> &compact,
std::vector<sh::ShaderVariable> *expanded);
std::vector<ShaderVariable> *expanded);
}
#endif // COMPILER_VARIABLE_INFO_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment