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_FRAGMENT_SHADER_TIMING_H_ michael@0: #define COMPILER_TIMING_RESTRICT_FRAGMENT_SHADER_TIMING_H_ michael@0: michael@0: #include "GLSLANG/ShaderLang.h" michael@0: michael@0: #include "compiler/intermediate.h" michael@0: #include "compiler/depgraph/DependencyGraph.h" michael@0: michael@0: class TInfoSinkBase; michael@0: michael@0: class RestrictFragmentShaderTiming : TDependencyGraphTraverser { michael@0: public: michael@0: RestrictFragmentShaderTiming(TInfoSinkBase& sink); michael@0: void enforceRestrictions(const TDependencyGraph& graph); michael@0: int numErrors() const { return mNumErrors; } michael@0: michael@0: virtual void visitArgument(TGraphArgument* parameter); michael@0: virtual void visitSelection(TGraphSelection* selection); michael@0: virtual void visitLoop(TGraphLoop* loop); michael@0: virtual void visitLogicalOp(TGraphLogicalOp* logicalOp); michael@0: michael@0: private: michael@0: void beginError(const TIntermNode* node); michael@0: void validateUserDefinedFunctionCallUsage(const TDependencyGraph& graph); michael@0: bool isSamplingOp(const TIntermAggregate* intermFunctionCall) const; michael@0: michael@0: TInfoSinkBase& mSink; michael@0: int mNumErrors; michael@0: michael@0: typedef std::set StringSet; michael@0: StringSet mSamplingOps; michael@0: }; michael@0: michael@0: #endif // COMPILER_TIMING_RESTRICT_FRAGMENT_SHADER_TIMING_H_