1 //
2 // Copyright (c) 2016 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 // This mutating tree traversal works around a bug in the HLSL compiler optimizer with "pow" that
7 // manifests under the following conditions:
8 //
9 // - If pow() has a literal exponent value
10 // - ... and this value is integer or within 10e-6 of an integer
11 // - ... and it is in {-4, -3, -2, 2, 3, 4, 5, 6, 7, 8}
12 //
13 // The workaround is to replace the pow with a series of multiplies.
14 // See http://anglebug.com/851
15 
16 #ifndef COMPILER_TRANSLATOR_EXPANDINTEGERPOWEXPRESSIONS_H_
17 #define COMPILER_TRANSLATOR_EXPANDINTEGERPOWEXPRESSIONS_H_
18 
19 namespace sh
20 {
21 
22 class TIntermNode;
23 class TSymbolTable;
24 
25 void ExpandIntegerPowExpressions(TIntermNode *root, TSymbolTable *symbolTable);
26 
27 }  // namespace sh
28 
29 #endif  // COMPILER_TRANSLATOR_EXPANDINTEGERPOWEXPRESSIONS_H_
30