blob: 8bc8c9664edd5a86652b49639229d600a3baabc9 [file] [log] [blame]
Jamie Madill1048e432016-07-23 18:51:28 -04001//
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
19class TIntermNode;
20
21namespace sh
22{
23
24void ExpandIntegerPowExpressions(TIntermNode *root, unsigned int *tempIndex);
25
26} // namespace sh
27
28#endif // COMPILER_TRANSLATOR_EXPANDINTEGERPOWEXPRESSIONS_H_