blob: 06f63994cdf725ad19d45c66aad46dc3741960ad [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
Kimmo Kinnunenb18609b2015-07-16 14:13:11 +030010#include "compiler/translator/ExtensionBehavior.h"
Jamie Madillb1a85f42014-08-19 15:23:24 -040011#include "compiler/translator/IntermNode.h"
Jamie Madill05a80ce2013-06-20 11:55:49 -040012
13#include <set>
14
15class TInfoSinkBase;
16
17class ValidateOutputs : public TIntermTraverser
18{
19 public:
Kimmo Kinnunenb18609b2015-07-16 14:13:11 +030020 ValidateOutputs(const TExtensionBehavior &extBehavior, int maxDrawBuffers);
Jamie Madill05a80ce2013-06-20 11:55:49 -040021
Kimmo Kinnunenb18609b2015-07-16 14:13:11 +030022 int validateAndCountErrors(TInfoSinkBase &sink) const;
Jamie Madill05a80ce2013-06-20 11:55:49 -040023
Corentin Walleze5a1f272015-08-21 02:58:25 +020024 void visitSymbol(TIntermSymbol *) override;
Jamie Madill05a80ce2013-06-20 11:55:49 -040025
26 private:
Jamie Madill05a80ce2013-06-20 11:55:49 -040027 int mMaxDrawBuffers;
Kimmo Kinnunenb18609b2015-07-16 14:13:11 +030028 bool mAllowUnspecifiedOutputLocationResolution;
Jamie Madill05a80ce2013-06-20 11:55:49 -040029
Kimmo Kinnunenb18609b2015-07-16 14:13:11 +030030 typedef std::vector<TIntermSymbol *> OutputVector;
31 OutputVector mOutputs;
32 OutputVector mUnspecifiedLocationOutputs;
Jamie Madill05a80ce2013-06-20 11:55:49 -040033 std::set<TString> mVisitedSymbols;
Jamie Madill05a80ce2013-06-20 11:55:49 -040034};
Geoff Lang0a73dd82014-11-19 16:18:08 -050035
36#endif // COMPILER_TRANSLATOR_VALIDATEOUTPUTS_H_