1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/angle/src/compiler/timing/RestrictVertexShaderTiming.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,33 @@ 1.4 +// 1.5 +// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. 1.6 +// Use of this source code is governed by a BSD-style license that can be 1.7 +// found in the LICENSE file. 1.8 +// 1.9 + 1.10 +#ifndef COMPILER_TIMING_RESTRICT_VERTEX_SHADER_TIMING_H_ 1.11 +#define COMPILER_TIMING_RESTRICT_VERTEX_SHADER_TIMING_H_ 1.12 + 1.13 +#include "GLSLANG/ShaderLang.h" 1.14 + 1.15 +#include "compiler/intermediate.h" 1.16 +#include "compiler/InfoSink.h" 1.17 + 1.18 +class TInfoSinkBase; 1.19 + 1.20 +class RestrictVertexShaderTiming : public TIntermTraverser { 1.21 +public: 1.22 + RestrictVertexShaderTiming(TInfoSinkBase& sink) 1.23 + : TIntermTraverser(true, false, false) 1.24 + , mSink(sink) 1.25 + , mNumErrors(0) {} 1.26 + 1.27 + void enforceRestrictions(TIntermNode* root) { root->traverse(this); } 1.28 + int numErrors() { return mNumErrors; } 1.29 + 1.30 + virtual void visitSymbol(TIntermSymbol*); 1.31 +private: 1.32 + TInfoSinkBase& mSink; 1.33 + int mNumErrors; 1.34 +}; 1.35 + 1.36 +#endif // COMPILER_TIMING_RESTRICT_VERTEX_SHADER_TIMING_H_