Move ShaderVariables to common shared source.
Also move the block layout encoding utilities to the common folder.
The combined changes allow us to include the shader and block code
into both libGLESv2 and the translator separately. This in turn
fixes the Chromium component build, where we were calling internal
translator functions directly from libGLESv2.
BUG=angle:568
Change-Id: Ibcfa2c936a7c737ad515c10bd24061ff39ee5747
Reviewed-on: https://chromium-review.googlesource.com/192891
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/OutputHLSL.h b/src/compiler/translator/OutputHLSL.h
index 5d66fc5..ad42f2d 100644
--- a/src/compiler/translator/OutputHLSL.h
+++ b/src/compiler/translator/OutputHLSL.h
@@ -17,7 +17,7 @@
#include "compiler/translator/intermediate.h"
#include "compiler/translator/ParseContext.h"
-#include "compiler/translator/ShaderVariable.h"
+#include "common/shadervars.h"
namespace sh
{
@@ -32,11 +32,11 @@
void output();
TInfoSinkBase &getBodyStream();
- const std::vector<Uniform> &getUniforms();
- const ActiveInterfaceBlocks &getInterfaceBlocks() const;
- const std::vector<Attribute> &getOutputVariables() const;
- const std::vector<Attribute> &getAttributes() const;
- const std::vector<Varying> &getVaryings() const;
+ const std::vector<gl::Uniform> &getUniforms();
+ const std::vector<gl::InterfaceBlock> &getInterfaceBlocks() const;
+ const std::vector<gl::Attribute> &getOutputVariables() const;
+ const std::vector<gl::Attribute> &getAttributes() const;
+ const std::vector<gl::Varying> &getVaryings() const;
TString typeString(const TType &type);
TString textureString(const TType &type);
@@ -184,10 +184,10 @@
TString registerString(TIntermSymbol *operand);
int samplerRegister(TIntermSymbol *sampler);
int uniformRegister(TIntermSymbol *uniform);
- void declareInterfaceBlockField(const TType &type, const TString &name, std::vector<InterfaceBlockField>& output);
- Uniform declareUniformToList(const TType &type, const TString &name, int registerIndex, std::vector<Uniform>& output);
+ void declareInterfaceBlockField(const TType &type, const TString &name, std::vector<gl::InterfaceBlockField>& output);
+ gl::Uniform declareUniformToList(const TType &type, const TString &name, int registerIndex, std::vector<gl::Uniform>& output);
void declareUniform(const TType &type, const TString &name, int index);
- void declareVaryingToList(const TType &type, TQualifier baseTypeQualifier, const TString &name, std::vector<Varying>& fieldsOut);
+ void declareVaryingToList(const TType &type, TQualifier baseTypeQualifier, const TString &name, std::vector<gl::Varying>& fieldsOut);
// Returns the uniform's register index
int declareUniformAndAssignRegister(const TType &type, const TString &name);
@@ -210,11 +210,11 @@
static bool isVaryingOut(TQualifier qualifier);
static bool isVarying(TQualifier qualifier);
- std::vector<Uniform> mActiveUniforms;
- ActiveInterfaceBlocks mActiveInterfaceBlocks;
- std::vector<Attribute> mActiveOutputVariables;
- std::vector<Attribute> mActiveAttributes;
- std::vector<Varying> mActiveVaryings;
+ std::vector<gl::Uniform> mActiveUniforms;
+ std::vector<gl::InterfaceBlock> mActiveInterfaceBlocks;
+ std::vector<gl::Attribute> mActiveOutputVariables;
+ std::vector<gl::Attribute> mActiveAttributes;
+ std::vector<gl::Varying> mActiveVaryings;
std::map<TString, int> mStd140StructElementIndexes;
std::map<TIntermTyped*, TString> mFlaggedStructMappedNames;
std::map<TIntermTyped*, TString> mFlaggedStructOriginalNames;