blob: 87916afef8fd28cc59242239900b7db0939d0332 [file] [log] [blame]
Olli Etuaho19d1dc92016-03-08 17:18:46 +02001//
2// Copyright (c) 2016 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// ValidateMaxParameters checks if function definitions have more than a set number of parameters.
7
8#ifndef COMPILER_TRANSLATOR_VALIDATEMAXPARAMETERS_H_
9#define COMPILER_TRANSLATOR_VALIDATEMAXPARAMETERS_H_
10
11#include "compiler/translator/IntermNode.h"
12
13class ValidateMaxParameters : public TIntermTraverser
14{
15 public:
16 // Returns false if maxParameters is exceeded.
17 static bool validate(TIntermNode *root, unsigned int maxParameters);
18
19 protected:
20 bool visitAggregate(Visit visit, TIntermAggregate *node) override;
21
22 private:
23 ValidateMaxParameters(unsigned int maxParameters);
24
25 unsigned int mMaxParameters;
26 bool mValid;
27};
28
29#endif // COMPILER_TRANSLATOR_VALIDATEMAXPARAMETERS_H_