Jamie Madill | 05a80ce | 2013-06-20 11:55:49 -0400 | [diff] [blame^] | 1 | // |
| 2 | // Copyright (c) 2013 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
| 7 | #include "GLSLANG/ShaderLang.h" |
| 8 | #include "compiler/intermediate.h" |
| 9 | |
| 10 | #include <set> |
| 11 | |
| 12 | class TInfoSinkBase; |
| 13 | |
| 14 | class ValidateOutputs : public TIntermTraverser |
| 15 | { |
| 16 | public: |
| 17 | ValidateOutputs(TInfoSinkBase& sink, int maxDrawBuffers); |
| 18 | |
| 19 | int numErrors() const { return mNumErrors; } |
| 20 | |
| 21 | virtual void visitSymbol(TIntermSymbol*); |
| 22 | |
| 23 | private: |
| 24 | TInfoSinkBase& mSink; |
| 25 | int mMaxDrawBuffers; |
| 26 | int mNumErrors; |
| 27 | bool mHasUnspecifiedOutputLocation; |
| 28 | |
| 29 | typedef std::map<int, TIntermSymbol*> OutputMap; |
| 30 | OutputMap mOutputMap; |
| 31 | std::set<TString> mVisitedSymbols; |
| 32 | |
| 33 | void error(TSourceLoc loc, const char *reason, const char* token); |
| 34 | }; |