| 1 | // |
| 2 | // Copyright (c) 2018 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 | // RewriteRepeatedAssignToSwizzled.h: Rewrite expressions that assign an assignment to a swizzled |
| 7 | // vector, like: |
| 8 | // v.x = z = expression; |
| 9 | // to: |
| 10 | // z = expression; |
| 11 | // v.x = z; |
| 12 | // |
| 13 | // Note that this doesn't handle some corner cases: expressions nested inside other expressions, |
| 14 | // inside loop headers, or inside if conditions. |
| 15 | |
| 16 | #ifndef COMPILER_TRANSLATOR_TREEOPS_REWRITEREPEATEDASSIGNTOSWIZZLED_H_ |
| 17 | #define COMPILER_TRANSLATOR_TREEOPS_REWRITEREPEATEDASSIGNTOSWIZZLED_H_ |
| 18 | |
| 19 | namespace sh |
| 20 | { |
| 21 | |
| 22 | class TIntermBlock; |
| 23 | |
| 24 | void RewriteRepeatedAssignToSwizzled(TIntermBlock *root); |
| 25 | |
| 26 | } // namespace sh |
| 27 | |
| 28 | #endif // COMPILER_TRANSLATOR_TREEOPS_REWRITEREPEATEDASSIGNTOSWIZZLED_H_ |
| 29 | |