alokp@chromium.org | 07620a5 | 2010-09-23 17:53:56 +0000 | [diff] [blame] | 1 | // |
zmo@google.com | fd747b8 | 2011-04-23 01:30:07 +0000 | [diff] [blame] | 2 | // Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved. |
alokp@chromium.org | 07620a5 | 2010-09-23 17:53:56 +0000 | [diff] [blame] | 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
zmo@google.com | fd747b8 | 2011-04-23 01:30:07 +0000 | [diff] [blame] | 7 | #ifndef COMPILER_VARIABLE_INFO_H_ |
| 8 | #define COMPILER_VARIABLE_INFO_H_ |
| 9 | |
Geoff Lang | 1773282 | 2013-08-29 13:46:49 -0400 | [diff] [blame] | 10 | #include "compiler/translator/intermediate.h" |
Jamie Madill | a718c1e | 2014-07-02 15:31:22 -0400 | [diff] [blame^] | 11 | #include "common/shadervars.h" |
alokp@chromium.org | 07620a5 | 2010-09-23 17:53:56 +0000 | [diff] [blame] | 12 | |
Zhenyao Mo | 74da9f2 | 2013-09-23 14:57:01 -0400 | [diff] [blame] | 13 | // Traverses intermediate tree to collect all attributes, uniforms, varyings. |
| 14 | class CollectVariables : public TIntermTraverser { |
alokp@chromium.org | 07620a5 | 2010-09-23 17:53:56 +0000 | [diff] [blame] | 15 | public: |
Jamie Madill | a718c1e | 2014-07-02 15:31:22 -0400 | [diff] [blame^] | 16 | CollectVariables(std::vector<sh::Attribute> *attribs, |
| 17 | std::vector<sh::Uniform> *uniforms, |
| 18 | std::vector<sh::Varying> *varyings, |
Zhenyao Mo | 74da9f2 | 2013-09-23 14:57:01 -0400 | [diff] [blame] | 19 | ShHashFunction64 hashFunction); |
alokp@chromium.org | 07620a5 | 2010-09-23 17:53:56 +0000 | [diff] [blame] | 20 | |
| 21 | virtual void visitSymbol(TIntermSymbol*); |
alokp@chromium.org | ee76f6a | 2010-09-27 19:28:55 +0000 | [diff] [blame] | 22 | virtual bool visitAggregate(Visit, TIntermAggregate*); |
alokp@chromium.org | 07620a5 | 2010-09-23 17:53:56 +0000 | [diff] [blame] | 23 | |
| 24 | private: |
Jamie Madill | a718c1e | 2014-07-02 15:31:22 -0400 | [diff] [blame^] | 25 | std::vector<sh::Attribute> *mAttribs; |
| 26 | std::vector<sh::Uniform> *mUniforms; |
| 27 | std::vector<sh::Varying> *mVaryings; |
daniel@transgaming.com | 0aa3b5a | 2012-11-28 19:43:24 +0000 | [diff] [blame] | 28 | |
Zhenyao Mo | d2d340b | 2013-09-23 14:57:05 -0400 | [diff] [blame] | 29 | bool mPointCoordAdded; |
| 30 | bool mFrontFacingAdded; |
| 31 | bool mFragCoordAdded; |
| 32 | |
daniel@transgaming.com | 0aa3b5a | 2012-11-28 19:43:24 +0000 | [diff] [blame] | 33 | ShHashFunction64 mHashFunction; |
Jamie Madill | a718c1e | 2014-07-02 15:31:22 -0400 | [diff] [blame^] | 34 | |
| 35 | template <typename VarT> |
| 36 | void visitInfoList(const TIntermSequence& sequence, std::vector<VarT> *infoList) const; |
alokp@chromium.org | 07620a5 | 2010-09-23 17:53:56 +0000 | [diff] [blame] | 37 | }; |
| 38 | |
daniel@transgaming.com | 5cb728c | 2011-05-17 18:34:24 +0000 | [diff] [blame] | 39 | #endif // COMPILER_VARIABLE_INFO_H_ |