blob: 0788f4ed64eb7bc996da8ad959fbc493c4497d17 [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
Jamie Madill45bcc782016-11-07 13:58:48 -050015namespace sh
16{
17
Jamie Madill05a80ce2013-06-20 11:55:49 -040018class TInfoSinkBase;
19
20class ValidateOutputs : public TIntermTraverser
21{
22 public:
Kimmo Kinnunenb18609b2015-07-16 14:13:11 +030023 ValidateOutputs(const TExtensionBehavior &extBehavior, int maxDrawBuffers);
Jamie Madill05a80ce2013-06-20 11:55:49 -040024
Kimmo Kinnunenb18609b2015-07-16 14:13:11 +030025 int validateAndCountErrors(TInfoSinkBase &sink) const;
Jamie Madill05a80ce2013-06-20 11:55:49 -040026
Corentin Walleze5a1f272015-08-21 02:58:25 +020027 void visitSymbol(TIntermSymbol *) override;
Jamie Madill05a80ce2013-06-20 11:55:49 -040028
29 private:
Jamie Madill05a80ce2013-06-20 11:55:49 -040030 int mMaxDrawBuffers;
Kimmo Kinnunenb18609b2015-07-16 14:13:11 +030031 bool mAllowUnspecifiedOutputLocationResolution;
Jamie Madill05a80ce2013-06-20 11:55:49 -040032
Kimmo Kinnunenb18609b2015-07-16 14:13:11 +030033 typedef std::vector<TIntermSymbol *> OutputVector;
34 OutputVector mOutputs;
35 OutputVector mUnspecifiedLocationOutputs;
Jamie Madill5ed23982016-04-22 15:08:57 -040036 std::set<std::string> mVisitedSymbols;
Jamie Madill05a80ce2013-06-20 11:55:49 -040037};
Geoff Lang0a73dd82014-11-19 16:18:08 -050038
Jamie Madill45bcc782016-11-07 13:58:48 -050039} // namespace sh
40
Geoff Lang0a73dd82014-11-19 16:18:08 -050041#endif // COMPILER_TRANSLATOR_VALIDATEOUTPUTS_H_