blob: e391ad9486025191ef359cc9c1a87259c0b55eeb [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 Lang17732822013-08-29 13:46:49 -04007#include "compiler/translator/intermediate.h"
Jamie Madill05a80ce2013-06-20 11:55:49 -04008
9#include <set>
10
11class TInfoSinkBase;
12
13class ValidateOutputs : public TIntermTraverser
14{
15 public:
16 ValidateOutputs(TInfoSinkBase& sink, int maxDrawBuffers);
17
18 int numErrors() const { return mNumErrors; }
19
20 virtual void visitSymbol(TIntermSymbol*);
21
22 private:
23 TInfoSinkBase& mSink;
24 int mMaxDrawBuffers;
25 int mNumErrors;
26 bool mHasUnspecifiedOutputLocation;
27
28 typedef std::map<int, TIntermSymbol*> OutputMap;
29 OutputMap mOutputMap;
30 std::set<TString> mVisitedSymbols;
31
32 void error(TSourceLoc loc, const char *reason, const char* token);
33};