Olli Etuaho | 3d932d8 | 2016-04-12 11:10:30 +0300 | [diff] [blame^] | 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 | // DeferGlobalInitializers is an AST traverser that moves global initializers into a function, and |
| 7 | // adds a function call to that function in the beginning of main(). |
| 8 | // This enables initialization of globals with uniforms or non-constant globals, as allowed by |
| 9 | // the WebGL spec. Some initializers referencing non-constants may need to be unfolded into if |
| 10 | // statements in HLSL - this kind of steps should be done after DeferGlobalInitializers is run. |
| 11 | // |
| 12 | |
| 13 | #ifndef COMPILER_TRANSLATOR_DEFERGLOBALINITIALIZERS_H_ |
| 14 | #define COMPILER_TRANSLATOR_DEFERGLOBALINITIALIZERS_H_ |
| 15 | |
| 16 | class TIntermNode; |
| 17 | |
| 18 | void DeferGlobalInitializers(TIntermNode *root); |
| 19 | |
| 20 | #endif // COMPILER_TRANSLATOR_DEFERGLOBALINITIALIZERS_H_ |