blob: 58da54ced3a2996f5d4edbc18dcfc46bc455a9b7 [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
7#include "GLSLANG/ShaderLang.h"
Geoff Lang17732822013-08-29 13:46:49 -04008#include "compiler/translator/intermediate.h"
Jamie Madill05a80ce2013-06-20 11:55:49 -04009
10#include <set>
11
12class TInfoSinkBase;
13
14class 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};