blob: 1538e0f1571fbca961acb88c61d1ba3b24c8e3d4 [file] [log] [blame]
Jamie Madill05a80ce2013-06-20 11:55:49 -04001//
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 Lang0a73dd82014-11-19 16:18:08 -05007#ifndef COMPILER_TRANSLATOR_VALIDATEOUTPUTS_H_
8#define COMPILER_TRANSLATOR_VALIDATEOUTPUTS_H_
9
Jamie Madillb1a85f42014-08-19 15:23:24 -040010#include "compiler/translator/IntermNode.h"
Jamie Madill05a80ce2013-06-20 11:55:49 -040011
12#include <set>
13
14class TInfoSinkBase;
15
16class ValidateOutputs : public TIntermTraverser
17{
18 public:
19 ValidateOutputs(TInfoSinkBase& sink, int maxDrawBuffers);
20
21 int numErrors() const { return mNumErrors; }
22
23 virtual void visitSymbol(TIntermSymbol*);
24
25 private:
26 TInfoSinkBase& mSink;
27 int mMaxDrawBuffers;
28 int mNumErrors;
29 bool mHasUnspecifiedOutputLocation;
30
31 typedef std::map<int, TIntermSymbol*> OutputMap;
32 OutputMap mOutputMap;
33 std::set<TString> mVisitedSymbols;
34
35 void error(TSourceLoc loc, const char *reason, const char* token);
36};
Geoff Lang0a73dd82014-11-19 16:18:08 -050037
38#endif // COMPILER_TRANSLATOR_VALIDATEOUTPUTS_H_