michael@0: // michael@0: // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: #ifndef COMPILER_TIMING_RESTRICT_VERTEX_SHADER_TIMING_H_ michael@0: #define COMPILER_TIMING_RESTRICT_VERTEX_SHADER_TIMING_H_ michael@0: michael@0: #include "GLSLANG/ShaderLang.h" michael@0: michael@0: #include "compiler/intermediate.h" michael@0: #include "compiler/InfoSink.h" michael@0: michael@0: class TInfoSinkBase; michael@0: michael@0: class RestrictVertexShaderTiming : public TIntermTraverser { michael@0: public: michael@0: RestrictVertexShaderTiming(TInfoSinkBase& sink) michael@0: : TIntermTraverser(true, false, false) michael@0: , mSink(sink) michael@0: , mNumErrors(0) {} michael@0: michael@0: void enforceRestrictions(TIntermNode* root) { root->traverse(this); } michael@0: int numErrors() { return mNumErrors; } michael@0: michael@0: virtual void visitSymbol(TIntermSymbol*); michael@0: private: michael@0: TInfoSinkBase& mSink; michael@0: int mNumErrors; michael@0: }; michael@0: michael@0: #endif // COMPILER_TIMING_RESTRICT_VERTEX_SHADER_TIMING_H_