Consolidate shader variable storage in Compiler.
The Compiler base class now stores all the shader variables and
interface block information, instead of duplicating the information
in the HLSL translator.
BUG=angle:466
Change-Id: Ia69079fde64fbd6b0cbfc66defd5e37d99ee3e6e
Reviewed-on: https://chromium-review.googlesource.com/206020
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/Compiler.h b/src/compiler/translator/Compiler.h
index 340714d..66c9563 100644
--- a/src/compiler/translator/Compiler.h
+++ b/src/compiler/translator/Compiler.h
@@ -67,9 +67,12 @@
// Get results of the last compilation.
int getShaderVersion() const { return shaderVersion; }
TInfoSink& getInfoSink() { return infoSink; }
- const std::vector<sh::Attribute> &getAttribs() const { return attribs; }
+
+ const std::vector<sh::Attribute> &getAttributes() const { return attributes; }
+ const std::vector<sh::Attribute> &getOutputVariables() const { return outputVariables; }
const std::vector<sh::Uniform> &getUniforms() const { return uniforms; }
const std::vector<sh::Varying> &getVaryings() const { return varyings; }
+ const std::vector<sh::InterfaceBlock> &getInterfaceBlocks() const { return interfaceBlocks; }
ShHashFunction64 getHashFunction() const { return hashFunction; }
NameMap& getNameMap() { return nameMap; }
@@ -130,6 +133,12 @@
ShArrayIndexClampingStrategy getArrayIndexClampingStrategy() const;
const BuiltInFunctionEmulator& getBuiltInFunctionEmulator() const;
+ std::vector<sh::Attribute> attributes;
+ std::vector<sh::Attribute> outputVariables;
+ std::vector<sh::Uniform> uniforms;
+ std::vector<sh::Varying> varyings;
+ std::vector<sh::InterfaceBlock> interfaceBlocks;
+
private:
sh::GLenum shaderType;
ShShaderSpec shaderSpec;
@@ -156,9 +165,6 @@
// Results of compilation.
int shaderVersion;
TInfoSink infoSink; // Output sink.
- std::vector<sh::Attribute> attribs; // Active attributes in the compiled shader.
- std::vector<sh::Uniform> uniforms; // Active uniforms in the compiled shader.
- std::vector<sh::Varying> varyings; // Varyings in the compiled shader.
// name hashing.
ShHashFunction64 hashFunction;