Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
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 // Contains analysis utilities for dealing with HLSL's lack of support for
7 // the use of intrinsic functions which (implicitly or explicitly) compute
8 // gradients of functions with discontinuities.
9 //
11 #ifndef COMPILER_DETECTDISCONTINUITY_H_
12 #define COMPILER_DETECTDISCONTINUITY_H_
14 #include "compiler/intermediate.h"
16 namespace sh
17 {
18 // Checks whether a loop can run for a variable number of iterations
19 class DetectLoopDiscontinuity : public TIntermTraverser
20 {
21 public:
22 bool traverse(TIntermNode *node);
24 protected:
25 bool visitBranch(Visit visit, TIntermBranch *node);
26 bool visitLoop(Visit visit, TIntermLoop *loop);
27 bool visitAggregate(Visit visit, TIntermAggregate *node);
29 int mLoopDepth;
30 bool mLoopDiscontinuity;
31 };
33 bool containsLoopDiscontinuity(TIntermNode *node);
35 // Checks for intrinsic functions which compute gradients
36 class DetectGradientOperation : public TIntermTraverser
37 {
38 public:
39 bool traverse(TIntermNode *node);
41 protected:
42 bool visitUnary(Visit visit, TIntermUnary *node);
43 bool visitAggregate(Visit visit, TIntermAggregate *node);
45 bool mGradientOperation;
46 };
48 bool containsGradientOperation(TIntermNode *node);
50 }
52 #endif // COMPILER_DETECTDISCONTINUITY_H_