blob: c9282d2bd9ca74035a8085c221dd5a8531a2ea8f [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
Olli Etuaho77ba4082016-12-16 12:01:18 +000025 void validate(TDiagnostics *diagnostics) 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;
Andrei Volykhina5527072017-03-22 16:46:30 +030032 bool mUsesFragDepth;
Jamie Madill05a80ce2013-06-20 11:55:49 -040033
Kimmo Kinnunenb18609b2015-07-16 14:13:11 +030034 typedef std::vector<TIntermSymbol *> OutputVector;
35 OutputVector mOutputs;
36 OutputVector mUnspecifiedLocationOutputs;
Andrei Volykhina5527072017-03-22 16:46:30 +030037 OutputVector mYuvOutputs;
Jamie Madill5ed23982016-04-22 15:08:57 -040038 std::set<std::string> mVisitedSymbols;
Jamie Madill05a80ce2013-06-20 11:55:49 -040039};
Geoff Lang0a73dd82014-11-19 16:18:08 -050040
Jamie Madill45bcc782016-11-07 13:58:48 -050041} // namespace sh
42
Jamie Madilld7b1ab52016-12-12 14:42:19 -050043#endif // COMPILER_TRANSLATOR_VALIDATEOUTPUTS_H_