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 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 7 | #ifndef COMPILER_TRANSLATOR_VALIDATEOUTPUTS_H_ |
| 8 | #define COMPILER_TRANSLATOR_VALIDATEOUTPUTS_H_ |
| 9 | |
Kimmo Kinnunen | b18609b | 2015-07-16 14:13:11 +0300 | [diff] [blame] | 10 | #include "compiler/translator/ExtensionBehavior.h" |
Jamie Madill | b1a85f4 | 2014-08-19 15:23:24 -0400 | [diff] [blame] | 11 | #include "compiler/translator/IntermNode.h" |
Jamie Madill | 05a80ce | 2013-06-20 11:55:49 -0400 | [diff] [blame] | 12 | |
| 13 | #include <set> |
| 14 | |
| 15 | class TInfoSinkBase; |
| 16 | |
| 17 | class ValidateOutputs : public TIntermTraverser |
| 18 | { |
| 19 | public: |
Kimmo Kinnunen | b18609b | 2015-07-16 14:13:11 +0300 | [diff] [blame] | 20 | ValidateOutputs(const TExtensionBehavior &extBehavior, int maxDrawBuffers); |
Jamie Madill | 05a80ce | 2013-06-20 11:55:49 -0400 | [diff] [blame] | 21 | |
Kimmo Kinnunen | b18609b | 2015-07-16 14:13:11 +0300 | [diff] [blame] | 22 | int validateAndCountErrors(TInfoSinkBase &sink) const; |
Jamie Madill | 05a80ce | 2013-06-20 11:55:49 -0400 | [diff] [blame] | 23 | |
Corentin Wallez | e5a1f27 | 2015-08-21 02:58:25 +0200 | [diff] [blame] | 24 | void visitSymbol(TIntermSymbol *) override; |
Jamie Madill | 05a80ce | 2013-06-20 11:55:49 -0400 | [diff] [blame] | 25 | |
| 26 | private: |
Jamie Madill | 05a80ce | 2013-06-20 11:55:49 -0400 | [diff] [blame] | 27 | int mMaxDrawBuffers; |
Kimmo Kinnunen | b18609b | 2015-07-16 14:13:11 +0300 | [diff] [blame] | 28 | bool mAllowUnspecifiedOutputLocationResolution; |
Jamie Madill | 05a80ce | 2013-06-20 11:55:49 -0400 | [diff] [blame] | 29 | |
Kimmo Kinnunen | b18609b | 2015-07-16 14:13:11 +0300 | [diff] [blame] | 30 | typedef std::vector<TIntermSymbol *> OutputVector; |
| 31 | OutputVector mOutputs; |
| 32 | OutputVector mUnspecifiedLocationOutputs; |
Jamie Madill | 05a80ce | 2013-06-20 11:55:49 -0400 | [diff] [blame] | 33 | std::set<TString> mVisitedSymbols; |
Jamie Madill | 05a80ce | 2013-06-20 11:55:49 -0400 | [diff] [blame] | 34 | }; |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 35 | |
| 36 | #endif // COMPILER_TRANSLATOR_VALIDATEOUTPUTS_H_ |