zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ForLoopUnroll.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2011 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 
8 
9 struct TLoopIndexInfo {
10  int id;
11  int initValue;
12  int stopValue;
16 };
17 
19 public:
21 
22  void FillLoopIndexInfo(TIntermLoop* node, TLoopIndexInfo& info);
23 
24  // Update the info.currentValue for the next loop iteration.
25  void Step();
26 
27  // Return false if loop condition is no longer satisfied.
29 
30  // Check if the symbol is the index of a loop that's unrolled.
32 
33  // Return the current value of a given loop index symbol.
34  int GetLoopIndexValue(TIntermSymbol* symbol);
35 
36  void Push(TLoopIndexInfo& info);
37  void Pop();
38 
40 
41 private:
42  int getLoopIncrement(TIntermLoop* node);
43 
44  int evaluateIntConstant(TIntermConstantUnion* node);
45 
46  TVector<TLoopIndexInfo> mLoopIndexStack;
47 };
48 
TOperator
Definition: intermediate.h:29
void FillLoopIndexInfo(TIntermLoop *node, TLoopIndexInfo &info)
int GetLoopIndexValue(TIntermSymbol *symbol)
static void MarkForLoopsWithIntegerIndicesForUnrolling(TIntermNode *root)
TOperator op
Definition: ForLoopUnroll.h:14
void Push(TLoopIndexInfo &info)
bool SatisfiesLoopCondition()
bool NeedsToReplaceSymbolWithValue(TIntermSymbol *symbol)