Home | History | Annotate | Download | only in timing
      1 //
      2 // Copyright (c) 2012 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 #ifndef COMPILER_TIMING_RESTRICT_VERTEX_SHADER_TIMING_H_
      8 #define COMPILER_TIMING_RESTRICT_VERTEX_SHADER_TIMING_H_
      9 
     10 #include "compiler/translator/IntermNode.h"
     11 #include "compiler/translator/InfoSink.h"
     12 
     13 class TInfoSinkBase;
     14 
     15 class RestrictVertexShaderTiming : public TIntermTraverser {
     16 public:
     17     RestrictVertexShaderTiming(TInfoSinkBase& sink)
     18         : TIntermTraverser(true, false, false)
     19         , mSink(sink)
     20         , mNumErrors(0) {}
     21 
     22     void enforceRestrictions(TIntermNode* root) { root->traverse(this); }
     23     int numErrors() { return mNumErrors; }
     24 
     25     virtual void visitSymbol(TIntermSymbol*);
     26 private:
     27     TInfoSinkBase& mSink;
     28     int mNumErrors;
     29 };
     30 
     31 #endif  // COMPILER_TIMING_RESTRICT_VERTEX_SHADER_TIMING_H_
     32