blob: 0f808dbb972051586a0f20fd7189f9455a4b0ebb [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
Jamie Madillb1a85f42014-08-19 15:23:24 -04007#include "compiler/translator/IntermNode.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};